- Cleanup example rc file

- Support SHUTDOWN
 - Check for needed files/dependencies in precmd
 - Respect LOCALBASE
 - Make rclint happy
- Rename symlink from qmail.sh to qmailsmtpd
- Rename installed example rc file from qmail-smtpd.rcNG to qmailsmtpd
This commit is contained in:
Bryan Drewery 2013-02-23 18:49:29 +00:00
parent 18e5af8e58
commit 678eff9c21
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=312845
8 changed files with 82 additions and 65 deletions

View File

@ -3,7 +3,7 @@
PORTNAME= qmail
PORTVERSION= ${QMAIL_VERSION}.${MYSQL_PATCH_VERSION}
PORTREVISION= 3
PORTREVISION= 4
CATEGORIES= mail
PKGNAMESUFFIX= -mysql

View File

@ -2,7 +2,7 @@
PORTNAME= qmail
PORTVERSION= ${QMAIL_VERSION}.${SPAMCONTROL_VERSION}
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= mail
MASTER_SITES+= http://www.fehcom.de/qmail/spamcontrol/:spamcontrol \
${MASTER_SITE_LOCAL:S/$/:spamcontrol/}

View File

@ -3,7 +3,7 @@
PORTNAME= qmail
PORTVERSION= ${QMAIL_VERSION}.${TLS_PATCH_DATE}
PORTREVISION= 5
PORTREVISION= 6
CATEGORIES= mail
PKGNAMESUFFIX= -tls

View File

@ -3,7 +3,7 @@
PORTNAME= qmail
PORTVERSION?= ${QMAIL_VERSION}
PORTREVISION?= 7
PORTREVISION?= 8
CATEGORIES= mail
MASTER_SITES+= ${MASTER_SITE_QMAIL}
DISTNAME= ${PORTNAME}-${QMAIL_VERSION}
@ -60,7 +60,7 @@ QMAILQUEUE_PATCH_DESC= Run a QMAILQUEUE program
QMQP_COMPRESS_DESC= QMQP on the fly compression
QMTPC_PATCH_DESC= Send email using qmtp protocol
QUOTATRASH_DESC= Include the Trash in the quota
RCDLINK_DESC= Create rc.d/qmail.sh symlink
RCDLINK_DESC= Create rc.d/qmail symlink
SENDERCHECK4_DESC= LOOSE checks exclusively for RELAY clients
SMTPAUTHUSER_DESC= Create env SMTPAUTHUSER containing authuser
SMTPEXECCHECK_DESC= Smtp DOS/Windows executable detection
@ -289,6 +289,10 @@ PKGMESSAGE?= ${WRKDIR}/pkg-message-${PKGMESSAGE_SUFFIX}
SUB_FILES+= pkg-message
.endif
.if !defined(SLAVE_LDAP)
SUB_FILES+= qmailsmtpd
.endif
WRKDIR_doc= ${WRKDIR}/doc
PORTDOCS= *
@ -813,7 +817,7 @@ do-install:
${INSTALL_SCRIPT} ${WRKDIR}/${i:T} ${PREFIX}/boot
.endfor
.if !defined(SLAVE_LDAP)
${INSTALL_SCRIPT} ${FILESDIR}/qmail-smtpd.rcNG ${PREFIX}/boot
${INSTALL_SCRIPT} ${WRKDIR}/qmailsmtpd ${PREFIX}/boot
.endif
.for i in 1 5 7 8
@${MKDIR} ${PREFIX}/man/man$i

View File

@ -12,10 +12,10 @@ if [ "$2" = "POST-INSTALL" ]; then
[ -e ${PREFIX}/control/me ] || (cd ${PREFIX}/configure && ./config)
%%RCDLINK%%ln -s ${PREFIX}/rc %%LOCALBASE%%/etc/rc.d/qmail.sh
%%RCDLINK%%ln -s ${PREFIX}/rc %%LOCALBASE%%/etc/rc.d/qmailsmtpd
%%RCDLINK%%echo ""
%%RCDLINK%%echo "A %%LOCALBASE%%/etc/rc.d/qmail.sh symlink was created. To enable qmail at boot"
%%RCDLINK%%echo "A %%LOCALBASE%%/etc/rc.d/qmailsmtpd symlink was created. To enable qmail at boot"
%%RCDLINK%%echo "time you need to copy a script to %%PREFIX%%/rc. There are some examples at"
%%RCDLINK%%echo "%%PREFIX%%/boot"
%%RCDLINK%%echo ""

View File

@ -1,55 +0,0 @@
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: qmailsmtpd
# REQUIRE: LOGIN cleanvar
#
# To use the checkpassword interface to qmail-smtpd, set
# qmailsmtpd_checkpassword to the full path to the checkpassword program (e.g.
# security/checkpassword or security checkpassword-pam).
#
# Note: tcpserver can be found in the sysutils/ucspi-tcp package.
#
# qmailsmtpd_checkpassword could be set to e.g. /usr/local/bin/checkpassword-pam
. /etc/rc.subr
name="qmailsmtpd"
rcvar=qmailsmtpd_enable
load_rc_config $name
: ${qmailsmtpd_tcpserver="/usr/local/bin/tcpserver"}
: ${qmailsmtpd_tcprules="/usr/local/bin/tcprules"}
: ${qmailsmtpd_enable="NO"}
: ${qmailsmtpd_cdb="/etc/tcp.smtp"}
: ${qmailsmtpd_flags="-R -H -u 82 -g 81"}
: ${qmailsmtpd_host="0"}
: ${qmailsmtpd_port="smtp"}
: ${qmailsmtpd_smtpd="/var/qmail/bin/qmail-smtpd"}
: ${qmailsmtpd_fqdn=`hostname`}
: ${qmailsmtpd_checksubprogram="/usr/bin/true"}
qmailsmtpd_start() {
$qmailsmtpd_tcprules $qmailsmtpd_cdb.cdb $qmailsmtpd_cdb.tmp < $qmailsmtpd_cdb \
|| return 1
if [ "x$qmailsmtpd_checkpassword" != "x" ]; then
qmailsmtpd_usercheck="$qmailsmtpd_fqdn $qmailsmtpd_checkpassword $qmailsmtpd_checksubprogram"
fi
echo "Starting qmail-smtpd."
$qmailsmtpd_tcpserver -x $qmailsmtpd_cdb.cdb $qmailsmtpd_flags $qmailsmtpd_host $qmailsmtpd_port \
$qmailsmtpd_smtpd $qmailsmtpd_usercheck &
echo $! > /var/run/qmailsmtpd.pid
}
qmailsmtpd_stop() {
echo "Stopping qmail-smtpd"
kill `cat /var/run/qmailsmtpd.pid`
}
start_cmd="qmailsmtpd_start"
stop_cmd="qmailsmtpd_stop"
run_rc_command "$1"

View File

@ -0,0 +1,68 @@
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: qmailsmtpd
# REQUIRE: LOGIN cleanvar
# KEYWORD: shutdown
#
# To use the checkpassword interface to qmail-smtpd, set
# qmailsmtpd_checkpassword to the full path to the checkpassword program (e.g.
# security/checkpassword or security checkpassword-pam).
#
# Note: tcpserver can be found in the sysutils/ucspi-tcp package.
#
# qmailsmtpd_checkpassword could be set to e.g. /usr/local/bin/checkpassword-pam
. /etc/rc.subr
name=qmailsmtpd
rcvar=qmailsmtpd_enable
load_rc_config $name
: ${qmailsmtpd_tcpserver:=%%LOCALBASE%%/bin/tcpserver}
: ${qmailsmtpd_tcprules:=%%LOCALBASE%%/bin/tcprules}
: ${qmailsmtpd_pidfile:=/var/run/qmailsmtpd.pid}
: ${qmailsmtpd_enable:=NO}
: ${qmailsmtpd_cdb:=/etc/tcp.smtp}
: ${qmailsmtpd_flags="-R -H -u 82 -g 81"}
: ${qmailsmtpd_host:=0}
: ${qmailsmtpd_port:=smtp}
: ${qmailsmtpd_smtpd:=%%PREFIX%%/bin/qmail-smtpd}
: ${qmailsmtpd_fqdn:=`hostname`}
: ${qmailsmtpd_checksubprogram:=/usr/bin/true}
start_cmd=qmailsmtpd_start
start_precmd=qmailsmtpd_precmd
pidfile=${qmailsmtpd_pidfile}
procname=${qmailsmtpd_tcprules}
qmailsmtpd_start()
{
if [ -n "$qmailsmtpd_checkpassword" ]; then
qmailsmtpd_usercheck="$qmailsmtpd_fqdn $qmailsmtpd_checkpassword $qmailsmtpd_checksubprogram"
fi
echo "Starting qmailsmtpd."
$qmailsmtpd_tcpserver -x $qmailsmtpd_cdb.cdb $qmailsmtpd_flags $qmailsmtpd_host $qmailsmtpd_port \
$qmailsmtpd_smtpd $qmailsmtpd_usercheck &
echo $! > $pidfile
}
qmailsmtpd_precmd()
{
if ! [ -e "${qmailsmtpd_tcpserver}" ]; then
echo "sysutils/ucspi-tcp is required" >&2
return 1
fi
if ! [ -e "${qmailsmtpd_cdb}" ]; then
echo "TCP rules file '${qmailsmtpd_cdb}' is missing." >&2
return 1
fi
$qmailsmtpd_tcprules $qmailsmtpd_cdb.cdb $qmailsmtpd_cdb.tmp < $qmailsmtpd_cdb \
|| return 1
}
run_rc_command "$1"

View File

@ -1,5 +1,5 @@
@comment $FreeBSD$
%%RCDLINK%%@unexec rm -f %%LOCALBASE%%/etc/rc.d/qmail.sh
%%RCDLINK%%@unexec rm -f %%LOCALBASE%%/etc/rc.d/qmailsmtpd
%%LDAP%%bin/auth_imap
%%LDAP%%bin/auth_pop
%%LDAP%%bin/auth_smtp
@ -78,7 +78,7 @@ bin/tcp-env
%%NOT_LDAP%%boot/maildir
%%NOT_LDAP%%boot/proc
%%NOT_LDAP%%boot/proc+df
%%NOT_LDAP%%boot/qmail-smtpd.rcNG
%%NOT_LDAP%%boot/qmailsmtpd
%%LDAP%%boot/qmail/log/run
%%LDAP%%boot/qmail/run
%%LDAP%%boot/qmail-smtpd/log/run