summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Brinkmann <luckyduck@gentoo.org>2005-02-13 19:52:06 +0000
committerJan Brinkmann <luckyduck@gentoo.org>2005-02-13 19:52:06 +0000
commit03f2a4e866c39f8b7ba522de0b1bb85ffd817a52 (patch)
tree059257d6b577a87f3ee0c9b94c1f5a2a28c491b9 /www-servers/tomcat
parentVersion bump thanks to Sander Knopper <sander@knopper.tk> in bug #79211 (diff)
downloadgentoo-2-03f2a4e866c39f8b7ba522de0b1bb85ffd817a52.tar.gz
gentoo-2-03f2a4e866c39f8b7ba522de0b1bb85ffd817a52.tar.bz2
gentoo-2-03f2a4e866c39f8b7ba522de0b1bb85ffd817a52.zip
tomcat now builds from source and installs jar files using dojar, also removed a packed jars issue. fixes #18352
(Portage version: 2.0.51.16)
Diffstat (limited to 'www-servers/tomcat')
-rw-r--r--www-servers/tomcat/ChangeLog9
-rw-r--r--www-servers/tomcat/files/5.0.28/build.xml-02.patch92
-rw-r--r--www-servers/tomcat/files/5.0.28/gentoo.diff4
-rw-r--r--www-servers/tomcat/files/5.0.28/scripts.patch12
-rw-r--r--www-servers/tomcat/files/5.0.28/tomcat.conf16
-rw-r--r--www-servers/tomcat/files/5.0.28/tomcat.env2
-rw-r--r--www-servers/tomcat/files/5.0.28/tomcat.init14
-rw-r--r--www-servers/tomcat/tomcat-5.0.28.ebuild202
8 files changed, 255 insertions, 96 deletions
diff --git a/www-servers/tomcat/ChangeLog b/www-servers/tomcat/ChangeLog
index aad414a7269e..9efcd2e2e867 100644
--- a/www-servers/tomcat/ChangeLog
+++ b/www-servers/tomcat/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for www-servers/tomcat
# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/ChangeLog,v 1.15 2005/02/09 18:21:17 luckyduck Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/ChangeLog,v 1.16 2005/02/13 19:52:06 luckyduck Exp $
+
+ 13 Feb 2005; Jan Brinkmann <luckyduck@gentoo.org>
+ files/5.0.28/build.xml-02.patch, files/5.0.28/gentoo.diff,
+ +files/5.0.28/scripts.patch, files/5.0.28/tomcat.conf,
+ files/5.0.28/tomcat.env, files/5.0.28/tomcat.init, tomcat-5.0.28.ebuild:
+ tomcat now builds from source and installs jar files using dojar, also removed
+ a packed jars issue. fixes #18352
09 Feb 2005; Jan Brinkmann <luckyduck@gentoo.org> +files/5.0.27/tomcat.env,
+files/5.0.28/tomcat.env, tomcat-5.0.27-r4.ebuild, tomcat-5.0.28.ebuild:
diff --git a/www-servers/tomcat/files/5.0.28/build.xml-02.patch b/www-servers/tomcat/files/5.0.28/build.xml-02.patch
index 6eaf757fbff9..60dd70513349 100644
--- a/www-servers/tomcat/files/5.0.28/build.xml-02.patch
+++ b/www-servers/tomcat/files/5.0.28/build.xml-02.patch
@@ -1,16 +1,77 @@
---- jakarta-tomcat-5/build.xml 2004-10-05 23:21:44.091181840 +1000
-+++ jakarta-tomcat-5/build.xml 2004-10-05 23:22:26.574723360 +1000
-@@ -1545,8 +1545,7 @@
- <!-- That is ugly XXX needs a review -->
- <copy file="LICENSE" tofile="../LICENSE"/>
- <copy file="LICENSE" tofile="${base.path}/LICENSE"/>
+--- ../jakarta-tomcat-5.0.28-src.orig/jakarta-tomcat-5/build.xml 2005-02-12 13:54:09.000000000 +0100
++++ jakarta-tomcat-5/build.xml 2005-02-13 00:29:52.167830424 +0100
+@@ -129,6 +129,7 @@
+
+ <!-- ====================== DEPLOY: Copy Static Files =================== -->
+ <target name="deploy-static" depends="init">
++ <!--
+ <copy file="${jsp-api.jar}" todir="${tomcat.build}/common/lib"/>
+ <copy file="${servlet-api.jar}" todir="${tomcat.build}/common/lib"/>
+
+@@ -147,7 +148,8 @@
+
+ <copy todir="${tomcat.build}/common/lib" file="${ant.jar}"/>
+ <copy todir="${tomcat.build}/common/lib" file="${ant-launcher.jar}"/>
+- </target>
++ -->
++</target>
+
+ <!-- ====================== Build all components =================== -->
+ <target name="build-servletapi" unless="servletapi.build.notrequired" description="Build servlet API">
+@@ -393,6 +395,7 @@
+ </classpath>
+ <include name="admin/**" />
+ </javac>
++
+ </target>
+
+ <target name="build-catalina" depends="init"
+@@ -439,9 +442,10 @@
+
+ <target name="build" depends="init"
+ description="Builds all components">
++ <!--
+ <copy file="${commons-digester.jar}" todir="${tomcat.build}/server/lib"/>
+ <copy file="${commons-collections.jar}" todir="${tomcat.build}/common/lib"/>
+-
++ -->
+ <antcall target="build-tomcatutil"/>
+ <antcall target="build-tomcatcoyote"/>
+ <antcall target="build-catalina"/>
+@@ -563,9 +567,10 @@
+ </ant>
+
+ <!-- Precompiling and fixing webapps -->
++ <!--
+ <antcall target="build-webapps-precompile" />
+ <antcall target="fix-webapps" />
-
-- <!-- Downdown any sub package or tools needed. -->
-+<!--
++ -->
+ </target>
+
+ <target name="fix-webapps" depends="init" >
+@@ -798,10 +803,10 @@
+ <!-- ====================== Compat target =================== -->
+
+ <target name="compat" description="Create compatibility binaries for JREs before 1.4" >
+-
++ <!--
+ <copy todir="${tomcat.compat}/common/endorsed" file="${xercesImpl.jar}"/>
+ <copy todir="${tomcat.compat}/common/endorsed" file="${xml-apis.jar}"/>
+-
++ -->
+ </target>
+
+ <!-- ====================== DEPLOY: Deploy Components =================== -->
+@@ -1547,6 +1552,7 @@
+ <copy file="LICENSE" tofile="${base.path}/LICENSE"/>
+
+ <!-- Downdown any sub package or tools needed. -->
++ <!--
<antcall target="downloadgz">
<param name="sourcefile" value="${commons-beanutils.loc}"/>
<param name="destfile" value="${commons-beanutils.jar}"/>
-@@ -1593,7 +1592,6 @@
+@@ -1593,7 +1599,6 @@
</antcall>
<antcall target="downloadgz">
@@ -18,12 +79,19 @@
<param name="sourcefile" value="${xerces.loc}"/>
<param name="destfile" value="${xml-apis.jar}"/>
</antcall>
-@@ -1655,7 +1653,7 @@
+@@ -1655,14 +1660,12 @@
<param name="sourcefile" value="${saxpath.loc}"/>
<param name="destfile" value="${saxpath.jar}"/>
</antcall>
-
-+-->
- <!-- Build the dependencies that are not yet released -->
+- <!-- Build the dependencies that are not yet released -->
++ -->
<antcall target="build-depends"/>
+ </target>
+
+ <target name="proxyflags">
+- <!-- check proxy parameters. -->
+ <condition property="useproxy">
+ <equals arg1="${proxy.use}" arg2="on" />
+ </condition>
diff --git a/www-servers/tomcat/files/5.0.28/gentoo.diff b/www-servers/tomcat/files/5.0.28/gentoo.diff
index 78e61fe7035c..82458fbfeb6b 100644
--- a/www-servers/tomcat/files/5.0.28/gentoo.diff
+++ b/www-servers/tomcat/files/5.0.28/gentoo.diff
@@ -1,12 +1,12 @@
--- jakarta-tomcat-catalina/catalina/src/bin/catalina.sh 2004-05-19 02:25:07.000000000 -0400
+++ jakarta-tomcat-catalina/catalina/src/bin/catalina.sh 2004-05-19 02:23:20.128089696 -0400
@@ -38,6 +38,10 @@
- # $Id: gentoo.diff,v 1.1 2004/10/09 09:59:14 axxo Exp $
+ # $Id: gentoo.diff,v 1.2 2005/02/13 19:52:06 luckyduck Exp $
# -----------------------------------------------------------------------------
+# source the appropriate files right away
+source /etc/profile
-+source /etc/conf.d/tomcat5
++source /etc/conf.d/tomcat-5
+
# OS specific support. $var _must_ be set to either true or false.
cygwin=false
diff --git a/www-servers/tomcat/files/5.0.28/scripts.patch b/www-servers/tomcat/files/5.0.28/scripts.patch
new file mode 100644
index 000000000000..a72f3b827ed8
--- /dev/null
+++ b/www-servers/tomcat/files/5.0.28/scripts.patch
@@ -0,0 +1,12 @@
+diff -uprN ../jakarta-tomcat-5.0.28-src.orig/jakarta-tomcat-catalina/catalina/src/bin/catalina.sh jakarta-tomcat-catalina/catalina/src/bin/catalina.sh
+--- ../jakarta-tomcat-5.0.28-src.orig/jakarta-tomcat-catalina/catalina/src/bin/catalina.sh 2005-02-12 13:54:09.755358496 +0100
++++ jakarta-tomcat-catalina/catalina/src/bin/catalina.sh 2005-02-12 18:47:07.925070512 +0100
+@@ -104,7 +104,7 @@ fi
+ if [ -n "$JSSE_HOME" ]; then
+ CLASSPATH="$CLASSPATH":"$JSSE_HOME"/lib/jcert.jar:"$JSSE_HOME"/lib/jnet.jar:"$JSSE_HOME"/lib/jsse.jar
+ fi
+-CLASSPATH="$CLASSPATH":"$CATALINA_HOME"/bin/bootstrap.jar:"$CATALINA_HOME"/bin/commons-logging-api.jar
++CLASSPATH="$CLASSPATH":"$CATALINA_HOME"/bin/bootstrap.jar:`java-config -p commons-logging`
+
+ if [ -z "$CATALINA_BASE" ] ; then
+ CATALINA_BASE="$CATALINA_HOME"
diff --git a/www-servers/tomcat/files/5.0.28/tomcat.conf b/www-servers/tomcat/files/5.0.28/tomcat.conf
index aa0cbb329a6a..8f12519215a2 100644
--- a/www-servers/tomcat/files/5.0.28/tomcat.conf
+++ b/www-servers/tomcat/files/5.0.28/tomcat.conf
@@ -1,4 +1,4 @@
-# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/files/5.0.28/tomcat.conf,v 1.1 2004/10/09 09:59:14 axxo Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/files/5.0.28/tomcat.conf,v 1.2 2005/02/13 19:52:06 luckyduck Exp $
# JVM Runtime
# Using the default setting, it will determine your JVM from the system-vm
@@ -14,25 +14,25 @@
# commands are executed.
# JAVA_OPTS=""
+# profile
+PROFILE=default
+
# Where your web applications are located
-CATALINA_HOME=/opt/tomcat5
-#CATALINA_BASE=${CATALINA_HOME}
+CATALINA_HOME=/usr/share/tomcat-5
+CATALINA_BASE=/var/lib/tomcat-5/${PROFILE}
# Tomcat's User
CATALINA_USER=tomcat
-# Tomcat Console Log Location
-CATALINA_OUT=/var/log/tomcat5/catalina.log
-
# Location of the Tomcat JARs and classes
-#CATALINA_LIBDIR=/usr/share/tomcat5/lib
+CATALINA_LIBDIR=/usr/share/tomcat-5/server/lib
# The CLASSPATH for Tomcat to use, plus any others you need.
#CLASSPATH=${CLASSPATH}:${CATALINA_LIBDIR}
# (Optional) Directory path location of temporary directory the JVM should
# use (java.io.tmpdir). Defaults to $CATALINA_BASE/temp.
-# CATALINA_TMPDIR="/your/path/here"
+CATALINA_TMPDIR="/var/tmp/tomcat-5/${PROFILE}"
# TOMCAT STARTUP/SHUTDOWN
# debug Start Catalina in a debugger
diff --git a/www-servers/tomcat/files/5.0.28/tomcat.env b/www-servers/tomcat/files/5.0.28/tomcat.env
index 7570b733c38c..78ff04318116 100644
--- a/www-servers/tomcat/files/5.0.28/tomcat.env
+++ b/www-servers/tomcat/files/5.0.28/tomcat.env
@@ -1 +1 @@
-CATALINA_HOME=/opt/tomcat5
+CATALINA_HOME=/usr/share/tomcat-5
diff --git a/www-servers/tomcat/files/5.0.28/tomcat.init b/www-servers/tomcat/files/5.0.28/tomcat.init
index fc99eecb80f8..729884331be0 100644
--- a/www-servers/tomcat/files/5.0.28/tomcat.init
+++ b/www-servers/tomcat/files/5.0.28/tomcat.init
@@ -1,7 +1,7 @@
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/files/5.0.28/tomcat.init,v 1.1 2004/10/09 09:59:14 axxo Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/files/5.0.28/tomcat.init,v 1.2 2005/02/13 19:52:06 luckyduck Exp $
depend() {
use dns logger mysql postgresql net
@@ -9,14 +9,18 @@ depend() {
start() {
ebegin "Starting Tomcat"
- start-stop-daemon --start --quiet --chuid tomcat:tomcat --exec ${CATALINA_HOME}/bin/catalina.sh -- ${TOMCAT_START}
- sleep 5
+ start-stop-daemon --start --quiet --chuid tomcat:tomcat \
+ --exec ${CATALINA_HOME}/bin/catalina.sh \
+ -- ${TOMCAT_START}
+ #sleep 5
eend $?
}
stop() {
ebegin "Stopping Tomcat"
- start-stop-daemon --start --quiet --chuid tomcat:tomcat --exec ${CATALINA_HOME}/bin/catalina.sh -- ${TOMCAT_STOP}
- sleep 5
+ start-stop-daemon --start --quiet --chuid tomcat:tomcat \
+ --exec ${CATALINA_HOME}/bin/catalina.sh \
+ -- ${TOMCAT_STOP}
+ #sleep 5
eend $?
}
diff --git a/www-servers/tomcat/tomcat-5.0.28.ebuild b/www-servers/tomcat/tomcat-5.0.28.ebuild
index e02f8b36b790..e4966d60c3c9 100644
--- a/www-servers/tomcat/tomcat-5.0.28.ebuild
+++ b/www-servers/tomcat/tomcat-5.0.28.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/tomcat-5.0.28.ebuild,v 1.7 2005/02/09 18:21:17 luckyduck Exp $
+# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/tomcat-5.0.28.ebuild,v 1.8 2005/02/13 19:52:06 luckyduck Exp $
inherit eutils java-pkg
@@ -13,7 +13,7 @@ KEYWORDS="~x86 ~ppc64 ~amd64"
LICENSE="Apache-2.0"
DEPEND="sys-apps/sed
>=virtual/jdk-1.4
- jikes? ( dev-java/jikes )"
+ ${RDEPEND}"
RDEPEND=">=virtual/jdk-1.4
>=dev-java/commons-beanutils-1.7.0
>=dev-java/commons-collections-3.1
@@ -32,7 +32,8 @@ RDEPEND=">=virtual/jdk-1.4
dev-java/jmx
>=dev-java/log4j-1.2.8
>=dev-java/regexp-1.3
- =dev-java/struts-1.1-r2
+ ~dev-java/servletapi-2.4
+ =dev-java/struts-1.1*
>=dev-java/saxpath-1.0
>=dev-java/xerces-2.6.2-r1
jikes? ( dev-java/jikes )"
@@ -40,32 +41,46 @@ IUSE="doc jikes"
S=${WORKDIR}/jakarta-${P}-src
-TOMCAT_HOME="/opt/${PN}${SLOT}"
-TOMCAT_NAME="${PN}${SLOT}"
+TOMCAT_HOME="/usr/share/${PN}-${SLOT}"
+TOMCAT_NAME="${PN}-${SLOT}"
src_unpack() {
unpack ${A}
- mkdir ${T}/lib
- cd ${T}/lib
- java-pkg_jar-from commons-logging
- java-pkg_jar-from xerces-2
- java-pkg_jar-from struts
- java-pkg_jar-from saxpath
- java-pkg_jar-from jaxen
- java-pkg_jar-from jmx
- java-pkg_jar-from commons-beanutils
- java-pkg_jar-from servletapi-2.4
-
cd ${S}
-
- # update the build.xml to remove downloading
epatch ${FILESDIR}/${PV}/build.xml-01.patch
epatch ${FILESDIR}/${PV}/build.xml-02.patch
-
epatch ${FILESDIR}/${PV}/gentoo.diff
- #epatch ${FILESDIR}/${PV}/jikes.diff
+ epatch ${FILESDIR}/${PV}/scripts.patch
+ use jikes && epatch ${FILESDIR}/${PV}/jikes.diff
+
+ # avoid packed jars :-)
+ mkdir -p ${S}/jakarta-tomcat-5/build/common
+ cd ${S}/jakarta-tomcat-5/build
+
+ mkdir ./bin && cd ./bin
+ java-pkg_jar-from commons-logging commons-logging-api.jar
+ java-pkg_jar-from jmx jmxri.jar jmx.jar
+ java-pkg_jar-from commons-daemon
+
+ mkdir ../common/endorsed && cd ../common/endorsed
+ java-pkg_jar-from xerces-2 xml-apis.jar
+ java-pkg_jar-from xerces-2 xercesImpl.jar
+
+ mkdir ../lib && cd ../lib
+ java-pkg_jar-from ant-core
+ java-pkg_jar-from commons-collections
+ java-pkg_jar-from commons-dbcp
+ java-pkg_jar-from commons-el
+ java-pkg_jar-from commons-pool
+ java-pkg_jar-from servletapi-2.4
+ mkdir -p ../../server/lib && cd ../../server/lib
+ java-pkg_jar-from commons-beanutils commons-beanutils.jar
+ java-pkg_jar-from commons-digester
+ java-pkg_jar-from commons-fileupload
+ java-pkg_jar-from commons-modeler
+ java-pkg_jar-from regexp
}
src_compile(){
@@ -85,23 +100,18 @@ src_compile(){
antflags="${antflags} -Djunit.jar=$(java-config -p junit)"
antflags="${antflags} -Dlog4j.jar=$(java-config -p log4j)"
antflags="${antflags} -Dregexp.jar=$(java-config -p regexp)"
-
- antflags="${antflags} -Dstruts.jar=${T}/lib/struts.jar"
- antflags="${antflags} -Dcommons-beanutils.jar=${T}/lib/commons-beanutils.jar"
- antflags="${antflags} -Dcommons-logging.jar=${T}/lib/commons-logging.jar"
- antflags="${antflags} -Dcommons-logging-api.jar=${T}/lib/commons-logging-api.jar"
- antflags="${antflags} -Djaxen.jar=${T}/lib/jaxen-full.jar"
- antflags="${antflags} -Djmx.jar=${T}/lib/jmxri.jar"
- antflags="${antflags} -Djmx-tools.jar=${T}/lib/jmxtools.jar"
- antflags="${antflags} -Djsp-api.jar=${T}/lib/jsp-api.jar"
- antflags="${antflags} -Dsaxpath.jar=${T}/lib/saxpath.jar"
- antflags="${antflags} -Dservlet-api.jar=${T}/lib/servlet-api.jar"
- antflags="${antflags} -Dstruts.jar=${T}/lib/struts.jar"
- antflags="${antflags} -DxercesImpl.jar=${T}/lib/xercesImpl.jar"
- antflags="${antflags} -Dxml-apis.jar=${T}/lib/xml-apis.jar"
+ antflags="${antflags} -Dstruts.jar=$(java-pkg_getjar struts struts.jar)"
+ antflags="${antflags} -Dcommons-beanutils.jar=$(java-pkg_getjar commons-beanutils commons-beanutils.jar)"
+ antflags="${antflags} -Dcommons-logging.jar=$(java-pkg_getjar commons-logging commons-logging.jar)"
+ antflags="${antflags} -Dcommons-logging-api.jar=$(java-pkg_getjar commons-logging commons-logging-api.jar)"
+ antflags="${antflags} -Djaxen.jar=$(java-pkg_getjar jaxen jaxen-full.jar)"
+ antflags="${antflags} -Djmx.jar=$(java-pkg_getjar jmx jmxri.jar)"
+ antflags="${antflags} -Djmx-tools.jar=$(java-pkg_getjar jmx jmxtools.jar)"
+ antflags="${antflags} -Dsaxpath.jar=$(java-pkg_getjar saxpath saxpath.jar)"
+ antflags="${antflags} -DxercesImpl.jar=$(java-pkg_getjar xerces-2 xercesImpl.jar)"
+ antflags="${antflags} -Dxml-apis.jar=$(java-pkg_getjar xerces-2 xml-apis.jar)"
antflags="${antflags} -Dstruts.home=/usr/share/struts"
- antflags="${antflags} -Dlog4j.home=/usr/share/log4j"
ant ${antflags} || die "compile failed"
@@ -110,36 +120,80 @@ src_install() {
cd ${S}/jakarta-tomcat-5/build
# init.d, env.d, conf.d
- insinto /etc/init.d
- insopts -m0750
- newins ${FILESDIR}/${PV}/${PN}.init ${TOMCAT_NAME}
-
- insinto /etc/env.d/
- newins ${FILESDIR}/${PV}/${PN}.env 21${PN}
+ newinitd ${FILESDIR}/${PV}/tomcat.init ${TOMCAT_NAME}
+ newconfd ${FILESDIR}/${PV}/tomcat.conf ${TOMCAT_NAME}
+ newenvd ${FILESDIR}/${PV}/${PN}.env 21${PN}
- insinto /etc/conf.d
- insopts -m0644
- newins ${FILESDIR}/${PV}/${PN}.conf ${TOMCAT_NAME}
- use jikes && sed -e "\cCATALINA_OPTScaCATALINA_OPTS=\"-Dbuild.compiler.emacs=true\"" -i ${D}/etc/conf.d/${TOMCAT_NAME}
+ if use jikes; then
+ sed -e "\cCATALINA_OPTScaCATALINA_OPTS=\"-Dbuild.compiler.emacs=true\"" \
+ -i ${D}/etc/conf.d/${TOMCAT_NAME}
+ fi
+ # create dir structure
diropts -m750
- dodir ${TOMCAT_HOME} /var/log/${TOMCAT_NAME} /etc/${TOMCAT_NAME}
- keepdir /var/log/${TOMCAT_NAME}
-
- mv conf/* ${D}/etc/${TOMCAT_NAME} || die "failed to move conf"
- mv bin common server shared temp work ${D}${TOMCAT_HOME} || die "failed to move"
- keepdir ${TOMCAT_HOME}/{work,temp}
-
- if ! use doc; then
- rm -rf webapps/{tomcat-docs,jsp-examples,servlets-examples}
+ dodir /usr/share/${TOMCAT_NAME}
+
+ dodir /var/log/${TOMCAT_NAME}/default
+ dodir /etc/${TOMCAT_NAME}/default/
+ dodir /var/tmp/${TOMCAT_NAME}/default
+ dodir /var/run/${TOMCAT_NAME}/default
+ dodir /var/lib/${TOMCAT_NAME}/default
+
+ keepdir /var/log/${TOMCAT_NAME}/default
+ keepdir /etc/${TOMCAT_NAME}/default/
+ keepdir /var/tmp/${TOMCAT_NAME}/default
+ keepdir /var/run/${TOMCAT_NAME}/default
+
+ # we don't need dos scripts
+ rm -f bin/*.bat
+
+ # copy the manager and admin context's to the right position
+ mkdir -p conf/Catalina/localhost
+ cp ${S}/jakarta-tomcat-catalina/webapps/admin/admin.xml \
+ conf/Catalina/localhost
+ cp ${S}/jakarta-tomcat-catalina/webapps/manager/manager.xml \
+ conf/Catalina/localhost
+
+ # make the jars available via java-config -p and jar-from, etc
+ base=`pwd`
+ libdirs="common/lib server/lib"
+ for dir in ${libdirs}
+ do
+ cd ${dir}
+
+ for jar in $(ls *.jar);
+ do
+ # replace the file with a symlink
+ if [ ! -L ${jar} ]; then
+ java-pkg_dojar ${jar}
+ rm -f ${jar}
+ ln -s ${DESTTREE}/share/${PN}-${SLOT}/lib/${jar} ${jar}
+ fi
+ done
+
+ cd ${base}
+ done
+
+ # copy over the directories
+ cp -ra conf/* ${D}/etc/${TOMCAT_NAME}/default || die "failed to copy conf"
+ cp -ra bin common server shared ${D}/usr/share/${TOMCAT_NAME} || die "failed to copy"
+
+ # if the useflag is set, copy over the examples
+ if use doc; then
+ dodir /var/lib/${TOMCAT_NAME}/default/webapps
+ cp ../RELEASE-NOTES webapps/ROOT/RELEASE-NOTES.txt
+ cp -r webapps/{tomcat-docs,jsp-examples,servlets-examples,ROOT,webdav} \
+ ${D}/var/lib/${TOMCAT_NAME}/default/webapps
fi
- mv webapps ${D}${TOMCAT_HOME}
-
- dosym /etc/${TOMCAT_NAME} ${TOMCAT_HOME}/conf
- dosym /var/log/${TOMCAT_NAME} ${TOMCAT_HOME}/logs
+ # symlink the directories to make CATALINA_BASE possible
+ dosym /etc/${TOMCAT_NAME}/default /var/lib/${TOMCAT_NAME}/default/conf
+ dosym /var/log/${TOMCAT_NAME}/default /var/lib/${TOMCAT_NAME}/default/logs
+ dosym /var/tmp/${TOMCAT_NAME}/default /var/lib/${TOMCAT_NAME}/default/temp
+ dosym /var/run/${TOMCAT_NAME}/default /var/lib/${TOMCAT_NAME}/default/work
- fperms 640 /etc/${TOMCAT_NAME}/tomcat-users.xml
+ dodoc ${S}/jakarta-tomcat-5/{LICENSE,RELEASE-NOTES,RUNNING.txt}
+ fperms 640 /etc/${TOMCAT_NAME}/default/tomcat-users.xml
}
@@ -147,20 +201,27 @@ pkg_preinst() {
enewgroup tomcat
enewuser tomcat -1 -1 /dev/null tomcat
- chown -R tomcat:tomcat ${D}/opt/${TOMCAT_NAME}
+ chown -R root:tomcat ${D}/usr/share/${TOMCAT_NAME}
chown -R tomcat:tomcat ${D}/etc/${TOMCAT_NAME}
chown -R tomcat:tomcat ${D}/var/log/${TOMCAT_NAME}
+ chown -R tomcat:tomcat ${D}/var/tmp/${TOMCAT_NAME}
+ chown -R tomcat:tomcat ${D}/var/run/${TOMCAT_NAME}
+ chown -R tomcat:tomcat ${D}/var/lib/${TOMCAT_NAME}
}
pkg_postinst() {
#due to previous ebuild bloopers, make sure everything is correct
- use doc && chown -R root:root /usr/share/doc/${PF}
chown root:root /etc/init.d/${TOMCAT_NAME}
chown root:root /etc/conf.d/${TOMCAT_NAME}
- chown -R tomcat:tomcat /opt/${TOMCAT_NAME}
+ # These directories contain the runtime files and
+ # are therefor owned by tomcat
chown -R tomcat:tomcat /etc/${TOMCAT_NAME}
chown -R tomcat:tomcat /var/log/${TOMCAT_NAME}
+ chown -R tomcat:tomcat /var/tmp/${TOMCAT_NAME}
+ chown -R tomcat:tomcat /var/run/${TOMCAT_NAME}
+ chown -R tomcat:tomcat /var/lib/${TOMCAT_NAME}
+
chmod 750 /etc/${TOMCAT_NAME}
@@ -171,8 +232,8 @@ pkg_postinst() {
einfo " Contains application data, configuration files."
einfo " 2. Runtime settings: /etc/conf.d/${TOMCAT_NAME}"
einfo " Contains CLASSPATH and JAVA_HOME settings."
- einfo " 3. Configuration: /etc/${TOMCAT_NAME}"
- einfo " 4. Logs: /var/log/${TOMCAT_NAME}/"
+ einfo " 3. Configuration: /etc/${TOMCAT_NAME}/default"
+ einfo " 4. Logs: /var/log/${TOMCAT_NAME}/default"
einfo " "
einfo " "
einfo " STARTING AND STOPPING TOMCAT:"
@@ -187,14 +248,21 @@ pkg_postinst() {
ewarn " A version number has been appended so that tomcat 3, 4 and 5"
ewarn " can be installed side by side"
einfo " "
+ ewarn " This ebuild implements a new filesystem layout for tomcat"
+ ewarn " please read http://gentoo-wiki.com/Tomcat_Gentoo_ebuild for"
+ ewarn " more information!."
+ einfo " "
einfo " NETWORK CONFIGURATION:"
einfo " By default, Tomcat runs on port 8080. You can change this"
- einfo " value by editing /etc/${TOMCAT_NAME}/server.xml."
+ einfo " value by editing /etc/${TOMCAT_NAME}/default/server.xml."
einfo " "
einfo " To test Tomcat while it's running, point your web browser to:"
einfo " http://localhost:8080/"
- ! use doc && einfo " You do not have the doc USE flag set, examples have NOT been installed."
- einfo " "
+ if ! use doc; then
+ ewarn ""
+ ewarn "You do not have the doc USE flag set, examples have NOT been installed."
+ ewarn " "
+ fi
einfo " "
einfo " BUGS:"
einfo " Please file any bugs at http://bugs.gentoo.org/ or else it"