Index: head/mail/panda-cclient/Makefile =================================================================== --- head/mail/panda-cclient/Makefile (revision 483320) +++ head/mail/panda-cclient/Makefile (revision 483321) @@ -1,116 +1,111 @@ # Created by: Kelly Yancey # $FreeBSD$ PORTNAME= cclient PORTVERSION= 20130621 +PORTREVISION= 1 CATEGORIES= mail devel ipv6 PKGNAMEPREFIX= panda- MAINTAINER= thierry@FreeBSD.org COMMENT= Mark Crispin's C-client mail access routines forked from UW LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE USE_GITHUB= yes GH_ACCOUNT= jonabbey GH_PROJECT= panda-imap GH_TAGNAME= 7905901 CONFLICTS_INSTALL= cclient-20* OPTIONS_DEFINE= SSL SSL_AND_PLAINTEXT IPV6 MBX_DEFAULT OPTIONS_DEFAULT= SSL SSL_AND_PLAINTEXT_DESC= Allow plain text passwords and SSL MBX_DEFAULT_DESC= Use MBX as default mailbox format MAKE_JOBS_UNSAFE= yes .include .if ${PORT_OPTIONS:MSSL} USES+= ssl PKGMESSAGE= pkg-message-ssl .endif -.include - -.if ${PORT_OPTIONS:MSSL} && ${SSL_DEFAULT:Mopenssl-devel} -BROKEN= Does not build with openssl-devel -.endif - USE_LDCONFIG= yes ALL_TARGET= bsf .if ! ${PORT_OPTIONS:MSSL} MAKE_ARGS+= SSLTYPE=none SSLDIR=${OPENSSLBASE} .else .if ${PORT_OPTIONS:MSSL_AND_PLAINTEXT} MAKE_ARGS+= SSLTYPE=unix SSLDIR=${OPENSSLDIR} .else MAKE_ARGS+= SSLTYPE=unix.nopwd SSLDIR=${OPENSSLDIR} .endif .endif MAKE_ARGS+= EXTRACFLAGS="${CFLAGS}" SHLIBBASE= c-client4 SHLIBMAJ= 10 SHLIBNAME= lib${SHLIBBASE}.so.${SHLIBMAJ} MAKE_ENV+= SHLIBNAME=${SHLIBNAME} SHLIBBASE=${SHLIBBASE} PLIST_SUB+= SHLIBNAME=${SHLIBNAME} SHLIBBASE=${SHLIBBASE} pre-configure: .for file in Makefile src/osdep/unix/Makefile src/osdep/unix/Makefile.gss ${REINPLACE_CMD} -e "s|/usr/local|${PREFIX}|g" ${WRKSRC}/${file} .endfor ${REINPLACE_CMD} -e "s:/etc/ssl/certs:${PREFIX}/certs:g; \ s:/etc/ssl/private:${PREFIX}/certs:g" ${WRKSRC}/Makefile ${REINPLACE_CMD} -e "s:/etc/c-client.cf:${PREFIX}/etc/c-client.cf:" \ ${WRKSRC}/src/osdep/unix/env_unix.h .if ${PORT_OPTIONS:MSSL} ${REINPLACE_CMD} -e " \ s:SSLINCLUDE=/usr/include/openssl SSLLIB=/usr/lib:SSLINCLUDE=${OPENSSLINC} SSLLIB=${OPENSSLLIB}: \ " ${WRKSRC}/Makefile .endif .if ${PORT_OPTIONS:MIPV6} ${REINPLACE_CMD} -e "s|^IP=4|IP=6|" ${WRKSRC}/Makefile \ ${WRKSRC}/src/osdep/unix/Makefile .endif .if ${PORT_OPTIONS:MMBX_DEFAULT} ${REINPLACE_CMD} -e "s|^CREATEPROTO=unixproto|CREATEPROTO=mbxproto|" \ ${WRKSRC}/src/osdep/unix/Makefile .endif post-configure: @${ECHO_MSG} ">> The c-client shared library will be named ${SHLIBNAME}" HEADERS= c-client.h dummy.h env.h env_unix.h fdstring.h flockcyg.h \ flocksim.h flstring.h fs.h ftl.h imap4r1.h linkage.c linkage.h \ mail.h misc.h netmsg.h newsrc.h nl.h nntp.h osdep.h pseudo.h \ rfc822.h smtp.h sslio.h tcp.h tcp_unix.h unix.h utf8.h \ utf8aux.h PORTREV_H= ${WRKDIR}/portrevision.h post-build: @${ECHO_CMD} "#define CCLIENT_PORTVERSION \"${PORTVERSION}\"" >${PORTREV_H} .if ${PORT_OPTIONS:MSSL} @${ECHO_CMD} "#define CCLIENT_SSLENABLED \"yes\"" >>${PORTREV_H} .else @${ECHO_CMD} "#define CCLIENT_SSLENABLED \"no\"" >>${PORTREV_H} .endif do-install: ${MKDIR} ${STAGEDIR}${PREFIX}/include/c-client .for f in ${HEADERS} ${INSTALL_DATA} ${WRKSRC}/c-client/${f} ${STAGEDIR}${PREFIX}/include/c-client .endfor ${INSTALL_LIB} ${WRKSRC}/c-client/${SHLIBNAME} ${STAGEDIR}${PREFIX}/lib ${LN} -sf ${SHLIBNAME} ${STAGEDIR}${PREFIX}/lib/lib${SHLIBBASE}.so ${INSTALL_DATA} ${WRKSRC}/c-client/c-client.a \ ${STAGEDIR}${PREFIX}/lib/lib${SHLIBBASE}.a ${INSTALL_DATA} ${WRKSRC}/c-client/CFLAGS ${STAGEDIR}${PREFIX}/include/c-client ${INSTALL_DATA} ${WRKSRC}/c-client/LDFLAGS ${STAGEDIR}${PREFIX}/include/c-client ${INSTALL_DATA} ${WRKSRC}/c-client/OSCFLAGS ${STAGEDIR}${PREFIX}/include/c-client ${INSTALL_DATA} ${PORTREV_H} ${STAGEDIR}${PREFIX}/include/c-client -.include +.include Index: head/mail/panda-cclient/files/patch-Makefile =================================================================== --- head/mail/panda-cclient/files/patch-Makefile (revision 483320) +++ head/mail/panda-cclient/files/patch-Makefile (revision 483321) @@ -1,78 +1,50 @@ -*** Makefile.orig Wed May 9 00:50:45 2007 ---- Makefile Mon Jul 23 16:02:26 2007 -*************** -*** 294,300 **** - - # Make the IMAP Toolkit - -! all: c-client SPECIALS rebuild bundled - - c-client: - @echo Not processed yet. In a first-time build, you must specify ---- 294,300 ---- - - # Make the IMAP Toolkit - -! all: c-client SPECIALS rebuild - - c-client: - @echo Not processed yet. In a first-time build, you must specify -*************** -*** 559,567 **** - @echo + In order to rectify this problem, you MUST build with: - @echo ++ SSLTYPE=$(SSLTYPE).nopwd - @echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- @echo -- @echo Do you want to continue this build anyway? Type y or n please: -- @$(SH) -c 'read x; case "$$x" in y) exit 0;; *) (make nounenc;exit 1);; esac' - - nounenc: - @echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ---- 559,564 ---- -*************** -*** 582,590 **** - @echo ++ SSLTYPE=nopwd - @echo + You must also have OpenSSL or equivalent installed. - @echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- @echo -- @echo Do you want to continue this build anyway? Type y or n please: -- @$(SH) -c 'read x; case "$$x" in y) exit 0;; *) (make nonossl;exit 1);; esac' - - nonossl: - @echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ---- 579,584 ---- -*************** -*** 659,665 **** - $(TOOLS)/$@ "$(LN)" src/tmail tmail - $(LN) $(TOOLS)/$@ . - -! build: OSTYPE rebuild rebuildclean bundled - - OSTYPE: - @$(MAKE) ip$(IP) ---- 653,659 ---- - $(TOOLS)/$@ "$(LN)" src/tmail tmail - $(LN) $(TOOLS)/$@ . - -! build: OSTYPE rebuild rebuildclean - - OSTYPE: - @$(MAKE) ip$(IP) -*************** -*** 679,686 **** - @$(SH) -c '(test $(BUILDTYPE) = rebuild -o $(BUILDTYPE) = `$(CAT) OSTYPE`) || (echo Already built for `$(CAT) OSTYPE` -- you must do \"make clean\" first && exit 1)' - @echo Rebuilding c-client for `$(CAT) OSTYPE`... - @$(TOUCH) SPECIALS -! $(CD) c-client;$(MAKE) all CC=`$(CAT) CCTYPE` \ -! CFLAGS="`$(CAT) CFLAGS`" `$(CAT) SPECIALS` - - rebuildclean: - $(SH) -c '$(RM) rebuild || true' ---- 673,679 ---- - @$(SH) -c '(test $(BUILDTYPE) = rebuild -o $(BUILDTYPE) = `$(CAT) OSTYPE`) || (echo Already built for `$(CAT) OSTYPE` -- you must do \"make clean\" first && exit 1)' - @echo Rebuilding c-client for `$(CAT) OSTYPE`... - @$(TOUCH) SPECIALS -! $(CD) c-client;$(MAKE) all CFLAGS="`$(CAT) CFLAGS`" `$(CAT) SPECIALS` - - rebuildclean: - $(SH) -c '$(RM) rebuild || true' +--- Makefile.orig 2013-06-21 21:29:17 UTC ++++ Makefile +@@ -295,7 +295,7 @@ BUILD=$(MAKE) build EXTRACFLAGS='$(EXTRA + + # Make the IMAP Toolkit + +-all: c-client SPECIALS rebuild bundled ++all: c-client SPECIALS rebuild + + c-client: + @echo Not processed yet. In a first-time build, you must specify +@@ -587,9 +587,6 @@ sslunix sslsco: + @echo + In order to rectify this problem, you MUST build with: + @echo ++ SSLTYPE=$(SSLTYPE).nopwd + @echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +- @echo +- @echo Do you want to continue this build anyway? Type y or n please: +- @$(SH) -c 'read x; case "$$x" in y) exit 0;; *) (make nounenc;exit 1);; esac' + + nounenc: + @echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +@@ -610,9 +607,6 @@ sslnone: + @echo ++ SSLTYPE=nopwd + @echo + You must also have OpenSSL or equivalent installed. + @echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +- @echo +- @echo Do you want to continue this build anyway? Type y or n please: +- @$(SH) -c 'read x; case "$$x" in y) exit 0;; *) (make nonossl;exit 1);; esac' + + nonossl: + @echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +@@ -687,7 +681,7 @@ an ua: + $(TOOLS)/$@ "$(LN)" src/tmail tmail + $(LN) $(TOOLS)/$@ . + +-build: OSTYPE rebuild rebuildclean bundled ++build: OSTYPE rebuild rebuildclean + + OSTYPE: + @$(MAKE) ip$(IP) +@@ -707,8 +701,7 @@ rebuild: + @$(SH) -c '(test $(BUILDTYPE) = rebuild -o $(BUILDTYPE) = `$(CAT) OSTYPE`) || (echo Already built for `$(CAT) OSTYPE` -- you must do \"make clean\" first && exit 1)' + @echo Rebuilding c-client for `$(CAT) OSTYPE`... + @$(TOUCH) SPECIALS +- $(CD) c-client;$(MAKE) all CC=`$(CAT) CCTYPE` \ +- CFLAGS="`$(CAT) CFLAGS`" `$(CAT) SPECIALS` ++ $(CD) c-client;$(MAKE) all CFLAGS="`$(CAT) CFLAGS`" `$(CAT) SPECIALS` + + rebuildclean: + $(SH) -c '$(RM) rebuild || true' Index: head/mail/panda-cclient/files/patch-src_osdep_unix_Makefile =================================================================== --- head/mail/panda-cclient/files/patch-src_osdep_unix_Makefile (revision 483320) +++ head/mail/panda-cclient/files/patch-src_osdep_unix_Makefile (revision 483321) @@ -1,152 +1,152 @@ ---- src/osdep/unix/Makefile.orig 2013-06-21 23:29:17.000000000 +0200 -+++ src/osdep/unix/Makefile 2014-12-01 22:35:23.000000000 +0100 +--- src/osdep/unix/Makefile.orig 2013-06-21 21:29:17 UTC ++++ src/osdep/unix/Makefile @@ -30,9 +30,9 @@ EXTRAAUTHENTICATORS= EXTRADRIVERS=mbox -PASSWDTYPE=std -SSLTYPE=nopwd -IP=4 +PASSWDTYPE=pam +SSLTYPE=unix.nopwd +IP=6 # The optimization level here for GCC ports is set here for a reason. It's -@@ -56,13 +56,13 @@ +@@ -56,13 +56,13 @@ GCC4CFLAGS= $(GCCCFLAGS) -Wno-pointer-si # Extended flags needed for SSL. You may need to modify. -SSLDIR=/usr/local/ssl -SSLCERTS=$(SSLDIR)/certs +#SSLDIR=/usr/local/ssl +SSLCERTS=$(PREFIX)/certs SSLKEYS=$(SSLCERTS) SSLINCLUDE=$(SSLDIR)/include SSLLIB=$(SSLDIR)/lib -SSLCRYPTO=-lcrypto +SSLCRYPTO=-lcrypto -lcrypt # Older versions of MIT Kerberos also have a libcrypto. If so, you may need # to use this instead -@@ -89,7 +89,7 @@ +@@ -89,7 +89,7 @@ AFSLDFLAGS=-L$(AFSLIB)/afs -L$(AFSLIB) - # AFSLDFLAGS may also need -L/usr/ucblib -lucb DCECFLAGS= -DDCE_MINIMAL -DPASSWD_OVERRIDE=\"/opt/pop3/passwd/passwd\" DCELDFLAGS= -ldce -PAMLDFLAGS= -lpam -ldl +PAMLDFLAGS= # -lpam -lcrypt # Build parameters normally set by the individual port -@@ -132,7 +132,7 @@ +@@ -132,7 +132,7 @@ EMPTYPROTO=unixproto # Commands possibly overriden by the individual port ARRC=ar rc -CC=cc +#CC=cc LN=ln -s RANLIB=ranlib -@@ -156,7 +156,7 @@ +@@ -156,7 +156,7 @@ BINARIES=osdep.o mail.o misc.o newsrc.o dummy.o pseudo.o netmsg.o flstring.o fdstring.o \ rfc822.o nntp.o smtp.o imap4r1.o pop3.o \ unix.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o mix.o -CFLAGS=-g +CFLAGS+=$(BASECFLAGS) $(EXTRACFLAGS) CAT=cat MAKE=make -@@ -173,6 +173,10 @@ +@@ -173,6 +173,10 @@ BUILD=$(MAKE) build EXTRACFLAGS='$(EXTRA PASSWDTYPE=$(PASSWDTYPE) SSLTYPE=$(SSLTYPE) IP=$(IP) +# Need this for the shared library rule to work correctly +.SUFFIXES: .o .so +SOFILES=${BINARIES:.o=.so} + # Here if no make argument established missing: osdep.h -@@ -261,13 +265,14 @@ +@@ -261,13 +265,14 @@ bsd: # BSD UNIX BASECFLAGS="-g -Dconst=" bsf: # FreeBSD - $(BUILD) `$(CAT) SPECIALS` OS=$@ \ + $(BUILD) `$(CAT) SPECIALS` OS=$@ CHECKPW=pam \ SIGTYPE=psx CRXTYPE=nfs \ SPOOLDIR=/var \ ACTIVEFILE=/usr/local/news/lib/active \ RSHPATH=/usr/bin/rsh \ + LOCKPGM=$(PREFIX)/libexec/mlock \ BASECFLAGS="$(GCCCFLAGS)" \ - BASELDFLAGS="-lcrypt" + BASELDFLAGS="-lpam" bsi: # BSD/i386 $(BUILD) `$(CAT) SPECIALS` OS=$@ \ -@@ -863,23 +868,31 @@ +@@ -863,23 +868,31 @@ vu2: # VAX Ultrix 2.3, etc. # Build it! -build: clean once $(ARCHIVE) +build: clean once $(ARCHIVE) $(SHLIBNAME) -all: $(ARCHIVE) +all: $(ARCHIVE) $(SHLIBNAME) $(ARCHIVE): $(BINARIES) sh -c '$(RM) $(ARCHIVE) || true' @$(CAT) ./ARCHIVE @$(SH) ./ARCHIVE +$(SHLIBNAME): $(SOFILES) + $(CC) -shared -Wl,-soname=$(SHLIBNAME) -o $(SHLIBNAME) $(SOFILES) `cat LDFLAGS` + $(LN) $(SHLIBNAME) lib$(SHLIBBASE).so + +.c.so: osdep.h + $(CC) -fPIC -DPIC -c `cat CFLAGS` ${@:.so=.c} -o $@ + .c.o: - `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $*.c + $(CC) -c `cat CFLAGS` $*.c # Cleanup clean: sh -c '$(RM) auths.c crexcl.c ip_unix.c linkage.[ch] siglocal.c osdep*.[ch] *.o ARCHIVE *FLAGS *TYPE $(ARCHIVE) || true' + sh -c '$(RM) *.so $(SHLIBNAME)' # Dependencies -@@ -914,7 +927,7 @@ +@@ -914,7 +927,7 @@ utf8aux.o: mail.h misc.h osdep.h utf8.h # OS-dependent -osdep.o:mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \ +OSDEPS= mail.h misc.h env.h fs.h ftl.h nl.h tcp.h \ osdep.h env_unix.h tcp_unix.h \ osdep.c env_unix.c fs_unix.c ftl_unix.c nl_unix.c tcp_unix.c ip_unix.c\ auths.c crexcl.c flockcyg.c flocklnx.c flocksim.c fsync.c \ -@@ -928,12 +941,19 @@ +@@ -928,12 +941,19 @@ osdep.o:mail.h misc.h env.h fs.h ftl.h n write.c sslstdio.c \ strerror.c strpbrk.c strstr.c strtok.c strtoul.c \ OSCFLAGS + +osdep.o: $(OSDEPS) + $(CC) `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c + @echo ======================================================================== @echo Building OS-dependent module @echo If you get No such file error messages for files x509.h, ssl.h, @echo pem.h, buffer.h, bio.h, and crypto.h, that means that OpenSSL @echo is not installed on your system. Either install OpenSSL first @echo or build with command: make `$(CAT) OSTYPE` SSLTYPE=none - `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` -c osdep.c + @echo ======================================================================== + +osdep.so: $(OSDEPS) + $(CC) -fPIC -DPIC -c `$(CAT) CFLAGS` `$(CAT) OSCFLAGS` osdep.c -o $@ osdep.c: osdepbas.c osdepckp.c osdeplog.c osdepssl.c $(CAT) osdepbas.c osdepckp.c osdeplog.c osdepssl.c > osdep.c Index: head/mail/panda-cclient/files/patch-src_osdep_unix_os__bsi.h =================================================================== --- head/mail/panda-cclient/files/patch-src_osdep_unix_os__bsi.h (nonexistent) +++ head/mail/panda-cclient/files/patch-src_osdep_unix_os__bsi.h (revision 483321) @@ -0,0 +1,21 @@ +--- src/osdep/unix/os_bsi.h.orig Wed Apr 11 10:53:03 2001 ++++ src/osdep/unix/os_bsi.h Wed Apr 11 10:55:32 2001 +@@ -22,7 +22,18 @@ + #include + #include + #include ++ ++/* ++ * FreeBSD v3.x and onward whines about being obsolete, so switch ++ * to POSIX semantics. ++ */ ++#if __FreeBSD__ >= 3 ++#include ++#define direct dirent ++#else + #include ++#endif ++ + #include + #include + #include Property changes on: head/mail/panda-cclient/files/patch-src_osdep_unix_os__bsi.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/mail/panda-cclient/files/patch-src_osdep_unix_ssl__unix.c =================================================================== --- head/mail/panda-cclient/files/patch-src_osdep_unix_ssl__unix.c (nonexistent) +++ head/mail/panda-cclient/files/patch-src_osdep_unix_ssl__unix.c (revision 483321) @@ -0,0 +1,63 @@ +--- src/osdep/unix/ssl_unix.c.orig 2013-06-21 21:29:17 UTC ++++ src/osdep/unix/ssl_unix.c +@@ -22,6 +22,10 @@ + * http://www.apache.org/licenses/LICENSE-2.0 + * + */ ++ ++/* Patch for OPENSSL_VERSION_NUMBER >= 0x10100000 obtained from ++ * openembedded/meta-openembedded (on GitHub) ++ */ + + #define crypt ssl_private_crypt + #define STRING OPENSSL_STRING +@@ -241,8 +245,16 @@ static char *ssl_start_work (SSLSTREAM * + /* disable certificate validation? */ + if (flags & NET_NOVALIDATECERT) + SSL_CTX_set_verify (stream->context,SSL_VERIFY_NONE,NIL); +- else SSL_CTX_set_verify (stream->context,SSL_VERIFY_PEER,ssl_open_verify); ++ else { ++#if OPENSSL_VERSION_NUMBER >= 0x10100000 ++ X509_VERIFY_PARAM *param = SSL_CTX_get0_param(stream->context); ++ X509_VERIFY_PARAM_set_hostflags(param, X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS); ++ X509_VERIFY_PARAM_set1_host(param, host, 0); ++#endif ++ ++ SSL_CTX_set_verify (stream->context,SSL_VERIFY_PEER,ssl_open_verify); + /* set default paths to CAs... */ ++ } + SSL_CTX_set_default_verify_paths (stream->context); + /* ...unless a non-standard path desired */ + if (s = (char *) mail_parameters (NIL,GET_SSLCAPATH,NIL)) +@@ -280,6 +292,7 @@ static char *ssl_start_work (SSLSTREAM * + if (SSL_write (stream->con,"",0) < 0) + return ssl_last_error ? ssl_last_error : "SSL negotiation failed"; + /* need to validate host names? */ ++#if OPENSSL_VERSION_NUMBER < 0x10100000 + if (!(flags & NET_NOVALIDATECERT) && + (err = ssl_validate_cert (cert = SSL_get_peer_certificate (stream->con), + host))) { +@@ -289,6 +302,7 @@ static char *ssl_start_work (SSLSTREAM * + sprintf (tmp,"*%.128s: %.255s",err,cert ? cert->name : "???"); + return ssl_last_error = cpystr (tmp); + } ++#endif + return NIL; + } + +@@ -327,6 +341,7 @@ static int ssl_open_verify (int ok,X509_ + * Returns: NIL if validated, else string of error message + */ + ++#if OPENSSL_VERSION_NUMBER < 0x10100000 + static char *ssl_validate_cert (X509 *cert,char *host) + { + int i,n; +@@ -356,6 +371,7 @@ static char *ssl_validate_cert (X509 *ce + else ret = "Unable to locate common name in certificate"; + return ret; + } ++#endif + + /* Case-independent wildcard pattern match + * Accepts: base string Property changes on: head/mail/panda-cclient/files/patch-src_osdep_unix_ssl__unix.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property