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 | |
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')
-rw-r--r-- | www/tomcat55/Makefile | 35 | ||||
-rw-r--r-- | www/tomcat55/distinfo | 9 | ||||
-rw-r--r-- | www/tomcat55/files/patch-conf::server.xml | 18 | ||||
-rw-r--r-- | www/tomcat55/files/pkg-deinstall.in | 11 | ||||
-rw-r--r-- | www/tomcat55/files/pkg-install.in | 68 | ||||
-rw-r--r-- | www/tomcat55/files/tomcat55.sh.in | 22 | ||||
-rw-r--r-- | www/tomcat55/pkg-plist | 10 |
7 files changed, 123 insertions, 50 deletions
diff --git a/www/tomcat55/Makefile b/www/tomcat55/Makefile index 4fc727676863..44215e7e3532 100644 --- a/www/tomcat55/Makefile +++ b/www/tomcat55/Makefile @@ -6,7 +6,7 @@ # PORTNAME= tomcat -PORTVERSION= 5.5.30 +PORTVERSION= 5.5.31 CATEGORIES= www java MASTER_SITES= ${MASTER_SITE_APACHE} MASTER_SITE_SUBDIR= tomcat/tomcat-5/v${PORTVERSION}/bin @@ -32,6 +32,7 @@ TOMCAT_USER?= www TOMCAT_GROUP?= www TOMCAT_UID?= 80 HTTP_PORT?= 8180 +HTTP_TIMEOUT?= 20000 SHUTDOWN_PORT?= 8005 AJP_1_3_PORT?= 8009 STDOUT_LOG= ${LOG_DIR}/stdout.log @@ -53,8 +54,12 @@ SUB_LIST= AJP_1_3_PORT=${AJP_1_3_PORT} \ APP_TITLE="${APP_TITLE}" \ GROUP=${TOMCAT_GROUP} \ HTTP_PORT=${HTTP_PORT} \ + HTTP_TIMEOUT=${HTTP_TIMEOUT} \ JAR_FILE=${JAR_FILE} \ + JAVA_HOME=${JAVA_HOME} \ + LOG_DIR=${LOG_DIR} \ PID_FILE=${PID_FILE} \ + PORTNAME=${PORTNAME} \ SHUTDOWN_PORT=${SHUTDOWN_PORT} \ STDERR_LOG=${STDERR_LOG} \ STDOUT_LOG=${STDOUT_LOG} \ @@ -86,7 +91,7 @@ pre-patch: post-patch: @${ECHO_MSG} -n ">> Removing unneeded files..." - @${RM} -f `${FIND} ${WRKSRC} -name '*.bat'` `${FIND} ${WRKSRC} -name '*.orig'` `${FIND} ${WRKSRC} -name '*.exe'` `${FIND} ${WRKSRC} -name '*.dll'` + @${FIND} ${WRKSRC} -type f \( -name '*.bak' -or -name '*.bat' -or -name '*.dll' -or -name '*.exe' -or -name '*.orig' \) -delete @${RMDIR} ${WRKSRC}/bin/[i,x]64 @${ECHO_MSG} " [ DONE ]" @@ -96,9 +101,6 @@ post-patch: @${ECHO_MSG} " [ DONE ]" .endfor -pre-install: - @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL - do-install: @${ECHO_MSG} -n ">> Creating destination directory..." @${MKDIR} ${APP_HOME} @@ -118,28 +120,9 @@ do-install: fi; \ done @${CP} -R ${WRKSRC}/* ${APP_HOME} - @${ECHO_MSG} " [ DONE ]" - - @${ECHO_MSG} -n ">> Creating log files..." - @${INSTALL} -m 664 -o ${TOMCAT_USER} -g ${TOMCAT_GROUP} /dev/null ${STDOUT_LOG} - @${INSTALL} -m 664 -o ${TOMCAT_USER} -g ${TOMCAT_GROUP} /dev/null ${STDERR_LOG} - @${ECHO_MSG} " [ DONE ]" - - @${ECHO_MSG} -n ">> Creating symlink to tools.jar..." - @${LN} -sf ${JAVA_HOME}/lib/tools.jar ${APP_HOME}/common/lib/tools.jar - @${ECHO_MSG} " [ DONE ]" - - @${ECHO_MSG} -n ">> Fixing ownership settings..." - @${CHOWN} -R ${TOMCAT_USER}:${TOMCAT_GROUP} ${APP_HOME}/conf ${APP_HOME}/logs \ - ${APP_HOME}/temp ${APP_HOME}/work ${APP_HOME}/webapps - @${ECHO_MSG} " [ DONE ]" - - @${ECHO_MSG} -n ">> Fixing permissions..." - @${FIND} ${APP_HOME} -type d | while read a; do\ - ${CHMOD} 755 "$$a"; \ - done - @${ECHO_MSG} " [ DONE ]" +# create missing directories and fix permissions post-install: + @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL @${ECHO_MSG} "${APP_TITLE} ${PORTVERSION} has been installed in ${APP_HOME}." .include <bsd.port.post.mk> diff --git a/www/tomcat55/distinfo b/www/tomcat55/distinfo index 504e3c3eb670..10f75ff5a366 100644 --- a/www/tomcat55/distinfo +++ b/www/tomcat55/distinfo @@ -1,3 +1,6 @@ -MD5 (apache-tomcat-5.5.30.tar.gz) = 661dd3fbc25249e9ceb86652eb6a4f07 -SHA256 (apache-tomcat-5.5.30.tar.gz) = ba6a25b642a5d034869a1f8a456cbebb8eb556fc788fe266286d78b344350f84 -SIZE (apache-tomcat-5.5.30.tar.gz) = 8274143 +MD5 (apache-tomcat-5.5.31.tar.gz) = 9ab07386e23f4c3dfc3b0a5e29b5f854 +SHA256 (apache-tomcat-5.5.31.tar.gz) = 9f02f47d2cf351bcff4c0d013a253c965ad0cc0fc0305d086f2f653022ccfa82 +SIZE (apache-tomcat-5.5.31.tar.gz) = 8277017 +MD5 (apache-tomcat-5.5.31-compat.tar.gz) = 31958bdab2926e41b6f7f93a8e2304b2 +SHA256 (apache-tomcat-5.5.31-compat.tar.gz) = 3b86e7a232bae1d94642b3119e0e713c2f27509b0e2c5f598666f77b6b1691b8 +SIZE (apache-tomcat-5.5.31-compat.tar.gz) = 1651313 diff --git a/www/tomcat55/files/patch-conf::server.xml b/www/tomcat55/files/patch-conf::server.xml index 1e1f67aed8f6..93c4a1f82e0e 100644 --- a/www/tomcat55/files/patch-conf::server.xml +++ b/www/tomcat55/files/patch-conf::server.xml @@ -1,8 +1,6 @@ -$FreeBSD$ - ---- conf/server.xml.orig Sun Jun 5 21:37:27 2005 -+++ conf/server.xml Sun Jun 5 21:40:08 2005 -@@ -10,7 +10,7 @@ +--- ./conf/server.xml.orig 2010-09-04 21:54:16.000000000 +0200 ++++ ./conf/server.xml 2010-10-01 23:00:25.000000000 +0200 +@@ -27,7 +27,7 @@ define subcomponents such as "Valves" or "Loggers" at this level. --> @@ -11,7 +9,7 @@ $FreeBSD$ <!-- Comment these entries out to disable JMX MBeans support used for the administration web application --> -@@ -72,8 +72,8 @@ +@@ -90,11 +90,11 @@ IP address of the remote client. --> @@ -21,8 +19,12 @@ $FreeBSD$ + <Connector port="%%HTTP_PORT%%" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" - connectionTimeout="20000" disableUploadTimeout="true" /> -@@ -97,8 +97,8 @@ +- connectionTimeout="20000" disableUploadTimeout="true" /> ++ connectionTimeout="%%HTTP_TIMEOUT%%" disableUploadTimeout="true" /> + <!-- Note : To disable connection timeouts, set connectionTimeout value + to 0 --> + +@@ -115,8 +115,8 @@ clientAuth="false" sslProtocol="TLS" /> --> diff --git a/www/tomcat55/files/pkg-deinstall.in b/www/tomcat55/files/pkg-deinstall.in index 655ee46519d3..fd79fa1965bd 100644 --- a/www/tomcat55/files/pkg-deinstall.in +++ b/www/tomcat55/files/pkg-deinstall.in @@ -11,7 +11,10 @@ # $FreeBSD$ # +PATH=/usr/bin:/bin:/usr/sbin:/usr/local/bin + USER=%%USER%% +GROUP=%%GROUP%% PID_FILE=%%PID_FILE%% # Make sure we're in the right stage of the process @@ -21,7 +24,7 @@ if [ "$2" = "DEINSTALL" ]; then if [ -s ${PID_FILE} ]; then PID=`cat ${PID_FILE}` echo -n ">> Killing Tomcat process (${PID})..." - /bin/kill ${PID} > /dev/null 2> /dev/null + kill ${PID} > /dev/null 2> /dev/null if [ $? -eq 0 ]; then echo " [ DONE ]" else @@ -38,10 +41,14 @@ if [ "$2" = "DEINSTALL" ]; then fi if [ "$2" = "POST-DEINSTALL" ]; then - # If the user exists, then display a message + # If the user/group 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 + + if pw groupshow "${GROUP}" 2>&1 >/dev/null; then + echo "To delete the ${GROUP} group permanently, use 'pw groupdel ${GROUP}'" + fi fi exit 0 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 diff --git a/www/tomcat55/files/tomcat55.sh.in b/www/tomcat55/files/tomcat55.sh.in index fc634f090997..1937a5115063 100644 --- a/www/tomcat55/files/tomcat55.sh.in +++ b/www/tomcat55/files/tomcat55.sh.in @@ -123,6 +123,7 @@ flags="-p ${pidfile} ${java_command} start ${tomcat%%TOMCAT_VERSION%%_flags} ${l start_precmd=pid_touch stop_cmd="tomcat%%TOMCAT_VERSION%%_stop" +status_cmd="tomcat%%TOMCAT_VERSION%%_status" pid_touch () { @@ -133,9 +134,9 @@ pid_touch () tomcat%%TOMCAT_VERSION%%_stop() { rc_pid=$(check_pidfile $pidfile $procname) - if [ -z "$rc_pid" ]; then - [ -n "$rc_fast" ] && return 0 - if [ -n "$pidfile" ]; then + if [ -z `cat $pidfile` ]; then + [ -n `cat $pidfile` ] && return 0 + if [ -n `cat $pidfile` ]; then echo "${name} not running? (check $pidfile)." else echo "${name} not running?" @@ -145,11 +146,24 @@ tomcat%%TOMCAT_VERSION%%_stop() { echo "Stopping ${name}." ${java_command} stop - tomcat_wait_max_for_pid ${tomcat%%TOMCAT_VERSION%%_stop_timeout} ${rc_pid} + tomcat_wait_max_for_pid ${tomcat%%TOMCAT_VERSION%%_stop_timeout} `cat $pidfile` kill -KILL ${rc_pid} 2> /dev/null && echo "Killed." echo -n > ${pidfile} } +tomcat%%TOMCAT_VERSION%%_status() { + if [ ! -f $pidfile ]; then + pid_touch + fi + + if [ -z `cat $pidfile` ]; then + echo "${name} is not running." + return 1 + else + echo "${name} is running as pid `cat $pidfile`." + fi +} + tomcat_wait_max_for_pid() { _timeout=$1 shift diff --git a/www/tomcat55/pkg-plist b/www/tomcat55/pkg-plist index 03de3fe434c1..bb5ffa54af49 100644 --- a/www/tomcat55/pkg-plist +++ b/www/tomcat55/pkg-plist @@ -46,15 +46,25 @@ %%T%%/common/lib/servlet-api.jar %%T%%/common/lib/tools.jar %%T%%/conf/Catalina/localhost/host-manager.xml.%%CONF_EXT%% +@exec if [ ! -f %D/%%T%%/conf/Catalina/localhost/host-manager.xml ]; then cp %D/%%T%%/conf/Catalina/localhost/host-manager.xml.%%CONF_EXT%% %D/%%T%%/conf/Catalina/localhost/host-manager.xml; fi %%T%%/conf/Catalina/localhost/manager.xml.%%CONF_EXT%% +@exec if [ ! -f %D/%%T%%/conf/Catalina/localhost/manager.xml ]; then cp %D/%%T%%/conf/Catalina/localhost/manager.xml.%%CONF_EXT%% %D/%%T%%/conf/Catalina/localhost/manager.xml; fi %%T%%/conf/catalina.policy.%%CONF_EXT%% +@exec if [ ! -f %D/%%T%%/conf/catalina.policy ]; then cp %D/%%T%%/conf/catalina.policy.%%CONF_EXT%% %D/%%T%%/conf/catalina.policy;fi %%T%%/conf/catalina.properties.%%CONF_EXT%% +@exec if [ ! -f %D/%%T%%/conf/catalina.properties ]; then cp %D/%%T%%/conf/catalina.properties.%%CONF_EXT%% %D/%%T%%/conf/catalina.properties;fi %%T%%/conf/context.xml.%%CONF_EXT%% +@exec if [ ! -f %D/%%T%%/conf/context.xml ]; then cp %D/%%T%%/conf/context.xml.%%CONF_EXT%% %D/%%T%%/conf/context.xml;fi %%T%%/conf/logging.properties.%%CONF_EXT%% +@exec if [ ! -f %D/%%T%%/conf/logging.properties ]; then cp %D/%%T%%/conf/logging.properties.%%CONF_EXT%% %D/%%T%%/conf/logging.properties;fi %%T%%/conf/server-minimal.xml.%%CONF_EXT%% +@exec if [ ! -f %D/%%T%%/conf/server-minimal.xml ]; then cp %D/%%T%%/conf/server-minimal.xml.%%CONF_EXT%% %D/%%T%%/conf/server-minimal.xml;fi %%T%%/conf/server.xml.%%CONF_EXT%% +@exec [ -f %D/%%T%%/conf/server.xml ] || cp %D/%%T%%/conf/server.xml.%%CONF_EXT%% %D/%%T%%/conf/server.xml %%T%%/conf/tomcat-users.xml.%%CONF_EXT%% +@exec if [ ! -f %D/%%T%%/conf/tomcat-users.xml ];then cp %D/%%T%%/conf/tomcat-users.xml.%%CONF_EXT%% %D/%%T%%/conf/tomcat-users.xml;fi %%T%%/conf/web.xml.%%CONF_EXT%% +@exec if [ ! -f %D/%%T%%/conf/web.xml ];then cp %D/%%T%%/conf/web.xml.%%CONF_EXT%% %D/%%T%%/conf/web.xml;fi %%T%%/logs/stderr.log %%T%%/logs/stdout.log %%T%%/server/lib/catalina-ant-jmx.jar |