diff options
author | William Thomson <wltjr@gentoo.org> | 2006-09-04 01:18:50 +0000 |
---|---|---|
committer | William Thomson <wltjr@gentoo.org> | 2006-09-04 01:18:50 +0000 |
commit | 2264be81ce5dede9e6da98edd869f8f7e2bd97cf (patch) | |
tree | 9576259f126adb6dbe5f4f1e7500c23eef77c7e3 /www-servers | |
parent | Marked stable on mips. (diff) | |
download | gentoo-2-2264be81ce5dede9e6da98edd869f8f7e2bd97cf.tar.gz gentoo-2-2264be81ce5dede9e6da98edd869f8f7e2bd97cf.tar.bz2 gentoo-2-2264be81ce5dede9e6da98edd869f8f7e2bd97cf.zip |
Migrated 5.5.17 ebuild to gen 2. Introduced use of java5 USE flag. Synced with changes applied to Tomcat in overlay. Added patches to stop building examples and docs unless USE flags are set
(Portage version: 2.1.1_rc1)
Diffstat (limited to 'www-servers')
-rw-r--r-- | www-servers/tomcat/files/5.5.17/jsr152build-xml-examples.patch | 28 | ||||
-rw-r--r-- | www-servers/tomcat/files/5.5.17/jsr154build-xml-examples.patch | 28 | ||||
-rw-r--r-- | www-servers/tomcat/files/5.5.17/tomcat.conf | 10 | ||||
-rwxr-xr-x | www-servers/tomcat/files/5.5.17/tomcat.init | 6 | ||||
-rw-r--r-- | www-servers/tomcat/files/5.5.17/tomcatbuild-xml-docs.patch | 120 | ||||
-rw-r--r-- | www-servers/tomcat/files/5.5.17/tomcatbuild-xml-examples.patch | 84 | ||||
-rw-r--r-- | www-servers/tomcat/files/digest-tomcat-5.5.17-r2 | 3 | ||||
-rw-r--r-- | www-servers/tomcat/tomcat-5.5.17-r1.ebuild | 48 | ||||
-rw-r--r-- | www-servers/tomcat/tomcat-5.5.17-r2.ebuild | 317 |
9 files changed, 612 insertions, 32 deletions
diff --git a/www-servers/tomcat/files/5.5.17/jsr152build-xml-examples.patch b/www-servers/tomcat/files/5.5.17/jsr152build-xml-examples.patch new file mode 100644 index 000000000000..933e2aa48242 --- /dev/null +++ b/www-servers/tomcat/files/5.5.17/jsr152build-xml-examples.patch @@ -0,0 +1,28 @@ +--- apache-tomcat-5.5.17-src/servletapi/jsr152/build.xml 2006-07-29 14:13:41.000000000 -0400 ++++ servletapi/jsr152/build.xml 2006-07-29 14:13:17.000000000 -0400 +@@ -119,6 +119,7 @@ + classpath="${jsp-anttask.jar}" /> + </target> + ++ <!-- + <target name="examples" depends="prepare,ant"> + + <copy todir="${jsp-api.build}/examples"> +@@ -221,7 +222,7 @@ + basedir="${jsp-api.build}/examples" includes="**"/> + + </target> +- ++ --> + + <!-- ===================== Distribution Files ========================= --> + <target name="jar" depends="compile" +@@ -245,7 +246,7 @@ + + </target> + +- <target name="dist" depends="compile,examples,javadoc,jar" ++ <target name="dist" depends="compile,javadoc,jar" + description="Create binary distribution"> + + <!-- Copy Javadocs --> diff --git a/www-servers/tomcat/files/5.5.17/jsr154build-xml-examples.patch b/www-servers/tomcat/files/5.5.17/jsr154build-xml-examples.patch new file mode 100644 index 000000000000..4dac35390f1d --- /dev/null +++ b/www-servers/tomcat/files/5.5.17/jsr154build-xml-examples.patch @@ -0,0 +1,28 @@ +--- apache-tomcat-5.5.17-src/servletapi/jsr154/build.xml 2006-04-14 14:12:10.000000000 -0400 ++++ servletapi/jsr154/build.xml 2006-07-29 14:41:05.000000000 -0400 +@@ -99,6 +99,7 @@ + + + <!-- ======================== Build JavaDoc =========================== --> ++ <!-- + <target name="examples" depends="prepare"> + + <copy todir="${servlet-api.build}/examples"> +@@ -119,7 +120,7 @@ + basedir="${servlet-api.build}/examples" includes="**"/> + + </target> +- ++ --> + + <!-- ===================== Distribution Files ========================= --> + <target name="jar" depends="compile" +@@ -144,7 +145,7 @@ + + </target> + +- <target name="dist" depends="compile,examples,javadoc,jar" ++ <target name="dist" depends="compile,javadoc,jar" + description="Create binary distribution"> + + <!-- Copy Javadocs --> diff --git a/www-servers/tomcat/files/5.5.17/tomcat.conf b/www-servers/tomcat/files/5.5.17/tomcat.conf index d52a0660672f..04b5705bb7e2 100644 --- a/www-servers/tomcat/files/5.5.17/tomcat.conf +++ b/www-servers/tomcat/files/5.5.17/tomcat.conf @@ -1,4 +1,4 @@ -# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/files/5.5.17/tomcat.conf,v 1.1 2006/07/03 02:13:09 nichoj Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/files/5.5.17/tomcat.conf,v 1.2 2006/09/04 01:18:50 wltjr Exp $ # JVM Runtime # Using the default setting, it will determine your JVM from the system-vm @@ -15,21 +15,21 @@ JAVA_HOME=`java-config --jre-home` # JAVA_OPTS="" # Where your web applications are located -CATALINA_HOME=/usr/share/tomcat-5.5 -CATALINA_BASE=/var/lib/tomcat-5.5 +CATALINA_HOME=/usr/share/tomcat-5.5/ +CATALINA_BASE=/var/lib/tomcat-5.5/ # Tomcat's User CATALINA_USER=tomcat # Location of the Tomcat JARs and classes -CATALINA_LIBDIR=/usr/share/tomcat-5.5/server/lib +CATALINA_LIBDIR=/usr/share/tomcat-5.5/server/lib/ # The CLASSPATH for Tomcat to use, plus any others you need. CLASSPATH=${CATALINA_LIBDIR} # (Optional) Directory path location of temporary directory the JVM should # use (java.io.tmpdir). Defaults to $CATALINA_BASE/temp. -CATALINA_TMPDIR="/var/tmp/tomcat-5.5" +CATALINA_TMPDIR="/var/tmp/tomcat-5.5/" # TOMCAT STARTUP/SHUTDOWN # debug Start Catalina in a debugger diff --git a/www-servers/tomcat/files/5.5.17/tomcat.init b/www-servers/tomcat/files/5.5.17/tomcat.init index 93b5767fc5e6..94ef2deaf31e 100755 --- a/www-servers/tomcat/files/5.5.17/tomcat.init +++ b/www-servers/tomcat/files/5.5.17/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.5.17/tomcat.init,v 1.2 2006/07/07 20:08:51 nichoj Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/files/5.5.17/tomcat.init,v 1.3 2006/09/04 01:18:50 wltjr Exp $ init_env_vars() { # Set some sane defaults @@ -16,7 +16,7 @@ init_env_vars() { fi # Populate the classpath - CLASSPATH="${CLASSPATH}:$JAVA_HOME/lib/tools.jar" + CLASSPATH="${CLASSPATH}:${CATALINA_HOME}/server/lib:$JAVA_HOME/lib/tools.jar" if [[ -n "${JSSE_HOME}" ]]; then CLASSPATH="${CLASSPATH}:${JSSE_HOME}/lib/jcert.jar:${JSSE_HOME}/lib/jnet.jar:${JSSE_HOME}/lib/jsse.jar" fi @@ -56,7 +56,7 @@ start() { start-helper $JAVA_HOME/bin/jdb \ -sourcepath ${CATALINA_HOME}/../../jakarta-tomcat-catalina/catalina/src/share \ -Djava.security.manager \ - -Djava.security.policy=/etc/tomcat-5.5/conf/catalina.policy + -Djava.security.policy=/etc/tomcat-5.5/catalina.policy elif [[ "${TOMCAT_START}" == "jpda start" ]] ; then start-helper $JAVA_HOME/bin/java ${JPDA_OPTS} elif [[ "${TOMCAT_START}" == "start" ]] ; then diff --git a/www-servers/tomcat/files/5.5.17/tomcatbuild-xml-docs.patch b/www-servers/tomcat/files/5.5.17/tomcatbuild-xml-docs.patch new file mode 100644 index 000000000000..513eeefe5d34 --- /dev/null +++ b/www-servers/tomcat/files/5.5.17/tomcatbuild-xml-docs.patch @@ -0,0 +1,120 @@ +--- apache-tomcat-5.5.17-src/build/build.xml 2006-04-14 14:11:26.000000000 -0400 ++++ build.xml 2006-07-29 14:58:08.000000000 -0400 +@@ -788,6 +788,7 @@ + <property name="flags.hide" value="true" /> + </ant> + ++ <!-- + <ant dir="${catalina.home}/webapps/docs" target="build-main"> + <property name="webapps.build" value="${tomcat.build}/webapps" /> + <property name="classes.dir" value="${tomcat.build}/classes" /> +@@ -795,6 +796,7 @@ + <property name="catalina.deploy" value="${tomcat.build}" /> + <property name="flags.hide" value="true" /> + </ant> ++ --> + + <antcall target="build-admin" /> + +@@ -843,11 +845,13 @@ + filtering="true" /> + + <!-- Add documents to the tomcat-docs webapp --> ++ <!-- + <copy file="${basedir}/resources/build.xml" + todir="${tomcat.build}/webapps/tomcat-docs" /> + <copy file="./RELEASE-NOTES" + tofile="${tomcat.build}/webapps/tomcat-docs/RELEASE-NOTES.txt" + filtering="true" /> ++ --> + + <!-- Build JARs for webapps classes --> + <mkdir dir="${tomcat.build}/server/webapps/admin/WEB-INF/lib" /> +@@ -1027,6 +1031,7 @@ + </copy> + + <!-- Copy deployer documentation --> ++ <!-- + <copy todir="${tomcat.deployer}"> + <fileset dir="${tomcat.build}/webapps/tomcat-docs"> + <include name="images/jakarta-logo.gif" /> +@@ -1035,7 +1040,8 @@ + </copy> + <copy tofile="${tomcat.deployer}/docs/manual.html" + file="${tomcat.build}/webapps/tomcat-docs/printer/deployer-howto.html" /> +- ++ --> ++ + </target> + + <!-- ====================== Compat target =================== --> +@@ -1344,8 +1350,8 @@ + + + <!-- ====================== DIST: Create Javadoc ======================== --> +- <target name="dist-javadoc"> + <!-- ++ <target name="dist-javadoc"> + <ant dir="${catalina.home}" target="dist-javadoc"/> + <mkdir dir="${tomcat.dist}/webapps/tomcat-docs/catalina/docs/api"/> + <copy todir="${tomcat.dist}/webapps/tomcat-docs/catalina/docs/api"> +@@ -1356,7 +1362,6 @@ + <copy todir="${tomcat.dist}/webapps/tomcat-docs/jasper/docs/api"> + <fileset dir="${jasper.build}/javadoc" /> + </copy> +- --> + <mkdir dir="${tomcat.dist}/webapps/tomcat-docs/servletapi"/> + <copy todir="${tomcat.dist}/webapps/tomcat-docs/servletapi"> + <fileset dir="${api.home}/jsr154/dist/docs/api" /> +@@ -1366,6 +1371,7 @@ + <fileset dir="${api.home}/jsr152/dist/docs/api" /> + </copy> + </target> ++ --> + + + <!-- ====================== DIST: Create Sources ======================== --> +@@ -1441,7 +1447,7 @@ + + + <!-- ====================== DIST: Create Archives ======================= --> +- <target name="dist" depends="deploy,dist-static,dist-javadoc,embed" ++ <target name="dist" depends="deploy,dist-static,embed" + description="Create binary distribution"> + </target> + +@@ -1479,7 +1485,7 @@ + + + <!-- ==================== RELEASE: Create Release ======================= --> +- <target name="release" depends="clean,dist,dist-source,prepare-release,installer,package-zip,package-tgz,package-embed-zip,package-embed-tgz,package-deployer-zip,package-deployer-tgz,package-compat-zip,package-compat-tgz,package-admin-zip,package-admin-tgz,package-src-zip,package-src-tgz,package-docs-tgz,clean-tester,run-tester" ++ <target name="release" depends="clean,dist,dist-source,prepare-release,installer,package-zip,package-tgz,package-embed-zip,package-embed-tgz,package-deployer-zip,package-deployer-tgz,package-compat-zip,package-compat-tgz,package-admin-zip,package-admin-tgz,package-src-zip,package-src-tgz,clean-tester,run-tester" + description="Create a Tomcat 5 packaged distribution"> + + <filter token="VERSION" value="${version}"/> +@@ -1772,8 +1778,8 @@ + </target> + + <!-- Packages the documentation distro in tar.gz format --> ++ <!-- + <target name="package-docs-tgz" depends="prepare-release"> +- <!-- Generate docs --> + <ant dir="${catalina.home}" target="dist-javadoc"/> + <mkdir dir="${tomcat.dist}/webapps/tomcat-docs/catalina/docs/api"/> + <copy todir="${tomcat.dist}/webapps/tomcat-docs/catalina/docs/api"> +@@ -1785,7 +1791,6 @@ + <fileset dir="${jasper.build}/javadoc" /> + </copy> + +- <!-- Package gocs --> + <fixcrlf srcdir="${tomcat.dist}" includes="*.txt,LICENSE,NOTICE" eol="lf"/> + + <tar longfile="gnu" compression="gzip" +@@ -1805,6 +1810,7 @@ + <echo file="${tomcat.release}/v${version}/bin/${final.name}-fulldocs.tar.gz.MD5" + message="${md5sum.binary-prefix}${final.name}-fulldocs.tar.gz${line.separator}" append="true" /> + </target> ++ --> + + <!-- Packages the source code distribution in zip format --> + <target name="package-src-zip"> diff --git a/www-servers/tomcat/files/5.5.17/tomcatbuild-xml-examples.patch b/www-servers/tomcat/files/5.5.17/tomcatbuild-xml-examples.patch new file mode 100644 index 000000000000..c2cae9e208b8 --- /dev/null +++ b/www-servers/tomcat/files/5.5.17/tomcatbuild-xml-examples.patch @@ -0,0 +1,84 @@ +--- apache-tomcat-5.5.17-src/build/build.xml 2006-04-14 14:11:26.000000000 -0400 ++++ build/build.xml 2006-07-29 13:02:50.000000000 -0400 +@@ -398,12 +398,16 @@ + <!-- JSPC --> + <property name="admin.base" location="${tomcat.build}/server/webapps/admin" /> + <property name="ROOT.base" location="${tomcat.build}/webapps/ROOT" /> ++ <!-- + <property name="jsp-examples.base" location="${tomcat.build}/webapps/jsp-examples" /> ++ --> + + <mkdir dir="${admin.base}/WEB-INF/src/admin" /> + <mkdir dir="${ROOT.base}/WEB-INF/src" /> + <mkdir dir="${ROOT.base}/WEB-INF/classes" /> ++ <!-- + <mkdir dir="${jsp-examples.base}/WEB-INF/src" /> ++ --> + + <path id="jspc.classpath"> + <pathelement location="${java.home}/../lib/tools.jar"/> +@@ -437,6 +441,7 @@ + addWebXmlMappings="true" + outputDir="${ROOT.base}/WEB-INF/src" /> + ++ <!-- + <jasper2 + compile="false" + validateXml="false" +@@ -444,6 +449,7 @@ + webXmlFragment="${jsp-examples.base}/WEB-INF/generated_web.xml" + addWebXmlMappings="true" + outputDir="${jsp-examples.base}/WEB-INF/src" /> ++ --> + + <jasper2 + package="admin" +@@ -475,6 +481,7 @@ + <include name="**" /> + </javac> + ++ <!-- + <mkdir dir="${jsp-examples.base}/WEB-INF/src/tags"/> + <copy todir="${jsp-examples.base}/WEB-INF/classes"> + <fileset dir="${jsp-examples.base}/WEB-INF/src"> +@@ -507,6 +514,7 @@ + <include name="**" /> + <exclude name="tags/**" /> + </javac> ++ --> + + <javac destdir="${admin.base}/WEB-INF/classes" + optimize="off" +@@ -767,7 +775,7 @@ + </ant> + <ant dir="${api.home}/jsr152" target="dist"> + </ant> +- ++ <!-- + <mkdir dir="${tomcat.build}/webapps/servlets-examples"/> + <copy todir="${tomcat.build}/webapps/servlets-examples"> + <fileset dir="${api.home}/jsr154/build/examples" includes="**"/> +@@ -779,7 +787,7 @@ + <exclude name="WEB-INF/tagPlugins.xml" /> + </fileset> + </copy> +- ++ --> + <ant dir="${catalina.home}/webapps/ROOT" target="build-main"> + <property name="webapps.build" value="${tomcat.build}/webapps" /> + <property name="classes.dir" value="${tomcat.build}/classes" /> +@@ -1082,12 +1090,14 @@ + <antcall target="fix-webapps"/> + + <!-- Copy the examples webapps --> ++ <!-- + <copy todir="${tomcat.build}/webapps/jsp-examples"> + <fileset dir="${api.home}/jsr152/build/examples"/> + </copy> + <copy todir="${tomcat.build}/webapps/servlets-examples"> + <fileset dir="${api.home}/jsr154/build/examples"/> + </copy> ++ --> + + <!-- Copy Unix JSVC from commons-daemon --> + <copy file="${commons-daemon.jsvc.tar.gz}" diff --git a/www-servers/tomcat/files/digest-tomcat-5.5.17-r2 b/www-servers/tomcat/files/digest-tomcat-5.5.17-r2 new file mode 100644 index 000000000000..51d603367aa1 --- /dev/null +++ b/www-servers/tomcat/files/digest-tomcat-5.5.17-r2 @@ -0,0 +1,3 @@ +MD5 afedf090888029b19a1bebc471264105 apache-tomcat-5.5.17-src.tar.gz 4282022 +RMD160 004d87bc64b32eee42f9979d2fdbb36836b69015 apache-tomcat-5.5.17-src.tar.gz 4282022 +SHA256 295c9fa64d9aa81d5c836b694804d8d57fcfdbc76b9889a044852aa73f2c3ad8 apache-tomcat-5.5.17-src.tar.gz 4282022 diff --git a/www-servers/tomcat/tomcat-5.5.17-r1.ebuild b/www-servers/tomcat/tomcat-5.5.17-r1.ebuild index 9d3efebf99d6..6ff5f61627b4 100644 --- a/www-servers/tomcat/tomcat-5.5.17-r1.ebuild +++ b/www-servers/tomcat/tomcat-5.5.17-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/tomcat-5.5.17-r1.ebuild,v 1.1 2006/07/07 20:08:51 nichoj Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/tomcat-5.5.17-r1.ebuild,v 1.2 2006/09/04 01:18:50 wltjr Exp $ inherit eutils java-pkg @@ -14,29 +14,29 @@ HOMEPAGE="http://jakarta.apache.org/tomcat" KEYWORDS="~amd64 ~x86" LICENSE="Apache-2.0" -RDEPEND=">=virtual/jdk-1.4 - =dev-java/eclipse-ecj-3.1* - =dev-java/commons-beanutils-1.7* - >=dev-java/commons-collections-3.1 - >=dev-java/commons-daemon-1.0.1 - >=dev-java/commons-dbcp-1.2.1 - >=dev-java/commons-digester-1.7 - >=dev-java/commons-fileupload-1.0 - >=dev-java/commons-httpclient-2.0 - >=dev-java/commons-el-1.0 - >=dev-java/commons-launcher-0.9 - >=dev-java/commons-logging-1.0.4 - >=dev-java/commons-modeler-1.1 - >=dev-java/commons-pool-1.2 - ~dev-java/jaxen-1.0 - >=dev-java/junit-3.8.1 - =dev-java/mx4j-3* - >=dev-java/log4j-1.2.9 - >=dev-java/saxpath-1.0 - ~dev-java/servletapi-2.4 - =dev-java/struts-1.2* - =dev-java/gnu-jaf-1* - >=dev-java/xerces-2.7.1" +RDEPEND=">=virtual/jdk-1.4* + =dev-java/eclipse-ecj-3.1* + =dev-java/commons-beanutils-1.7* + >=dev-java/commons-collections-3.1 + >=dev-java/commons-daemon-1.0.1 + >=dev-java/commons-dbcp-1.2.1 + >=dev-java/commons-digester-1.7 + >=dev-java/commons-fileupload-1.0 + >=dev-java/commons-httpclient-2.0 + >=dev-java/commons-el-1.0 + >=dev-java/commons-launcher-0.9 + >=dev-java/commons-logging-1.0.4 + >=dev-java/commons-modeler-1.1 + >=dev-java/commons-pool-1.2 + ~dev-java/jaxen-1.0 + >=dev-java/junit-3.8.1 + =dev-java/mx4j-3* + >=dev-java/log4j-1.2.9 + >=dev-java/saxpath-1.0 + ~dev-java/servletapi-2.4 + =dev-java/struts-1.2* + =dev-java/gnu-jaf-1* + >=dev-java/xerces-2.7.1" DEPEND=">=virtual/jdk-1.4 ${RDEPEND} sys-apps/sed diff --git a/www-servers/tomcat/tomcat-5.5.17-r2.ebuild b/www-servers/tomcat/tomcat-5.5.17-r2.ebuild new file mode 100644 index 000000000000..91b5e8eda662 --- /dev/null +++ b/www-servers/tomcat/tomcat-5.5.17-r2.ebuild @@ -0,0 +1,317 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/tomcat-5.5.17-r2.ebuild,v 1.1 2006/09/04 01:18:50 wltjr Exp $ + +inherit eutils java-pkg-2 java-ant-2 + +DESCRIPTION="Apache Servlet-2.4/JSP-2.0 Container" + +MY_P="apache-${P}-src" +SLOT="5.5" +SRC_URI="mirror://apache/${PN}/${PN}-5/v${PV}/src/${MY_P}.tar.gz" +HOMEPAGE="http://jakarta.apache.org/tomcat" +KEYWORDS="~amd64 ~x86" +LICENSE="Apache-2.0" + +RDEPEND="=dev-java/eclipse-ecj-3.1* + =dev-java/commons-beanutils-1.7* + >=dev-java/commons-collections-3.1 + >=dev-java/commons-daemon-1.0.1 + >=dev-java/commons-dbcp-1.2.1 + >=dev-java/commons-digester-1.7 + >=dev-java/commons-fileupload-1.0 + >=dev-java/commons-el-1.0 + >=dev-java/commons-launcher-0.9 + >=dev-java/commons-logging-1.0.4 + >=dev-java/commons-modeler-1.1 + >=dev-java/commons-pool-1.2 + >=dev-java/log4j-1.2.9 + ~dev-java/servletapi-2.4 + java5? ( >=virtual/jre-1.5 ) + !java5? ( + =virtual/jre-1.4* + >=dev-java/commons-httpclient-2.0 + =dev-java/gnu-jaf-1* + ~dev-java/jaxen-1.0 + >=dev-java/junit-3.8.1 + =dev-java/mx4j-3* + >=dev-java/saxpath-1.0 + >=dev-java/xerces-2.7.1 + =dev-java/xml-commons-external-1.3* + )" +DEPEND="java5? ( >=virtual/jdk-1.5 ) + !java5? ( =virtual/jdk-1.4* ) + ${RDEPEND} + sys-apps/sed + dev-java/ant" +IUSE="java5 doc examples source test" + +if ! use java5; then + JAVA_PKG_NV_DEPEND="=virtual/jdk-1.4*" +else + JAVA_PKG_NV_DEPEND="=virtual/jdk-1.5*" +fi + +S=${WORKDIR}/${MY_P} + +TOMCAT_HOME="/usr/share/${PN}-${SLOT}" +TOMCAT_NAME="${PN}-${SLOT}" +WEBAPPS_DIR="/var/lib/${TOMCAT_NAME}/webapps" + +pkg_setup() { + # new user for tomcat + enewgroup tomcat + enewuser tomcat -1 -1 /dev/null tomcat + + if use java5; then + JAVA_PKG_WANT_SOURCE="1.5" + JAVA_PKG_WANT_TARGET="1.5" + fi +} + +ant_src_unpack() { + unpack ${A} + cd ${S} + + local PATCHES=" + mainbuild-xml.patch + tomcatbuild-xml.patch + catalinabuild-xml.patch + jasperbuild-xml.patch + " + for patch in ${PATCHES}; do + epatch "${FILESDIR}/${PV}/${patch}" + done + if ! use doc; then + epatch "${FILESDIR}/${PV}/tomcatbuild-xml-docs.patch" + fi + if ! use examples; then + epatch "${FILESDIR}/${PV}/tomcatbuild-xml-examples.patch" + epatch "${FILESDIR}/${PV}/jsr152build-xml-examples.patch" + epatch "${FILESDIR}/${PV}/jsr154build-xml-examples.patch" + fi + + # avoid packed jars :-) + mkdir -p ${S}/build/build/common + cd ${S}/build/build + + mkdir ./bin && cd ./bin + java-pkg_jar-from commons-logging commons-logging-api.jar + java-pkg_jar-from commons-daemon + if ! use java5; then + java-pkg_jar-from mx4j-3.0 mx4j.jar jmx.jar + java-pkg_jar-from mx4j-3.0 mx4j-rjmx.jar jmx-remote.jar + fi + + if ! use java5; then + mkdir ../common/endorsed && cd ../common/endorsed + java-pkg_jar-from xml-commons-external-1.3 xml-apis.jar + java-pkg_jar-from xerces-2 xercesImpl.jar + fi + + 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-1.7 commons-beanutils.jar + java-pkg_jar-from commons-digester + java-pkg_jar-from commons-fileupload + java-pkg_jar-from commons-modeler +} + +src_compile(){ + local antflags="-Dbase.path=${T}" + + antflags="${antflags} -Dcommons-collections.jar=$(java-config -p commons-collections)" + antflags="${antflags} -Dcommons-daemon.jar=$(java-config -p commons-daemon)" + antflags="${antflags} -Dcommons-digester.jar=$(java-config -p commons-digester)" + antflags="${antflags} -Dcommons-dbcp.jar=$(java-config -p commons-dbcp)" + antflags="${antflags} -Dcommons-el.jar=$(java-config -p commons-el)" + antflags="${antflags} -Dcommons-pool.jar=$(java-config -p commons-pool)" + antflags="${antflags} -Dcommons-fileupload.jar=$(java-config -p commons-fileupload)" + antflags="${antflags} -Dcommons-launcher.jar=$(java-config -p commons-launcher)" + antflags="${antflags} -Dcommons-modeler.jar=$(java-config -p commons-modeler)" + antflags="${antflags} -Djunit.jar=$(java-config -p junit)" + antflags="${antflags} -Djdt.jar=$(java-pkg_getjar eclipse-ecj-3.1 ecj.jar)" + antflags="${antflags} -Dlog4j.jar=$(java-config -p log4j)" + antflags="${antflags} -Dcommons-beanutils.jar=$(java-pkg_getjar commons-beanutils-1.7 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} -Djasper.home=${S}/jasper" + if ! use java5; then + antflags="${antflags} -Dcommons-httpclient.jar=$(java-config -p commons-httpclient)" + antflags="${antflags} -Dactivation.jar=$(java-config -p gnu-jaf-1)" + antflags="${antflags} -Djaxen.jar=$(java-pkg_getjar jaxen jaxen-full.jar)" + antflags="${antflags} -Djmx.jar=$(java-pkg_getjar mx4j-3.0 mx4j.jar)" + antflags="${antflags} -Djmx-remote.jar=$(java-pkg_getjar mx4j-3.0 mx4j-rjmx.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)" + fi + + eant ${antflags} || die "compile failed" + +} + +src_install() { + cd ${S}/build/build + + # init.d, conf.d + newinitd ${FILESDIR}/${PV}/tomcat.init ${TOMCAT_NAME} + newconfd ${FILESDIR}/${PV}/tomcat.conf ${TOMCAT_NAME} + + # create dir structure + diropts -m755 -o tomcat -g tomcat + dodir /usr/share/${TOMCAT_NAME} + keepdir /var/log/${TOMCAT_NAME}/ + keepdir /var/tmp/${TOMCAT_NAME}/ + keepdir /var/run/${TOMCAT_NAME}/ + + local CATALINA_BASE=/var/lib/${TOMCAT_NAME}/ + dodir ${CATALINA_BASE} + keepdir ${CATALINA_BASE}/shared/lib + keepdir ${CATALINA_BASE}/shared/classes + + keepdir /usr/share/${TOMCAT_NAME}/${CATALIA_HOME}/common/lib + + dodir /etc/${TOMCAT_NAME} + fperms 750 /etc/${TOMCAT_NAME} + + diropts -m0755 + + # 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}/container/webapps/admin/admin.xml \ + conf/Catalina/localhost + cp ${S}/container/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 *.jar; + do + # replace the file with a symlink + if [ ! -L ${jar} ]; then + java-pkg_dojar ${jar} + rm -f ${jar} + ln -s ${DESTTREE}/share/${TOMCAT_NAME}/lib/${jar} ${jar} + fi + done + + cd ${base} + done + + # replace a packed struts.jar + cd server/webapps/admin/WEB-INF/lib + rm -f struts.jar + java-pkg_jar-from struts-1.2 struts.jar + cd ${base} + + # replace the default pw with a random one, see #92281 + local randpw=$(echo ${RANDOM}|md5sum|cut -c 1-15) + sed -e s:SHUTDOWN:${randpw}: -i conf/{server,server-minimal}.xml + + # copy over the directories + chown -R tomcat:tomcat webapps/* conf/* + cp -pR conf/* ${D}/etc/${TOMCAT_NAME} || die "failed to copy conf" + cp -R bin common server ${D}/usr/share/${TOMCAT_NAME} || die "failed to copy" + + keepdir ${WEBAPPS_DIR} + set_webapps_perms ${D}/${WEBAPPS_DIR} + + # Copy over webapps, some controlled by use flags + cp -p ../RELEASE-NOTES webapps/ROOT/RELEASE-NOTES.txt + cp -pr webapps/ROOT ${D}${CATALINA_BASE}/webapps + if use doc; then + cp -pr webapps/tomcat-docs ${D}${CATALINA_BASE}/webapps + fi + if use examples; then + cp -pr webapps/{jsp-examples,servlets-examples,webdav} \ + ${D}${CATALINA_BASE}/webapps + fi + + # symlink the directories to make CATALINA_BASE possible + dosym /etc/${TOMCAT_NAME} ${CATALINA_BASE}/conf + dosym /var/log/${TOMCAT_NAME} ${CATALINA_BASE}/logs + dosym /var/tmp/${TOMCAT_NAME} ${CATALINA_BASE}/temp + dosym /var/run/${TOMCAT_NAME} ${CATALINA_BASE}/work + + dodoc ${S}/build/{RELEASE-NOTES,RUNNING.txt} + fperms 640 /etc/${TOMCAT_NAME}/tomcat-users.xml +} + +pkg_postinst() { + #due to previous ebuild bloopers, make sure everything is correct + chown root:root /etc/init.d/${TOMCAT_NAME} + chown root:root /etc/conf.d/${TOMCAT_NAME} + + einfo + ewarn " This ebuild implements a new filesystem layout for tomcat" + ewarn " please read http://www.gentoo.org/proj/en/java/tomcat-guide.xml" + ewarn " for more information!." + einfo + einfo " Please file any bugs at http://bugs.gentoo.org/ or else it" + einfo " may not get seen. Thank you." + einfo + +# einfo "Run emerge --config =${PF}" +# einfo "to configure Tomcat if you need to for example" +# einfo "change the home directory of the Tomcat user." +} + +#helpers +set_webapps_perms() { + chown tomcat:tomcat ${1} || die "Failed to change owner off ${1}." + chmod 750 ${1} || die "Failed to change permissions off ${1}." +} + +pkg_config() { + # Better suggestions are welcome + local currentdir="$(getent passwd tomcat | gawk -F':' '{ print $6 }')" + + einfo "The default home directory for Tomcat is /dev/null." + einfo "You need to change it if your applications needs it to" + einfo "be an actual directory. Current home directory:" + einfo "${currentdir}" + einfo "" + einfo "Do you want to change it [yes/no]?" + + local answer + read answer + + if [[ "${answer}" == "yes" ]]; then + einfo "" + einfo "Suggestions:" + einfo "${WEBAPPS_DIR}" + einfo "" + einfo "If you want to suggest a directory, file a bug to" + einfo "http://bugs.gentoo.org" + einfo "" + einfo "Enter home directory:" + + local homedir + read homedir + + einfo "" + einfo "Setting home directory to: ${homedir}" + + /usr/sbin/usermod -d"${homedir}" tomcat + + einfo "You can run emerge --config =${PF}" + einfo "again to change to homedir" + einfo "at any time." + fi +} |