Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Jan 2001 09:07:14 -0500 (EST)
From:      yds@dppl.com
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        dwcjr@inethouston.net, blaz@amis.net
Subject:   ports/24429: FIX: Postfix current
Message-ID:  <20010118140714.094F77441C@sapas.dppl.com>

next in thread | raw e-mail | index | archive | help

>Number:         24429
>Category:       ports
>Synopsis:       FIX: Postfix current
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 18 06:10:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Yarema
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
Digital Page Publishers Ltd
>Environment:

	FreeBSD 4.2-STABLE i386

>Description:

First the port as it stand uses ${DOCDIR} without first setting it.
This installs all the docs in /usr/share/doc -- clearly not what was
intended.  Changed to set DOCDIR=	${PREFIX}/share/doc/postfix
where the docs actually belong.

Second I got tired of typing make -DWITH_PCRE -DWITH_SASL etc.  So I
put all that into the ${SCRIPTDIR}/configure.postfix based on the fine work
done in mod_php[34] and cyrus-sasl ports.

Third I added an option to use Berkeley DB3 which is required if SASL was
also built with DB3.

And the final fix is to generate /etc/mail/mailer.conf with tabs instead of
spaces.  I've submitted patches to fix this last point in the past but they
somehow never make it in.

I also changed the PLIST substitution variables from WITH_* to SUB_*
This changes nothing except making it easier for me to keep track what the
variables actually do.

>How-To-Repeat:

	cd /usr/ports/mail/postfix-current && make install

>Fix:

diff -ruN postfix-current/Makefile postfix-current.1/Makefile
--- postfix-current/Makefile	Tue Dec 19 00:37:09 2000
+++ postfix-current.1/Makefile	Thu Jan 18 08:39:20 2001
@@ -7,6 +7,7 @@
 
 PORTNAME=	postfix
 PORTVERSION=	20001217
+PORTREVISION=	1
 CATEGORIES=	mail
 MASTER_SITES=	ftp://ftp.porcupine.org/mirrors/postfix-release/experimental/ \
 		ftp://ftp.aet.tu-cottbus.de/pub/postfix_tls/%SUBDIR%/ \
@@ -44,79 +45,28 @@
 BIN2=	postalias postcat postconf postdrop postfix \
 	postkick postlock postlog postmap postsuper sendmail
 
-.if defined(WITH_TEST)
-BIN3=   smtp-sink smtp-source
-PLIST_SUB+=		WITH_TEST=""
-.else
-PLIST_SUB+=		WITH_TEST="@comment "
-.endif
+DOCDIR=	${PREFIX}/share/doc/postfix
 
 .if !defined(DEBUG)
 MAKEFILEFLAGS+=	DEBUG=
 .endif
 
-.if defined(CC)
-MAKEFILEFLAGS+=	CC="${CC}"
-.endif
-
 MAKEFILEFLAGS+=	OPT="${CFLAGS}"
 
-.if defined(WITH_MYSQL)
-BUILD_DEPENDS+=		${LOCALBASE}/lib/mysql/libmysqlclient.a:${PORTSDIR}/databases/mysql322-client
-POSTFIX_CCARGS+=	-DHAS_MYSQL -I${LOCALBASE}/include/mysql
-POSTFIX_AUXLIBS+=	${LOCALBASE}/lib/mysql/libmysqlclient.a -lm
-.endif
-
-.if defined(WITH_LDAP)
-CONF2+=			sample-ldap.cf
-BUILD_DEPENDS+=		${LOCALBASE}/lib/libldap.a:${PORTSDIR}/net/openldap
-POSTFIX_CCARGS+=	-DHAS_LDAP -I${LOCALBASE}/include
-POSTFIX_AUXLIBS+=	${LOCALBASE}/lib/libldap.a ${PREFIX}/lib/liblber.a
-PLIST_SUB+=		WITH_LDAP=""
-.else
-PLIST_SUB+=		WITH_LDAP="@comment "
-.endif
-
-.if defined(WITH_PCRE)
-CONF1+=			pcre_table
-CONF2+=			sample-pcre.cf
-MAN5+=			pcre_table.5
-BUILD_DEPENDS+=		${LOCALBASE}/lib/libpcre.a:${PORTSDIR}/devel/pcre
-POSTFIX_CCARGS+=	-DHAS_PCRE -I${LOCALBASE}/include
-POSTFIX_AUXLIBS+=	${LOCALBASE}/lib/libpcre.a
-PLIST_SUB+=		WITH_PCRE=""
-.else
-PLIST_SUB+=		WITH_PCRE="@comment "
-.endif
+SCRIPTS_ENV=	WRKDIRPREFIX="${WRKDIRPREFIX}" \
+		PREFIX="${PREFIX}" \
+		TOUCH="${TOUCH}" \
+		MKDIR="${MKDIR}"
 
-.if defined(WITH_SASL)
-CONF2+=			sample-auth.cf
-BUILD_DEPENDS+=		${LOCALBASE}/lib/libsasl.a:${PORTSDIR}/security/cyrus-sasl
-POSTFIX_CCARGS+=	-DUSE_SASL_AUTH -I${LOCALBASE}/include
-POSTFIX_AUXLIBS+=	${LOCALBASE}/lib/libsasl.a -lpam -lcrypt
-.if exists(/usr/lib/libkrb.a)
-POSTFIX_AUXLIBS+=	-lkrb -ldes -lcom_err
-.endif
-PLIST_SUB+=		WITH_SASL=""
-.else
-PLIST_SUB+=		WITH_SASL="@comment "
-.endif
+pre-fetch:
+	@${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/configure.postfix
 
-.if defined(WITH_TLS)
-CONF2+=			sample-tls.cf
-BIN1+=			tlsmgr
-POSTFIX_CCARGS+=	-DHAS_SSL -I/usr/include/openssl
-POSTFIX_AUXLIBS+=	-lssl -lcrypto
-DISTFILES+=		${DISTNAME}.tar.gz pfixtls-0.6.30-snap20001217-0.9.6.tar.gz
-EXTRA_PATCHES+=		${WRKDIR}/pfixtls-0.6.30-snap20001217-0.9.6/pfixtls.diff
-PATCH_STRIP=		-p1
-PLIST_SUB+=		WITH_TLS=""
-.else
-PLIST_SUB+=		WITH_TLS="@comment "
+.if exists(${WRKDIRPREFIX}${.CURDIR}/Makefile.inc)
+.include "${WRKDIRPREFIX}${.CURDIR}/Makefile.inc"
 .endif
 
 post-patch:
-	(cd ${WRKSRC} && make -f Makefile.init makefiles ${MAKEFILEFLAGS} \
+	(cd ${WRKSRC} && ${MAKE} -f Makefile.init makefiles ${MAKEFILEFLAGS} \
 	CCARGS="${POSTFIX_CCARGS}" AUXLIBS="${POSTFIX_AUXLIBS}" && \
 	${ECHO} "all: default" >> Makefile)
 
@@ -198,6 +148,9 @@
 post-install:
 	@PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
 
+post-clean:
+	@${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc
+
 .include <bsd.port.pre.mk>
 
 replace:
@@ -209,9 +162,9 @@
 	${ECHO} ", named ${PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf
 	${ECHO} "#" >> /etc/mail/mailer.conf
 	${ECHO} "sendmail	${PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf
-	${ECHO} "send-mail      ${PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf
-	${ECHO} "mailq          ${PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf
-	${ECHO} "newaliases     ${PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf
+	${ECHO} "send-mail	${PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf
+	${ECHO} "mailq		${PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf
+	${ECHO} "newaliases	${PREFIX}/sbin/sendmail" >> /etc/mail/mailer.conf
 .else
 	@${ECHO_MSG} "===> Replacing sendmail"
 	@if [ -e /usr/sbin/sendmail ]; then \
diff -ruN postfix-current/pkg-plist postfix-current.1/pkg-plist
--- postfix-current/pkg-plist	Fri Dec 15 07:51:14 2000
+++ postfix-current.1/pkg-plist	Thu Jan 18 07:14:31 2001
@@ -5,19 +5,19 @@
 etc/postfix/sample-access
 etc/postfix/sample-aliases
 etc/postfix/sample-aliases.cf
-%%WITH_SASL%%etc/postfix/sample-auth.cf
+%%SUB_SASL%%etc/postfix/sample-auth.cf
 etc/postfix/sample-canonical
 etc/postfix/sample-canonical.cf
 etc/postfix/sample-debug.cf
 etc/postfix/sample-filter.cf
 etc/postfix/sample-flush.cf
-%%WITH_LDAP%%etc/postfix/sample-ldap.cf
+%%SUB_LDAP%%etc/postfix/sample-ldap.cf
 etc/postfix/sample-local.cf
 etc/postfix/sample-main.cf
 etc/postfix/sample-master.cf
 etc/postfix/sample-misc.cf
-%%WITH_PCRE%%etc/postfix/sample-pcre.cf
-%%WITH_PCRE%%etc/postfix/sample-pcre_table
+%%SUB_PCRE%%etc/postfix/sample-pcre.cf
+%%SUB_PCRE%%etc/postfix/sample-pcre_table
 etc/postfix/sample-rate.cf
 etc/postfix/sample-regexp.cf
 etc/postfix/sample-regexp_table
@@ -27,7 +27,7 @@
 etc/postfix/sample-rewrite.cf
 etc/postfix/sample-smtp.cf
 etc/postfix/sample-smtpd.cf
-%%WITH_TLS%%etc/postfix/sample-tls.cf
+%%SUB_TLS%%etc/postfix/sample-tls.cf
 etc/postfix/sample-transport
 etc/postfix/sample-transport.cf
 etc/postfix/sample-virtual
@@ -47,7 +47,7 @@
 libexec/postfix/smtp
 libexec/postfix/smtpd
 libexec/postfix/spawn
-%%WITH_TLS%%libexec/postfix/tlsmgr
+%%SUB_TLS%%libexec/postfix/tlsmgr
 libexec/postfix/trivial-rewrite
 sbin/postalias
 sbin/postcat
@@ -60,7 +60,7 @@
 sbin/postsuper
 sbin/postdrop
 sbin/sendmail
-%%WITH_TEST%%sbin/smtp-sink
-%%WITH_TEST%%sbin/smtp-source
+%%SUB_TEST%%sbin/smtp-sink
+%%SUB_TEST%%sbin/smtp-source
 @dirrm etc/postfix
 @dirrm libexec/postfix
diff -ruN postfix-current/scripts/configure.postfix postfix-current.1/scripts/configure.postfix
--- postfix-current/scripts/configure.postfix	Wed Dec 31 19:00:00 1969
+++ postfix-current.1/scripts/configure.postfix	Thu Jan 18 08:25:46 2001
@@ -0,0 +1,115 @@
+#!/bin/sh
+# $FreeBSD: $
+
+if [ -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc ]; then
+	exit
+fi
+
+tempfile=`mktemp -t checklist`
+
+if [ "${BATCH}" ]; then
+	set \"PCRE\"
+else
+	/usr/bin/dialog --title "Postfix configuration options" --clear \
+		--checklist "\n\
+Please select desired options:" -1 -1 16 \
+PCRE		"Perl Compatible Regular Expressions" ON \
+SASL		"Cyrus SASL (Simple Authentication and Security Layer)" OFF \
+DB3		"Berkeley DB3 (required if SASL also built with DB3)" OFF \
+TLS		"Secure Sockets Layer and Transport Layer Security" OFF \
+MySQL		"MySQL map lookups" OFF \
+OpenLDAP	"OpenLDAP map lookups" OFF \
+Test		"SMTP/LMTP test server and generator" OFF \
+2> $tempfile
+
+	retval=$?
+
+	if [ -s $tempfile ]; then
+		set `cat $tempfile`
+	fi
+	rm -f $tempfile
+
+	case $retval in
+		0)	if [ -z "$*" ]; then
+				echo "Nothing selected"
+			fi
+			;;
+		1)	echo "Cancel pressed."
+			exit 1
+			;;
+	esac
+fi
+
+${MKDIR} ${WRKDIRPREFIX}${CURDIR}
+exec > ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
+
+echo "PREFIX=	${PREFIX}"
+
+SUB_PCRE="@comment "
+SUB_SASL="@comment "
+SUB_TLS="@comment "
+SUB_LDAP="@comment "
+SUB_TEST="@comment "
+
+while [ "$1" ]; do
+	case $1 in
+		\"PCRE\")
+			echo "CONF1+=		pcre_table"
+			echo "CONF2+=		sample-pcre.cf"
+			echo "MAN5+=		pcre_table.5"
+			echo "BUILD_DEPENDS+=	\${LOCALBASE}/lib/libpcre.a:\${PORTSDIR}/devel/pcre"
+			echo "POSTFIX_CCARGS+=	-DHAS_PCRE -I\${LOCALBASE}/include"
+			echo "POSTFIX_AUXLIBS+=	\${LOCALBASE}/lib/libpcre.a"
+			SUB_PCRE=""
+			;;
+		\"SASL\")
+			echo "CONF2+=		sample-auth.cf"
+			echo "BUILD_DEPENDS+=	\${LOCALBASE}/lib/libsasl.a:\${PORTSDIR}/security/cyrus-sasl"
+			echo "POSTFIX_CCARGS+=	-DUSE_SASL_AUTH -I\${LOCALBASE}/include"
+			echo "POSTFIX_AUXLIBS+=	\${LOCALBASE}/lib/libsasl.a -lpam -lcrypt"
+			echo ".if exists(/usr/lib/libkrb.a)"
+			echo "POSTFIX_AUXLIBS+=	-lkrb -ldes -lcom_err"
+			echo ".endif"
+			SUB_SASL=""
+			;;
+		\"TLS\")
+			echo "CONF2+=		sample-tls.cf"
+			echo "BIN1+=		tlsmgr"
+			echo "POSTFIX_CCARGS+=	-DHAS_SSL -I/usr/include/openssl"
+			echo "POSTFIX_AUXLIBS+=	-lssl -lcrypto"
+			echo "DISTFILES+=	\${DISTNAME}.tar.gz pfixtls-0.6.30-snap20001217-0.9.6.tar.gz"
+			echo "EXTRA_PATCHES+=	\${WRKDIR}/pfixtls-0.6.30-snap20001217-0.9.6/pfixtls.diff"
+			echo "PATCH_STRIP=	-p1"
+			SUB_TLS=""
+			;;
+		\"DB3\")
+			echo "LIB_DEPENDS+=	db3.1:\${PORTSDIR}/databases/db3"
+			echo "POSTFIX_CCARGS+=	-I\${LOCALBASE}/include/db3"
+			echo "POSTFIX_AUXLIBS+=	-L\${LOCALBASE}/lib -ldb3"
+			;;
+		\"MySQL\")
+			echo "BUILD_DEPENDS+=	\${LOCALBASE}/lib/mysql/libmysqlclient.a:\${PORTSDIR}/databases/mysql322-client"
+			echo "POSTFIX_CCARGS+=	-DHAS_MYSQL -I\${LOCALBASE}/include/mysql"
+			echo "POSTFIX_AUXLIBS+=	\${LOCALBASE}/lib/mysql/libmysqlclient.a -lm"
+			;;
+		\"OpenLDAP\")
+			echo "CONF2+=		sample-ldap.cf"
+			echo "BUILD_DEPENDS+=	\${LOCALBASE}/lib/libldap.a:\${PORTSDIR}/net/openldap"
+			echo "POSTFIX_CCARGS+=	-DHAS_LDAP -I\${LOCALBASE}/include"
+			echo "POSTFIX_AUXLIBS+=	\${LOCALBASE}/lib/libldap.a \${PREFIX}/lib/liblber.a"
+			SUB_LDAP=""
+			;;
+		\"Test\")
+			echo "BIN3=		smtp-sink smtp-source"
+			SUB_TEST=""
+			;;
+		*)
+			echo "Invalid option(s): $*" > /dev/stderr
+			rm -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc
+			exit 1
+			;;
+	esac
+	shift
+done
+
+echo "PLIST_SUB=	SUB_PCRE=\"${SUB_PCRE}\" SUB_SASL=\"${SUB_SASL}\" SUB_TLS=\"${SUB_TLS}\" SUB_LDAP=\"${SUB_LDAP}\" SUB_TEST=\"${SUB_TEST}\""

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


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010118140714.094F77441C>