Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 485000
Collapse All | Expand All

(-)tomcat/files/tomcat.init (+105 lines)
Line 0 Link Here
1
#!/@GENTOO_PORTAGE_EPREFIX@sbin/runscript
2
# Copyright 1999-2012 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
5
extra_commands="forcestop"
6
7
PIDFILE=/@GENTOO_PORTAGE_EPREFIX@var/run/${RC_SVCNAME}.pid
8
9
: ${CATALINA_HOME:=/@GENTOO_PORTAGE_EPREFIX@usr/share/tomcat-@SLOT@}
10
: ${CATALINA_BASE:=/@GENTOO_PORTAGE_EPREFIX@var/lib/${RC_SVCNAME}}
11
: ${CATALINA_TMPDIR:=/@GENTOO_PORTAGE_EPREFIX@var/tmp/${RC_SVCNAME}}
12
: ${CATALINA_USER:=tomcat}
13
: ${CATALINA_GROUP:=tomcat}
14
15
: ${TOMCAT_START:=start}
16
17
: ${JPDA_TRANSPORT:="dt_socket"}
18
: ${JPDA_ADDRESS:="8000"}
19
: ${JPDA_OPTS="-Xdebug -Xrunjdwp:transport=${JPDA_TRANSPORT},address=${JPDA_ADDRESS},server=y,suspend=n"}
20
21
export JAVA_HOME=`java-config ${TOMCAT_JVM:+--select-vm ${TOMCAT_JVM}} --jre-home`
22
23
CLASSPATH=`java-config --classpath tomcat-@SLOT@${TOMCAT_EXTRA_JARS:+,${TOMCAT_EXTRA_JARS}}`
24
export CLASSPATH="${CLASSPATH}${TOMCAT_EXTRA_CLASSPATH:+:${TOMCAT_EXTRA_CLASSPATH}}"
25
26
depend() {
27
	use dns logger net
28
}
29
30
start()	{
31
	ebegin "Starting ${RC_SVCNAME}"
32
33
	if [ ! -e "${CATALINA_TMPDIR}" ]; then
34
		eerror "CATALINA_TMPDIR does not exist. Unable to start tomcat."
35
		eerror "Please see /@GENTOO_PORTAGE_EPREFIX@etc/conf.d/${RC_SVCNAME} for more information."
36
		eend 1
37
	fi
38
39
	cmd=java args=
40
	if [ "${TOMCAT_START}" = "debug" ] || [ "${TOMCAT_START}" = "-security debug" ] ; then
41
		cmd=jdb
42
		args="${args} -sourcepath ${CATALINA_HOME}/../../jakarta-tomcat-catalina/catalina/src/share"
43
	fi
44
	if [ "${TOMCAT_START}" = "-security debug" ] || [ "${TOMCAT_START}" = "-security start" ]; then
45
		args="${args} -Djava.security.manager"
46
		args="${args} -Djava.security.policy=${CATALINA_BASE}/conf/catalina.policy"
47
	fi
48
	if [ "${TOMCAT_START}" = "jpda start" ] ; then
49
		args="${args} ${JPDA_OPTS}"
50
	fi
51
	if [ -r "${CATALINA_HOME}"/bin/tomcat-juli.jar ]; then
52
		args="${args} -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
53
		-Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties"
54
	fi
55
56
	start-stop-daemon  --start \
57
		--quiet --background \
58
		--chdir "${CATALINA_TMPDIR}" \
59
		--user ${CATALINA_USER}:${CATALINA_GROUP} \
60
		--make-pidfile --pidfile ${PIDFILE} \
61
		--exec ${JAVA_HOME}/bin/${cmd} \
62
		-- \
63
			${JAVA_OPTS} \
64
			${args} \
65
			-Dcatalina.base="${CATALINA_BASE}" \
66
			-Dcatalina.home="${CATALINA_HOME}" \
67
			-Djava.io.tmpdir="${CATALINA_TMPDIR}" \
68
			-classpath "${CLASSPATH}" \
69
			org.apache.catalina.startup.Bootstrap \
70
			${CATALINA_OPTS} \
71
			${TOMCAT_START}
72
73
	eend $?
74
}
75
76
stop()	{
77
	ebegin "Stopping '${RC_SVCNAME}'"
78
79
	start-stop-daemon --stop \
80
		--quiet --retry=60 \
81
		--pidfile ${PIDFILE} \
82
		--exec ${JAVA_HOME}/bin/java \
83
		-- \
84
			${JAVA_OPTS} \
85
			-classpath "${CLASSPATH}" \
86
			${CATALINA_OPTS} \
87
			stop ${STD_OUT}
88
89
	eend $?
90
}
91
92
forcestop()	{
93
	ebegin "Forcing '${RC_SVCNAME}' to stop"
94
95
	start-stop-daemon --stop \
96
		--quiet --retry=60 \
97
		--pidfile ${PIDFILE} \
98
		--signal=9
99
100
	if service_started "${RC_SVCNAME}"; then
101
		mark_service_stopped "${RC_SVCNAME}"
102
	fi
103
104
	eend $?
105
}
(-)tomcat/files/tomcat-instance-manager-r3.bash (+297 lines)
Line 0 Link Here
1
#!/bin/bash
2
# Copyright 1999-2015 Gentoo Foundation
3
# Distributed under the terms of the GNU General Public License v2
4
# Author: Ralph Sennhauser <sera@gentoo.org>
5
6
die() {
7
	echo "${@}"
8
	exit 1
9
}
10
11
dir_is_empty() {
12
	# usage:
13
	#  dir_is_empty <some-dir>
14
	#
15
	# returns 2 if the dir does not even exist
16
	# returns 1 if the dir is not empty
17
	# returns 0 (success) if the dir exists and is empty
18
19
	local dir=$1
20
	local files
21
22
	if [[ ! -e ${dir} ]] ; then
23
		return 2
24
	fi
25
26
	shopt -s nullglob dotglob     # To include hidden files
27
	files=( "${dir}"/* )
28
	shopt -u nullglob dotglob
29
30
	if [[ ${#files[@]} -eq 0 ]]; then
31
		return 0
32
	else
33
		return 1
34
	fi
35
36
}
37
38
usage() {
39
	cat <<EOL
40
Usage: ${BASH_SOURCE} <--create|--remove|--help> [--suffix s][--user u][--group g]
41
42
  Options:
43
    --help:
44
      show this text.
45
    --create:
46
      create a new instance
47
    --remove:
48
      remove an existing instance.
49
    --suffix SUFFIX:
50
      a suffix for this instance. the suffix may not collide with an already
51
      existing instance, defaults to empty.
52
    --user USER:
53
      the user for which to configure this instance for. The user needs to
54
      exist already. defaults to tomcat.
55
    --group GROUP:
56
      the group for which to configure this instance for. The group needs to
57
      exist already. defaults to tomcat.
58
59
  Examples:
60
    ${BASH_SOURCE} --create --suffix testing --user tacmot --group tacmot
61
    ${BASH_SOURCE} --remove --suffix testing
62
EOL
63
}
64
65
parse_argv() {
66
	action="not specified"
67
	instance_name="tomcat-@SLOT@"
68
	instance_systemd=${instance_name}
69
	instance_user="tomcat"
70
	instance_group="tomcat"
71
72
	while [[ -n $1 ]]; do
73
		case $1 in
74
			--help)
75
				usage
76
				exit 0;;
77
			--suffix)
78
				instance_name+="-$2"
79
				instance_systemd+="@${2}.service.d"
80
				shift; shift;;
81
			--user)
82
				instance_user="$2"
83
				shift; shift;;
84
			--group)
85
				instance_group="$2"
86
				shift; shift;;
87
			--create)
88
				action=create
89
				shift;;
90
			--remove)
91
				action=remove
92
				shift;;
93
			--backup)
94
				action=backup
95
				shift;;
96
			--restore)
97
				action=restore
98
				shift;;
99
			--update)
100
				action=update
101
				shift;;
102
			*)
103
				echo "Invalid option '$1'"
104
				usage
105
				exit 2;;
106
		esac
107
	done
108
109
	tomcat_home="/@GENTOO_PORTAGE_EPREFIX@usr/share/tomcat-@SLOT@"
110
	instance_base="/@GENTOO_PORTAGE_EPREFIX@var/lib/${instance_name}"
111
	instance_conf="/@GENTOO_PORTAGE_EPREFIX@etc/${instance_name}"
112
	instance_logs="/@GENTOO_PORTAGE_EPREFIX@var/log/${instance_name}"
113
	instance_temp="/@GENTOO_PORTAGE_EPREFIX@var/tmp/${instance_name}"
114
115
	if [[ -x /usr/bin/systemctl ]] && ([[ "${instance_user}" != "tomcat" ]] || [[ "${instance_group}" != "tomcat" ]]); then
116
		systemd_overlay="/@GENTOO_PORTAGE_EPREFIX@etc/systemd/system/${instance_systemd}"
117
	fi
118
119
	if [[ -d "/@GENTOO_PORTAGE_EPREFIX@etc/systemd/system/${instance_systemd}" ]]; then
120
		all_targets=(
121
			"${instance_base}"
122
			"${instance_logs}"
123
			"${instance_temp}"
124
			"/@GENTOO_PORTAGE_EPREFIX@etc/${instance_name}"
125
			"/@GENTOO_PORTAGE_EPREFIX@etc/init.d/${instance_name}"
126
			"/@GENTOO_PORTAGE_EPREFIX@etc/conf.d/${instance_name}"
127
			"/@GENTOO_PORTAGE_EPREFIX@etc/systemd/system/${instance_systemd}"
128
		)
129
	else
130
		all_targets=(
131
			"${instance_base}"
132
			"${instance_logs}"
133
			"${instance_temp}"
134
			"/@GENTOO_PORTAGE_EPREFIX@etc/${instance_name}"
135
			"/@GENTOO_PORTAGE_EPREFIX@etc/init.d/${instance_name}"
136
			"/@GENTOO_PORTAGE_EPREFIX@etc/conf.d/${instance_name}"
137
		)
138
	fi
139
}
140
141
test_can_deploy() {
142
	local no_deploy target
143
	for target in "${all_targets[@]}"; do
144
		if [[ -e "${target}" ]]; then
145
			if ! dir_is_empty "${target}" ; then
146
				echo "Error: '${target}' already exists and is not empty."
147
				no_deploy=yes
148
			fi
149
		fi
150
	done
151
	if [[ -n "${no_deploy}" ]]; then
152
		cat <<-EOL
153
To protect an existing installation no new instance was deployed. You can use
154
'${BASH_SOURCE} --remove'
155
to remove an existing instance first or run
156
'${BASH_SOURCE} --create --suffix <instance_suffix>'
157
to deploy an instance under a different name
158
EOL
159
		usage
160
		exit 1
161
	fi
162
163
	if ! getent passwd | cut -d: -f1 | grep -Fx "${instance_user}" > /dev/null; then
164
		echo "Error: user '${instance_user}' doesn't exist."
165
		exit 1
166
	fi
167
168
	if ! getent group | cut -d: -f1 | grep -Fx "${instance_group}" > /dev/null; then
169
		echo "Error: group '${instance_group}' doesn't exist."
170
		exit 1
171
	fi
172
}
173
174
deploy_instance() {
175
	test_can_deploy
176
	if [[ ! -z "${systemd_overlay}" ]]; then
177
		mkdir -p "${systemd_overlay}" || die
178
		cat > "${systemd_overlay}"/00-gentoo.conf <<-'EOF'
179
[Service]
180
User=@INSTANCE_USER@
181
Group=@INSTANCE_GROUP@
182
EOF
183
		sed -i -e "s|@INSTANCE_USER@|${instance_user}|g" \
184
			-e "s|@INSTANCE_GROUP@|${instance_group}|g" \
185
			"${systemd_overlay}"/00-gentoo.conf || die
186
	fi
187
188
	mkdir -p "${instance_base}"/{work,webapps} || die
189
	mkdir -p "${instance_logs}" || die
190
	mkdir -p "${instance_temp}" || die
191
	mkdir -p "${instance_conf}" || die
192
193
	cp -r "${tomcat_home}"/webapps/ROOT "${instance_base}"/webapps || die
194
195
	chown -R "${instance_user}":"${instance_group}" \
196
		"${instance_base}" "${instance_logs}" "${instance_temp}" || die
197
198
	find "${instance_base}"/webapps -type d -exec chmod 750 {} + || die
199
	find "${instance_base}"/webapps -type f -exec chmod 640 {} + || die
200
201
	# initial config #
202
203
	cp -r "${tomcat_home}"/conf/* "${instance_conf}"/ || die
204
205
	sed -i -e "s|\${catalina.base}/logs|${instance_logs}|" \
206
		"${instance_conf}"/logging.properties || die
207
	sed -i -e "s|directory=\"logs\"|directory=\"${instance_logs}\"|" \
208
		"${instance_conf}"/server.xml || die
209
210
	mkdir -p "${instance_conf}"/Catalina/localhost || die
211
	cat > "${instance_conf}"/Catalina/localhost/host-manager.xml <<-'EOF'
212
<?xml version="1.0" encoding="UTF-8"?>
213
<Context docBase="${catalina.home}/webapps/host-manager"
214
	antiResourceLocking="false" privileged="true" />
215
EOF
216
217
	cat > "${instance_conf}"/Catalina/localhost/manager.xml <<-'EOF'
218
<?xml version="1.0" encoding="UTF-8"?>
219
	<Context docBase="${catalina.home}/webapps/manager"
220
	antiResourceLocking="false" privileged="true" />
221
EOF
222
223
	if [[ -d "${tomcat_home}"/webapps/docs ]]; then
224
		cat > "${instance_conf}"/Catalina/localhost/docs.xml <<-'EOF'
225
<?xml version="1.0" encoding="UTF-8"?>
226
	<Context docBase="${catalina.home}/webapps/docs" />
227
EOF
228
	fi
229
230
	if [[ -d "${tomcat_home}"/webapps/examples ]]; then
231
		cat > "${instance_conf}"/Catalina/localhost/examples.xml <<-'EOF'
232
<?xml version="1.0" encoding="UTF-8"?>
233
<Context docBase="${catalina.home}/webapps/examples" />
234
EOF
235
	fi
236
237
	chown -R "${instance_user}":"${instance_group}" "${instance_conf}" || die
238
	find "${instance_conf}" -type d -exec chmod 750 {} + || die
239
	find "${instance_conf}" -type f -exec chmod 640 {} + || die
240
241
	# rc script #
242
243
	cp "${tomcat_home}"/gentoo/tomcat.init \
244
		"/@GENTOO_PORTAGE_EPREFIX@etc/init.d/${instance_name}" || die
245
246
	sed -e "s|@INSTANCE_NAME@|${instance_name}|g" \
247
		-e "s|@INSTANCE_USER@|${instance_user}|g" \
248
		-e "s|@INSTANCE_GROUP@|${instance_group}|g" \
249
		"${tomcat_home}"/gentoo/tomcat.conf \
250
		> "/@GENTOO_PORTAGE_EPREFIX@etc/conf.d/${instance_name}" || die
251
252
	# some symlinks for tomcat and netbeans #
253
254
	ln -s "${instance_conf}" "${instance_base}"/conf || die
255
	ln -s "${instance_temp}" "${instance_base}"/temp || die
256
257
	# a note to update the default configuration #
258
259
	cat <<-EOL
260
Successfully created instance '${instance_name}'
261
It's strongly recommended for production systems to go carefully through the
262
configuration files at '${instance_conf}'.
263
The generated initial configuration is close to upstreams default which
264
favours the demo aspect over hardening.
265
EOL
266
}
267
268
remove_instance() {
269
	echo "The following files will be removed permanently:"
270
	local target; for target in "${all_targets[@]}"; do
271
		find ${target}
272
	done
273
274
	echo "Type 'yes' to continue"
275
	read
276
	if [[ ${REPLY} == yes ]]; then
277
		rm -rv "${all_targets[@]}"
278
	else 
279
		echo "Aborting as requested ..."
280
	fi
281
}
282
283
parse_argv "$@"
284
285
if [[ ${action} == create ]]; then
286
	deploy_instance
287
elif [[ ${action} == remove ]]; then
288
	remove_instance
289
elif [[ ${action} == "not specified" ]]; then
290
	echo "No action specified!"
291
	usage
292
	exit 1
293
else
294
	echo "${action} not yet implemented!"
295
	usage
296
	exit 1
297
fi
(-)tomcat/files/tomcat.start (+132 lines)
Line 0 Link Here
1
#!@GENTOO_PORTAGE_EPREFIX@/bin/bash
2
# Author: Jens Koegler <j.koegler@web.de>
3
# based on the original init.d script
4
# set debugging on
5
# set -x
6
die() {
7
  usage
8
  exit 1
9
}
10
11
usage() {
12
  cat <<EOL
13
Usage: ${BASH_SOURCE} [start|stop] <instance-name>
14
Usage: NAME=<instance> ${BASH_SOURCE} [start|stop]
15
Instance-name can be the environment variable NAME
16
EOL
17
}
18
19
if ([[ $# -gt 2 ]] || [[ $# -eq 0 ]]); then
20
  die
21
fi
22
23
RUN=$1
24
TOMCAT=`basename ${BASH_SOURCE}`
25
if [ $# -eq 2 ]; then
26
  printf -v INSTANCE "%s-%s" "$TOMCAT" "$2"
27
else
28
  if [[ -z ${NAME} ]]; then
29
    die
30
  else
31
    printf -v INSTANCE "%s-%s" "$TOMCAT" "$NAME"
32
  fi
33
fi
34
35
if [[ -f @GENTOO_PORTAGE_EPREFIX@/etc/conf.d/${INSTANCE} ]]; then
36
  source @GENTOO_PORTAGE_EPREFIX@/etc/conf.d/${INSTANCE}
37
else
38
  echo "The configuration file in /etc/conf.d does not exist"
39
  die
40
fi
41
42
: ${CATALINA_HOME:=@GENTOO_PORTAGE_EPREFIX@/usr/share/${TOMCAT}}
43
: ${CATALINA_BASE:=@GENTOO_PORTAGE_EPREFIX@/var/lib/${INSTANCE}}
44
: ${CATALINA_TMPDIR:=@GENTOO_PORTAGE_EPREFIX@/var/tmp/${INSTANCE}}
45
46
: ${TOMCAT_START:=start}
47
48
: ${JPDA_TRANSPORT:="dt_socket"}
49
: ${JPDA_ADDRESS:="8000"}
50
: ${JPDA_OPTS="-Xdebug -Xrunjdwp:transport=${JPDA_TRANSPORT},address=${JPDA_ADDRESS},server=y,suspend=n"}
51
52
if [ ! -e "${CATALINA_TMPDIR}" ]; then
53
  echo "CATALINA_TMPDIR does not exist. Unable to start tomcat."
54
	echo "Please see /@GENTOO_PORTAGE_EPREFIX@/etc/conf.d/${INSTANCE} for more information."
55
	die
56
fi
57
58
export JAVA_HOME=`java-config ${TOMCAT_JVM:+--select-vm ${TOMCAT_JVM}} --jre-home`
59
export CLASSPATH="${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar"
60
61
start() {
62
63
	if [ ! -e "${CATALINA_TMPDIR}" ]; then
64
		echo "CATALINA_TMPDIR does not exist. Unable to start tomcat."
65
		echo "Please see /etc/conf.d/${INSTANCE} for more information."
66
		die
67
	fi
68
69
	local DEPEND=$(java-config --query DEPEND --package tomcat-@SLOT@):${TOMCAT_EXTRA_JARS}
70
	DEPEND=${DEPEND%:}
71
72
	local GCLASSPATH=$(java-config --with-dependencies --classpath "${DEPEND//:/,}"):${TOMCAT_EXTRA_CLASSPATH}
73
	GCLASSPATH=${GCLASSPATH%:}
74
75
	local cmd=java args=
76
	if [ "${TOMCAT_START}" = "debug" ] || [ "${TOMCAT_START}" = "-security debug" ] ; then
77
		cmd=jdb
78
		args="${args} -sourcepath ${CATALINA_HOME}/../../jakarta-tomcat-catalina/catalina/src/share"
79
	fi
80
	if [ "${TOMCAT_START}" = "-security debug" ] || [ "${TOMCAT_START}" = "-security start" ]; then
81
		args="${args} -Djava.security.manager"
82
		args="${args} -Djava.security.policy=${CATALINA_BASE}/conf/catalina.policy"
83
	fi
84
	if [ "${TOMCAT_START}" = "jpda start" ] ; then
85
		args="${args} ${JPDA_OPTS}"
86
	fi
87
	if [ -r "${CATALINA_HOME}"/bin/tomcat-juli.jar ]; then
88
		args="${args} -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \
89
		-Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties"
90
	fi
91
92
	${JAVA_HOME}/bin/${cmd} \
93
		${JAVA_OPTS} \
94
		${args} \
95
		'-XX:OnOutOfMemoryError=kill -9 %%p' \
96
		-Dcatalina.base="${CATALINA_BASE}" \
97
		-Dcatalina.home="${CATALINA_HOME}" \
98
		-Djava.io.tmpdir="${CATALINA_TMPDIR}" \
99
		-Dgentoo.classpath="${GCLASSPATH//:/,}" \
100
		-classpath "${CLASSPATH}" \
101
		org.apache.catalina.startup.Bootstrap \
102
		${CATALINA_OPTS} \
103
		${TOMCAT_START}
104
105
}
106
107
stop() {
108
109
	${JAVA_HOME}/bin/java \
110
		${JAVA_OPTS} \
111
		${args} \
112
		-Dcatalina.base="${CATALINA_BASE}" \
113
		-Dcatalina.home="${CATALINA_HOME}" \
114
		-Djava.io.tmpdir="${CATALINA_TMPDIR}" \
115
		-Dgentoo.classpath="${GCLASSPATH//:/,}" \
116
		-classpath "${CLASSPATH}" \
117
		org.apache.catalina.startup.Bootstrap stop
118
    
119
}
120
121
case "${RUN}" in
122
  start)
123
    start
124
    ;;
125
  stop)
126
    stop
127
    ;;
128
  *)
129
    die
130
    ;;
131
esac
132
(-)tomcat/files/tomcat.systemd (+19 lines)
Line 0 Link Here
1
[Unit]
2
Description=Apache Tomcat Web Application Container
3
After=network.target
4
5
[Service]
6
Type=simple
7
EnvironmentFile=/etc/conf.d/tomcat-@SLOT@-%i
8
Environment="NAME=%i"
9
Environment=SHELL=/bin/bash
10
ExecStart=/usr/bin/tomcat-@SLOT@ start
11
ExecStop=/usr/bin/tomcat-@SLOT@ stop
12
SuccessExitStatus=143
13
User=tomcat
14
Group=tomcat
15
TimeoutStopSec=90
16
Restart=always
17
18
[Install]
19
WantedBy=multi-user.target
(-)tomcat/tomcat-7.0.67.ebuild (-5 / +8 lines)
Lines 6-12 Link Here
6
6
7
JAVA_PKG_IUSE="doc source test"
7
JAVA_PKG_IUSE="doc source test"
8
8
9
inherit eutils java-pkg-2 java-ant-2 prefix user
9
inherit eutils java-pkg-2 java-ant-2 prefix user systemd
10
10
11
MY_P="apache-${P}-src"
11
MY_P="apache-${P}-src"
12
12
Lines 67-73 Link Here
67
EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false"
67
EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false"
68
68
69
# revisions of the scripts
69
# revisions of the scripts
70
IM_REV="-r1"
70
IM_REV="-r3"
71
INIT_REV="-r1"
71
INIT_REV="-r1"
72
72
73
src_compile() {
73
src_compile() {
Lines 120-134 Link Here
120
120
121
	### rc ###
121
	### rc ###
122
122
123
	cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die
123
	cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash,.systemd,.start} "${T}" || die
124
	eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash}
124
	eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash,.start}
125
	sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die
125
	sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash,.systemd,.start} || die
126
126
127
	insinto "${dest}"/gentoo
127
	insinto "${dest}"/gentoo
128
	doins "${T}"/tomcat.conf
128
	doins "${T}"/tomcat.conf
129
	exeinto "${dest}"/gentoo
129
	exeinto "${dest}"/gentoo
130
	newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
130
	newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
131
	newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
131
	newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
132
	systemd_newunit "${T}"/tomcat.systemd "tomcat-${SLOT}@.service"
133
	exeinto "/usr/bin"
134
	newexe "${T}"/tomcat.start tomcat-${SLOT}
132
}
135
}
133
136
134
pkg_postinst() {
137
pkg_postinst() {
(-)tomcat/tomcat-7.0.68-r1.ebuild (-5 / +8 lines)
Lines 6-12 Link Here
6
6
7
JAVA_PKG_IUSE="doc source test"
7
JAVA_PKG_IUSE="doc source test"
8
8
9
inherit eutils java-pkg-2 java-ant-2 prefix user
9
inherit eutils java-pkg-2 java-ant-2 prefix user systemd
10
10
11
MY_P="apache-${P}-src"
11
MY_P="apache-${P}-src"
12
12
Lines 66-72 Link Here
66
EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false"
66
EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false"
67
67
68
# revisions of the scripts
68
# revisions of the scripts
69
IM_REV="-r1"
69
IM_REV="-r3"
70
INIT_REV="-r1"
70
INIT_REV="-r1"
71
71
72
src_compile() {
72
src_compile() {
Lines 119-133 Link Here
119
119
120
	### rc ###
120
	### rc ###
121
121
122
	cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die
122
	cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash,.systemd,.start} "${T}" || die
123
	eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash}
123
	eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash,.start}
124
	sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die
124
	sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash,.systemd,.start} || die
125
125
126
	insinto "${dest}"/gentoo
126
	insinto "${dest}"/gentoo
127
	doins "${T}"/tomcat.conf
127
	doins "${T}"/tomcat.conf
128
	exeinto "${dest}"/gentoo
128
	exeinto "${dest}"/gentoo
129
	newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
129
	newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
130
	newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
130
	newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
131
	systemd_newunit "${T}"/tomcat.systemd "tomcat-${SLOT}@.service"
132
	exeinto "/usr/bin"
133
	newexe "${T}"/tomcat.start tomcat-${SLOT}
131
}
134
}
132
135
133
pkg_postinst() {
136
pkg_postinst() {
(-)tomcat/tomcat-8.0.32-r1.ebuild (-5 / +8 lines)
Lines 6-12 Link Here
6
6
7
JAVA_PKG_IUSE="doc source test"
7
JAVA_PKG_IUSE="doc source test"
8
8
9
inherit eutils java-pkg-2 java-ant-2 prefix user
9
inherit eutils java-pkg-2 java-ant-2 prefix user systemd
10
10
11
MY_P="apache-${P}-src"
11
MY_P="apache-${P}-src"
12
12
Lines 69-75 Link Here
69
EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false"
69
EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false"
70
70
71
# revisions of the scripts
71
# revisions of the scripts
72
IM_REV="-r2"
72
IM_REV="-r3"
73
INIT_REV="-r1"
73
INIT_REV="-r1"
74
74
75
src_compile() {
75
src_compile() {
Lines 128-142 Link Here
128
128
129
	### rc ###
129
	### rc ###
130
130
131
	cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die
131
	cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash,.systemd,.start} "${T}" || die
132
	eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash}
132
	eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash,.start}
133
	sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die
133
	sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash,.systemd,.start} || die
134
134
135
	insinto "${dest}"/gentoo
135
	insinto "${dest}"/gentoo
136
	doins "${T}"/tomcat.conf
136
	doins "${T}"/tomcat.conf
137
	exeinto "${dest}"/gentoo
137
	exeinto "${dest}"/gentoo
138
	newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
138
	newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
139
	newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
139
	newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
140
	systemd_newunit "${T}"/tomcat.systemd "tomcat-${SLOT}@.service"
141
	exeinto "/usr/bin"
142
	newexe "${T}"/tomcat.start tomcat-${SLOT}
140
}
143
}
141
144
142
pkg_postinst() {
145
pkg_postinst() {
(-)tomcat/tomcat-8.0.33.ebuild (-4 / +7 lines)
Lines 6-12 Link Here
6
6
7
JAVA_PKG_IUSE="doc source test"
7
JAVA_PKG_IUSE="doc source test"
8
8
9
inherit eutils java-pkg-2 java-ant-2 prefix user
9
inherit eutils java-pkg-2 java-ant-2 prefix user systemd
10
10
11
MY_P="apache-${P}-src"
11
MY_P="apache-${P}-src"
12
12
Lines 128-142 Link Here
128
128
129
	### rc ###
129
	### rc ###
130
130
131
	cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die
131
	cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash,.systemd,.start} "${T}" || die
132
	eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash}
132
	eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash,.start}
133
	sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die
133
	sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash,.systemd,.start} || die
134
134
135
	insinto "${dest}"/gentoo
135
	insinto "${dest}"/gentoo
136
	doins "${T}"/tomcat.conf
136
	doins "${T}"/tomcat.conf
137
	exeinto "${dest}"/gentoo
137
	exeinto "${dest}"/gentoo
138
	newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
138
	newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
139
	newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
139
	newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
140
	systemd_newunit "${T}"/tomcat.systemd "tomcat-${SLOT}@.service"
141
	exeinto "/usr/bin"
142
	newexe "${T}"/tomcat.start tomcat-${SLOT}
140
}
143
}
141
144
142
pkg_postinst() {
145
pkg_postinst() {
(-)tomcat/tomcat-9.0.0_alpha4.ebuild (-5 / +8 lines)
Lines 6-12 Link Here
6
6
7
JAVA_PKG_IUSE="doc source test"
7
JAVA_PKG_IUSE="doc source test"
8
8
9
inherit eutils java-pkg-2 java-ant-2 prefix user
9
inherit eutils java-pkg-2 java-ant-2 prefix user systemd
10
10
11
MY_PV="${PV/_alpha/.M}"
11
MY_PV="${PV/_alpha/.M}"
12
MY_P="apache-${PN}-${MY_PV}-src"
12
MY_P="apache-${PN}-${MY_PV}-src"
Lines 70-76 Link Here
70
EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false"
70
EANT_EXTRA_ARGS="-Dversion=${PV}-gentoo -Dversion.number=${PV} -Dcompile.debug=false"
71
71
72
# revisions of the scripts
72
# revisions of the scripts
73
IM_REV="-r2"
73
IM_REV="-r3"
74
INIT_REV="-r1"
74
INIT_REV="-r1"
75
75
76
src_compile() {
76
src_compile() {
Lines 129-143 Link Here
129
129
130
	### rc ###
130
	### rc ###
131
131
132
	cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} "${T}" || die
132
	cp "${FILESDIR}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash,.systemd,.start} "${T}" || die
133
	eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash}
133
	eprefixify "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash,.start}
134
	sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash} || die
134
	sed -i -e "s|@SLOT@|${SLOT}|g" "${T}"/tomcat{.conf,${INIT_REV}.init,-instance-manager${IM_REV}.bash,.systemd,.start} || die
135
135
136
	insinto "${dest}"/gentoo
136
	insinto "${dest}"/gentoo
137
	doins "${T}"/tomcat.conf
137
	doins "${T}"/tomcat.conf
138
	exeinto "${dest}"/gentoo
138
	exeinto "${dest}"/gentoo
139
	newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
139
	newexe "${T}"/tomcat${INIT_REV}.init tomcat.init
140
	newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
140
	newexe "${T}"/tomcat-instance-manager${IM_REV}.bash tomcat-instance-manager.bash
141
	systemd_newunit "${T}"/tomcat.systemd "tomcat-${SLOT}@.service"
142
	exeinto "/usr/bin"
143
	newexe "${T}"/tomcat.start tomcat-${SLOT}
141
}
144
}
142
145
143
pkg_postinst() {
146
pkg_postinst() {

Return to bug 485000