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 "Apache 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
/bin/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 /bin/rm -f
done
for repository in /var/lib/tomcat5/common/lib ; do
find $repository -name '\[*\]*.jar' -not -type d | xargs /bin/rm -f
done
for repository in /var/lib/tomcat5/server/lib ; do
find $repository -name '\[*\]*.jar' -not -type d | xargs /bin/rm -f
done
fi
POSTIN
/bin/sh
# install tomcat5 (but don't activate)
/sbin/chkconfig --add tomcat5
# Remove old automated symlinks
for repository in /var/lib/tomcat5/common/endorsed ; do
find $repository -name '\[*\]*.jar' -not -type d | xargs /bin/rm -f
done
for repository in /var/lib/tomcat5/common/lib ; do
find $repository -name '\[*\]*.jar' -not -type d | xargs /bin/rm -f
done
for repository in /var/lib/tomcat5/server/lib ; do
find $repository -name '\[*\]*.jar' -not -type d | xargs /bin/rm -f
done
# Create automated links - since all needed extensions may not have been
# installed for this jvm output is muted
build-jar-repository /var/lib/tomcat5/common/endorsed jaxp_parser_impl \
xml-commons-jaxp-1.3-apis 2>&1
build-jar-repository /var/lib/tomcat5/common/lib commons-collections-tomcat5 \
commons-dbcp-tomcat5 commons-el commons-pool-tomcat5 jaf javamail jsp \
tomcat5/naming-factory tomcat5/naming-resources servlet \
jasper5-compiler jasper5-runtime 2>&1
build-jar-repository /var/lib/tomcat5/common/lib ecj 2>&1
build-jar-repository /var/lib/tomcat5/server/lib catalina-ant5 commons-modeler \
tomcat5/catalina-ant-jmx tomcat5/catalina-cluster tomcat5/catalina \
tomcat5/catalina-optional tomcat5/catalina-storeconfig \
tomcat5/servlets-default tomcat5/servlets-invoker tomcat5/servlets-webdav \
tomcat5/tomcat-ajp tomcat5/tomcat-apr tomcat5/tomcat-coyote \
tomcat5/tomcat-http tomcat5/tomcat-jkstatus-ant tomcat5/tomcat-util 2>&1
if [ -x /usr/bin/rebuild-gcj-db ]; then /usr/bin/rebuild-gcj-db || true ; fi
POSTUN
/bin/sh
if [ -x /usr/bin/rebuild-gcj-db ]; then /usr/bin/rebuild-gcj-db || true ; fi