diff options
author | Herve Quiroz <hq@FreeBSD.org> | 2004-12-27 22:37:15 +0000 |
---|---|---|
committer | Herve Quiroz <hq@FreeBSD.org> | 2004-12-27 22:37:15 +0000 |
commit | e417860b34e1ff8b359a877633dbe279f0ab2c79 (patch) | |
tree | de1502f047ee532a1aecc661c44bbe6ed336d316 /www/jakarta-tomcat3 | |
parent | Remove useless "do-patch: NADA" -- the lack of patch-* files is sufficient. (diff) |
- Backup configuration files during deinstall
- Fix plist problem when NOPORTDOCS is defined
- Fix pkg_add permission problem [1]
- use ECHO_MSG rather than ECHO_CMD
- Bump PORTREVISION
PR: 75487, 57235 [1]
Submitted by: maintainer
Diffstat (limited to 'www/jakarta-tomcat3')
-rw-r--r-- | www/jakarta-tomcat3/Makefile | 97 | ||||
-rw-r--r-- | www/jakarta-tomcat3/pkg-plist | 72 |
2 files changed, 102 insertions, 67 deletions
diff --git a/www/jakarta-tomcat3/Makefile b/www/jakarta-tomcat3/Makefile index a3ab59549641..4b9d279dcef6 100644 --- a/www/jakarta-tomcat3/Makefile +++ b/www/jakarta-tomcat3/Makefile @@ -7,6 +7,7 @@ PORTNAME= jakarta-tomcat PORTVERSION= 3.3.2 +PORTREVISION= 1 CATEGORIES= www java MASTER_SITES= ${MASTER_SITE_APACHE_JAKARTA} MASTER_SITE_SUBDIR= tomcat-3/v${PORTVERSION}/bin @@ -14,7 +15,9 @@ MASTER_SITE_SUBDIR= tomcat-3/v${PORTVERSION}/bin MAINTAINER= liukang@bjut.edu.cn COMMENT= Open-source Java web server by Apache, stable 3.x branch -MAN1= ${CONTROL_SCRIPT_NAME}.1 +.if !defined(NOPORTDOCS) +MAN1= ${CONTROL_SCRIPT_NAME}.1 +.endif USE_JAVA= YES JAVA_VERSION= 1.2+ @@ -25,7 +28,7 @@ MAJOR_VER= ${PORTVERSION:R:R} WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION} APP_HOME?= ${PREFIX}/${PKGBASE}${PORTVERSION:R} LOG_DIR= ${APP_HOME}/logs -PLIST_SUB+= T=${APP_HOME:S/^${PREFIX}\///} +PLIST_SUB+= T=${APP_HOME:S/^${PREFIX}\///} WWWOWN=${USER} WWWGRP=${GROUP} APP_TITLE= Jakarta Tomcat APP_SHORTNAME= tomcat${MAJOR_VER} CONTROL_SCRIPT_NAME= ${APP_SHORTNAME}ctl @@ -49,31 +52,32 @@ REPLACE_FILES= ${PORTSDIR}/www/jakarta-tomcat4/files/daemonctl.c \ ${WRKSRC}/conf/server.xml JAR_FILE= lib/tomcat.jar WRKDIR?= ${WRKDIRPREFIX}${.CURDIR}/work - +CONF_EXT= sample +PLIST_SUB+= CONF_EXT=${CONF_EXT} .include <bsd.port.pre.mk> pre-patch: - @${ECHO_CMD} "Installation settings:" - @${ECHO_CMD} " Destination directory: ${APP_HOME}" - @${ECHO_CMD} " Control program location: ${CONTROL_SCRIPT}" - @${ECHO_CMD} " Startup script location: ${STARTUP_SCRIPT}" - @${ECHO_CMD} " Location of JDK: ${JAVA_HOME}" - @${ECHO_CMD} " Location of Java port: ${JAVA_PORT}" - @${ECHO_CMD} " Running as (user/group): ${USER}/${GROUP}" - @${ECHO_CMD} " HTTP port: ${HTTP_PORT}" - @${ECHO_CMD} " Logfile stdout: ${STDOUT_LOG}" - @${ECHO_CMD} " Logfile stderr: ${STDERR_LOG}" - @${ECHO_CMD} " Starting after install: ${AUTO_START}" - @${ECHO_CMD} " Stop time-out: ${STOP_TIMEOUT} sec." + @${ECHO_MSG} "Installation settings:" + @${ECHO_MSG} " Destination directory: ${APP_HOME}" + @${ECHO_MSG} " Control program location: ${CONTROL_SCRIPT}" + @${ECHO_MSG} " Startup script location: ${STARTUP_SCRIPT}" + @${ECHO_MSG} " Location of JDK: ${JAVA_HOME}" + @${ECHO_MSG} " Location of Java port: ${JAVA_PORT}" + @${ECHO_MSG} " Running as (user/group): ${USER}/${GROUP}" + @${ECHO_MSG} " HTTP port: ${HTTP_PORT}" + @${ECHO_MSG} " Logfile stdout: ${STDOUT_LOG}" + @${ECHO_MSG} " Logfile stderr: ${STDERR_LOG}" + @${ECHO_MSG} " Starting after install: ${AUTO_START}" + @${ECHO_MSG} " Stop time-out: ${STOP_TIMEOUT} sec." @PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL post-patch: - @${ECHO_CMD} -n ">> Removing unneeded files..." + @${ECHO_MSG} -n ">> Removing unneeded files..." @${RM} -f `${FIND} ${WRKSRC} -name '*.bat'` `${FIND} ${WRKSRC} -name '*.orig'` `${FIND} ${WRKSRC} -name '*.exe'` - @${ECHO_CMD} " [ DONE ]" + @${ECHO_MSG} " [ DONE ]" .for f in ${REPLACE_FILES} - @${ECHO_CMD} -n ">> Customizing `basename $f`..." + @${ECHO_MSG} -n ">> Customizing `basename $f`..." @${SED} \ -e "/%%APP_HOME%%/s//${APP_HOME:S/\//\\\//g}/g" \ -e "/%%APP_SHORTNAME%%/s//${APP_SHORTNAME}/g" \ @@ -98,21 +102,30 @@ post-patch: -e "/%%STOP_TIMEOUT%%/s//${STOP_TIMEOUT}/g" \ -e "/%%USER%%/s//${USER}/g" \ $f > ${WRKDIR}/`basename $f` - @${ECHO_CMD} " [ DONE ]" + @${ECHO_MSG} " [ DONE ]" .endfor do-install: - @${ECHO_CMD} -n ">> Creating destination directory..." + @${ECHO_MSG} -n ">> Creating destination directory..." @${MKDIR} ${APP_HOME} @${MKDIR} ${LOG_DIR} - @${ECHO_CMD} " [ DONE ]" - - @${ECHO_CMD} -n ">> Copying files to destination directory..." + @${ECHO_MSG} " [ DONE ]" + + @${ECHO_MSG} ">> Copying files to destination directory..." + @(cd ${WRKSRC};${FIND} conf -type f | ${SED} -e '/${CONF_EXT}/d') \ + | while read a; do \ + ${MV} ${WRKSRC}/$$a ${WRKSRC}/$$a.${CONF_EXT}; \ + if [ ! -e "${APP_HOME}/$$a" ]; then \ + ${ECHO_MSG} " Installing local configuration file: $$a"; \ + ${CP} ${WRKSRC}/$$a.${CONF_EXT} ${WRKSRC}/$$a; \ + else \ + ${ECHO_MSG} " Preserving local configuration file: $$a"; \ + fi; \ + done @${CP} -R ${WRKSRC}/* ${APP_HOME} - @${CP} ${WRKDIR}/server.xml ${APP_HOME}/conf/ - @${ECHO_CMD} " [ DONE ]" + @${ECHO_MSG} " [ DONE ]" - @${ECHO_CMD} -n ">> Compiling and installing control program..." + @${ECHO_MSG} -n ">> Compiling and installing control program..." @${SED} \ -e "/%%JAVA_ARGS%%/s//\"-Dtomcat.install=${APP_HOME:S/\//\\\//g}\",/g" \ -e "/%%JAR_ARGS%%/s//\"run\",/g" \ @@ -121,43 +134,43 @@ do-install: @${CP} ${WRKDIR}/${CONTROL_SCRIPT_NAME} ${CONTROL_SCRIPT} @${CHOWN} ${USER}:${GROUP} ${CONTROL_SCRIPT} @${CHMOD} 6754 ${CONTROL_SCRIPT} - @${ECHO_CMD} " [ DONE ]" + @${ECHO_MSG} " [ DONE ]" - @${ECHO_CMD} -n ">> Installing startup script..." + @${ECHO_MSG} -n ">> Installing startup script..." @${CP} ${WRKDIR}/startup.sh ${STARTUP_SCRIPT} @${CHMOD} 0544 ${STARTUP_SCRIPT} - @${ECHO_CMD} " [ DONE ]" + @${ECHO_MSG} " [ DONE ]" .if !defined(NOPORTDOCS) - @${ECHO_CMD} -n ">> Installing man pages..." + @${ECHO_MSG} -n ">> Installing man pages..." @${INSTALL_MAN} ${WRKDIR}/daemonctl.1 ${MANPREFIX}/man/man1/${CONTROL_SCRIPT_NAME}.1 - @${ECHO_CMD} " [ DONE ]" + @${ECHO_MSG} " [ DONE ]" .endif - @${ECHO_CMD} -n ">> Creating log files..." + @${ECHO_MSG} -n ">> Creating log files..." @${INSTALL} /dev/null ${STDOUT_LOG} @${INSTALL} /dev/null ${STDERR_LOG} - @${ECHO_CMD} " [ DONE ]" + @${ECHO_MSG} " [ DONE ]" - @${ECHO_CMD} -n ">> Fixing ownership settings..." + @${ECHO_MSG} -n ">> Fixing ownership settings..." @${CHOWN} -R ${USER}:${GROUP} ${APP_HOME} - @${ECHO_CMD} " [ DONE ]" + @${ECHO_MSG} " [ DONE ]" - @${ECHO_CMD} -n ">> Fixing permissions..." + @${ECHO_MSG} -n ">> Fixing permissions..." @${CHMOD} 755 `${FIND} ${APP_HOME} -type d` - @${ECHO_CMD} " [ DONE ]" + @${ECHO_MSG} " [ DONE ]" - @${ECHO_CMD} -n ">> Creating PID file..." + @${ECHO_MSG} -n ">> Creating PID file..." @${TOUCH} ${PID_FILE} @${CHOWN} ${USER}:${GROUP} ${PID_FILE} @${CHMOD} 0600 ${PID_FILE} - @${ECHO_CMD} " [ DONE ]" + @${ECHO_MSG} " [ DONE ]" post-install: - @${ECHO_CMD} "${APP_TITLE} ${PORTVERSION} has been installed in ${APP_HOME}." - @${ECHO_CMD} "If a user should be able to use ${CONTROL_SCRIPT_NAME}, then put this user in the group ${GROUP}." + @${ECHO_MSG} "${APP_TITLE} ${PORTVERSION} has been installed in ${APP_HOME}." + @${ECHO_MSG} "If a user should be able to use ${CONTROL_SCRIPT_NAME}, then put this user in the group ${GROUP}." .if !defined(NOPORTDOCS) - @${ECHO_CMD} "Use 'man ${CONTROL_SCRIPT_NAME}' for information about starting and stopping ${APP_TITLE}." + @${ECHO_MSG} "Use 'man ${CONTROL_SCRIPT_NAME}' for information about starting and stopping ${APP_TITLE}." .endif .if ${AUTO_START} == "YES" @${CONTROL_SCRIPT} start || true diff --git a/www/jakarta-tomcat3/pkg-plist b/www/jakarta-tomcat3/pkg-plist index 9ccf7e715f97..139e4fd7199c 100644 --- a/www/jakarta-tomcat3/pkg-plist +++ b/www/jakarta-tomcat3/pkg-plist @@ -1,4 +1,23 @@ @comment $FreeBSD$ +@unexec if cmp -s %D/%%T%%/conf/jk/mod_jk.conf %D/%%T%%/conf/jk/mod_jk.conf.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/jk/mod_jk.conf; fi +@unexec if cmp -s %D/%%T%%/conf/jk/mod_jk.conf-jni %D/%%T%%/conf/jk/mod_jk.conf-jni.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/jk/mod_jk.conf-jni; fi +@unexec if cmp -s %D/%%T%%/conf/jk/obj.conf %D/%%T%%/conf/jk/obj.conf.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/jk/obj.conf; fi +@unexec if cmp -s %D/%%T%%/conf/jk/uriworkermap.properties %D/%%T%%/conf/jk/uriworkermap.properties.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/jk/uriworkermap.properties; else fi +@unexec if cmp -s %D/%%T%%/conf/jk/workers.properties %D/%%T%%/conf/jk/workers.properties.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/jk/workers.properties; fi +@unexec if cmp -s %D/%%T%%/conf/jk/wrapper.properties %D/%%T%%/conf/jk/wrapper.properties.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/jk/wrapper.properties; fi +@unexec if cmp -s %D/%%T%%/conf/jserv/tomcat.conf %D/%%T%%/conf/jserv/tomcat.conf.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/jserv/tomcat.conf; fi +@unexec if cmp -s %D/%%T%%/conf/jserv/tomcat.properties %D/%%T%%/conf/jserv/tomcat.properties.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/jserv/tomcat.properties; fi +@unexec if cmp -s %D/%%T%%/conf/jk2.properties %D/%%T%%/conf/jk2.properties.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/jk2.properties; fi +@unexec if cmp -s %D/%%T%%/conf/apps-127.0.0.1.xml %D/%%T%%/conf/apps-127.0.0.1.xml.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/apps-127.0.0.1.xml; fi +@unexec if cmp -s %D/%%T%%/conf/apps-admin.xml %D/%%T%%/conf/apps-admin.xml.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/apps-admin.xml; fi +@unexec if cmp -s %D/%%T%%/conf/apps-examples.xml %D/%%T%%/conf/apps-examples.xml.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/apps-examples.xml; fi +@unexec if cmp -s %D/%%T%%/conf/tomcat.policy %D/%%T%%/conf/tomcat.policy.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/tomcat.policy; fi +@unexec if cmp -s %D/%%T%%/conf/modules.xml %D/%%T%%/conf/modules.xml.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/modules.xml; fi +@unexec if cmp -s %D/%%T%%/conf/server.xml %D/%%T%%/conf/server.xml.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/server.xml; fi +@unexec if cmp -s %D/%%T%%/conf/users/admin-users.xml %D/%%T%%/conf/users/admin-users.xml.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/users/admin-users.xml; fi +@unexec if cmp -s %D/%%T%%/conf/users/example-users.xml %D/%%T%%/conf/users/example-users.xml.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/users/example-users.xml; fi +@unexec if cmp -s %D/%%T%%/conf/users/global-users.xml %D/%%T%%/conf/users/global-users.xml.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/users/global-users.xml; fi +@unexec if cmp -s %D/%%T%%/conf/users/tomcat-users.xml %D/%%T%%/conf/users/tomcat-users.xml.%%CONF_EXT%%; then rm -f %D/%%T%%/conf/users/tomcat-users.xml; fi bin/tomcat3ctl etc/rc.d/020.jakarta-tomcat3.sh %%T%%/logs/stdout.log @@ -98,25 +117,25 @@ etc/rc.d/020.jakarta-tomcat3.sh %%T%%/webapps/ROOT.war %%T%%/webapps/admin.war %%T%%/webapps/examples.war -%%T%%/conf/jk/mod_jk.conf -%%T%%/conf/jk/mod_jk.conf-jni -%%T%%/conf/jk/obj.conf -%%T%%/conf/jk/uriworkermap.properties -%%T%%/conf/jk/workers.properties -%%T%%/conf/jk/wrapper.properties -%%T%%/conf/jserv/tomcat.conf -%%T%%/conf/jserv/tomcat.properties -%%T%%/conf/users/admin-users.xml -%%T%%/conf/users/example-users.xml -%%T%%/conf/users/global-users.xml -%%T%%/conf/users/tomcat-users.xml -%%T%%/conf/jk2.properties -%%T%%/conf/modules.xml -%%T%%/conf/server.xml -%%T%%/conf/tomcat.policy -%%T%%/conf/apps-127.0.0.1.xml -%%T%%/conf/apps-admin.xml -%%T%%/conf/apps-examples.xml +%%T%%/conf/jk/mod_jk.conf.%%CONF_EXT%% +%%T%%/conf/jk/mod_jk.conf-jni.%%CONF_EXT%% +%%T%%/conf/jk/obj.conf.%%CONF_EXT%% +%%T%%/conf/jk/uriworkermap.properties.%%CONF_EXT%% +%%T%%/conf/jk/workers.properties.%%CONF_EXT%% +%%T%%/conf/jk/wrapper.properties.%%CONF_EXT%% +%%T%%/conf/jserv/tomcat.conf.%%CONF_EXT%% +%%T%%/conf/jserv/tomcat.properties.%%CONF_EXT%% +%%T%%/conf/users/admin-users.xml.%%CONF_EXT%% +%%T%%/conf/users/example-users.xml.%%CONF_EXT%% +%%T%%/conf/users/global-users.xml.%%CONF_EXT%% +%%T%%/conf/users/tomcat-users.xml.%%CONF_EXT%% +%%T%%/conf/jk2.properties.%%CONF_EXT%% +%%T%%/conf/modules.xml.%%CONF_EXT%% +%%T%%/conf/server.xml.%%CONF_EXT%% +%%T%%/conf/tomcat.policy.%%CONF_EXT%% +%%T%%/conf/apps-127.0.0.1.xml.%%CONF_EXT%% +%%T%%/conf/apps-admin.xml.%%CONF_EXT%% +%%T%%/conf/apps-examples.xml.%%CONF_EXT%% %%T%%/bin/jspc %%T%%/bin/shutdown %%T%%/bin/startup @@ -124,6 +143,14 @@ etc/rc.d/020.jakarta-tomcat3.sh %%T%%/ant/tomcat-ant.jar %%T%%/LICENSE %%T%%/KEYS +@exec mkdir -p %D/%%T%%/conf/auto || true +@exec mkdir -p %D/%%T%%/modules || true +@exec chown -R %%WWWOWN%%:%%WWWGRP%% %D/%%T%%/ +@unexec rmdir %D/%%T%%/conf/users 2>/dev/null || true +@unexec rmdir %D/%%T%%/conf/auto 2>/dev/null || true +@unexec rmdir %D/%%T%%/conf/jserv 2>/dev/null || true +@unexec rmdir %D/%%T%%/conf/jk 2>/dev/null || true +@unexec rmdir %D/%%T%%/conf 2>/dev/null || true @dirrm %%T%%/logs @dirrm %%T%%/doc/images @dirrm %%T%%/doc/appdev/sample/etc @@ -143,11 +170,6 @@ etc/rc.d/020.jakarta-tomcat3.sh @dirrm %%T%%/lib/endorsed @dirrm %%T%%/lib @dirrm %%T%%/webapps -@dirrm %%T%%/conf/jk -@dirrm %%T%%/conf/jserv -@dirrm %%T%%/conf/users -@dirrm %%T%%/conf/auto -@dirrm %%T%%/conf @dirrm %%T%%/bin @dirrm %%T%%/ant -@dirrm %%T%% +@unexec rmdir %D/%%T%% 2>/dev/null || true |