aboutsummaryrefslogtreecommitdiff
path: root/mail/qpopper
diff options
context:
space:
mode:
authorMario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>2001-10-05 03:48:34 +0000
committerMario Sergio Fujikawa Ferreira <lioux@FreeBSD.org>2001-10-05 03:48:34 +0000
commitd494132719f649d699b65dc7952e09a46691ad43 (patch)
tree1b3cebc6999d6de397f5727fd2460431b1b387d6 /mail/qpopper
parent89d58bf2f4d8764aa8e4e41e312c7a65fe63be5e (diff)
downloadports-d494132719f649d699b65dc7952e09a46691ad43.tar.gz
ports-d494132719f649d699b65dc7952e09a46691ad43.zip
Notes
Diffstat (limited to 'mail/qpopper')
-rw-r--r--mail/qpopper/Makefile42
-rw-r--r--mail/qpopper/pkg-install53
-rw-r--r--mail/qpopper/pkg-plist6
3 files changed, 95 insertions, 6 deletions
diff --git a/mail/qpopper/Makefile b/mail/qpopper/Makefile
index bb6c2b243c45..b9bd9c8a699e 100644
--- a/mail/qpopper/Makefile
+++ b/mail/qpopper/Makefile
@@ -29,15 +29,29 @@ GNU_CONFIGURE= yes
CONFIGURE_ENV= LIBS="-lmd -lutil" \
OS_DEFS="-DSETPROCTITLE ${OS_DEFS}"
CONFIGURE_ARGS= --enable-apop=${PREFIX}/etc/qpopper/pop.auth \
- --enable-nonauth-file=/etc/ftpusers \
+ --enable-nonauth-file=${POPUSERS_FILE} \
--with-apopuid=pop --without-gdbm \
--enable-keep-temp-drop
-PLIST_SUB= EPOPPASSD=${EPOPPASSD}
+PLIST_SUB= EPOPPASSD=${EPOPPASSD} \
+ POP_USER=${POP_USER} \
+ POP_GROUP=${POP_GROUP} \
+ POP_MODE_DIR=${POP_MODE_DIR} \
+ POP_MODE_CONF=${POP_MODE_CONF}
MAN8= qpopauth.8 qpopper.8
-pre-fetch:
+# internal configuration
+POP_USER= pop
+POP_GROUP= daemon
+POP_MODE_DIR= 0711
+POP_MODE_CONF= 0444
+POPUSERS_FILE= ${PREFIX}/etc/qpopper/popusers
+SAMPLE_EXT= .sample
+#
+PKGDEINSTALL= ${PKGINSTALL}
+
+pre-everything::
.if defined(APOP_ONLY)
@${ECHO_MSG} "==> The APOP_ONLY option is deprecated, please use"
@${ECHO_MSG} " WITH_APOP_ONLY instead."
@@ -56,6 +70,8 @@ pre-fetch:
@${ECHO_MSG} "WITH_APOP_ONLY=yes builds with APOP authentication only"
@${ECHO_MSG} "WITH_FULL_POPD_DEBUG=yes buils with more verbose debugging"
@${ECHO_MSG} "WITH_POPPASSD=yes builds the poppassd daemon"
+ @${ECHO_MSG} "WITH_SAMPLE_POPUSERS_FILE=yes builds a default (otherwise,"
+ @${ECHO_MSG} " use an empty file) reject file"
# If WITH_APOP_ONLY variable present in the environment, qpopper builds
# with APOP authentication only.
@@ -111,8 +127,26 @@ do-install:
.if defined(WITH_POPPASSD)
${INSTALL_PROGRAM} ${WRKSRC}/password/poppassd ${PREFIX}/libexec/qpoppassd
.endif
+ @${INSTALL} -d -o ${POP_USER} -g ${POP_GROUP} -m ${POP_MODE_DIR} \
+ ${PREFIX}/etc/${PORTNAME}
-post-install:
+post-install: install-conf-file
@${SED} -e "s:/usr/local:${PREFIX}:g" ${PKGMESSAGE}
+# based on original from op port, written by Cyrille Lefevre
+# <clefevre@citeweb.net>
+install-conf-file:
+ @if [ ! -f ${CONF_DIR}/${CONF_FILE}${SAMP_SUFX} ]; then \
+ if [ -f /etc/ftpusers ] && [ -n "${WITH_SAMPLE_POPUSERS_FILE}" ]; then \
+ ${INSTALL} -c -o ${POP_USER} -g ${POP_GROUP} -m ${POP_MODE_CONF} \
+ /etc/ftpusers ${POPUSERS_FILE}${SAMPLE_EXT} ; \
+ else \
+ ${CP} /dev/null ${POPUSERS_FILE}${SAMPLE_EXT} ; \
+ ${CHOWN} ${POP_USER}:${POP_GROUP} ${POPUSERS_FILE}${SAMPLE_EXT} ; \
+ ${CHMOD} ${POP_MODE_CONF} ${POPUSERS_FILE}${SAMPLE_EXT} ; \
+ fi ; \
+ fi
+ @${SETENV} PKG_PREFIX=${PREFIX} ${SH} \
+ ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+
.include <bsd.port.post.mk>
diff --git a/mail/qpopper/pkg-install b/mail/qpopper/pkg-install
new file mode 100644
index 000000000000..838c114b4337
--- /dev/null
+++ b/mail/qpopper/pkg-install
@@ -0,0 +1,53 @@
+#!/bin/sh
+# $FreeBSD$
+
+# based on original from op port, written by Cyrille Lefevre
+# <clefevre@citeweb.net>
+
+[ $# != 2 ] && exit 1
+PKGNAME=$1
+ACTION=$2
+
+CONF_DIR=${PKG_PREFIX}/etc/qpopper
+
+CONF_FILE=popusers
+CONF_OWN=pop
+CONF_GRP=daemon
+CONF_MODE=444
+
+SAMP_SUFX=.sample
+
+INSTALL=install
+CMP=cmp
+RM=rm
+
+case "$ACTION" in
+
+POST-INSTALL)
+ if [ -f ${CONF_DIR}/${CONF_FILE} ]; then
+ echo "$PKGNAME: Will not overwrite existing ${CONF_DIR}/${CONF_FILE} file."
+ else
+ ${INSTALL} -c -o ${CONF_OWN} -g ${CONF_GRP} -m ${CONF_MODE} \
+ ${CONF_DIR}/${CONF_FILE}${SAMP_SUFX} \
+ ${CONF_DIR}/${CONF_FILE}
+ fi
+ ;;
+
+DEINSTALL)
+ if ${CMP} -s ${CONF_DIR}/${CONF_FILE}${SAMP_SUFX} \
+ ${CONF_DIR}/${CONF_FILE}; then
+ ${RM} -f ${CONF_DIR}/${CONF_FILE}
+ else
+ echo "$PKGNAME: Will not remove existing ${CONF_DIR}/${CONF_FILE} file."
+ fi
+ ;;
+
+PRE-INSTALL|POST-DEINSTALL)
+ ;;
+
+*)
+ exit 1
+ ;;
+esac
+
+exit
diff --git a/mail/qpopper/pkg-plist b/mail/qpopper/pkg-plist
index 40479a1b1a74..166f96cd60df 100644
--- a/mail/qpopper/pkg-plist
+++ b/mail/qpopper/pkg-plist
@@ -3,5 +3,7 @@ bin/qpopauth
@exec ln -sf %D/bin/qpopauth %D/bin/qapopauth
libexec/qpopper
%%EPOPPASSD%%libexec/qpoppassd
-@dirrm etc/qpopper
-@exec mkdir -p %D/etc/qpopper && chown pop:daemon %D/etc/qpopper && chmod 700 %D/etc/qpopper
+@exec mkdir -p %D/etc/qpopper && chown %%POP_USER%%:%%POP_GROUP%% %D/etc/qpopper && chmod %%POP_MODE_DIR%% %D/etc/qpopper
+@mode %%POP_MODE_CONF%%
+etc/qpopper/popusers.sample
+@unexec rmdir %D/etc/qpopper 2>/dev/null || echo "If you are permanently removing this port, you should do a ``rm -rf ${PKG_PREFIX}/etc/qpopper`` to remove any configuration files and logs left." | fmt