- Use USERS and GROUPS

PR:		ports/157547
Submitted by:	Chris Rees (utisoft@gmail.com)
Approved by:	tabthorpe (co-mentor)
This commit is contained in:
Chris Rees 2011-06-27 17:44:37 +00:00
parent 7d9f73b790
commit e57590ed66
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=276512
2 changed files with 2 additions and 35 deletions

View file

@ -29,6 +29,8 @@ COUCH_LOGDIR?= ${COUCH_VARDIR}/log/couchdb
COUCH_LIBDIR?= ${COUCH_VARDIR}/lib/couchdb
COUCH_USER?= couchdb
USERS= ${COUCH_USER}
GROUPS= ${USERS}
USE_RC_SUBR= couchdb
USE_GMAKE= yes
USE_AUTOTOOLS= libtool
@ -54,9 +56,6 @@ post-patch:
@${REINPLACE_CMD} -e 's/install-data-am$$//' ${WRKSRC}/Makefile.in
.endif
pre-install:
@${SH} ${PKGINSTALL} ${PORTNAME} PRE-INSTALL
post-install:
@${CAT} ${PKGMESSAGE}
${MKDIR} ${COUCH_DBDIR}

View file

@ -1,32 +0,0 @@
#!/bin/sh
PATH=/bin:/usr/sbin
USER=couchdb
GROUP=couchdb
UID=919
GID=919
case $2 in
PRE-INSTALL)
if pw user show "${USER}" 2>/dev/null; then
echo "You already have a user \"${USER}\", so I will use it."
else
if pw groupadd ${GROUP} -g ${GID}
then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
if pw useradd ${USER} -u ${UID} -g ${GROUP} -h - \
-s /usr/sbin/nologin -L daemon -d /var/empty -c "CouchDB Account"
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
;;
esac