- Use USERS and GROUPS

- Stop automatically deleting user on deinstall; may be used by other ports

PR:		ports/157520
Submitted by:	Chris Rees (utisoft@gmail.com) (me)
Approved by:	tabthorpe (co-mentor)
This commit is contained in:
Chris Rees 2011-06-25 19:55:42 +00:00
parent 45ab52dc76
commit 886d2d357a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=276379
3 changed files with 2 additions and 34 deletions

View File

@ -18,6 +18,8 @@ COMMENT= Murmur is the server component of Mumble
BUILD_DEPENDS= ${LOCALBASE}/include/boost/function.hpp:${PORTSDIR}/devel/boost-libs
LIB_DEPENDS= protobuf.7:${PORTSDIR}/devel/protobuf
USERS= ${PORTNAME}
GROUPS= ${USERS}
USE_QT_VER= 4
QT_COMPONENTS= qmake_build moc_build corelib network xml sql sql-sqlite3_run

View File

@ -2,20 +2,10 @@
# $FreeBSD$
PATH=/bin:/usr/sbin
USER=murmur
GROUP=murmur
RUNDIR=/var/run/murmur
case $2 in
POST-DEINSTALL)
if pw group show ${GROUP} 2>&1 > /dev/null; then
echo "You should manually remove the \"${GROUP}\" group."
fi
if pw user show ${USER} 2>&1 > /dev/null; then
echo "You should manually remove the \"${USER}\" user."
fi
rm -Rf ${RUNDIR}
;;
esac

View File

@ -2,36 +2,12 @@
# $FreeBSD$
PATH=/bin:/usr/sbin
USER=murmur
GROUP=murmur
HOME=/nonexistent
LOGDIR=/var/log/murmur
RUNDIR=/var/run/murmur
DBDIR=/var/db/murmur
case $2 in
PRE-INSTALL)
if pw group show ${GROUP} 2> /dev/null; then
else
if pw groupadd ${GROUP}; then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
fi
if pw user show ${USER} 2> /dev/null; then
else
if pw useradd ${USER} -g ${GROUP} -h - \
-d ${HOME} -c "Murmur"
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
mkdir -m 750 ${LOGDIR} ${DBDIR} ${RUNDIR} 2> /dev/null
chown -R ${USER}:${GROUP} ${LOGDIR} ${DBDIR} ${RUNDIR}