summaryrefslogtreecommitdiff
path: root/mail
diff options
context:
space:
mode:
authorwiz <wiz>2007-03-01 18:04:48 +0000
committerwiz <wiz>2007-03-01 18:04:48 +0000
commitb45341c480836b054045a29d80a066d90e764d0f (patch)
tree68a06335e51140954e9f23c28fbed2b130832630 /mail
parenta8943def144c2104cdabeafee38297252dd49984 (diff)
downloadpkgsrc-b45341c480836b054045a29d80a066d90e764d0f.tar.gz
Use variables instead of interactively asking the user to provide values.
Some pkglint cleanup while here.
Diffstat (limited to 'mail')
-rw-r--r--mail/mailagent/Makefile35
-rwxr-xr-xmail/mailagent/scripts/pre-configure37
2 files changed, 27 insertions, 45 deletions
diff --git a/mail/mailagent/Makefile b/mail/mailagent/Makefile
index d808f5cbe25..38dd5b83240 100644
--- a/mail/mailagent/Makefile
+++ b/mail/mailagent/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.15 2006/04/22 09:22:11 rillig Exp $
+# $NetBSD: Makefile,v 1.16 2007/03/01 18:04:48 wiz Exp $
DISTNAME= mailagent-3.0.73
CATEGORIES= mail
@@ -20,26 +20,45 @@ CONFIGURE_ARGS+= -Dutmp='/var/run/utmp'
CONFIGURE_ARGS+= -Dprefix=${PREFIX:Q}
CONFIGURE_ARGS+= -Dmansrc=${PREFIX:Q}/man/man1
CONFIGURE_ARGS+= -Dnotifypatches='false'
-MAKE_ENV+= PATH=`${DIRNAME} ${PERL5}`:${PATH}
+MAKE_ENV+= PATH=`${DIRNAME} ${PERL5}`:${PATH:Q}
INSTALL_TARGET= install install.man
+MAILAGENT_DOMAIN?= example.com
+MAILAGENT_EMAIL?= testuser@example.com
+MAILAGENT_FQDN?= test.example.com
+MAILAGENT_ORGANIZATION?= Example Company
+
+BUILD_DEFS+= MAILAGENT_DOMAIN MAILAGENT_EMAIL MAILAGENT_FQDN MAILAGENT_ORGANIZATION
+
+CF= ${WRKSRC}/config.sh
+
pre-extract:
- @if [ `${SH} -c umask` != 0022 ]; then \
+ if [ `${SH} -c umask` != 0022 ]; then \
${ECHO} "Please set umask to 022 before running make,"; \
${ECHO} "or mailagent will not build successfully."; \
${FALSE}; fi
- @if [ `${ID} -u` = 0 ]; then \
+ if [ `${ID} -u` = 0 ]; then \
${ECHO} "Do not build mailagent as root or it won't pass the sanity tests."; \
${FALSE}; fi
pre-configure:
- cd ${.CURDIR} && ${SETENV} ${SCRIPTS_ENV} ${SH} ${SCRIPTDIR}/pre-configure
+ ${ECHO} "#!/bin/sh" > ${CF}
+ ${ECHO} "cf_email='${MAILAGENT_EMAIL}'" >> ${CF}
+ ${ECHO} "d_flockonly='define'" >> ${CF}
+ if [ `${ECHO} ${MAILAGENT_DOMAIN} | tr A-Z a-z` = `${ECHO} ${MAILAGENT_FQDN} | tr A-Z a-z` ]; then \
+ ${ECHO} "d_hidnet='undef'" >> ${CF}; \
+ ${ECHO} "hiddennet=''" >> ${CF}; \
+ else \
+ ${ECHO} "d_hidnet='define'" >> ${CF}; \
+ ${ECHO} "hiddennet='${MAILAGENT_DOMAIN}'" >> ${CF}; \
+ fi
+ ${ECHO} "orgname='${MAILAGENT_ORGANIZATION}'" >> ${CF}
post-install:
- @${INSTALL_DATA_DIR} ${PREFIX}/share/examples/mailagent
- @${INSTALL_DATA_DIR} ${PREFIX}/share/examples/mailagent/misc
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/mailagent
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/mailagent/misc
${CP} -pR ${WRKSRC}/misc/* ${PREFIX}/share/examples/mailagent/misc
- @${LN} -fs ${PREFIX}/lib/mailagent/examples \
+ ${LN} -fs ${PREFIX}/lib/mailagent/examples \
${PREFIX}/share/examples/mailagent/agent
.include "../../mk/bsd.pkg.mk"
diff --git a/mail/mailagent/scripts/pre-configure b/mail/mailagent/scripts/pre-configure
deleted file mode 100755
index a08a67bcb6b..00000000000
--- a/mail/mailagent/scripts/pre-configure
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/bin/sh
-# Pre-configure script for mailagent.
-# This script asks for information specific to the machine and writes
-# given values to work/mailagent-3.0/config.sh to set the default
-# values for COnfigure script so that Configure doesn't request any
-# input.
-
-while [ X$addr = X ]; do
- read -p "Enter your complete E-mail address> " addr
-done
-
-while [ X$host = X ]; do
- read -p "Enter fully qualified name of this host (`hostname`)> " host
- if [ X$host = X ]; then
- host=`hostname`
- fi
-done
-
-maildomain=`echo $addr | awk -F@ '{printf("%s", $2)}'`
-if [ `echo $maildomain | tr A-Z a-z` = `echo $host | tr A-Z a-z` ]; then
- d_hidnet=undef
- hiddennet=''
-else
- d_hidnet=define
- hiddennet=$maildomain
-fi
-
-read -p "Enter the name of your organization> " orgname
-
-cat >${WRKSRC}/config.sh <<EOM
-#!/bin/sh
-cf_email='$addr'
-d_flockonly='define'
-d_hidnet='$d_hidnet'
-hiddennet='$hiddennet'
-orgname='$orgname'
-EOM