From 702b5f6eb0f26e60b2fa57cc335c9c048915e46e Mon Sep 17 00:00:00 2001 From: kuriyama Date: Wed, 24 Jan 2001 02:01:25 +0000 Subject: Use configure.postfix script to configure. Add an option for Berkeley DB3. Use tabs instead of spaces in mailer.conf. PR: ports/24429 Submitted by: yds@dppl.com Reviewed and modified by: maintainer --- mail/postfix-current/Makefile | 93 +++++--------------- mail/postfix-current/pkg-install | 5 ++ mail/postfix-current/pkg-plist | 16 ++-- mail/postfix-current/scripts/configure.postfix | 115 +++++++++++++++++++++++++ 4 files changed, 150 insertions(+), 79 deletions(-) create mode 100644 mail/postfix-current/scripts/configure.postfix (limited to 'mail/postfix-current') diff --git a/mail/postfix-current/Makefile b/mail/postfix-current/Makefile index ab0fbecf58f3..37ece93129a2 100644 --- a/mail/postfix-current/Makefile +++ b/mail/postfix-current/Makefile @@ -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 @@ BIN1= bounce cleanup error flush lmtp local master nqmgr pickup \ 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/mysql323-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.33-snap20001217-0.9.6.tar.gz -EXTRA_PATCHES+= ${WRKDIR}/pfixtls-0.6.33-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) @@ -158,13 +108,11 @@ do-install: ${PREFIX}/sbin .endfor -.if defined(WITH_TEST) .for file in ${BIN3} @${INSTALL_PROGRAM} \ ${WRKSRC}/src/smtpstone/${file} \ ${PREFIX}/sbin .endfor -.endif .for file in ${MAN1} @${INSTALL_MAN} \ @@ -184,11 +132,11 @@ do-install: ${PREFIX}/man/man8 .endfor -.if !defined(NOPORTDOCS) - @${INSTALL} -d -o ${DOCOWN} -g ${DOCGRP} -m 555 ${DOCDIR} - @cd ${WRKSRC}/html && ${INSTALL_DATA} *.html *.gif ${DOCDIR} && \ - ${ECHO_MSG} "Installed HTML documentation in ${DOCDIR}" -.endif +#.if !defined(NOPORTDOCS) +# @${INSTALL} -d -o ${DOCOWN} -g ${DOCGRP} -m 555 ${DOCDIR} +# @cd ${WRKSRC}/html && ${INSTALL_DATA} *.html *.gif ${DOCDIR} && \ +# ${ECHO_MSG} "Installed HTML documentation in ${DOCDIR}" +#.endif @${ECHO_MSG} '--------------------------------------------------' @${ECHO_MSG} '- To replace your existing sendmail with postfix -' @@ -198,6 +146,9 @@ do-install: post-install: @PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL +post-clean: + @${RM} -f ${WRKDIRPREFIX}${.CURDIR}/Makefile.inc + .include replace: @@ -209,9 +160,9 @@ replace: ${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 --git a/mail/postfix-current/pkg-install b/mail/postfix-current/pkg-install index 7f5976b37897..0d18b67ddee3 100644 --- a/mail/postfix-current/pkg-install +++ b/mail/postfix-current/pkg-install @@ -1,4 +1,9 @@ #!/bin/sh +# +# $FreeBSD$ +# + +PKG_PREFIX=${PKG_PREFIX:=/usr/local} user=postfix group=postfix diff --git a/mail/postfix-current/pkg-plist b/mail/postfix-current/pkg-plist index 0b9e9338980f..02b4507487ee 100644 --- a/mail/postfix-current/pkg-plist +++ b/mail/postfix-current/pkg-plist @@ -5,19 +5,19 @@ etc/postfix/postfix-script 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-resource.cf 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/showq 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/postmap 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 --git a/mail/postfix-current/scripts/configure.postfix b/mail/postfix-current/scripts/configure.postfix new file mode 100644 index 000000000000..849cb4c70dcf --- /dev/null +++ b/mail/postfix-current/scripts/configure.postfix @@ -0,0 +1,115 @@ +#!/bin/sh +# $FreeBSD$ + +if [ -f ${WRKDIRPREFIX}${CURDIR}/Makefile.inc ]; then + exit +fi + +tempfile=`mktemp -t checklist` + +if [ "${BATCH}" = "yes" ]; 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.33-snap20001217-0.9.6.tar.gz" + echo "EXTRA_PATCHES+= \${WRKDIR}/pfixtls-0.6.33-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/mysql323-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}\"" -- cgit