Move user adding into pkg-install

This commit is contained in:
Andrey A. Chernov 2001-10-19 11:26:37 +00:00
parent 1c6cc68498
commit 8c027b5c1d
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=48938
3 changed files with 15 additions and 18 deletions

View file

@ -7,7 +7,7 @@
PORTNAME= qpopper PORTNAME= qpopper
PORTVERSION= 2.53 PORTVERSION= 2.53
PORTREVISION= 3 PORTREVISION= 4
CATEGORIES= mail CATEGORIES= mail
MASTER_SITES= ftp://ftp.qualcomm.com/eudora/servers/unix/popper/old/ MASTER_SITES= ftp://ftp.qualcomm.com/eudora/servers/unix/popper/old/
DISTNAME= ${PORTNAME}${PORTVERSION} DISTNAME= ${PORTNAME}${PORTVERSION}
@ -54,6 +54,9 @@ post-patch:
$(RM) ${WRKSRC}/md5.h $(RM) ${WRKSRC}/md5.h
$(CP) ${FILESDIR}/sendto.c ${WRKSRC} $(CP) ${FILESDIR}/sendto.c ${WRKSRC}
pre-install:
PKG_PREFIX=${PREFIX} ./pkg-install ${PKGNAME} PRE-INSTALL
do-install: do-install:
cd ${WRKSRC} && \ cd ${WRKSRC} && \
${INSTALL_PROGRAM} -o pop -m 4111 popauth ${PREFIX}/bin ${INSTALL_PROGRAM} -o pop -m 4111 popauth ${PREFIX}/bin

View file

@ -1,10 +1,17 @@
#!/bin/sh #!/bin/sh
# $FreeBSD$
#
if [ "$2" != "PRE-INSTALL" ]; then
exit 0
fi
USER=pop USER=pop
UID=68 UID=68
GID=6 GID=6
GROUP=mail 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 if pw groupadd ${GROUP} -g ${GID}; then
echo "Added group \"${GROUP}\"." echo "Added group \"${GROUP}\"."
else else
@ -13,7 +20,7 @@ if ! pw group show "${GROUP}" 2>/dev/null 1>&2; then
fi fi
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 - \ if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
-s "/sbin/nologin" -d "/nonexistent" -c "Post Office Owner" -s "/sbin/nologin" -d "/nonexistent" -c "Post Office Owner"
then then
@ -24,9 +31,9 @@ if ! pw user show "${USER}" 2>/dev/null 1>&2; then
fi fi
fi fi
usrdir=${PREFIX}/etc/popper usrdir=${PKG_PREFIX}/etc/popper
if [ ! -d $usrdir ]; then if [ ! -d $usrdir ]; then
mkdir -p $usrdir mkdir -p $usrdir
fi fi
chown pop:daemon $usrdir chown ${USER}:daemon $usrdir
chmod 700 $usrdir chmod 700 $usrdir

View file

@ -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