summaryrefslogtreecommitdiff
path: root/mail/popper/pkg-install
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2001-10-19 11:26:37 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2001-10-19 11:26:37 +0000
commit8c027b5c1d97540169ab4558a32c8fb259d4bf6c (patch)
tree80e629b1342dd55402b86ed0f23a814a0f790e43 /mail/popper/pkg-install
parentNew port py-mpz. This builds the mpz module (an interface to GMP) from (diff)
Move user adding into pkg-install
Notes
Notes: svn path=/head/; revision=48938
Diffstat (limited to 'mail/popper/pkg-install')
-rw-r--r--mail/popper/pkg-install39
1 files changed, 39 insertions, 0 deletions
diff --git a/mail/popper/pkg-install b/mail/popper/pkg-install
new file mode 100644
index 000000000000..ef42d381b195
--- /dev/null
+++ b/mail/popper/pkg-install
@@ -0,0 +1,39 @@
+#!/bin/sh
+# $FreeBSD$
+#
+
+if [ "$2" != "PRE-INSTALL" ]; then
+ exit 0
+fi
+
+USER=pop
+UID=68
+GID=6
+GROUP=mail
+
+if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
+ if pw groupadd ${GROUP} -g ${GID}; then
+ echo "Added group \"${GROUP}\"."
+ else
+ echo "Adding group \"${GROUP}\" failed..."
+ exit 1
+ fi
+fi
+
+if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
+ if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
+ -s "/sbin/nologin" -d "/nonexistent" -c "Post Office Owner"
+ then
+ echo "Added user \"${USER}\"."
+ else
+ echo "Adding user \"${USER}\" failed..."
+ exit 1
+ fi
+fi
+
+usrdir=${PKG_PREFIX}/etc/popper
+if [ ! -d $usrdir ]; then
+ mkdir -p $usrdir
+fi
+chown ${USER}:daemon $usrdir
+chmod 700 $usrdir