From 1ea1a86b111a95ad8dd1bece5a70ce58b91eb9ac Mon Sep 17 00:00:00 2001 From: Chris Rees Date: Fri, 12 Aug 2011 10:16:09 +0000 Subject: [PATCH] No need to create www user any more -- www has been in base since 4.6. Username is now no longer configurable however. --- www/geronimo/Makefile | 8 ++--- www/geronimo/files/pkg-deinstall.in | 7 ---- www/geronimo/files/pkg-install.in | 53 ----------------------------- 3 files changed, 4 insertions(+), 64 deletions(-) delete mode 100644 www/geronimo/files/pkg-install.in diff --git a/www/geronimo/Makefile b/www/geronimo/Makefile index 7c15573ebb7c..028fa6b48d87 100644 --- a/www/geronimo/Makefile +++ b/www/geronimo/Makefile @@ -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} . |\ diff --git a/www/geronimo/files/pkg-deinstall.in b/www/geronimo/files/pkg-deinstall.in index 655ee46519d3..48766068aca2 100644 --- a/www/geronimo/files/pkg-deinstall.in +++ b/www/geronimo/files/pkg-deinstall.in @@ -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 diff --git a/www/geronimo/files/pkg-install.in b/www/geronimo/files/pkg-install.in deleted file mode 100644 index ddc5dfda878a..000000000000 --- a/www/geronimo/files/pkg-install.in +++ /dev/null @@ -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