pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mail/mailfront Wrap long command line. Replace LOCALBA...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/2313cf528f89
branches:  trunk
changeset: 361879:2313cf528f89
user:      schmonz <schmonz%pkgsrc.org@localhost>
date:      Thu Apr 27 20:18:44 2017 +0000

description:
Wrap long command line. Replace LOCALBASE with PREFIX. Honor custom
values of ${QMAIL_DAEMON_USER} and ${QMAIL_LOG_USER}. Allow
smtpfront_smtpdcmd to be overridden in rc.conf.

diffstat:

 mail/mailfront/Makefile           |   6 +++++-
 mail/mailfront/files/smtpfront.sh |  24 +++++++++++++++++-------
 2 files changed, 22 insertions(+), 8 deletions(-)

diffs (89 lines):

diff -r e90b4f623b46 -r 2313cf528f89 mail/mailfront/Makefile
--- a/mail/mailfront/Makefile   Thu Apr 27 20:08:07 2017 +0000
+++ b/mail/mailfront/Makefile   Thu Apr 27 20:18:44 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.14 2017/02/21 16:04:04 joerg Exp $
+# $NetBSD: Makefile,v 1.15 2017/04/27 20:18:44 schmonz Exp $
 #
 
 DISTNAME=              mailfront-2.12
@@ -21,10 +21,14 @@
 DJB_CONFIG_CMDS+=      ${ECHO} ${PREFIX}/include > conf-include;       \
                        ${ECHO} ${PREFIX}/lib/${PKGBASE} > conf-modules;
 
+FILES_SUBST+=          QMAIL_DAEMON_USER=${QMAIL_DAEMON_USER:Q}
+FILES_SUBST+=          QMAIL_LOG_USER=${QMAIL_LOG_USER:Q}
 RCD_SCRIPTS=           smtpfront
 INSTALLATION_DIRS=     share/doc/mailfront
 INSTALL_ENV+=          install_prefix=${DESTDIR:Q}
 
+BUILD_DEFS+=           QMAIL_DAEMON_USER QMAIL_LOG_USER
+
 USE_LIBTOOL=           yes
 
 MAKE_JOBS_SAFE=                no # due to hacky libtoolization
diff -r e90b4f623b46 -r 2313cf528f89 mail/mailfront/files/smtpfront.sh
--- a/mail/mailfront/files/smtpfront.sh Thu Apr 27 20:08:07 2017 +0000
+++ b/mail/mailfront/files/smtpfront.sh Thu Apr 27 20:18:44 2017 +0000
@@ -1,6 +1,6 @@
 #!@RCD_SCRIPTS_SHELL@
 #
-# $NetBSD: smtpfront.sh,v 1.1.1.1 2005/07/20 03:30:19 schmonz Exp $
+# $NetBSD: smtpfront.sh,v 1.2 2017/04/27 20:18:44 schmonz Exp $
 #
 
 # PROVIDE: smtpfront
@@ -16,10 +16,11 @@
 : ${smtpfront_datalimit:="2000000"}
 : ${smtpfront_pretcpserver:=""}
 : ${smtpfront_presmtpd:=""}
+: ${smtpfront_smtpdcmd:="@PREFIX@/bin/smtpfront-qmail"}
 : ${smtpfront_postsmtpd:=""}
 : ${smtpfront_log:="YES"}
 : ${smtpfront_logcmd:="logger -t nb${name} -p mail.info"}
-: ${smtpfront_nologcmd:="@LOCALBASE@/bin/multilog -*"}
+: ${smtpfront_nologcmd:="@PREFIX@/bin/multilog -*"}
 
 if [ -f /etc/rc.subr ]; then
        . /etc/rc.subr
@@ -29,7 +30,7 @@
 required_files="@PKG_SYSCONFDIR@/control/concurrencyincoming"
 required_files="${required_files} @PKG_SYSCONFDIR@/tcp.smtp.cdb"
 required_files="${required_files} @PKG_SYSCONFDIR@/control/rcpthosts"
-command="@LOCALBASE@/bin/tcpserver"
+command="@PREFIX@/bin/tcpserver"
 procname=${name}
 start_precmd="smtpfront_precmd"
 extra_commands="cdb"
@@ -40,10 +41,19 @@
        # tcpserver(1) is akin to inetd(8), but runs one service per process.
        # We want to signal only the tcpserver process responsible for SMTP
        # service. Use argv0(1) to set procname to "smtpfront".
-       if [ -f /etc/rc.subr ]; then
-               checkyesno smtpfront_log || smtpfront_logcmd=${smtpfront_nologcmd}
+       if [ -f /etc/rc.subr ] && ! checkyesno smtpfront_log; then
+               smtpfront_logcmd=${smtpfront_nologcmd}
        fi
-       command="@SETENV@ - ${smtpfront_postenv} @LOCALBASE@/bin/softlimit -m ${smtpfront_datalimit} ${smtpfront_pretcpserver} @LOCALBASE@/bin/argv0 @LOCALBASE@/bin/tcpserver ${name} 
${smtpfront_tcpflags} -x @PKG_SYSCONFDIR@/tcp.smtp.cdb -c `@HEAD@ -1 @PKG_SYSCONFDIR@/control/concurrencyincoming` -u `@ID@ -u qmaild ` -g `@ID@ -g qmaild` ${smtpfront_tcphost} ${smtpfront_tcpport} 
${smtpfront_presmtpd} @LOCALBASE@/bin/smtpfront-qmail ${smtpfront_postsmtpd} 2>&1 | @LOCALBASE@/bin/setuidgid qmaill ${smtpfront_logcmd}"
+       command="@SETENV@ - ${smtpfront_postenv}
+@PREFIX@/bin/softlimit -m ${smtpfront_datalimit} ${smtpfront_pretcpserver}
+@PREFIX@/bin/argv0 @PREFIX@/bin/tcpserver ${name}
+${smtpfront_tcpflags} -x @PKG_SYSCONFDIR@/tcp.smtp.cdb
+-c `@HEAD@ -1 @PKG_SYSCONFDIR@/control/concurrencyincoming`
+-u `@ID@ -u @QMAIL_DAEMON_USER@ ` -g `@ID@ -g @QMAIL_DAEMON_USER@`
+${smtpfront_tcphost} ${smtpfront_tcpport}
+${smtpfront_presmtpd} ${smtpfront_smtpdcmd} ${smtpfront_postsmtpd}
+2>&1 |
+@PREFIX@/bin/setuidgid @QMAIL_LOG_USER@ ${smtpfront_logcmd}"
        command_args="&"
        rc_flags=""
 }
@@ -51,7 +61,7 @@
 smtpfront_cdb()
 {
        @ECHO@ "Reloading @PKG_SYSCONFDIR@/tcp.smtp."
-       @LOCALBASE@/bin/tcprules @PKG_SYSCONFDIR@/tcp.smtp.cdb @PKG_SYSCONFDIR@/tcp.smtp.tmp < @PKG_SYSCONFDIR@/tcp.smtp
+       @PREFIX@/bin/tcprules @PKG_SYSCONFDIR@/tcp.smtp.cdb @PKG_SYSCONFDIR@/tcp.smtp.tmp < @PKG_SYSCONFDIR@/tcp.smtp
        @CHMOD@ 644 @PKG_SYSCONFDIR@/tcp.smtp.cdb
 }
 



Home | Main Index | Thread Index | Old Index