PREIN
/bin/sh
# Add the "tomcat" user and group
# we need a shell to be able to use su - later
/usr/sbin/groupadd -g 91 -r tomcat 2> /dev/null || :
/usr/sbin/useradd -c "Tomcat" -u 91 -g tomcat \
-s /bin/sh -r -d /usr/share/tomcat5 tomcat 2> /dev/null || :
PREUN
/bin/sh
# Always clean up workdir and tempdir on upgrade/removal
rm -fr /var/cache/tomcat5/work/* /var/cache/tomcat5/temp/*
if [ $1 = 0 ]; then
[ -f /var/lock/subsys/tomcat5 ] && /etc/rc.d/init.d/tomcat5 stop
[ -f /etc/rc.d/init.d/tomcat5 ] && /sbin/chkconfig --del tomcat5
# Remove automated symlinks
for repository in /var/lib/tomcat5/common/endorsed ; do
find $repository -name '\[*\]*.jar' -not -type d | xargs rm -f
done
fi
POSTIN
/bin/sh
# install tomcat5 (but don't activate)
/sbin/chkconfig --add tomcat5
# Create automated links - since all needed extensions may not have been
# installed for this jvm output is muted
# Try to set a sensible jvm
unset JAVA_HOME
[ -r /etc/tomcat5/tomcat5.conf ] && . /etc/tomcat5/tomcat5.conf
[ -z "$JAVA_HOME" ] && [ -r /etc/java/java.conf ] && \
. /etc/java/java.conf
[ -z "$JAVA_HOME" ] && JAVA_HOME=/usr/lib/jvm/java
# Remove old automated symlinks
for repository in /var/lib/tomcat5/common/endorsed ; do
find $repository -name '\[*\]*.jar' -not -type d | xargs rm -f
done
build-jar-repository /var/lib/tomcat5/common/endorsed jaxp_parser_impl \
xml-commons-apis 2>&1
build-jar-repository /usr/share/tomcat5/bin mx4j/mx4j 2>&1
/usr/bin/rebuild-gcj-db
POSTUN
/bin/sh
/usr/bin/rebuild-gcj-db