Changeset View
Changeset View
Standalone View
Standalone View
head/www/tomcat6/Makefile
# Created by: Nemo Liu <nemoliu@FreeBSD.org> | # Created by: Nemo Liu <nemoliu@FreeBSD.org> | ||||
# $FreeBSD$ | # $FreeBSD$ | ||||
PORTNAME= tomcat | PORTNAME= tomcat | ||||
PORTVERSION= 6.0.53 | PORTVERSION= 6.0.53 | ||||
PORTREVISION= 1 | PORTREVISION= 2 | ||||
CATEGORIES= www java | CATEGORIES= www java | ||||
MASTER_SITES= APACHE/tomcat/tomcat-6/v${PORTVERSION}/bin | MASTER_SITES= APACHE/tomcat/tomcat-6/v${PORTVERSION}/bin | ||||
DISTNAME= apache-${PORTNAME}-${PORTVERSION} | DISTNAME= apache-${PORTNAME}-${PORTVERSION} | ||||
MAINTAINER= ale@FreeBSD.org | MAINTAINER= ale@FreeBSD.org | ||||
COMMENT= Open-source Java web server by Apache, 6.x branch | COMMENT= Open-source Java web server by Apache, 6.x branch | ||||
LICENSE= APACHE20 | LICENSE= APACHE20 | ||||
Show All 17 Lines | |||||
TOMCAT_USER?= www | TOMCAT_USER?= www | ||||
TOMCAT_GROUP?= www | TOMCAT_GROUP?= www | ||||
HTTP_PORT?= 8180 | HTTP_PORT?= 8180 | ||||
SHUTDOWN_PORT?= 8005 | SHUTDOWN_PORT?= 8005 | ||||
AJP_1_3_PORT?= 8009 | AJP_1_3_PORT?= 8009 | ||||
STDOUT_LOG= ${LOG_DIR}/stdout.log | STDOUT_LOG= ${LOG_DIR}/stdout.log | ||||
STDERR_LOG= ${LOG_DIR}/stderr.log | STDERR_LOG= ${LOG_DIR}/stderr.log | ||||
JAR_FILE= bin/bootstrap.jar | JAR_FILE= bin/bootstrap.jar | ||||
TOMCAT_CONF_FILES= catalina.policy catalina.properties context.xml \ | TOMCAT_SUBDIR?= ${DISTNAME:R} | ||||
logging.properties server.xml tomcat-users.xml web.xml | TOMCAT_HOME= ${PREFIX}/${TOMCAT_SUBDIR} | ||||
CONF_EXT= sample | PLIST_SUB= T=${TOMCAT_SUBDIR} \ | ||||
PLIST_SUB= T=${APP_HOME:S/^${PREFIX}\///} CONF_EXT=${CONF_EXT} \ | |||||
WWWOWN=${TOMCAT_USER} WWWGRP=${TOMCAT_GROUP} | WWWOWN=${TOMCAT_USER} WWWGRP=${TOMCAT_GROUP} | ||||
SUB_LIST= AJP_1_3_PORT=${AJP_1_3_PORT} \ | SUB_LIST= AJP_1_3_PORT=${AJP_1_3_PORT} \ | ||||
APP_HOME=${APP_HOME} \ | APP_HOME=${APP_HOME} \ | ||||
APP_SHORTNAME=${APP_SHORTNAME} \ | APP_SHORTNAME=${APP_SHORTNAME} \ | ||||
GROUP=${TOMCAT_GROUP} \ | GROUP=${TOMCAT_GROUP} \ | ||||
HTTP_PORT=${HTTP_PORT} \ | HTTP_PORT=${HTTP_PORT} \ | ||||
JAR_FILE=${JAR_FILE} \ | JAR_FILE=${JAR_FILE} \ | ||||
SHUTDOWN_PORT=${SHUTDOWN_PORT} \ | SHUTDOWN_PORT=${SHUTDOWN_PORT} \ | ||||
STDERR_LOG=${STDERR_LOG} \ | STDERR_LOG=${STDERR_LOG} \ | ||||
STDOUT_LOG=${STDOUT_LOG} \ | STDOUT_LOG=${STDOUT_LOG} \ | ||||
TOMCAT_HOME=${APP_HOME} \ | TOMCAT_HOME=${APP_HOME} \ | ||||
TOMCAT_VERSION=${MAJOR_VER:S/.//} \ | TOMCAT_VERSION=${MAJOR_VER:S/.//} \ | ||||
USER=${TOMCAT_USER} | USER=${TOMCAT_USER} | ||||
OPTIONS_DEFINE= HOST_MANAGER MANAGER DOCS EXAMPLES ROOT | |||||
OPTIONS_DEFAULT= HOST_MANAGER MANAGER ROOT | |||||
OPTIONS_SUB= yes | |||||
DOCS_DESC= Install Documentation web application | |||||
EXAMPLES_DESC= Install Examples web application | |||||
HOST_MANAGER_DESC= Install Host Manager application | |||||
MANAGER_DESC= Install Manager web application | |||||
ROOT_DESC= Install default ROOT web application | |||||
.include <bsd.port.pre.mk> | .include <bsd.port.pre.mk> | ||||
pre-patch: | pre-patch: | ||||
@${ECHO_MSG} "Installation settings:" | @${ECHO_MSG} "Installation settings:" | ||||
@${ECHO_MSG} " Destination directory: ${APP_HOME}" | @${ECHO_MSG} " Destination directory: ${APP_HOME}" | ||||
@${ECHO_MSG} " Location of JDK: ${JAVA_HOME}" | @${ECHO_MSG} " Location of JDK: ${JAVA_HOME}" | ||||
@${ECHO_MSG} " Location of Java port: ${JAVA_PORT}" | @${ECHO_MSG} " Location of Java port: ${JAVA_PORT}" | ||||
@${ECHO_MSG} " Running as (user/group): ${TOMCAT_USER}/${TOMCAT_GROUP}" | @${ECHO_MSG} " Running as (user/group): ${TOMCAT_USER}/${TOMCAT_GROUP}" | ||||
@${ECHO_MSG} " HTTP port: ${HTTP_PORT}" | @${ECHO_MSG} " HTTP port: ${HTTP_PORT}" | ||||
@${ECHO_MSG} " Shutdown listener port: ${SHUTDOWN_PORT}" | @${ECHO_MSG} " Shutdown listener port: ${SHUTDOWN_PORT}" | ||||
@${ECHO_MSG} " AJP 1.3 connector port: ${AJP_1_3_PORT}" | @${ECHO_MSG} " AJP 1.3 connector port: ${AJP_1_3_PORT}" | ||||
@${ECHO_MSG} " Logfile stdout: ${STDOUT_LOG}" | @${ECHO_MSG} " Logfile stdout: ${STDOUT_LOG}" | ||||
@${ECHO_MSG} " Logfile stderr: ${STDERR_LOG}" | @${ECHO_MSG} " Logfile stderr: ${STDERR_LOG}" | ||||
post-patch: | post-patch: | ||||
@${REINPLACE_CMD} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${WRKSRC}/conf/server.xml | @${REINPLACE_CMD} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} ${WRKSRC}/conf/server.xml | ||||
@${FIND} ${WRKSRC} -type f \( -name '*.bak' -or -name '*.bat' -or -name '*.dll' -or -name '*.exe' -or -name '*.orig' \) -delete | @${FIND} ${WRKSRC} -type f \( -name '*.bak' -or -name '*.bat' -or -name '*.dll' -or -name '*.exe' -or -name '*.orig' \) -delete | ||||
.for f in ${TOMCAT_CONF_FILES} | |||||
@${MV} ${WRKSRC}/conf/${f} ${WRKSRC}/conf/${f}.${CONF_EXT} | |||||
.endfor | |||||
pre-install: | pre-install: | ||||
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL | @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL | ||||
do-install: | do-install: | ||||
@${ECHO_MSG} -n ">> Creating destination directory..." | @${ECHO_MSG} -n ">> Creating destination directory..." | ||||
@${MKDIR} ${STAGEDIR}${APP_HOME} | @${MKDIR} ${STAGEDIR}${APP_HOME} | ||||
@${MKDIR} ${STAGEDIR}${LOG_DIR} | @${MKDIR} ${STAGEDIR}${LOG_DIR} | ||||
@${MKDIR} ${STAGEDIR}${APP_HOME}/endorsed | @${MKDIR} ${STAGEDIR}${APP_HOME}/endorsed | ||||
@${ECHO_MSG} " [ DONE ]" | @${ECHO_MSG} " [ DONE ]" | ||||
@${ECHO_MSG} -n ">> Copying files to destination directory..." | @${ECHO_MSG} -n ">> Copying files to destination directory..." | ||||
@${CP} -R ${WRKSRC}/* ${STAGEDIR}${APP_HOME} | @${CP} -R ${WRKSRC}/* ${STAGEDIR}${APP_HOME} | ||||
@${ECHO_MSG} " [ DONE ]" | @${ECHO_MSG} " [ DONE ]" | ||||
@${ECHO_MSG} -n ">> Fixing permissions..." | @${ECHO_MSG} -n ">> Fixing permissions..." | ||||
@${FIND} ${STAGEDIR}${APP_HOME} -type d -print0 | ${XARGS} -0 ${CHMOD} 755 | @${FIND} ${STAGEDIR}${APP_HOME} -type d -print0 | ${XARGS} -0 ${CHMOD} 755 | ||||
@${ECHO_MSG} " [ DONE ]" | @${ECHO_MSG} " [ DONE ]" | ||||
post-install: | |||||
(cd ${STAGEDIR}${TOMCAT_HOME}/conf &&\ | |||||
for f in $$(find . -type f); do ${MV} $$f $$f.sample; done) | |||||
post-install-HOST_MANAGER-on: | |||||
(cd ${STAGEDIR}${TOMCAT_HOME}/webapps &&\ | |||||
for f in host-manager/META-INF/context.xml host-manager/WEB-INF/web.xml; do \ | |||||
${MV} $$f $$f.sample; done) | |||||
post-install-HOST_MANAGER-off: | |||||
@${RM} -R ${STAGEDIR}${TOMCAT_HOME}/webapps/host-manager | |||||
post-install-MANAGER-on: | |||||
(cd ${STAGEDIR}${TOMCAT_HOME}/webapps &&\ | |||||
for f in manager/META-INF/context.xml manager/WEB-INF/web.xml; do \ | |||||
${MV} $$f $$f.sample; done) | |||||
post-install-MANAGER-off: | |||||
@${RM} -R ${STAGEDIR}${TOMCAT_HOME}/webapps/manager | |||||
post-install-DOCS-off: | |||||
@${RM} -R ${STAGEDIR}${TOMCAT_HOME}/webapps/docs | |||||
post-install-EXAMPLES-off: | |||||
@${RM} -R ${STAGEDIR}${TOMCAT_HOME}/webapps/examples | |||||
post-install-ROOT-off: | |||||
@${RM} -R ${STAGEDIR}${TOMCAT_HOME}/webapps/ROOT | |||||
.include <bsd.port.post.mk> | .include <bsd.port.post.mk> |