ports/129555: mail/cclient & mail/imap-uw 2006j is buggy and ancient (contain all thinks necesarry for update to 2007d)

Dan Lukes dan at obluda.cz
Wed Dec 10 19:40:01 UTC 2008


>Number:         129555
>Category:       ports
>Synopsis:       mail/cclient & mail/imap-uw 2006j is buggy and ancient (contain all thinks necesarry for update to 2007d)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 10 19:40:00 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Dan Lukes
>Release:        FreeBSD 6.4-RELEASE i386
>Organization:
>Environment:
System: FreeBSD
cclient-2006j_1,1
imap-uw-2006j_3,1


>Description:

The current ports version, 2006j, has serious bug related to locking. It's hard to
use it with latest Thunderbird with mail filter sets. Such bug has been repaired in 2006k.

But the latest (current) version is 2007d. It will be nice to see it in the ports tree ...

The excerpt of Changelog follows:


Updated: 29 October 2008

imap-2007d is a maintenance release, consisting primarily of bugfixes to
problems discovered in the release that affected a small number of users
plus a security fix for users of tmail or dmail.


Updated: 25 March 2008

imap-2007b is a maintenance release, consisting primarily of bugfixes to
problems discovered in the release that affected a small number of users.


Updated: 2 January 2008

imap-2007a is a maintenance release, consisting primarily of bugfixes to
problems discovered in the release that affected a small number of users.


Updated: 20 December 2007

imap-2007 is a release corresponding with the release of Alpine 1.0.
The primary focus of the imap-2007 release is bugfixes and reliability
improvements.  This includes:
 . fixes to problems discovered between the Alpine 0.99999 pre-release
    and Alpine 1.0
 . fixes to the mix driver to timing race problems uncovered by Timo
    Sirainen's imaptest suite.  imap-2007 using the mix format is
    believed to pass imaptest completely.

A new function, utf8_csvalidmap(), has been added for the benefit of
Alpine to use in examining UTF-8 text and determining efficiently
whether it can be downgraded to a legacy charset.  If you develop an
MUA, this may be useful for you too, although you'll have to read the
source code to see how to use it.  The purpose of the "not-CJK" bit is
to prevent messages being downgraded to a CJK charset if all they have
in that charset are some special punctuation.


Updated: 5 September 2007

imap-2006k is a maintenance release, consisting primarily of bugfixes to
problems discovered in the release that affected a small number of users.

The primary focus of this maintenance release is to correct deadlock
issues.  There were two major causes of the deadlocks:
 . a change in imap-2006i attempted to resolve a glibc mutex-based
   deadlock in imapd's signal handler, but ended up worsening the problem.
 . a bug in the mbx driver, introduced as part of the UIDPLUS work in 2006,
   applied an mbx-style lock briefly on a traditional UNIX format mailbox.
   If the traditional UNIX format mailbox was already locked by some other
   process, the result would be a deadlock of both processes.

imapd's signal handling logic is rewritten to avoid the mutex issue, and
the mbx driver is fixed so that mbx-style locks are only applied to mbx
format mailboxes.

imapd now supports the WITHIN extension.

>How-To-Repeat:
	N/A
>Fix:


The import of 2007d imapd/cclient require small changes only - the version change in Makefile and new distinfo. 

In imap-uw the patch-ai and patch-ah needs to be changed mainly because of formattings changes - no serious change here.
So most important change is within imap-uw/files/patch-src-[dt]mail-Makefile because of quota support and new source file - [dt]quota.c

All files that needs to be replaced in both ports are attached bellow.

--- imap-uw/files/patch-ah begins here ---
--- src/ipopd/ipop3d.c.orig	2008-06-04 20:18:34.000000000 +0200
+++ src/ipopd/ipop3d.c	2008-12-10 18:41:56.000000000 +0100
@@ -34,6 +34,11 @@
 #include <time.h>
 #include "c-client.h"
 
+#ifdef DRAC_AUTH
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <stdlib.h>
+#endif /* DRAC_AUTH */
 
 #define CRLF PSOUT ("\015\012")	/* primary output terpri */
 
@@ -59,6 +64,12 @@
 
 /* Global storage */
 
+#ifdef DRAC_AUTH
+#define DRACTIMEOUT 10*60     /* check every 10 minutes */
+time_t lastdrac = 0;          /* time of last drac check */
+extern char *getenv ();
+#endif /* DRAC_AUTH */
+
 char *version = "104";		/* edit number of this server */
 short state = AUTHORIZATION;	/* server state */
 short critical = NIL;		/* non-zero if in critical code */
@@ -100,7 +111,53 @@
 int mbxopen (char *mailbox);
 long blat (char *text,long lines,unsigned long size,STRING *st);
 void rset ();
-
+#ifdef DRAC_AUTH
+void drac_auth();
+#endif /* DRAC_AUTH */
+
+#ifdef DRAC_AUTH
+/* DRAC Authorization
+ */
+void drac_auth ()
+{
+  if (time (0) > lastdrac + DRACTIMEOUT)
+  {
+	  FILE *dracconf;
+	  char host[100];
+	  char *drachost;
+	  char *err;
+	  char *p;
+
+	  if ( (dracconf = fopen(ETC_DIR "/dracd.host", "r")) == NULL)
+	  {
+		syslog (LOG_INFO, "dracd: error opening %s/dracd.host config file",ETC_DIR);
+		exit(1);
+	  }
+
+	  fgets(host, 100, dracconf);
+	  p = strchr(host, '\n');
+	  if(p != NULL)
+		*p = '\0';
+	  fclose(dracconf);
+
+	  if( drachost = (host) )
+	  {
+		  struct sockaddr_in sin;
+		  int sinlen = sizeof (struct sockaddr_in);
+		  char *client = getpeername (0,(struct sockaddr *) &sin,(void *) &sinlen) ?
+			"UNKNOWN" : inet_ntoa (sin.sin_addr);
+
+		  lastdrac = time(0);
+
+		  if (dracauth(drachost, inet_addr(client), &err) != 0)
+			  syslog (LOG_INFO, err);
+		  else
+			  syslog (LOG_INFO, "dracd: authorized ip %s", client);
+	  }
+  }
+}
+#endif /* DRAC_AUTH */
+
 /* Main program */
 
 int main (int argc,char *argv[])
@@ -113,7 +170,7 @@
     (((s = strrchr (argv[0],'/')) || (s = strrchr (argv[0],'\\'))) ?
      s+1 : argv[0]) : "ipop3d";
 				/* set service name before linkage */
-  mail_parameters (NIL,SET_SERVICENAME,(void *) "pop");
+  mail_parameters (NIL,SET_SERVICENAME,(void *) "pop3");
 #include "linkage.c"
 				/* initialize server */
   server_init (pgmname,"pop3","pop3s",clkint,kodint,hupint,trmint,NIL);
@@ -228,9 +285,13 @@
 	      syslog (LOG_INFO,"AUTHENTICATE %s failure host=%.80s",s,
 		      tcp_clienthost ());
 	    }
-	    else if ((state = mbxopen ("INBOX")) == TRANSACTION)
+	    else if ((state = mbxopen ("INBOX")) == TRANSACTION) {
+              #ifdef DRAC_AUTH
+              drac_auth();
+              #endif /* DRAC_AUTH */
 	      syslog (LOG_INFO,"Auth user=%.80s host=%.80s nmsgs=%lu/%lu",
 		      user,tcp_clienthost (),nmsgs,stream->nmsgs);
+            }
 	    else syslog (LOG_INFO,"Auth user=%.80s host=%.80s no mailbox",
 			 user,tcp_clienthost ());
 	  }
@@ -260,9 +321,13 @@
 	      PSOUT ("-ERR Missing APOP argument\015\012");
 	    else if (!(user = apop_login (challenge,s,t,argc,argv)))
 	      PSOUT ("-ERR Bad APOP\015\012");
-	    else if ((state = mbxopen ("INBOX")) == TRANSACTION)
+	    else if ((state = mbxopen ("INBOX")) == TRANSACTION) {
+              #ifdef DRAC_AUTH
+              drac_auth();
+              #endif /* DRAC_AUTH */
 	      syslog (LOG_INFO,"APOP user=%.80s host=%.80s nmsgs=%lu/%lu",
 		      user,tcp_clienthost (),nmsgs,stream->nmsgs);
+            }
 	    else syslog (LOG_INFO,"APOP user=%.80s host=%.80s no mailbox",
 			 user,tcp_clienthost ());
 	  }
@@ -665,6 +730,9 @@
 				/* attempt the login */
     if (server_login (user,pass,t,argc,argv)) {
       int ret = mbxopen ("INBOX");
+	#ifdef DRAC_AUTH
+	drac_auth();
+	#endif /* DRAC_AUTH */
       if (ret == TRANSACTION)	/* mailbox opened OK? */
 	syslog (LOG_INFO,"%sLogin user=%.80s host=%.80s nmsgs=%lu/%lu",
 		t ? "Admin " : "",user,tcp_clienthost (),nmsgs,stream->nmsgs);
--- imap-uw/files/patch-ah ends here ---

--- imap-uw/files/patch-ai begins here ---
--- src/imapd/imapd.c.orig	2008-06-04 20:39:54.000000000 +0200
+++ src/imapd/imapd.c	2008-12-10 18:46:58.000000000 +0100
@@ -37,6 +37,11 @@
 #include "newsrc.h"
 #include <sys/stat.h>
 
+#ifdef DRAC_AUTH
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <stdlib.h>
+#endif /* DRAC_AUTH */
 
 #define CRLF PSOUT ("\015\012")	/* primary output terpri */
 
@@ -207,6 +212,12 @@
 
 /* Global storage */
 
+#ifdef DRAC_AUTH
+#define DRACTIMEOUT 10*60     /* check every 10 minutes */
+time_t lastdrac = 0;          /* time of last drac check */
+extern char *getenv ();
+#endif /* DRAC_AUTH */
+
 char *version = "404";		/* edit number of this server */
 char *logout = "Logout";	/* syslogreason for logout */
 char *goodbye = NIL;		/* bye reason */
@@ -283,7 +294,50 @@
   msg_string_next,		/* get next byte in string structure */
   msg_string_setpos		/* set position in string structure */
 };
-
+
+#ifdef DRAC_AUTH
+/* DRAC Authorization
+ */
+void drac_auth ()
+{
+  if (time (0) > lastdrac + DRACTIMEOUT)
+  {
+	  FILE *dracconf;
+	  char host[100];
+	  char *drachost;
+	  char *err;
+	  char *p;
+
+	  if ( (dracconf = fopen(ETC_DIR "/dracd.host", "r")) == NULL)
+	  {
+		syslog (LOG_INFO, "dracd: error opening %s/dracd.host config file",ETC_DIR);
+		exit(1);
+	  }
+
+	  fgets(host, 100, dracconf);
+	  p = strchr(host, '\n');
+	  if(p != NULL)
+		*p = '\0';
+	  fclose(dracconf);
+
+	  if( drachost = (host) )
+	  {
+		  struct sockaddr_in sin;
+		  int sinlen = sizeof (struct sockaddr_in);
+		  char *client = getpeername (0,(struct sockaddr *) &sin,(void *) &sinlen) ?
+			"UNKNOWN" : inet_ntoa (sin.sin_addr);
+
+		  lastdrac = time(0);
+
+		  if (dracauth(drachost, inet_addr(client), &err) != 0)
+			  syslog (LOG_INFO, err);
+		  else
+			  syslog (LOG_INFO, "dracd: authorized ip %s", client);
+	  }
+  }
+}
+#endif /* DRAC_AUTH */
+
 /* Main program */
 
 int main (int argc,char *argv[])
@@ -1525,6 +1579,9 @@
 	      lasterror ());
       return;
     }
+	#ifdef DRAC_AUTH
+	drac_auth();
+	#endif /* DRAC_AUTH */
 				/* change in number of messages? */
     if (existsquelled || (nmsgs != stream->nmsgs)) {
       PSOUT ("* ");
--- imap-uw/files/patch-ai ends here ---

--- imap-uw/files/patch-src-dmail-Makefile begins here ---
--- src/dmail/Makefile.orig	2008-06-04 20:18:34.000000000 +0200
+++ src/dmail/Makefile	2008-12-10 19:13:21.000000000 +0100
@@ -31,19 +31,14 @@
 
 # Get local definitions from c-client directory
 
-CC = `cat $C/CCTYPE`
-CFLAGS = -I$C `cat $C/CFLAGS`
-LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+CFLAGS+=	-DNFSKLUDGE -I$(LOCALBASE)/include/c-client
+LDFLAGS+=	-L$(LOCALBASE)/lib -lc-client4
 
-dmail: $(CCLIENTLIB) dmail.o dquota.o
+dmail: dmail.o dquota.o
 	$(CC) $(CFLAGS) -o dmail dmail.o dquota.o $(LDFLAGS)
 
-dmail.o: $C/mail.h $C/misc.h $C/osdep.h dquota.h
-
 dquota.o: dquota.h
-
-$(CCLIENTLIB):
-	cd $C;make
+	$(CC) $(CFLAGS) -c -o dquota.o dquota.c $(LDFLAGS)
 
 clean:
 	rm -f *.o dmail
--- imap-uw/files/patch-src-dmail-Makefile ends here ---

--- imap-uw/files/patch-src-tmail-Makefile begins here ---
--- src/tmail/Makefile.orig	2008-06-04 20:18:34.000000000 +0200
+++ src/tmail/Makefile	2008-12-10 19:10:23.000000000 +0100
@@ -31,19 +31,14 @@
 
 # Get local definitions from c-client directory
 
-CC = `cat $C/CCTYPE`
-CFLAGS = -I$C `cat $C/CFLAGS`
-LDFLAGS = $(CCLIENTLIB) `cat $C/LDFLAGS`
+CFLAGS+=	-DNFSKLUDGE -I$(LOCALBASE)/include/c-client
+LDFLAGS+=	-L$(LOCALBASE)/lib -lc-client4
 
-tmail: $(CCLIENTLIB) tmail.o tquota.o
+tmail: tmail.o tquota.o
 	$(CC) $(CFLAGS) -o tmail tmail.o tquota.o $(LDFLAGS)
 
-tmail.o: $C/mail.h $C/misc.h $C/osdep.h tquota.h
-
 tquota.o: tquota.h
-
-$(CCLIENTLIB):
-	cd $C;make
+	$(CC) $(CFLAGS) -c -o tquota.o tquota.c $(LDFLAGS)
 
 clean:
 	rm -f *.o tmail
--- imap-uw/files/patch-src-tmail-Makefile ends here ---

--- imap-uw/Makefile begins here ---
# New ports collection makefile for:	imap-uw
# Date created:		9 Jan 1997
# Whom:			pst
#
# $FreeBSD: ports/mail/imap-uw/Makefile,v 1.84 2007/10/01 16:04:16 marcus Exp $
#

PORTNAME=	imap
PORTVERSION=	2007d
#DISTVERSIONSUFFIX=	2
#PORTREVISION=	3
#PORTEPOCH=	1
CATEGORIES=	mail ipv6
MASTER_SITES=	ftp://ftp.cac.washington.edu/imap/%SUBDIR%/ \
		ftp://ftp.nuug.no/pub/anders/distfiles/%SUBDIR%/ \
		http://atreides.freenix.no/~anders/%SUBDIR%/ \
		ftp://ftp.funet.fi/pub/mirrors/ftp.cac.washington.edu/mail/%SUBDIR%/
MASTER_SITE_SUBDIR=	. old
PKGNAMESUFFIX=	-uw
DISTNAME=	imap-${PORTVERSION}
EXTRACT_SUFX=	.tar.Z
DISTFILES=	${DISTNAME}${DISTVERSIONSUFFIX}${EXTRACT_SUFX}

MAINTAINER=	anders at FreeBSD.org
COMMENT=	University of Washington IMAP4rev1/POP2/POP3 mail servers

# This port must have the same SSL settings as mail/cclient, which it depends on
# To make MBX format the default mailbox format, change the settings of cclient

OPTIONS=	SSL "Compile with SSL support" on \
		SSL_AND_PLAINTEXT "Allow plain text passwords and SSL" off \
		DRAC "Dynamically open MTA for relaying" off \
		NETSCAPE_BRAIN_DAMAGE "See Makefile for documentation" off

.include <bsd.port.pre.mk>

LIB_DEPENDS=	c-client4.9:${PORTSDIR}/mail/cclient
.if defined(WITH_DRAC)
BUILD_DEPENDS=	${LOCALBASE}/lib/libdrac.a:${PORTSDIR}/mail/drac
.endif

DOCSDIR=	${PREFIX}/share/doc/${PORTNAME}${PKGNAMESUFFIX}
WRKSRC=		${WRKDIR}/${DISTNAME}

MAN1=		dmail.1 mailutil.1 tmail.1
MAN8=		ipopd.8 imapd.8

ALL_TARGET=	bsf
.if defined(WITHOUT_SSL)
MAKE_ARGS+=	SSLTYPE=none SSLDIR=${OPENSSLBASE}
.else
USE_OPENSSL=	yes
.if defined(WITH_SSL_AND_PLAINTEXT)
MAKE_ARGS+=	SSLTYPE=unix
.else
MAKE_ARGS+=	SSLTYPE=unix.nopwd
.endif
.endif

# Define this to get somewhat better interoperability with Netscape.
.if defined(WITH_NETSCAPE_BRAIN_DAMAGE)
MAKE_ARGS+=	WITH_NETSCAPE_BRAIN_DAMAGE=yes
.endif
# See src/imapd/Makefile for more information about these three options.

pre-build:
	@${SH} ${PKGREQ}.rev ${LOCALBASE}/include/c-client/portrevision.h ${PORTVERSION}
.if !defined(WITHOUT_SSL)
	@${SH} ${PKGREQ}.ssl ${LOCALBASE}/include/c-client/portrevision.h yes
.else
	@${SH} ${PKGREQ}.ssl ${LOCALBASE}/include/c-client/portrevision.h no
.endif

do-install:
	${INSTALL_PROGRAM} ${WRKSRC}/imapd/imapd ${PREFIX}/libexec/
	${INSTALL_PROGRAM} ${WRKSRC}/ipopd/ipop2d ${PREFIX}/libexec/
	${INSTALL_PROGRAM} ${WRKSRC}/ipopd/ipop3d ${PREFIX}/libexec/
	${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g mail -m 2711 \
		${WRKSRC}/mlock/mlock ${PREFIX}/libexec
	${INSTALL_PROGRAM} ${WRKSRC}/mtest/mtest ${PREFIX}/bin/mboxtest
	${INSTALL_MAN} \
		${WRKSRC}/src/imapd/imapd.8 ${PREFIX}/man/man8/imapd.8
	${INSTALL_MAN} \
		${WRKSRC}/src/ipopd/ipopd.8 ${PREFIX}/man/man8/ipopd.8
	${INSTALL_PROGRAM} ${WRKSRC}/dmail/dmail ${PREFIX}/bin/
	${INSTALL_PROGRAM} ${WRKSRC}/mailutil/mailutil ${PREFIX}/bin/
	${INSTALL_PROGRAM} ${WRKSRC}/tmail/tmail ${PREFIX}/bin/
	${INSTALL_MAN} ${WRKSRC}/src/dmail/dmail.1 ${PREFIX}/man/man1/
	${INSTALL_MAN} ${WRKSRC}/src/mailutil/mailutil.1 ${PREFIX}/man/man1/
	${INSTALL_MAN} ${WRKSRC}/src/tmail/tmail.1 ${PREFIX}/man/man1/

post-install:
	@${CAT} ${PKGMESSAGE}
.if defined(WITH_DRAC)
	@${ECHO} "================================================================================"
	@${ECHO} "To have DRAC working, you must create ${PREFIX}/etc/dracd.host, containing"
	@${ECHO} "the hostname of the DRAC server:"
	@${ECHO}
	@${ECHO} "localhost"
	@${ECHO} "================================================================================"
.endif
.if !defined(WITHOUT_SSL)
	@${ECHO}
	@${ECHO} "To create and install a new SSL certificate for imapd and ipop3d, type \"make"
	@${ECHO} "cert\". Or install manually in ${PREFIX}/certs."
	@${ECHO}
	@${ECHO} "Example inetd config for SSL only services:"
	@${ECHO}
	@${ECHO} "pop3s   stream  tcp     nowait  root    ${PREFIX}/libexec/ipop3d       ipop3d"
	@${ECHO} "imaps   stream  tcp     nowait  root    ${PREFIX}/libexec/imapd        imapd"
	@${ECHO} "================================================================================"
.endif
.if !defined(NOPORTDOCS)
	${MKDIR} -m 0755 -p ${DOCSDIR}
	@${TAR} -C ${WRKSRC}/docs -cf - . | \
		(umask 022; ${TAR} -C ${DOCSDIR} -xf -)
.endif

cert:
	@${INSTALL} -d -o root -g wheel -m 0755 ${PREFIX}/certs
	@openssl req -new -x509 -days 365 -nodes -config ${FILESDIR}/imap-uw.cnf -out ${PREFIX}/certs/imapd.pem -keyout ${PREFIX}/certs/imapd.pem
	@openssl x509 -subject -dates -fingerprint -noout -in ${PREFIX}/certs/imapd.pem
	@${CHMOD} 700 ${PREFIX}/certs/imapd.pem
	@${LN} -s ${PREFIX}/certs/imapd.pem ${PREFIX}/certs/ipop3d.pem

.include <bsd.port.post.mk>
--- imap-uw/Makefile ends here ---

--- imap-uw/distinfo begins here ---
MD5 (imap-2007d.tar.Z) = 80cdf8366a69417818f4d73181f16b9d
SHA256 (imap-2007d.tar.Z) = ccf0ec482ed9170f507bc307ef0ec5b732d1ad236a11c18a8dbc578ecd65fc1d
SIZE (imap-2007d.tar.Z) = 2794618
--- imap-uw/distinfo ends here ---

--- cclient/Makefile begins here ---
# New ports collection makefile for:	cclient
# Date created:				2 July 2000
# Whom:					Kelly Yancey <kbyanc at FreeBSD.org>
#
# $FreeBSD: ports/mail/cclient/Makefile,v 1.41 2007/10/01 04:03:01 marcus Exp $
#

PORTNAME=	cclient
PORTVERSION=	2007d
#PORTREVISION=	1
#PORTEPOCH=	1
CATEGORIES=	mail devel ipv6
MASTER_SITES=	ftp://ftp.cac.washington.edu/imap/%SUBDIR%/ \
		http://atreides.freenix.no/~anders/%SUBDIR%/ \
		ftp://ftp.funet.fi/pub/mirrors/ftp.cac.washington.edu/imap/%SUBDIR%/ \
		ftp://ftp.nuug.no/pub/anders/distfiles/%SUBDIR%/
MASTER_SITE_SUBDIR=	. old
DISTNAME=	imap-${PORTVERSION}
EXTRACT_SUFX=	.tar.Z
#DISTVERSIONSUFFIX=	2
DISTFILES=	${DISTNAME}${DISTVERSIONSUFFIX}${EXTRACT_SUFX}

MAINTAINER=	anders at FreeBSD.org
COMMENT=	C-client mail access routines

OPTIONS=	SSL "Compile with SSL support" on \
		SSL_AND_PLAINTEXT "Allow plain text passwords and SSL" off \
		IPV6 "Support IPv6" on \
		MBX_DEFAULT "Use MBX as default mailbox format" off

.include <bsd.port.pre.mk>

USE_LDCONFIG=	yes
ALL_TARGET=	bsf
.if defined(WITHOUT_SSL)
MAKE_ARGS+=	SSLTYPE=none SSLDIR=${OPENSSLBASE}
.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}

SHLIBBASE=	c-client4
SHLIBMAJ=	9
SHLIBNAME=	lib${SHLIBBASE}.so.${SHLIBMAJ}
MAKE_ENV=	SHLIBNAME=${SHLIBNAME} SHLIBBASE=${SHLIBBASE}
PLIST_SUB=	SHLIBNAME=${SHLIBNAME} SHLIBBASE=${SHLIBBASE}

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
	@${REINPLACE_CMD} -e "s:/etc/ssl/certs:${PREFIX}/certs:g; \
		s:/etc/ssl/private:${PREFIX}/certs:g" ${WRKSRC}/Makefile
.if !defined(WITHOUT_IPV6)
	@${REINPLACE_CMD} -e "s|^IP=4|IP=6|" ${WRKSRC}/Makefile \
		${WRKSRC}/src/osdep/unix/Makefile
.endif
.if defined(WITH_MBX_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 !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
	${INSTALL_DATA} ${WRKSRC}/c-client/CFLAGS ${PREFIX}/include/c-client
	${INSTALL_DATA} ${WRKSRC}/c-client/LDFLAGS ${PREFIX}/include/c-client
	${INSTALL_DATA} ${WRKSRC}/c-client/OSCFLAGS ${PREFIX}/include/c-client

post-install:
	${INSTALL_DATA} ${PORTREV_H} ${PREFIX}/include/c-client
.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 them explicitly with ssl (-lssl -lcrypto) may or may not help."
	@${ECHO} "================================================================================"
.endif

.include <bsd.port.post.mk>
--- Makefile ends here ---

--- cclient/distinfo begins here ---
MD5 (imap-2007d.tar.Z) = 80cdf8366a69417818f4d73181f16b9d
SHA256 (imap-2007d.tar.Z) = ccf0ec482ed9170f507bc307ef0ec5b732d1ad236a11c18a8dbc578ecd65fc1d
SIZE (imap-2007d.tar.Z) = 2794618
--- cclient/distinfo ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list