aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2001-10-19 19:26:37 +0800
committerache <ache@FreeBSD.org>2001-10-19 19:26:37 +0800
commit0125c72e23d6081accd3d9d684f4482d47486c95 (patch)
tree563773463ef4fe6dd56099724e58219b41063ddc
parentd796aedea138e3cc4d26c81bfb001ab6abea6271 (diff)
downloadfreebsd-ports-gnome-0125c72e23d6081accd3d9d684f4482d47486c95.tar.gz
freebsd-ports-gnome-0125c72e23d6081accd3d9d684f4482d47486c95.tar.zst
freebsd-ports-gnome-0125c72e23d6081accd3d9d684f4482d47486c95.zip
Move user adding into pkg-install
-rw-r--r--mail/popper/Makefile5
-rw-r--r--mail/popper/pkg-install (renamed from mail/popper/scripts/pre-install)15
-rw-r--r--mail/popper/pkg-req13
3 files changed, 15 insertions, 18 deletions
diff --git a/mail/popper/Makefile b/mail/popper/Makefile
index 5267652d90a3..d6eb3ea1776f 100644
--- a/mail/popper/Makefile
+++ b/mail/popper/Makefile
@@ -7,7 +7,7 @@
PORTNAME= qpopper
PORTVERSION= 2.53
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= mail
MASTER_SITES= ftp://ftp.qualcomm.com/eudora/servers/unix/popper/old/
DISTNAME= ${PORTNAME}${PORTVERSION}
@@ -54,6 +54,9 @@ post-patch:
$(RM) ${WRKSRC}/md5.h
$(CP) ${FILESDIR}/sendto.c ${WRKSRC}
+pre-install:
+ PKG_PREFIX=${PREFIX} ./pkg-install ${PKGNAME} PRE-INSTALL
+
do-install:
cd ${WRKSRC} && \
${INSTALL_PROGRAM} -o pop -m 4111 popauth ${PREFIX}/bin
diff --git a/mail/popper/scripts/pre-install b/mail/popper/pkg-install
index 77e73a2b55b4..ef42d381b195 100644
--- a/mail/popper/scripts/pre-install
+++ b/mail/popper/pkg-install
@@ -1,10 +1,17 @@
#!/bin/sh
+# $FreeBSD$
+#
+
+if [ "$2" != "PRE-INSTALL" ]; then
+ exit 0
+fi
+
USER=pop
UID=68
GID=6
GROUP=mail
-if ! pw group show "${GROUP}" 2>/dev/null 1>&2; then
+if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
if pw groupadd ${GROUP} -g ${GID}; then
echo "Added group \"${GROUP}\"."
else
@@ -13,7 +20,7 @@ if ! pw group show "${GROUP}" 2>/dev/null 1>&2; then
fi
fi
-if ! pw user show "${USER}" 2>/dev/null 1>&2; then
+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
@@ -24,9 +31,9 @@ if ! pw user show "${USER}" 2>/dev/null 1>&2; then
fi
fi
-usrdir=${PREFIX}/etc/popper
+usrdir=${PKG_PREFIX}/etc/popper
if [ ! -d $usrdir ]; then
mkdir -p $usrdir
fi
-chown pop:daemon $usrdir
+chown ${USER}:daemon $usrdir
chmod 700 $usrdir
diff --git a/mail/popper/pkg-req b/mail/popper/pkg-req
deleted file mode 100644
index 01bcc6374f10..000000000000
--- a/mail/popper/pkg-req
+++ /dev/null
@@ -1,13 +0,0 @@
-if [ "$2" != "INSTALL" ]; then
- exit 0
-fi
-if ! id -u pop > /dev/null 2>&1; then
- echo "You need an account \"pop\" to install this package."
- echo "Please add it by hand (try \"man vipw\") and try again."
- echo ""
- echo "An example passwd entry is:"
- echo "pop:*:68:6::0:0:Post Office Owner:/nonexistent:/nonexistent"
- echo ""
- exit 1
-fi
-exit 0