View | Details | Raw Unified | Return to bug 159695
Collapse All | Expand All

(-)www/tomcat6/Makefile (-11 / +7 lines)
Lines 7-12 Link Here
7
7
8
PORTNAME=	tomcat
8
PORTNAME=	tomcat
9
PORTVERSION=	6.0.32
9
PORTVERSION=	6.0.32
10
PORTREVISION=	1
10
CATEGORIES=	www java
11
CATEGORIES=	www java
11
MASTER_SITES=	${MASTER_SITE_APACHE}
12
MASTER_SITES=	${MASTER_SITE_APACHE}
12
MASTER_SITE_SUBDIR=	tomcat/tomcat-6/v${PORTVERSION}/bin
13
MASTER_SITE_SUBDIR=	tomcat/tomcat-6/v${PORTVERSION}/bin
Lines 23-36 Link Here
23
NO_BUILD=	YES
24
NO_BUILD=	YES
24
25
25
USE_RC_SUBR=	tomcat6.sh
26
USE_RC_SUBR=	tomcat6.sh
26
SUB_FILES=	pkg-install
27
27
28
MAJOR_VER=	${PORTVERSION:R}
28
MAJOR_VER=	${PORTVERSION:R}
29
APP_HOME?=	${PREFIX}/${DISTNAME:R}
29
APP_HOME?=	${PREFIX}/${DISTNAME:R}
30
LOG_DIR=	${APP_HOME}/logs
30
LOG_DIR=	${APP_HOME}/logs
31
APP_SHORTNAME=	${PORTNAME}${MAJOR_VER:S/.//}
31
APP_SHORTNAME=	${PORTNAME}${MAJOR_VER:S/.//}
32
TOMCAT_USER?=	www
32
USERS=	www
33
TOMCAT_GROUP?=	www
33
GROUPS=	www
34
HTTP_PORT?=	8180
34
HTTP_PORT?=	8180
35
SHUTDOWN_PORT?=	8005
35
SHUTDOWN_PORT?=	8005
36
AJP_1_3_PORT?=	8009
36
AJP_1_3_PORT?=	8009
Lines 41-47 Link Here
41
			logging.properties server.xml tomcat-users.xml web.xml
41
			logging.properties server.xml tomcat-users.xml web.xml
42
CONF_EXT=	sample
42
CONF_EXT=	sample
43
PLIST_SUB=	T=${APP_HOME:S/^${PREFIX}\///} CONF_EXT=${CONF_EXT} \
43
PLIST_SUB=	T=${APP_HOME:S/^${PREFIX}\///} CONF_EXT=${CONF_EXT} \
44
		WWWOWN=${TOMCAT_USER} WWWGRP=${TOMCAT_GROUP}
44
		WWWOWN=${USERS} WWWGRP=${GROUPS}
45
LATEST_LINK=	${APP_SHORTNAME}
45
LATEST_LINK=	${APP_SHORTNAME}
46
46
47
SUB_LIST=	AJP_1_3_PORT=${AJP_1_3_PORT} \
47
SUB_LIST=	AJP_1_3_PORT=${AJP_1_3_PORT} \
Lines 54-61 Link Here
54
		STDERR_LOG=${STDERR_LOG} \
54
		STDERR_LOG=${STDERR_LOG} \
55
		STDOUT_LOG=${STDOUT_LOG} \
55
		STDOUT_LOG=${STDOUT_LOG} \
56
		TOMCAT_HOME=${APP_HOME} \
56
		TOMCAT_HOME=${APP_HOME} \
57
		TOMCAT_VERSION=${MAJOR_VER:S/.//} \
57
		TOMCAT_VERSION=${MAJOR_VER:S/.//}
58
		USER=${TOMCAT_USER}
59
58
60
.include <bsd.port.pre.mk>
59
.include <bsd.port.pre.mk>
61
60
Lines 64-70 Link Here
64
	@${ECHO_MSG} "   Destination directory:    ${APP_HOME}"
63
	@${ECHO_MSG} "   Destination directory:    ${APP_HOME}"
65
	@${ECHO_MSG} "   Location of JDK:          ${JAVA_HOME}"
64
	@${ECHO_MSG} "   Location of JDK:          ${JAVA_HOME}"
66
	@${ECHO_MSG} "   Location of Java port:    ${JAVA_PORT}"
65
	@${ECHO_MSG} "   Location of Java port:    ${JAVA_PORT}"
67
	@${ECHO_MSG} "   Running as (user/group):  ${TOMCAT_USER}/${TOMCAT_GROUP}"
66
	@${ECHO_MSG} "   Running as (user/group):  ${USERS}/${GROUPS}"
68
	@${ECHO_MSG} "   HTTP port:                ${HTTP_PORT}"
67
	@${ECHO_MSG} "   HTTP port:                ${HTTP_PORT}"
69
	@${ECHO_MSG} "   Shutdown listener port:   ${SHUTDOWN_PORT}"
68
	@${ECHO_MSG} "   Shutdown listener port:   ${SHUTDOWN_PORT}"
70
	@${ECHO_MSG} "   AJP 1.3 connector port:   ${AJP_1_3_PORT}"
69
	@${ECHO_MSG} "   AJP 1.3 connector port:   ${AJP_1_3_PORT}"
Lines 78-86 Link Here
78
	@${MV} ${WRKSRC}/conf/${f} ${WRKSRC}/conf/${f}.${CONF_EXT}
77
	@${MV} ${WRKSRC}/conf/${f} ${WRKSRC}/conf/${f}.${CONF_EXT}
79
.endfor
78
.endfor
80
79
81
pre-install:
82
	@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
83
84
do-install:
80
do-install:
85
	@${ECHO_MSG} -n ">> Creating destination directory..."
81
	@${ECHO_MSG} -n ">> Creating destination directory..."
86
	@${MKDIR} ${APP_HOME}
82
	@${MKDIR} ${APP_HOME}
Lines 105-111 Link Here
105
	@${ECHO_MSG} " [ DONE ]"
101
	@${ECHO_MSG} " [ DONE ]"
106
102
107
	@${ECHO_MSG} -n ">> Fixing ownership settings..."
103
	@${ECHO_MSG} -n ">> Fixing ownership settings..."
108
	@${CHOWN} -R ${TOMCAT_USER}:${TOMCAT_GROUP} ${APP_HOME}/conf ${APP_HOME}/logs \
104
	@${CHOWN} -R ${USERS}:${GROUPS} ${APP_HOME}/conf ${APP_HOME}/logs \
109
		${APP_HOME}/temp ${APP_HOME}/webapps ${APP_HOME}/work
105
		${APP_HOME}/temp ${APP_HOME}/webapps ${APP_HOME}/work
110
	@${ECHO_MSG} " [ DONE ]"
106
	@${ECHO_MSG} " [ DONE ]"
111
107
(-)www/tomcat6/files/pkg-install.in (-53 lines)
Removed Link Here
1
#!/bin/sh
2
#
3
# Checks if the '%%USER%%' user and '%%GROUP%%' group exist. If they don't, then
4
# an attempt is made to create both.
5
#
6
# $FreeBSD: ports/www/tomcat6/files/pkg-install.in,v 1.1 2006/02/07 08:50:09 lawrance Exp $
7
#
8
9
# Make sure we're called during the 'make install' process
10
if [ "$2" != "PRE-INSTALL" ]; then
11
    exit 0
12
fi
13
14
# Set some constants
15
UID=80
16
GID=${UID}
17
USER=%%USER%%
18
GROUP=%%GROUP%%
19
20
# See if the group already exists
21
if ! pw groupshow "${GROUP}" 2>/dev/null 1>&2; then
22
23
	# If not, try to create it
24
	if pw groupadd "${GROUP}" -g ${GID}; then
25
		echo "Added group \"${GROUP}\"."
26
	elif pw groupadd "${GROUP}"; then
27
		echo "Added group \"${GROUP}\"."
28
	else
29
		echo "Adding group \"${GROUP}\" failed..."
30
		exit 1
31
	fi
32
fi
33
34
# See if the user already exists
35
if ! pw usershow "${USER}" 2>/dev/null 1>&2; then
36
37
	# If not, try to create it
38
	if pw useradd "${USER}" -u ${UID} -g "${GROUP}" -h - \
39
                -s "/sbin/nologin" -d "/nonexistent" \
40
                -c "World Wide Web Owner";
41
	then
42
		echo "Added user \"${USER}\"."
43
	elif pw useradd "${USER}" -g "${GROUP}" -h - \
44
                -s "/sbin/nologin" -d "/nonexistent" \
45
                -c "World Wide Web Owner";
46
	then
47
		echo "Added user \"${USER}\"."
48
	else
49
		echo "Adding user \"${USER}\" failed..."
50
		exit 1
51
	fi
52
fi
53
exit 0

Return to bug 159695