1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-22 04:17:44 +00:00

No need to create www user any more -- www has been in base since 4.6.

Username is now no longer configurable however.
This commit is contained in:
Chris Rees 2011-08-12 10:16:09 +00:00
parent 5d74c0654a
commit 1ea1a86b11
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=279540
3 changed files with 4 additions and 64 deletions

View File

@ -20,7 +20,7 @@ JAVA_VERSION= 1.5+
NO_BUILD= YES
USE_RC_SUBR= geronimo2.sh
SUB_FILES= pkg-install pkg-deinstall
SUB_FILES= pkg-deinstall
OPTIONS= TOMCAT6 "Use Tomcat instead of default Jetty" off
@ -37,6 +37,9 @@ APP_HOME?= ${PREFIX}/${PKGBASE}${MAJOR_VER}
LOG_DIR= ${APP_HOME}/var/log
APP_TITLE= Geronimo
APP_SHORTNAME= geronimo${MAJOR_VER}
.if defined(GERONIMO_USER)
IGNORE= no longer allows customisation of GERONIMO_USER or GERONIMO_GROUP
.endif
GERONIMO_USER?= www
GERONIMO_GROUP?=www
GERONIMO_OUT= ${LOG_DIR}/geronimo.out
@ -73,9 +76,6 @@ post-patch:
@${RM} -f `${FIND} ${WRKSRC} -name '*.bat'` `${FIND} ${WRKSRC} -name '*.orig'` `${FIND} ${WRKSRC} -name '*.exe'`
@${ECHO_MSG} " [ DONE ]"
pre-install:
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
do-install:
${MKDIR} ${APP_HOME} && ${CHOWN} ${GERONIMO_USER}:${GERONIMO_GROUP} ${APP_HOME}
@(cd ${WRKSRC} && ${FIND} . |\

View File

@ -37,11 +37,4 @@ if [ "$2" = "DEINSTALL" ]; then
fi
fi
if [ "$2" = "POST-DEINSTALL" ]; then
# If the user exists, then display a message
if pw usershow "${USER}" 2>/dev/null 1>&2; then
echo "To delete the ${USER} user permanently, use 'pw userdel ${USER}'"
fi
fi
exit 0

View File

@ -1,53 +0,0 @@
#!/bin/sh
#
# Checks if the '%%USER%%' user and '%%GROUP%%' group exist. If they don't, then
# an attempt is made to create both.
#
# $FreeBSD$
#
# Make sure we're called during the 'make install' process
if [ "$2" != "PRE-INSTALL" ]; then
exit 0
fi
# Set some constants
UID=80
GID=${UID}
USER=%%USER%%
GROUP=%%GROUP%%
# See if the group already exists
if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
# If not, try to create it
if pw groupadd "${GROUP}" -g ${GID}; then
echo "Added group \"${GROUP}\"."
elif pw groupadd "${GROUP}"; then
echo "Added group \"${GROUP}\"."
else
echo "Adding group \"${GROUP}\" failed..."
exit 1
fi
fi
# See if the user already exists
if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
# If not, try to create it
if pw useradd "${USER}" -u ${UID} -g "${GROUP}" -h - \
-s "/sbin/nologin" -d "/nonexistent" \
-c "World Wide Web Owner";
then
echo "Added user \"${USER}\"."
elif pw useradd "${USER}" -g "${GROUP}" -h - \
-s "/sbin/nologin" -d "/nonexistent" \
-c "World Wide Web Owner";
then
echo "Added user \"${USER}\"."
else
echo "Adding user \"${USER}\" failed..."
exit 1
fi
fi
exit 0