aboutsummaryrefslogtreecommitdiffstats
path: root/www/jakarta-tomcat4/Makefile
blob: a571d09245c85ca1856be4b1c306c8be6a4f5962 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# New ports collection makefile for:    jakarta-tomcat
# Date created:     20 Oct 2000
# Whom:         des
#
# $FreeBSD$
#

PORTNAME=   jakarta-tomcat
PORTVERSION=    4.0.6
CATEGORIES= www java
MASTER_SITES=   http://jakarta.apache.org/builds/jakarta-tomcat-${PORTVERSION:R}/release/v${PORTVERSION}/bin/ \
        ${MASTER_SITE_LOCAL}
MASTER_SITE_SUBDIR= znerd

MAINTAINER= liukang@bjut.edu.cn
COMMENT=    Open-source Java web server by Apache, stable 4.0.x branch

USE_JAVA=   1.2+
NO_BUILD=   YES
LATEST_LINK=    ${APP_SHORTNAME}

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}\///}
APP_TITLE=  Jakarta Tomcat
APP_SHORTNAME=  tomcat${MAJOR_VER}
CONTROL_SCRIPT_NAME=    ${APP_SHORTNAME}ctl
CONTROL_SCRIPT= ${PREFIX}/bin/${CONTROL_SCRIPT_NAME}
CONTROL_SCRIPT_MANPAGE_TITLE=   ${CONTROL_SCRIPT_NAME:U}
STARTUP_ORDER?= 020
STARTUP_SCRIPT_NAME=    ${PORTNAME}${MAJOR_VER}.sh
STARTUP_SCRIPT= ${PREFIX}/etc/rc.d/${STARTUP_ORDER}.${STARTUP_SCRIPT_NAME}
USER=       www
GROUP=      www
PW?=        /usr/sbin/pw
HTTP_PORT?= 8180
SHUTDOWN_PORT?= 8005
WARP_PORT?= 8008
AJP_1_3_PORT?=  8009
STDOUT_LOG= ${LOG_DIR}/stdout.log
STDERR_LOG= ${LOG_DIR}/stderr.log
AUTO_START?=    NO
STOP_TIMEOUT?=  5
PID_FILE=   /var/run/${APP_SHORTNAME}.pid
REPLACE_FILES=  ${FILESDIR}/daemonctl.c \
        ${FILESDIR}/daemonctl.1 \
        ${FILESDIR}/startup.sh \
        ${WRKSRC}/conf/server.xml
JAR_FILE=   bin/bootstrap.jar
WRKDIR?=    ${WRKDIRPREFIX}${.CURDIR}/work

.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} "   Shutdown listener port:   ${SHUTDOWN_PORT}"
    @${ECHO_CMD} "   WARP port:                ${WARP_PORT}"
    @${ECHO_CMD} "   AJP 1.3 connector port:   ${AJP_1_3_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."
    @PKG_PREFIX=${PREFIX} ${SH} pkg-install ${PKGNAME} PRE-INSTALL

post-patch:
    @${ECHO_CMD} -n ">> Removing unneeded files..."
    @${RM} -f `${FIND} ${WRKSRC} -name '*.bat'` `${FIND} ${WRKSRC} -name '*.orig'` `${FIND} ${WRKSRC} -name '*.exe'`
    @${ECHO_CMD} " [ DONE ]"

.for f in ${REPLACE_FILES}
    @${ECHO_CMD} -n ">> Customizing `basename $f`..."
    @${SED} \
    -e "/%%AJP_1_3_PORT%%/s//${AJP_1_3_PORT}/g" \
    -e "/%%APP_HOME%%/s//${APP_HOME:S/\//\\\//g}/g" \
    -e "/%%APP_SHORTNAME%%/s//${APP_SHORTNAME}/g" \
    -e "/%%APP_TITLE%%/s//${APP_TITLE}/g" \
    -e "/%%CONTROL_SCRIPT%%/s//${CONTROL_SCRIPT:S/\//\\\//g}/g" \
    -e "/%%CONTROL_SCRIPT_MANPAGE_TITLE%%/s//${CONTROL_SCRIPT_MANPAGE_TITLE}/g" \
    -e "/%%CONTROL_SCRIPT_NAME%%/s//${CONTROL_SCRIPT_NAME}/g" \
    -e "/%%GROUP%%/s//${GROUP}/g" \
    -e "/%%HTTP_PORT%%/s//${HTTP_PORT}/g" \
    -e "/%%JAVA_CMD%%/s//bin\/java/g" \
    -e "/%%JAVA_HOME%%/s//${JAVA_HOME:S/\//\\\//g}/g" \
    -e "/%%JAR_FILE%%/s//${JAR_FILE:S/\//\\\//g}/g" \
    -e "/%%LOG_DIR%%/s//${LOG_DIR:S/\//\\\//g}/g" \
    -e "/%%PID_FILE%%/s//${PID_FILE:S/\//\\\//g}/g" \
    -e "/%%PORTNAME%%/s//${PORTNAME}/g" \
    -e "/%%PORTVERSION%%/s//${PORTVERSION}/g" \
    -e "/%%PREFIX%%/s//${PREFIX:S/\//\\\//g}/g" \
    -e "/%%SHUTDOWN_PORT%%/s//${SHUTDOWN_PORT}/g" \
    -e "/%%STARTUP_SCRIPT_NAME%%/s//${STARTUP_SCRIPT_NAME}/g" \
    -e "/%%STARTUP_SCRIPT%%/s//${STARTUP_SCRIPT:S/\//\\\//g}/g" \
    -e "/%%STDERR_LOG%%/s//${STDERR_LOG:S/\//\\\//g}/g" \
    -e "/%%STDOUT_LOG%%/s//${STDOUT_LOG:S/\//\\\//g}/g" \
    -e "/%%STOP_TIMEOUT%%/s//${STOP_TIMEOUT}/g" \
    -e "/%%USER%%/s//${USER}/g" \
    -e "/%%WARP_PORT%%/s//${WARP_PORT}/g" \
    $f > ${WRKDIR}/`basename $f`
    @${ECHO_CMD} " [ DONE ]"
.endfor

do-install:
    @${ECHO_CMD} -n ">> Creating destination directory..."
    @${MKDIR} ${APP_HOME}
    @${MKDIR} ${LOG_DIR}
    @${ECHO_CMD} " [ DONE ]"

    @${ECHO_CMD} -n ">> Copying files to destination directory..."
    @${CP} -R ${WRKSRC}/* ${APP_HOME}
    @${CP} ${WRKDIR}/server.xml ${APP_HOME}/conf/
    @${ECHO_CMD} " [ DONE ]"

    @${ECHO_CMD} -n ">> Compiling and installing control program..."
    @${SED} \
    -e "/%%JAVA_ARGS%%/s//\"-Dcatalina.home=${APP_HOME:S/\//\\\//g}\",/g" \
    -e "/%%JAR_ARGS%%/s//\"start\",/g" \
    ${WRKDIR}/daemonctl.c > ${WRKDIR}/daemonctl_.c
    @cd ${WRKDIR} && ${CC} -ansi -o ${CONTROL_SCRIPT_NAME} daemonctl_.c
    @${CP} ${WRKDIR}/${CONTROL_SCRIPT_NAME} ${CONTROL_SCRIPT}
    @${CHOWN} ${USER}:${GROUP} ${CONTROL_SCRIPT}
    @${CHMOD} 6754 ${CONTROL_SCRIPT}
    @${ECHO_CMD} " [ DONE ]"

    @${ECHO_CMD} -n ">> Installing startup script..."
    @${CP} ${WRKDIR}/startup.sh ${STARTUP_SCRIPT}
    @${CHMOD} 0544 ${STARTUP_SCRIPT}
    @${ECHO_CMD} " [ DONE ]"

.if !defined(NOPORTDOCS)
    @${ECHO_CMD} -n ">> Installing man pages..."
    @${INSTALL_MAN} ${WRKDIR}/daemonctl.1 ${MANPREFIX}/man/man1/${CONTROL_SCRIPT_NAME}.1
    @${ECHO_CMD} " [ DONE ]"
.endif

    @${ECHO_CMD} -n ">> Creating log files..."
    @${INSTALL} /dev/null ${STDOUT_LOG}
    @${INSTALL} /dev/null ${STDERR_LOG}
    @${ECHO_CMD} " [ DONE ]"

    @${ECHO_CMD} -n ">> Creating symlink to tools.jar..."
    @${LN} -sf ${JAVA_HOME}/lib/tools.jar ${APP_HOME}/common/lib/tools.jar
    @${ECHO_CMD} " [ DONE ]"

    @${ECHO_CMD} -n ">> Fixing ownership settings..."
    @${CHOWN} -R ${USER}:${GROUP} ${APP_HOME}
    @${ECHO_CMD} " [ DONE ]"

    @${ECHO_CMD} -n ">> Fixing permissions..."
    @${CHMOD} 755 `${FIND} ${APP_HOME} -type d`
    @${ECHO_CMD} " [ DONE ]"

    @${ECHO_CMD} -n ">> Creating PID file..."
    @${TOUCH} ${PID_FILE}
    @${CHOWN} ${USER}:${GROUP} ${PID_FILE}
    @${CHMOD} 0600 ${PID_FILE}
    @${ECHO_CMD} " [ 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}."
.if !defined(NOPORTDOCS)
    @${ECHO_CMD} "Use 'man ${CONTROL_SCRIPT_NAME}' for information about starting and stopping ${APP_TITLE}."
.endif
.if ${AUTO_START} == "YES"
    @${CONTROL_SCRIPT} start || true
.endif

.include <bsd.port.post.mk>
00'>1999-10-193-3/+3 * Update to 0.99.4nakai1999-10-193-6/+9 * Update to 1.1.2nakai1999-10-192-3/+3 * Update to 0.16.0nakai1999-10-1815-1962/+3906 * Bump gnome libraries' version numbers.asami1999-10-171-1/+1 * Scwm depends esound.nakai1999-10-131-0/+1 * Finish updating this port to version 2.3 - version required comment,steve1999-10-123-6/+5 * Fix PropList shlib version. Along with Imlib, it was actually broken inasami1999-10-111-1/+1 * Activate the wmthemeinstall port.steve1999-10-111-0/+1 * Initial import of wmthemeinstall version 0.62.steve1999-10-115-0/+56 * Bump imlib shlib version.asami1999-10-101-1/+1 * What's with the weird indenting? Fix it.asami1999-10-101-12/+12 * Upgrade to 0.9.49.vanilla1999-10-102-3/+3 * Add back xpm dependencies so these will build again.asami1999-10-092-2/+4 * Update wmakerconf to 2.3dan1999-10-092-15/+15 * Update port to 0.61.1dan1999-10-094-4/+26 * Bump libPropList shlib number.asami1999-10-081-1/+1 * Use updated imlib library.nakai1999-10-081-3/+3 * Use updated imlib library.nakai1999-10-086-6/+6 * esound library update esd.1 -> esd.2nakai1999-10-083-3/+3 * Use the updated libproplist shared librarycpiazza1999-10-071-1/+1 * Upgrade to 0.61.1.tg1999-10-063-5/+7 * Update to 0.99.3nakai1999-10-066-112/+260 * Submitted by: "KATO Tsuguru" <tkato@prontomail.ne.jp>nakai1999-10-065-36/+25 * Submitted by:"KATO Tsuguru" <tkato@prontomail.ne.jp>nakai1999-10-064-10/+12 * Submitted by: "KATO Tsuguru" <tkato@prontomail.ne.jp>nakai1999-10-068-16/+52 * Update to 0.9.0nakai1999-10-056-75/+52 * Add a hook for a single icon per application instance.cpiazza1999-10-031-0/+4 * Update windowmaker-i18n to 0.61.0.dan1999-10-014-18/+15 * Upgrade xfce to 3.1.1dan1999-09-276-10/+170 * Don't define the second argument of bzero(3) as being an int since on thesteve1999-09-272-0/+22 * This committer needs a vacation. Remove a lot of extra junkcpiazza1999-09-251-64/+0 * Add a patch to remove a menu that's work in progress andcpiazza1999-09-241-0/+78 * Add trailing / to end of a MASTER_SITEcpiazza1999-09-213-3/+3 * Update to version 0.51.3.1cpiazza1999-09-216-15/+12 * Update to version 0.61.0cpiazza1999-09-213-10/+8 * The place of qt2 include files is changed.imura1999-09-201-3/+3 * Use USE_QT2 instead of an explicit LIB_DEPENDS.asami1999-09-201-2/+1 * Enforce random pkg/COMMENT rules, including the one that states Emacshoek1999-09-181-1/+1 * Modest attempt to improve the afterstep pkg/COMMENTs. I still don't likehoek1999-09-181-1/+1 * The version number of libgif.so has changed to 5.steve1999-09-185-5/+5 * Compile errortaoka1999-09-111-1/+2 * Upgrade to ctwm 3.5.2torstenb1999-09-112-2/+3 * WindowMaker -> Window Maker.cpiazza1999-09-101-1/+1 * Changed from $Id to $FreeBSDtaoka1999-09-091-1/+1 * Add wmgtaoka1999-09-091-0/+1 * a small GTK-based GNOME-compliant window managertaoka1999-09-095-0/+41 * Update to version 2.2cpiazza1999-09-093-7/+10 * Activate libwmfuncpiazza1999-09-091-0/+1 * The tiff port now lives in ports/graphics/tiff.steve1999-09-076-6/+6 * Update to version 1.1.steve1999-09-073-39/+35 * Add a MAKE_ENV= CXX=${CXX}. I have no idea why this is needed.cpiazza1999-09-061-0/+2 * Change MASTER_SITES: one is typo, one is not accessible now.sada1999-09-061-2/+1 * Update to version 0.51.2 and fix the URL in DESCRcpiazza1999-09-059-18/+15 * Update to version 0.4.6cpiazza1999-09-053-17/+21 * Checksum fix and DESCR update. Merge them from wm to wm-i18n.asami1999-09-024-12/+10 * FreeBSD.ORG -> FreeBSD.orgmharo1999-08-3110-12/+12 * $Id$ -> $FreeBSD$peter1999-08-3141-41/+41 * Don't write "This is ..." in pkg/COMMENT.hoek1999-08-301-1/+1 * 1. Support for bzip'ed themes (RUN_DEPENDS=bunzip2)cpiazza1999-08-292-5/+30 * expr -> ${EXPR}mharo1999-08-281-2/+2 * sed -> ${SED}mharo1999-08-281-2/+2 * echo -> ${ECHO} or ${ECHO_MSG} and in some cases, move echo stuffmharo1999-08-281-4/+4 * Update to version 0.9.48cpiazza1999-08-284-7/+32 * Activate wmakerconfcpiazza1999-08-271-1/+2 * Import of wmakerconf.cpiazza1999-08-275-0/+80 * move manpages out of PLISTmharo1999-08-261-3/+0 * oops, local repository was modified. revert back to previous versionmharo1999-08-263-6/+6 * LIB_DEPENDS= Fnlib.0 -> Fnlib.4mharo1999-08-263-6/+6 * Change Id->FreeBSD.obrien1999-08-251-1/+1 * Correct my e-mail address.green1999-08-241-2/+2 * awk -> ${AWK}mharo1999-08-231-2/+2 * Update to version 0.51.1cpiazza1999-08-216-12/+12 * * Fix wm-oldmenu2new.sada1999-08-212-2/+16 * Update to blackbox 0.51.0. This is the first release officallycpiazza1999-08-209-21/+18 * Move ports/misc/toolbox to ports/x11-wm/toolbox with a repocpiazza1999-08-192-3/+4 * Updated my email addressjim1999-08-152-4/+4 * Updated my email addressjim1999-08-142-4/+4 * Remove xfce-common, it's obsolete.cpiazza1999-08-131-2/+1 * Update to version 3.0.3cpiazza1999-08-1112-128/+674 * Update MASTER_SITES.cpiazza1999-08-081-2/+2 * Re-enforce caps, no period. An "exceptions" file has been createdhoek1999-08-034-4/+4 * Move enlightenment-conf from misc to x11-wm.asami1999-07-311-1/+2 * Change CONFIGURE_ARGS to reflect reality and add USE_GNOME/USE_KDEcpiazza1999-07-191-3/+18 * Add a new master sitecpiazza1999-07-191-2/+3 * Libdockapp: the standard library for windowmaker dock apps. It iscpiazza1999-07-195-0/+30 * devel/libdockapp -> x11-wm/libdockappcpiazza1999-07-191-1/+2 * Cleanup some more WWW (occasionally fixing-up the DESCR in general too).hoek1999-07-183-15/+8 * Update to 0.60.0cpiazza1999-07-175-20/+89 * Distfile changed without a version updatecpiazza1999-07-171-1/+1 * Add a patch that fixes a bug in the Windowing code that cancpiazza1999-07-153-9/+9 * Fix build on FreeBSD/Alpha.steve1999-07-051-2/+19 * Update URL.mph1999-07-034-4/+4 * Upgrade to 2.2.2.mph1999-07-0224-168/+172 * Update to 1.2.8cpiazza1999-06-303-10/+21 * Don't use sentences in pkg/COMMENT since we can't use periods.hoek1999-06-281-1/+1 * Remove trailing spaces, and any periods that were hidden by them.hoek1999-06-281-1/+1 * Rewrite pkg/COMMENT is such a manner that it will not be broken ifhoek1999-06-282-4/+4 * Commit #3/4 to enforce caps, no period.hoek1999-06-272-2/+2 * As threatened, enforce the "Capital, no period" rule. Ellipses arehoek1999-06-2727-27/+27 * Replace a dead master site with a functional one.cpiazza1999-06-203-9/+9 * Change my email address to FreeBSD.org.cpiazza1999-06-195-12/+9 * Upgrade to toolbox-0.4.3.jseger1999-06-142-4/+4 * A blackbox(Window Manager) style configuration utility.taoka1999-06-116-0/+42 * Update to version 0.9.41.steve1999-06-095-49/+35 * Set USE_LIBTOOL=yes so we get rid of another dastardly (sp?) .la file.steve1999-06-092-3/+2 * This port depends on libgnome.so.2 and not version 1.steve1999-06-071-2/+2 * Update to version 5.6.steve1999-06-075-9/+26 * Make sure we can find the WINGs header files when compiling util/*.steve1999-06-071-0/+11 * Remove the test to create ${PREFIX}/share/info/dir as it is nowmharo1999-06-061-1/+0 * Upgrade to 0.60.0.tg1999-06-043-12/+28 * Fixup build for FreeBSD/Alpha.steve1999-05-311-0/+176 * This now works on the Alpha too.steve1999-05-312-8/+2 * Fix build for Alpha.steve1999-05-311-4/+38 * Update to 0.50.5 and set cpiazza@home.net as maintainer.mharo1999-05-299-18/+24 * Fixup after imlib version bump.steve1999-05-293-12/+9 * Forget about ${PREFIX}/include/giflib.tg1999-05-272-4/+3 * Update to 0.24mharo1999-05-172-5/+4 * update to 0.9.39 (note that digit % 3 == 0)mharo1999-05-173-8/+8 * New MASTER_SITE.steve1999-05-101-2/+2 * Update to version 0.9.38 and change I18N to USE_I18N to avoid compilationsteve1999-05-106-21/+29 * Find the new xview port and misc cleanups.steve1999-05-054-52/+205 * Activate the fvwm2-i18n port.steve1999-05-051-1/+2 * Update to version 2.2 after repository copy.steve1999-05-055-241/+270 * Update to version 2.2.steve1999-05-0520-236/+216 * Add WWW:mharo1999-05-031-1/+1 * Add WWW:mharo1999-05-03