diff --git a/mail/cclient/Makefile b/mail/cclient/Makefile index 2e3eefe400ed..3022e0e7aa04 100644 --- a/mail/cclient/Makefile +++ b/mail/cclient/Makefile @@ -1,87 +1,93 @@ # New ports collection makefile for: cclient # Date created: 2 July 2000 # Whom: Kelly Yancey # # $FreeBSD$ # PORTNAME= cclient PORTVERSION= 2002 PORTEPOCH= 1 CATEGORIES= mail devel MASTER_SITES= ftp://ftp.cac.washington.edu/imap/ \ http://atreides.freenix.no/~anders/ \ ftp://ftp.funet.fi/pub/mirrors/ftp.cac.washington.edu/imap/ \ ftp://ftp.nuug.no/pub/anders/distfiles/ DISTNAME= imap-${PORTVERSION} EXTRACT_SUFX= .tar.Z MAINTAINER= anders@FreeBSD.org INSTALLS_SHLIB= yes ALL_TARGET= bsf -.if defined(WITH_SSL) -MAKE_ARGS+= SSLTYPE=unix.nopwd +.if defined(WITHOUT_SSL) +MAKE_ARGS+= SSLTYPE=none +.else USE_OPENSSL= yes +.if defined(WITH_SSL_AND_PLAINTEXT) +MAKE_ARGS+= SSLTYPE=unix +.else +MAKE_ARGS+= SSLTYPE=unix.nopwd +.endif .endif WRKSRC= ${WRKDIR}/${DISTNAME} USE_REINPLACE= yes SHLIBBASE= c-client4 SHLIBMAJ= 8 SHLIBNAME= lib${SHLIBBASE}.so.${SHLIBMAJ} MAKE_ENV= SHLIBNAME=${SHLIBNAME} SHLIBBASE=${SHLIBBASE} PLIST_SUB= SHLIBNAME=${SHLIBNAME} SHLIBBASE=${SHLIBBASE} .include .if ${PORTOBJFORMAT} == "aout" SHLIBNAME= lib${SHLIBBASE}.so.${SHLIBMAJ}.0 .endif post-patch: .for file in Makefile src/osdep/unix/Makefile src/osdep/unix/Makefile.gss @${REINPLACE_CMD} -e "s|/usr/local|${PREFIX}|g" ${WRKSRC}/${file} .endfor 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 flocksim.h \ flstring.h fs.h ftl.h imap4r1.h linkage.c linkage.h mail.h \ mbox.h mbx.h mh.h misc.h mmdf.h mtx.h mx.h netmsg.h news.h \ newsrc.h nl.h nntp.h osdep.h phile.h pop3.h pseudo.h rfc822.h \ smtp.h sslio.h tcp.h tcp_unix.h tenex.h unix.h utf8.h PORTREV_H= ${WRKDIR}/portrevision.h post-build: @${ECHO_CMD} "#define CCLIENT_PORTVERSION \"${PORTVERSION}\"" >${PORTREV_H} -.if defined(WITH_SSL) +.if !defined(WITHOUT_SSL) @${ECHO_CMD} "#define CCLIENT_SSLENABLED \"yes\"" >>${PORTREV_H} .else @${ECHO_CMD} "#define CCLIENT_SSLENABLED \"no\"" >>${PORTREV_H} .endif do-install: ${MKDIR} ${PREFIX}/include/c-client .for f in ${HEADERS} ${INSTALL_DATA} ${WRKSRC}/c-client/${f} ${PREFIX}/include/c-client .endfor ${INSTALL} ${COPY} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${WRKSRC}/c-client/${SHLIBNAME} ${PREFIX}/lib ${LN} -sf ${SHLIBNAME} ${PREFIX}/lib/lib${SHLIBBASE}.so ${INSTALL_DATA} ${WRKSRC}/c-client/c-client.a \ ${PREFIX}/lib/lib${SHLIBBASE}.a post-install: ${INSTALL_DATA} ${PORTREV_H} ${PREFIX}/include/c-client -.if defined(WITH_SSL) +.if !defined(WITHOUT_SSL) @${ECHO} "================================================================================" @${ECHO} "Warning: You have chosen to include SSL support. Applications/ports that use" @${ECHO} "the cclient library but do not support SSL may stop working or have problems - @${ECHO} "linking. Linking explicitly with ssl (-lssl -lcrypto) may or may not help." + @${ECHO} "linking. Linking them explicitly with ssl (-lssl -lcrypto) may or may not help." @${ECHO} "================================================================================" .endif .include diff --git a/mail/cclient/files/patch-ab b/mail/cclient/files/patch-ab index 6562900dbdd8..9e7f5acb2d19 100644 --- a/mail/cclient/files/patch-ab +++ b/mail/cclient/files/patch-ab @@ -1,151 +1,153 @@ ---- src/osdep/unix/Makefile.orig Mon Oct 14 15:45:24 2002 -+++ src/osdep/unix/Makefile Tue Nov 26 01:44:27 2002 +--- src/osdep/unix/Makefile.orig Tue Oct 15 00:45:24 2002 ++++ src/osdep/unix/Makefile Wed Nov 27 01:58:27 2002 @@ -22,18 +22,18 @@ EXTRAAUTHENTICATORS= EXTRADRIVERS=mbox -PASSWDTYPE=std -SSLTYPE=nopwd +PASSWDTYPE=pam -+SSLTYPE=nopwd.nopwd ++SSLTYPE=unix.nopwd # Extended flags needed for SSL. You may need to modify. -SSLDIR=/usr/local/ssl -SSLCERTS=$(SSLDIR)/certs -SSLINCLUDE=$(SSLDIR)/include -SSLLIB=$(SSLDIR)/lib +SSLDIR=$(OPENSSLBASE) +SSLCERTS=$(PREFIX)/certs +SSLINCLUDE=$(OPENSSLINC) +SSLLIB=$(OPENSSLLIB) -SSLCRYPTO=-lcrypto +SSLCRYPTO=-lcrypto -lcrypt # Older versions of MIT Kerberos also have a libcrypto. If so, you may need # to use this instead @@ -60,7 +60,7 @@ # 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 @@ -97,7 +97,7 @@ # Commands possibly overriden by the individual port ARRC=ar rc -CC=cc +#CC=cc LN=ln -s RANLIB=ranlib @@ -115,7 +115,7 @@ dummy.o pseudo.o netmsg.o flstring.o fdstring.o \ rfc822.o nntp.o smtp.o imap4r1.o pop3.o \ unix.o mbox.o mbx.o mmdf.o tenex.o mtx.o news.o phile.o mh.o mx.o -CFLAGS=-g +CFLAGS+=$(BASECFLAGS) $(EXTRACFLAGS) CAT=cat MAKE=make @@ -132,6 +132,10 @@ PASSWDTYPE=$(PASSWDTYPE) SSLTYPE=$(SSLTYPE) +# 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 @@ -212,13 +216,14 @@ 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 \ - BASECFLAGS="-g -O -pipe" \ - BASELDFLAGS="-lcrypt" + LOCKPGM=$(PREFIX)/libexec/mlock \ + BASECFLAGS="-DNFSKLUDGE" \ + BASELDFLAGS="-lpam" bsi: # BSD/i386 $(BUILD) `$(CAT) SPECIALS` OS=$@ \ @@ -762,23 +767,35 @@ # 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) +.if $(PORTOBJFORMAT) == "elf" + ld -shared -x -soname $(SHLIBNAME) -o $(SHLIBNAME) $(SOFILES) `cat LDFLAGS` +.else + ld -Bshareable -x -o $(SHLIBNAME) $(SOFILES) `cat LDFLAGS` +.endif + ln -s $(SHLIBNAME) lib$(SHLIBBASE).so + +.c.so: osdep.h + $(CC) -fpic -DPIC -c $(CFLAGS) ${@:.so=.c} -o $@ + .c.o: - `$(CAT) CCTYPE` -c `$(CAT) CFLAGS` $*.c + $(CC) -c $(CFLAGS) $*.c # Cleanup clean: sh -c '$(RM) auths.c crexcl.c nfstest.c linkage.[ch] siglocal.c osdep*.[ch] *.o ARCHIVE *FLAGS *TYPE $(ARCHIVE) || true' + sh -c '$(RM) *.so $(SHLIBNAME)' # Dependencies @@ -812,7 +829,7 @@ # 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 \ auths.c crexcl.c flocksim.c nfstest.c flcksafe.c fsync.c gethstid.c \ -@@ -824,12 +841,17 @@ +@@ -824,12 +841,19 @@ write.c sslstdio.c \ strerror.c strpbrk.c strstr.c strtok.c strtoul.c \ OSCFLAGS + +osdep.o: $(OSDEPS) -+ $(CC) $(CFLAGS) `$(CAT) OSCFLAGS` -c osdep.c ++ $(CC) $(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 $(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 diff --git a/mail/cclient/files/patch-ac b/mail/cclient/files/patch-ac index ae5ba9170a10..e8b0ceecf3f1 100644 --- a/mail/cclient/files/patch-ac +++ b/mail/cclient/files/patch-ac @@ -1,30 +1,50 @@ ---- Makefile.orig Mon Nov 4 16:19:13 2002 -+++ Makefile Tue Nov 26 01:18:50 2002 +--- Makefile.orig Tue Nov 5 01:19:13 2002 ++++ Makefile Wed Nov 27 00:59:07 2002 @@ -256,7 +256,7 @@ # Make the IMAP Toolkit -all: SPECIALS c-client rebuild bundled +all: SPECIALS c-client rebuild c-client: @echo Not processed yet. In a first-time build, you must specify -@@ -434,7 +434,7 @@ +@@ -396,9 +396,6 @@ + @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;; *) exit 1;; esac' + + sslnone: + @echo +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +@@ -411,9 +408,6 @@ + @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;; *) exit 1;; esac' + + + # C compiler types +@@ -434,7 +428,7 @@ $(TOOLS)/$@ "$(LN)" src/tmail tmail $(LN) $(TOOLS)/$@ . -build: OSTYPE rebuild rebuildclean bundled +build: OSTYPE rebuild rebuildclean OSTYPE: @echo Building c-client for $(BUILDTYPE)... -@@ -453,8 +453,7 @@ +@@ -453,8 +447,7 @@ @$(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'