head	1.6;
access;
symbols
	old_RELEASE_6_0_0:1.5
	old_RELEASE_5_4_0:1.5
	old_RELEASE_4_11_0:1.5
	old_RELEASE_5_3_0:1.5
	old_RELEASE_4_10_0:1.5
	old_RELEASE_5_2_1:1.4
	old_RELEASE_5_2_0:1.4
	old_RELEASE_4_9_0:1.4
	old_RELEASE_5_1_0:1.4
	old_RELEASE_4_8_0:1.4
	old_RELEASE_5_0_0:1.4
	old_RELEASE_4_7_0:1.4
	old_old_RELEASE_4_6_2:1.4
	old_old_RELEASE_4_6_1:1.4
	old_old_RELEASE_4_6_0:1.4
	old_old_old_RELEASE_5_0_DP1:1.4;
locks; strict;
comment	@# @;


1.6
date	2006.02.07.08.50.08;	author lawrance;	state dead;
branches;
next	1.5;

1.5
date	2004.01.02.12.31.10;	author znerd;	state Exp;
branches;
next	1.4;

1.4
date	2002.04.01.22.01.22;	author znerd;	state Exp;
branches;
next	1.3;

1.3
date	2002.03.30.18.42.23;	author znerd;	state Exp;
branches;
next	1.2;

1.2
date	2002.02.21.20.06.55;	author znerd;	state Exp;
branches;
next	1.1;

1.1
date	2002.02.04.13.40.56;	author znerd;	state Exp;
branches;
next	;


desc
@@


1.6
log
@Clean up Tomcat 4, 4.1, 5, and 5.5 ports.

These changes apply to all ports, unless mentioned otherwise:

- Move jakarta-tomcat55 to tomcat55 (it is no longer a Jakarta project). [6]
- Improve the tomcat55 rc script.  Fix PID handling.  Improve the
  shutdown process.  Use USE_RC_SUBR to its full potential. [2]
- Backport tomcat55 rc script to the other tomcat ports.  This allows
  us to pass command line arguments to the JVM.  Noted in UPDATING.
  [1], [3], [4]
- Change ownership of installed files.  All files are now installed
  with default uid/gid (root:wheel) except for those in the conf/, logs/,
  temp/ and work/ directories. [5]
- No longer install tomcatXXctl binary.  rc scripts are more flexible
  and can be reconfigured without recompiling.
- Remove AUTO_START and STOP_TIMEOUT (replaced with rc tomcatXX_stop_timeout).
- Remove a long list of sed expressions in favour of SUB_LIST.
- Move pkg_{,de}install to files/pkg_{,de}install.in.  Add them to
  SUB_FILES.  Tidy up substitutions and remove hardcoded values.
- Some nonfunctional tidying and removal of Makefile cruft.

PR:		ports/38018 [1], ports/38020 [2], ports/74344 [3],
		ports/75143 [4], ports/83434 [5], ports/92692 [6]
Submitted by:	Ari Suutari <ari.suutari@@syncrontech.com> [1] [2],
		SimpleRezo Team <freebsd@@simplerezo.com> [3],
		Anton Yudin <toha@@toha.org.ua> [4],
		Jan Grant <jan.grant@@bristol.ac.uk> [5],
		lawrance [6]
Approved by:	Kang Liu <liukang@@cn.freebsd.org> (maintainer) [6]
		Maintainer timeouts on [1], [2], [3], [4], [5]
Big thanks to:	hq for the initial tomcat55 script
		jasonb on FreeNode #tomcat for packaging advice
@
text
@#!/bin/sh
#
# This script does the following.
#
# * Checks if the PID file exists. If it does, it kills the
#   process and removes the PID file.
#
# * Checks if the 'www' user exists. If it does, then it displays
#   a message.
#
# $FreeBSD: ports/www/jakarta-tomcat41/pkg-deinstall,v 1.5 2004/01/02 12:31:10 znerd Exp $
#

# Make sure we're in the right stage of the process
if [ "$2" = "DEINSTALL" ]; then

	# Kill the process if it is still running
	PID_FILE=/var/run/tomcat41.pid
	if [ -s ${PID_FILE} ]; then
		PID=`cat ${PID_FILE}`
		echo -n ">> Killing Jakarta Tomcat process (${PID})..."
		/bin/kill ${PID} > /dev/null 2> /dev/null
		if [ $? -eq 0 ]; then
			echo " [ DONE ]"
		else
			echo " [ FAILED ]"
		fi
		echo -n ">> Removing PID file (${PID_FILE})..."
		rm ${PID_FILE} > /dev/null 2> /dev/null
		if [ $? -eq 0 ]; then
			echo " [ DONE ]"
		else
			echo " [ FAILED ]"
		fi
	fi
fi

if [ "$2" = "POST-DEINSTALL" ]; then
	# If the user exists, then display a message
	if pw usershow "www" 2>/dev/null 1>&2; then
		echo "To delete the www user permanently, use 'pw userdel www'"
	fi
fi

exit 0
@


1.5
log
@Fixed name of PID file in pkg-deinstall.
Bumped PORTREVISION.

PR:		60781
Submitted by:	Kang Liu <liukang@@bjpu.edu.cn>
@
text
@d11 1
a11 1
# $FreeBSD: ports/www/jakarta-tomcat41/pkg-deinstall,v 1.4 2002/04/01 22:01:22 znerd Exp $
@


1.4
log
@Upgrade to Jakarta Tomcat 4.0.3. The Jakarta Tomcat 3
branch has moved to www/jakarta-tomcat3.

PR:	31096, 32022
@
text
@d11 1
a11 1
# $FreeBSD$
d18 1
a18 1
	PID_FILE=/var/run/tomcat4.pid
@


1.3
log
@Stopping the server from pkg-deinstall. Applying
replacements to server.xml. Bumped PORTREVISION.
@
text
@d18 1
a18 1
	PID_FILE=/var/run/tomcat.pid
@


1.2
log
@Cleaned things up. Made things working :-) Both the startup script
in ${PREFIX}/etc/rc.d and the control script in ${PREFIX}/bin have
been refactored and now actually work very well.

Using the 'www' user and group, creating them if they don't exist.
I've used the same approach as www/apache13.

STDOUT_LOG and STDERR_LOG are now fixed (no ?= anymore) since the
package deinstall does not support a different location.

This fixes the first half of PR 28624.
See: http://www.freebsd.org/cgi/query-pr.cgi?pr=34931

Reported by:	Kees Jan Koster <k.j.koster@@kpn.com>
@
text
@d5 5
a9 2
# Checks if the 'www' user exists. If it does, then it displays
# a message.
d14 22
a35 3
# Make sure we're called during the 'make deinstall' process
if [ "$2" != "POST-DEINSTALL" ]; then
    exit 0
d38 5
a42 3
# If the user exists, then display a message
if pw usershow "www" 2>/dev/null 1>&2; then
	echo "To delete the www user permanently, use 'pw userdel www'"
@


1.1
log
@Run when deinstalling Tomcat. It will stop Tomcat, if it is running.
@
text
@d2 12
a13 6
PID_FILE=/var/run/jakarta-tomcat.pid
if [ -e ${PID_FILE} ]; then
	echo -n "Jakarta Tomcat is still running."
	/bin/kill `cat ${PID_FILE}`
	rm -f ${PID_FILE}
	echo " Stopped."
d15 7
@

