diff options
author | ohauer <ohauer@FreeBSD.org> | 2010-10-08 05:17:37 +0800 |
---|---|---|
committer | ohauer <ohauer@FreeBSD.org> | 2010-10-08 05:17:37 +0800 |
commit | e147f357843b87bfdc8b64951799d2a9afc9ce91 (patch) | |
tree | 3c0f82ee4d985db6f8350f7707098ffe10ad1728 /www/tomcat55/files/pkg-install.in | |
parent | 43976bfd26bef9d30c9e8fd4ca925fcd00c199f2 (diff) | |
download | freebsd-ports-gnome-e147f357843b87bfdc8b64951799d2a9afc9ce91.tar.gz freebsd-ports-gnome-e147f357843b87bfdc8b64951799d2a9afc9ce91.tar.zst freebsd-ports-gnome-e147f357843b87bfdc8b64951799d2a9afc9ce91.zip |
- update tomcat to 5.5.31
- replace a silly find construct in Makefile
- rewrite pkg-install
- include PATCH from PR 151078
PR: 150576
Submitted by: Jason <jgh _at_ experts-exchange.com> (maintainer)
Approved by: glarkin (mentor)
Diffstat (limited to 'www/tomcat55/files/pkg-install.in')
-rw-r--r-- | www/tomcat55/files/pkg-install.in | 68 |
1 files changed, 61 insertions, 7 deletions
diff --git a/www/tomcat55/files/pkg-install.in b/www/tomcat55/files/pkg-install.in index 4e4134e1512c..fe300c3c8426 100644 --- a/www/tomcat55/files/pkg-install.in +++ b/www/tomcat55/files/pkg-install.in @@ -6,18 +6,20 @@ # $FreeBSD$ # -# Make sure we're called during the 'make install' process -if [ "$2" != "PRE-INSTALL" ]; then - exit 0 -fi +PATH=/usr/bin:/bin:/usr/sbin:/usr/local/bin # Set some constants UID=%%UID%% GID=${UID} USER=%%USER%% GROUP=%%GROUP%% +APP_HOME=%%APP_HOME%% +JAVA_HOME=%%JAVA_HOME%% +LOG_DIR=%%LOG_DIR%% +STDOUT_LOG=%%STDOUT_LOG%% +STDERR_LOG=%%STDERR_LOG%% -# See if the group already exists +uidgid() { if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then # If not, try to create it @@ -29,6 +31,8 @@ if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then echo "Adding group \"${GROUP}\" failed..." exit 1 fi +else + echo "You already have a group \"${GROUP}\", so I will use it." fi # See if the user already exists @@ -36,12 +40,12 @@ 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" \ + -s "/usr/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" \ + -s "/usr/sbin/nologin" -d "/nonexistent" \ -c "World Wide Web Owner"; then echo "Added user \"${USER}\"." @@ -49,5 +53,55 @@ if ! pw usershow "${USER}" 2>/dev/null 1>&2; then echo "Adding user \"${USER}\" failed..." exit 1 fi +else + echo "You already have a user \"${USER}\", so I will use it." fi +} + + +post() { + echo -n ">> Creating destination directory..." + mkdir -p ${APP_HOME} + mkdir -p ${LOG_DIR} + echo " [ DONE ]" + + echo ">> Copying files to destination directory..." + + echo " [ DONE ]" + + echo -n ">> Creating log files..." + install -m 664 -o ${USER} -g ${GROUP} /dev/null ${STDOUT_LOG} + install -m 664 -o ${USER} -g ${GROUP} /dev/null ${STDERR_LOG} + echo " [ DONE ]" + + echo -n ">> Creating symlink to tools.jar..." + ln -sf ${JAVA_HOME}/lib/tools.jar ${APP_HOME}/common/lib/tools.jar + echo " [ DONE ]" + + echo -n ">> Fixing ownership settings..." + chown -R ${USER}:${GROUP} ${APP_HOME}/conf ${APP_HOME}/logs \ + ${APP_HOME}/temp ${APP_HOME}/work ${APP_HOME}/webapps + chmod -R a+r ${APP_HOME}/common ${APP_HOME}/server ${APP_HOME}/bin + echo " [ DONE ]" + + echo -n ">> Fixing permissions..." + find ${APP_HOME} -type d -exec chmod 755 {} \; + echo " [ DONE ] " +} + + +# PACKAGE_BUILDING is only defined on the build cluster or tinderbox! +# No interactive parts, there is no one who can answer! +if [ "x${PACKAGE_BUILDING}" != "x" ]; then + uidgid + post + exit 0 +fi + +if [ "$2" = "POST-INSTALL" ]; then + uidgid + post + exit 0 +fi + exit 0 |