- Fixed spool file ownerships when installing from a package

- Various pkg-plist cleanups to ensure that chmod/chown commands are
  executed in the proper order during package installation
- Added LICENSE
- Fixed REQUIRES: in rc.d script
- Bumped PORTREVISION

PR:		ports/154437 (based on)
Submitted by:	Uffe Jakobsen <uffe@uffe.org>
This commit is contained in:
Greg Larkin 2011-04-27 13:29:21 +00:00
parent 6b594ee023
commit 9bc1f69868
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=273258
4 changed files with 30 additions and 23 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= nullmailer
PORTVERSION= 1.05
PORTREVISION= 1
PORTREVISION= 2
PORTEPOCH= 1
CATEGORIES= mail
MASTER_SITES= http://untroubled.org/nullmailer/ \
@ -25,6 +25,10 @@ GID_FILES+= ../../GIDs
.endif
USERS= nullmail
GROUPS= nullmail
NULLMAIL_UID= 522
NULLMAIL_GID= 522
LICENSE= GPLv2
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --localstatedir=${LOCALSTATEDIR}
@ -43,15 +47,22 @@ MAN1= nullmailer-inject.1 sendmail.1
MAN7= nullmailer.7
MAN8= nullmailer-queue.8 nullmailer-send.8
# Pass BATCH to pkg-install for Evil Things(tm)
# Pass LOCALSTATEDIR to pkg-install for creating home directory correctly
pre-install:
@BATCH="${BATCH}" LOCALSTATEDIR="${LOCALSTATEDIR}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
post-install:
@cd ${WRKSRC} && make install-root
@${INSTALL_DATA} -c ${FILESDIR}/remotes.sample ${PREFIX}/etc/nullmailer/
@BATCH="${BATCH}" NMH_PREFIX="${NMH_PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
# Append commands that reference the nullmailer user to the plist, because
# we need to ensure that the account has been created by bsd.port.mk by
# the time these are executed.
@${ECHO_CMD} '@exec ${PW} usermod ${USERS} -d ${LOCALSTATEDIR}/nullmailer' >> ${TMPPLIST}
@${ECHO_CMD} '@exec ${CHOWN} ${USERS}:${USERS} ${LOCALSTATEDIR}/nullmailer/queue' >> ${TMPPLIST}
@${ECHO_CMD} '@exec ${CHOWN} ${USERS}:${USERS} ${LOCALSTATEDIR}/nullmailer/tmp' >> ${TMPPLIST}
@${ECHO_CMD} '@exec ${CHOWN} ${USERS}:${USERS} ${LOCALSTATEDIR}/nullmailer/trigger' >> ${TMPPLIST}
@${ECHO_CMD} '@exec ${CHOWN} ${USERS} ${PREFIX}/sbin/nullmailer-queue' >> ${TMPPLIST}
@${ECHO_CMD} '@exec ${CHOWN} ${USERS} ${PREFIX}/libexec/nullmailer/mailq' >> ${TMPPLIST}
@${ECHO_CMD} '@exec ${CHOWN} -R ${USERS} ${LOCALSTATEDIR}/nullmailer' >> ${TMPPLIST}
@${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${CAT} ${PKGMESSAGE}
.include <bsd.port.mk>

View file

@ -1,3 +1,2 @@
MD5 (nullmailer-1.05.tar.gz) = 35124cc05f893efba1310e2ec7c876ff
SHA256 (nullmailer-1.05.tar.gz) = 90356ed2bd95eef09ed04713fdef1f81c1ab95e02eee333a96a8e3eb230cac2f
SIZE (nullmailer-1.05.tar.gz) = 176800

View file

@ -2,7 +2,7 @@
# $FreeBSD$
#
# PROVIDE: nullmailer
# REQUIRE: DAEMON
# REQUIRE: LOGIN
#
# Add the following line to /etc/rc.conf to enable nullmailer:
#

View file

@ -1,28 +1,25 @@
libexec/nullmailer/smtp
libexec/nullmailer/qmqp
libexec/nullmailer/mailq
@exec chmod u+s %D/libexec/nullmailer/mailq
libexec/nullmailer/sendmail
bin/nullmailer-inject
sbin/nullmailer-queue
@exec chmod u+s %D/sbin/nullmailer-queue
sbin/nullmailer-send
etc/nullmailer/me.sample
@ignore etc/nullmailer/me.sample
etc/nullmailer/remotes.sample
@dirrm libexec/nullmailer
@dirrmtry etc/nullmailer
@cwd /
@exec mkdir -p %%LOCALSTATEDIR%%/nullmailer/queue
@exec chmod 700 %%LOCALSTATEDIR%%/nullmailer/queue
@dirrmtry %%LOCALSTATEDIR%%/nullmailer/queue
@exec mkdir -p %%LOCALSTATEDIR%%/nullmailer/tmp
@exec chmod 700 %%LOCALSTATEDIR%%/nullmailer/tmp
@exec rm -f %%LOCALSTATEDIR%%/nullmailer/trigger
@dirrmtry %%LOCALSTATEDIR%%/nullmailer/tmp
@exec mkfifo %%LOCALSTATEDIR%%/nullmailer/trigger
@exec chmod 600 %%LOCALSTATEDIR%%/nullmailer/trigger
@exec chown -R nullmail %%LOCALSTATEDIR%%/nullmailer/*
@exec chown nullmail %D/sbin/nullmailer-queue
@exec chmod u+s %D/sbin/nullmailer-queue
@exec chown nullmail %D/libexec/nullmailer/mailq
@exec chmod u+s %D/libexec/nullmailer/mailq
@unexec if [ -d %%LOCALSTATEDIR%%/nullmailer/queue ]; then rmdir %%LOCALSTATEDIR%%/nullmailer/queue; fi;
@unexec if [ -d %%LOCALSTATEDIR%%/nullmailer/tmp ]; then rmdir %%LOCALSTATEDIR%%/nullmailer/tmp; fi;
@unexec if [ -p %%LOCALSTATEDIR%%/nullmailer/trigger ]; then rm -f %%LOCALSTATEDIR%%/nullmailer/trigger; fi;
@dirrm libexec/nullmailer
@unexec t=`/bin/ls %D/etc/nullmailer`; if [ -z "$t" ]; then echo "Configuration directory is empty, remove it."; rmdir %D/etc/nullmailer; fi;
@unexec if [ -d %%LOCALSTATEDIR%%/nullmailer ]; then rmdir %%LOCALSTATEDIR%%/nullmailer; fi
@unexec if [ -n "$BATCH" ]; then echo "Warning: In batch mode, I will do 'rmuser -y nullmail'"; rmuser -y nullmail; fi;
@unexec rm -f %%LOCALSTATEDIR%%/nullmailer/trigger
@ignore %%LOCALSTATEDIR%%/nullmailer/trigger
@dirrmtry %%LOCALSTATEDIR%%/nullmailer