diff options
author | William Thomson <wltjr@gentoo.org> | 2006-11-20 04:32:22 +0000 |
---|---|---|
committer | William Thomson <wltjr@gentoo.org> | 2006-11-20 04:32:22 +0000 |
commit | ac873fe3300d3fbade287e2ae2c61653a594ef9a (patch) | |
tree | 3ba816991f68be2f9a1c70cce1841ec5c9ef17d8 /www-servers/tomcat | |
parent | Remove old versions (diff) | |
download | gentoo-2-ac873fe3300d3fbade287e2ae2c61653a594ef9a.tar.gz gentoo-2-ac873fe3300d3fbade287e2ae2c61653a594ef9a.tar.bz2 gentoo-2-ac873fe3300d3fbade287e2ae2c61653a594ef9a.zip |
Initial ebuild for Tomcat 6.0.2 alpha, despite sources/ebuild not named as such. Compiles, runs and should be some what useable. Although will be package masked, since it's alpha sources. jni USE flag should not be used, still working on that part, help there appreciated
(Portage version: 2.1.2_rc1-r6)
Diffstat (limited to 'www-servers/tomcat')
-rw-r--r-- | www-servers/tomcat/ChangeLog | 12 | ||||
-rw-r--r-- | www-servers/tomcat/files/6.0.2/build-xml.patch | 30 | ||||
-rw-r--r-- | www-servers/tomcat/files/6.0.2/tomcat.conf | 75 | ||||
-rwxr-xr-x | www-servers/tomcat/files/6.0.2/tomcat.init | 84 | ||||
-rw-r--r-- | www-servers/tomcat/files/digest-tomcat-6.0.2 | 3 | ||||
-rw-r--r-- | www-servers/tomcat/tomcat-6.0.2.ebuild | 169 |
6 files changed, 372 insertions, 1 deletions
diff --git a/www-servers/tomcat/ChangeLog b/www-servers/tomcat/ChangeLog index a3da55ff1dbe..3a5006cecf07 100644 --- a/www-servers/tomcat/ChangeLog +++ b/www-servers/tomcat/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for www-servers/tomcat # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/ChangeLog,v 1.75 2006/11/04 21:07:30 wltjr Exp $ +# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/ChangeLog,v 1.76 2006/11/20 04:32:22 wltjr Exp $ + +*tomcat-6.0.2 (20 Nov 2006) + + 20 Nov 2006; William L. Thomson Jr. <wltjr@gentoo.org> + +files/6.0.2/build-xml.patch, +files/6.0.2/tomcat.conf, + +files/6.0.2/tomcat.init, +tomcat-6.0.2.ebuild: + Initial ebuild for Tomcat 6.0.2 alpha, despite sources/ebuild not named as + such. Compiles, runs and should be some what useable. Although will be + package masked, since it's alpha sources. jni USE flag should not be used, + still working on that part, help there appreciated 04 Nov 2006; William L. Thomson Jr. <wltjr@gentoo.org> -tomcat-5.5.20.ebuild, -tomcat-5.5.20-r1.ebuild: diff --git a/www-servers/tomcat/files/6.0.2/build-xml.patch b/www-servers/tomcat/files/6.0.2/build-xml.patch new file mode 100644 index 000000000000..a89196ea4c40 --- /dev/null +++ b/www-servers/tomcat/files/6.0.2/build-xml.patch @@ -0,0 +1,30 @@ +--- build.xml 2006-11-15 18:33:20.000000000 -0500 ++++ ../build.xml 2006-11-19 16:47:58.000000000 -0500 +@@ -446,11 +446,16 @@ + + <target name="deploy" depends="build-only,build-docs"> + ++<!-- + <copy tofile="${tomcat.build}/bin/tomcat-native.tar.gz" + file="${tomcat-native.tar.gz}" /> ++--> + + <copy todir="${tomcat.build}/bin" file="${commons-daemon.jar}" /> ++ ++<!-- + <copy todir="${tomcat.build}/bin" file="${commons-daemon.jsvc.tar.gz}" /> ++--> + + <!-- Copy scripts --> + <copy todir="${tomcat.build}/bin"> +@@ -489,8 +494,10 @@ + excludes="**/CVS/**,**/.svn/**"> + </javac> + ++<!-- + <copy file="${tomcat-dbcp.jar}" todir="${tomcat.build}/lib" /> + <copy file="${jasper-jdt.jar}" todir="${tomcat.build}/lib" /> ++--> + + </target> + diff --git a/www-servers/tomcat/files/6.0.2/tomcat.conf b/www-servers/tomcat/files/6.0.2/tomcat.conf new file mode 100644 index 000000000000..f6121492a018 --- /dev/null +++ b/www-servers/tomcat/files/6.0.2/tomcat.conf @@ -0,0 +1,75 @@ +# $Header: /var/cvsroot/gentoo-x86/www-servers/tomcat/files/6.0.2/tomcat.conf,v 1.1 2006/11/20 04:32:22 wltjr Exp $ + +# JVM Runtime +# Using the default setting, it will determine your JVM from the system-vm +# set using java-config. +# See java-config(1) manual page for assistance in determining this value. +# +# You can override this value with whatever path you wish. +# Example: JAVA_HOME=/opt/sun-jdk-1.5.0.09 + +JAVA_HOME=`java-config --jre-home` + +# (Optional) Java runtime options used when the "start", "stop", or "run" +# commands are executed. +# JAVA_OPTS="" + +# Where your web applications are located +CATALINA_HOME=/usr/share/tomcat-6/ +CATALINA_BASE=/var/lib/tomcat-6/ + +# Tomcat's User/Group +# Change these at your own risk!!! These are not supported so if it +# breaks something, you are on your own. +CATALINA_USER=tomcat +CATALINA_GROUP=tomcat + +# Location of the Tomcat JARs and classes +CATALINA_LIBDIR=/usr/share/tomcat-6/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-6/" + +# TOMCAT STARTUP/SHUTDOWN +# debug Start Catalina in a debugger +# debug -security Debug Catalina with a security manager +# jpda start Start Catalina under JPDA debugger +# start Start Catalina in a separate window +# start -security Start in a separate window with security manager +# stop Stop Catalina" +# +# NOTE: -security requires JSSE (see below) +# NOTE: jpda requires JPDA (see below) +TOMCAT_START="start" +TOMCAT_STOP="stop" + +# (Optional) Java runtime options used when the "start", "stop", or "run" +# commands are executed. +# CATALINA_OPTS="" + +# Java Platform Debugger Architecture (JPDA) +# http://java.sun.com/products/jpda/ +# Included with Java SDK 1.3 and later. No need to specify location. +# +# JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start" +# command is executed. The default is "dt_socket". +# +# JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start" +# command is executed. The default is 8000. +# +# JPDA_TRANSPORT="dt_socket" +# JPDA_ADDRESS="8000" + +# Java Secure Socket Extension (JSSE) +# http://java.sun.com/products/jsse/ +# Included with Java SDK 1.4 and later. +# +# JSSE_HOME (Optional) May point at your Java Secure Sockets Extension +# (JSSE) installation, whose JAR files will be added to the +# system class path used to start Tomcat. +# +# JSSE_HOME="/opt/sun-jdk-1.5.0.09/jre/lib/" diff --git a/www-servers/tomcat/files/6.0.2/tomcat.init b/www-servers/tomcat/files/6.0.2/tomcat.init new file mode 100755 index 000000000000..a6bbeca8736b --- /dev/null +++ b/www-servers/tomcat/files/6.0.2/tomcat.init @@ -0,0 +1,84 @@ +#!/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/6.0.2/tomcat.init,v 1.1 2006/11/20 04:32:22 wltjr Exp $ + +init_env_vars() { + # Set some sane defaults + if [ -z "${CATALINA_TMPDIR}" ] ; then + CATALINA_TMPDIR="${CATALINA_BASE}"/temp + fi + JPDA_TRANSPORT=${JPDA_TRANSPORT:="dt_socket"} + JPDA_ADDRESS=${JPDA_ADDRESS:="8000"} + JPDA_OPTS=${JPDA_OPTS="-Xdebug -Xrunjdwp:transport=${JPDA_TRANSPORT},address=${JPDA_ADDRESS},server=y,suspend=n"} + + # Activate Logging + if [[ -r "${CATALINA_HOME}"/bin/tomcat-juli.jar ]]; then + JAVA_OPTS="${JAVA_OPTS} -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager \ + -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.properties" + fi + + # Populate the classpath + CLASSPATH="${CLASSPATH}:${CATALINA_HOME}/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 + CLASSPATH="${CLASSPATH}:${CATALINA_HOME}/bin/bootstrap.jar:${CATALINA_HOME}/bin/tomcat-juli.jar" + + OPTS_CP="${JAVA_OPTS} ${CATALINA_OPTS} -classpath ${CLASSPATH}" + + CATALINA_ARGS="-Dcatalina.base=${CATALINA_BASE} \ + -Dcatalina.home=${CATALINA_HOME} \ + -Djava.io.tmpdir=${CATALINA_TMPDIR} \ + org.apache.catalina.startup.Bootstrap " +} + +start-helper() { + local executor=${1} + shift + local arguments="--start --quiet --background --chuid ${CATALINA_USER}:${CATALINA_GROUP} \ + --make-pidfile --pidfile /var/run/tomcat.pid" + start-stop-daemon ${arguments} --exec ${executor} -- ${OPTS_CP} "$@" ${CATALINA_ARGS} ${TOMCAT_START} + return $? +} + +depend() { + use dns logger net +} + +start() { + ebegin "Starting Tomcat" + init_env_vars + # Figure out what arguments to pass start-helper based on TOMCAT_START + if [[ "${TOMCAT_START}" == "debug" ]] ; then + start-helper ${JAVA_HOME}/bin/jdb \ + -sourcepath ${CATALINA_HOME}/../../jakarta-tomcat-catalina/catalina/src/share + elif [[ "${TOMCAT_START}" == "debug -security" ]] ; then + start-helper ${JAVA_HOME}/bin/jdb \ + -sourcepath ${CATALINA_HOME}/../../jakarta-tomcat-catalina/catalina/src/share \ + -Djava.security.manager \ + -Djava.security.policy=${CATALINA_BASE}/conf/catalina.policy + elif [[ "${TOMCAT_START}" == "jpda start" ]] ; then + start-helper ${JAVA_HOME}/bin/java ${JPDA_OPTS} + elif [[ "${TOMCAT_START}" == "start" ]] ; then + start-helper ${JAVA_HOME}/bin/java + elif [[ "${TOMCAT_START}" == "start -security" ]] ; then + start-helper ${JAVA_HOME}/bin/java \ + -Djava.security.manager \ + -Djava.security.policy=${CATALINA_BASE}/conf/catalina.policy + else + eerror "Invalid TOMCAT_START variable value, or one is not set" + eerror "Please see /etc/conf.d/tomcat-5.5 for more information" + eend 1 + fi + eend $? +} + +stop() { + ebegin "Stopping Tomcat" + init_env_vars + start-stop-daemon --stop --quiet \ + --make-pidfile --pidfile /var/run/tomcat.pid \ + --exec ${JAVA_HOME}/bin/java -- ${OPTS_CP} ${CATALINA_ARGS} stop + eend $? +} diff --git a/www-servers/tomcat/files/digest-tomcat-6.0.2 b/www-servers/tomcat/files/digest-tomcat-6.0.2 new file mode 100644 index 000000000000..97af87b00b4b --- /dev/null +++ b/www-servers/tomcat/files/digest-tomcat-6.0.2 @@ -0,0 +1,3 @@ +MD5 2f9fad7642013a5e4ccba3d763e6d479 apache-tomcat-6.0.2-src.tar.gz 3244552 +RMD160 9061581c2d43d2368d47570eb5841dffd50bd961 apache-tomcat-6.0.2-src.tar.gz 3244552 +SHA256 77c7facbaa3460aef31cb7695fe8138f8f82abd03e8273658687a630e756e324 apache-tomcat-6.0.2-src.tar.gz 3244552 diff --git a/www-servers/tomcat/tomcat-6.0.2.ebuild b/www-servers/tomcat/tomcat-6.0.2.ebuild new file mode 100644 index 000000000000..8c0b2cddff93 --- /dev/null +++ b/www-servers/tomcat/tomcat-6.0.2.ebuild @@ -0,0 +1,169 @@ +# 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-6.0.2.ebuild,v 1.1 2006/11/20 04:32:22 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="6" +SRC_URI="mirror://apache/${PN}/${PN}-6/v${PV}/src/${MY_P}.tar.gz" +HOMEPAGE="http://jakarta.apache.org/tomcat" +KEYWORDS="~amd64 ~x86" +LICENSE="Apache-2.0" + +IUSE="doc examples jni source test" + +RDEPEND=">=virtual/jre-1.5 + =dev-java/eclipse-ecj-3.2* + >=dev-java/commons-daemon-1.0.1 + >=dev-java/commons-dbcp-1.2.1 + >=dev-java/commons-logging-1.1 + >=dev-java/commons-pool-1.2 + jni? ( dev-libs/apr + dev-libs/openssl )" + +DEPEND=">=virtual/jdk-1.5 + ${RDEPEND} + sys-apps/sed + test? ( + dev-java/junit + dev-java/ant + ) + !test? ( dev-java/ant-core )" + +JAVA_PKG_NV_DEPEND="=virtual/jdk-1.5*" + +S=${WORKDIR}/${MY_P} + +TOMCAT_HOME="/usr/share/${PN}-${SLOT}" +TOMCAT_NAME="${PN}-${SLOT}" +WEBAPPS_DIR="/var/lib/${TOMCAT_NAME}/webapps" + +pkg_setup() { + enewgroup tomcat 265 + enewuser tomcat 265 -1 /dev/null tomcat + + JAVA_PKG_WANT_SOURCE="1.5" + JAVA_PKG_WANT_TARGET="1.5" +} + +src_unpack() { + unpack ${A} + cd ${S} + + epatch "${FILESDIR}/${PV}/build-xml.patch" + + cd ${S}/bin + java-pkg_jar-from commons-daemon +} + +src_compile(){ + # Prevent out of memory/heap space errors + java-pkg_force-compiler ecj-3.2 + + local antflags="build-jasper-jdt build-only -Dbase.path=${T}" + antflags="${antflags} -Dant.jar=$(java-pkg_getjar ant-core ant.jar)" + antflags="${antflags} -Dcommons-daemon.jar=$(java-pkg_getjar commons-daemon commons-daemon.jar)" + antflags="${antflags} -Dcommons-dbcp.jar=$(java-pkg_getjar commons-dbcp commons-dbcp.jar)" + antflags="${antflags} -Dcommons-pool.jar=$(java-pkg_getjar commons-pool commons-pool.jar)" + antflags="${antflags} -Djdt.jar=$(java-pkg_getjar eclipse-ecj-3.2 ecj.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)" + eant build-jasper-jdt ${antflags} + + if use jni; then + cd ${S}/native/connector + sh buildconf --with-apr=/usr || die + econf --with-apr=/usr --with-ssl=/usr || die + make || die + fi +} + +src_install() { + local CATALINA_BASE=/var/lib/${TOMCAT_NAME}/ + + # 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 /etc/${TOMCAT_NAME} + fperms 750 /etc/${TOMCAT_NAME} + dodir /usr/share/${TOMCAT_NAME} + keepdir /var/log/${TOMCAT_NAME}/ + keepdir /var/tmp/${TOMCAT_NAME}/ + keepdir /var/run/${TOMCAT_NAME}/ + dodir ${CATALINA_BASE} + diropts -m0755 + + cd ${S} + # we don't need dos scripts + rm -f bin/*.bat + + # fix context's since upstream is slackin + sed -i -e 's:}/server/:}/:' ${S}/webapps/host-manager/host-manager.xml + sed -i -e 's:}/server/:}/:' ${S}/webapps/manager/manager.xml + + # copy the manager's context to the right position + mkdir -p conf/Catalina/localhost + cp ${S}/webapps/host-manager/host-manager.xml conf/Catalina/localhost + cp ${S}/webapps/manager/manager.xml conf/Catalina/localhost + + # 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.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 output/build/bin output/build/lib ${D}/usr/share/${TOMCAT_NAME} \ + || die "failed to copy" + + cp ${T}/tomcat6-deps/jdt/jasper-jdt.jar ${D}/usr/share/${TOMCAT_NAME}/lib \ + || die "failed to copy" + + keepdir ${WEBAPPS_DIR} + chown tomcat:tomcat ${D}/${WEBAPPS_DIR} || die "Failed to change owner off ${1}." + chmod 750 ${D}/${WEBAPPS_DIR} || die "Failed to change permissions off ${1}." + + cd ${S} + + # 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 + + mkdir ${D}${TOMCAT_HOME}/webapps + chown tomcat:tomcat ${D}${TOMCAT_HOME}/webapps + cp -pr webapps/host-manager ${D}${TOMCAT_HOME}/webapps + cp -pr webapps/manager ${D}${TOMCAT_HOME}/webapps + + if use doc; then + cp -pr webapps/docs ${D}${CATALINA_BASE}/webapps + fi + if use examples; then + cp -pr webapps/examples \ + ${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}/{RELEASE-NOTES,RUNNING.txt} + fperms 640 /etc/${TOMCAT_NAME}/tomcat-users.xml +} + +pkg_postinst() { + einfo + einfo " This ebuild implements a FHS compliant layout for tomcat" + einfo " Please read http://www.gentoo.org/proj/en/java/tomcat-guide.xml" + einfo " for more information." + einfo + einfo " Please report any bugs to http://bugs.gentoo.org/" + einfo +} |