[tomcat6/f12/master] Adding patches needed by tomcat6.0.26.

Dave Knox dknox at fedoraproject.org
Tue Oct 12 16:20:31 UTC 2010


commit a8cd8d3c3bf3b7f7d8f40e2eeeab33e6ab28bebd
Author: david knox <dknox at 78-97-42-72.skybeam.com>
Date:   Thu Oct 7 14:08:54 2010 -0600

    Adding patches needed by tomcat6.0.26.

 tomcat6-6.0-CVE-2010-2227.patch         |  138 ++++++++++
 tomcat6-6.0-bootstrap-MANIFEST.MF.patch |   13 +-
 tomcat6.spec                            |  438 ++++++++++++++++++++++---------
 3 files changed, 465 insertions(+), 124 deletions(-)
---
diff --git a/tomcat6-6.0-CVE-2010-2227.patch b/tomcat6-6.0-CVE-2010-2227.patch
new file mode 100644
index 0000000..4f00c89
--- /dev/null
+++ b/tomcat6-6.0-CVE-2010-2227.patch
@@ -0,0 +1,138 @@
+--- java/org/apache/coyote/http11/Http11AprProcessor.java.orig	2010-07-12 11:52:05.981133000 -0400
++++ java/org/apache/coyote/http11/Http11AprProcessor.java	2010-07-12 11:59:39.205913000 -0400
+@@ -78,6 +78,12 @@
+     protected static StringManager sm =
+         StringManager.getManager(Constants.Package);
+ 
++   /**
++    * Tracks how many internal filters are in the filter library so they
++    * are skipped whe looking for pluggable filters
++    */
++   private int pluggableFilterIndex = Integer.MAX_VALUE;
++
+ 
+     // ----------------------------------------------------------- Constructors
+ 
+@@ -1736,6 +1742,8 @@
+         //inputBuffer.addFilter(new GzipInputFilter());
+         outputBuffer.addFilter(new GzipOutputFilter());
+ 
++        pluggableFilterIndex = inputBuffer.filterLibrary.length;
++
+     }
+ 
+ 
+@@ -1754,7 +1762,7 @@
+                 (inputFilters[Constants.CHUNKED_FILTER]);
+             contentDelimitation = true;
+         } else {
+-            for (int i = 2; i < inputFilters.length; i++) {
++            for (int i = pluggableFilterIndex; i < inputFilters.length; i++) {
+                 if (inputFilters[i].getEncodingName()
+                     .toString().equals(encodingName)) {
+                     inputBuffer.addActiveFilter(inputFilters[i]);
+--- java/org/apache/coyote/http11/Http11NioProcessor.java.orig	2010-07-12 12:00:05.720580000 -0400
++++ java/org/apache/coyote/http11/Http11NioProcessor.java	2010-07-12 12:19:36.465303000 -0400
+@@ -81,6 +81,12 @@
+      */
+     protected SSLSupport sslSupport;
+ 
++   /**
++    * Tracks how many internal filters are in the filter library so they
++    * are skipped whe looking for pluggable filters
++    */
++   private int pluggableFilterIndex = Integer.MAX_VALUE;
++
+     // ----------------------------------------------------------- Constructors
+ 
+ 
+@@ -1763,6 +1769,8 @@
+         //inputBuffer.addFilter(new GzipInputFilter());
+         outputBuffer.addFilter(new GzipOutputFilter());
+ 
++        pluggableFilterIndex = inputBuffer.filterLibrary.length;
++
+     }
+ 
+ 
+@@ -1781,7 +1789,7 @@
+                 (inputFilters[Constants.CHUNKED_FILTER]);
+             contentDelimitation = true;
+         } else {
+-            for (int i = 2; i < inputFilters.length; i++) {
++            for (int i = pluggableFilterIndex; i < inputFilters.length; i++) {
+                 if (inputFilters[i].getEncodingName()
+                     .toString().equals(encodingName)) {
+                     inputBuffer.addActiveFilter(inputFilters[i]);
+--- java/org/apache/coyote/http11/Http11Processor.java.orig	2010-07-12 12:20:42.784634000 -0400
++++ java/org/apache/coyote/http11/Http11Processor.java	2010-07-12 12:23:14.996732000 -0400
+@@ -76,6 +76,11 @@
+     protected static boolean isSecurityEnabled = 
+ 	org.apache.coyote.Constants.IS_SECURITY_ENABLED;
+ 
++   /**
++    * Tracks how many internal filters are in the filter library so they
++    * are skipped whe looking for pluggable filters
++    */
++   private int pluggableFilterIndex = Integer.MAX_VALUE;
+     // ------------------------------------------------------------ Constructor
+ 
+ 
+@@ -1642,6 +1647,7 @@
+         //inputBuffer.addFilter(new GzipInputFilter());
+         outputBuffer.addFilter(new GzipOutputFilter());
+ 
++        pluggableFilterIndex = inputBuffer.filterLibrary.length;
+     }
+ 
+ 
+@@ -1660,7 +1666,7 @@
+                 (inputFilters[Constants.CHUNKED_FILTER]);
+             contentDelimitation = true;
+         } else {
+-            for (int i = 2; i < inputFilters.length; i++) {
++            for (int i = pluggableFilterIndex; i < inputFilters.length; i++) {
+                 if (inputFilters[i].getEncodingName()
+                     .toString().equals(encodingName)) {
+                     inputBuffer.addActiveFilter(inputFilters[i]);
+--- java/org/apache/coyote/http11/filters/BufferedInputFilter.java.orig	2010-01-19 08:43:40.000000000 -0500
++++ java/org/apache/coyote/http11/filters/BufferedInputFilter.java	2010-07-12 13:00:50.374586000 -0400
+@@ -102,10 +102,14 @@
+     }
+ 
+     public void recycle() {
+-        if (buffered.getBuffer().length > 65536) {
+-            buffered = null;
+-        } else {
+-            buffered.recycle();
++        if (buffered != null)
++        {
++           if (buffered.getBuffer().length > 65536)
++           {
++              buffered = null;
++           } else {
++              buffered.recycle();
++           }
+         }
+         tempRead.recycle();
+         hasRead = false;
+
+--- webapps/docs/changelog.xml.orig	2010-07-12 16:08:24.000000000 -0600
++++ webapps/docs/changelog.xml	2010-07-12 16:12:43.000000000 -0600
+@@ -40,6 +40,16 @@
+         Correct TCK failures with security manager caused by the original fix
+         for <bug>47774</bug>. (markt)
+       </fix>
++      <fix>
++         Arange filter logic (jgclere) 
++         Several flaws in the handling of the 'Transfer-Encoding' header 
++         were found that prevented the recycling of a buffer. A remote 
++         attacker could trigger this flaw which would cause subsequent 
++         requests to fail and/or information to leak between requests. 
++         This flaw is mitigated if Tomcat is behind a reverse proxy 
++         (such as Apache httpd 2.2) as the proxy should reject the 
++         invalid transfer encoding header.
++      </fix>
+     </changelog>
+   </subsection>
+   <subsection name="Other">
diff --git a/tomcat6-6.0-bootstrap-MANIFEST.MF.patch b/tomcat6-6.0-bootstrap-MANIFEST.MF.patch
index 7b278dc..ac94aac 100644
--- a/tomcat6-6.0-bootstrap-MANIFEST.MF.patch
+++ b/tomcat6-6.0-bootstrap-MANIFEST.MF.patch
@@ -1,8 +1,9 @@
---- res/bootstrap.jar.manifest.orig	2007-06-21 11:02:18.000000000 -0400
-+++ res/bootstrap.jar.manifest	2007-06-21 11:02:26.000000000 -0400
-@@ -1,5 +1,4 @@
+--- res/META-INF/bootstrap.jar.manifest.orig	2010-04-06 10:11:09.000000000 -0600
++++ res/META-INF/bootstrap.jar.manifest	2010-04-06 10:45:56.000000000 -0600
+@@ -1,6 +1,5 @@
  Manifest-Version: 1.0
  Main-Class: org.apache.catalina.startup.Bootstrap
--Class-Path: commons-daemon.jar tomcat-juli.jar tomcat-coyote.jar
- Specification-Title: Catalina
- Specification-Version: 6.0
+-Class-Path: commons-daemon.jar tomcat-juli.jar
+ Specification-Title: Apache Tomcat Bootstrap
+ Specification-Version: @VERSION_MAJOR_MINOR@
+ Specification-Vendor: Apache Software Foundation
diff --git a/tomcat6.spec b/tomcat6.spec
index 5aa9a58..b90e868 100644
--- a/tomcat6.spec
+++ b/tomcat6.spec
@@ -28,33 +28,34 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-%define section free
+%global section free
 
-%define jspspec 2.1
-%define major_version 6
-%define minor_version 0
-%define micro_version 26
-%define packdname apache-tomcat-%{version}-src
-%define servletspec 2.5
-%define tcuid 91
+%global jspspec 2.1
+%global major_version 6
+%global minor_version 0
+%global micro_version 26
+%global packdname apache-tomcat-%{version}-src
+%global servletspec 2.5
+%global elspec 2.1
+%global tcuid 91
 
 # FHS 2.3 compliant tree structure - http://www.pathname.com/fhs/2.3/
-%define basedir %{_var}/lib/%{name}
-%define appdir %{basedir}/webapps
-%define bindir %{_datadir}/%{name}/bin
-%define confdir %{_sysconfdir}/%{name}
-%define homedir %{_datadir}/%{name}
-%define libdir %{_javadir}/%{name}
-%define logdir %{_var}/log/%{name}
-%define cachedir %{_var}/cache/%{name}
-%define tempdir %{cachedir}/temp
-%define workdir %{cachedir}/work
-%define _initrddir %{_sysconfdir}/init.d
+%global basedir %{_var}/lib/%{name}
+%global appdir %{basedir}/webapps
+%global bindir %{_datadir}/%{name}/bin
+%global confdir %{_sysconfdir}/%{name}
+%global homedir %{_datadir}/%{name}
+%global libdir %{_javadir}/%{name}
+%global logdir %{_var}/log/%{name}
+%global cachedir %{_var}/cache/%{name}
+%global tempdir %{cachedir}/temp
+%global workdir %{cachedir}/work
+%global _initrddir %{_sysconfdir}/init.d
 
 Name: tomcat6
 Epoch: 0
 Version: %{major_version}.%{minor_version}.%{micro_version}
-Release: 1%{?dist}
+Release: 2%{?dist}
 Summary: Apache Servlet/JSP Engine, RI for Servlet %{servletspec}/JSP %{jspspec} API
 
 Group: Networking/Daemons
@@ -69,24 +70,32 @@ Source5: %{name}-%{major_version}.%{minor_version}.logrotate
 Source6: %{name}-%{major_version}.%{minor_version}-digest.script
 Source7: %{name}-%{major_version}.%{minor_version}-tool-wrapper.script
 Source8: servlet-api-OSGi-MANIFEST.MF
+Source9: jsp-api-OSGi-MANIFEST.MF
+Source10: %{name}-%{major_version}.%{minor_version}-log4j.properties
 Patch0: %{name}-%{major_version}.%{minor_version}-bootstrap-MANIFEST.MF.patch
 Patch1: %{name}-%{major_version}.%{minor_version}-tomcat-users-webapp.patch
+Patch2: %{name}-%{major_version}.%{minor_version}-CVE-2010-2227.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 BuildArch: noarch
-
 BuildRequires: ant
 BuildRequires: ant-trax
 BuildRequires: ecj
 BuildRequires: findutils
 BuildRequires: jakarta-commons-collections
+BuildRequires: jakarta-commons-collections-tomcat5
 BuildRequires: jakarta-commons-daemon
+BuildRequires: jakarta-commons-dbcp-tomcat5
+BuildRequires: jakarta-commons-pool-tomcat5
+BuildRequires: jakarta-taglibs-standard
 BuildRequires: java-1.6.0-devel
 BuildRequires: jpackage-utils >= 0:1.7.0
 BuildRequires: junit
+BuildRequires: log4j
 Requires(pre): shadow-utils
 Requires(pre): shadow-utils
 Requires: jakarta-commons-daemon
 Requires: jakarta-commons-logging
+Requires: jakarta-commons-collections
 Requires: java-1.6.0
 Requires: procps
 Requires: %{name}-lib = %{epoch}:%{version}-%{release}
@@ -94,6 +103,8 @@ Requires(post): /sbin/chkconfig
 Requires(preun): /sbin/chkconfig
 Requires(post): /lib/lsb/init-functions
 Requires(preun): /lib/lsb/init-functions
+Requires(post): jpackage-utils
+Requires(postun): jpackage-utils
 
 %description
 Tomcat is the servlet container that is used in the official Reference
@@ -140,16 +151,25 @@ Requires(postun): %{_sbindir}/update-alternatives
 %description jsp-%{jspspec}-api
 Apache Tomcat JSP API implementation classes.
 
+
+%package log4j
+Group: Internet/WWW/Dynamic Content
+Summary: Log4j support for Apache Tomcat
+Requires: jakarta-commons-logging
+
+%description log4j
+Log4j support for Apache Tomcat
+
 %package lib
 Group: Development/Compilers
 Summary: Libraries needed to run the Tomcat Web container
 Requires: %{name}-jsp-%{jspspec}-api = %{epoch}:%{version}-%{release}
 Requires: %{name}-servlet-%{servletspec}-api = %{epoch}:%{version}-%{release}
-Requires(post): ecj
-Requires(post): %{_javadir}/ecj.jar
-Requires(post): jakarta-commons-collections-tomcat5
-Requires(post): jakarta-commons-dbcp-tomcat5
-Requires(post): jakarta-commons-pool-tomcat5
+Requires: %{name}-el-%{elspec}-api = %{epoch}:%{version}-%{release}
+Requires: ecj
+Requires: jakarta-commons-collections-tomcat5
+Requires: jakarta-commons-dbcp-tomcat5
+Requires: jakarta-commons-pool-tomcat5
 Requires(preun): coreutils
 
 %description lib
@@ -167,11 +187,22 @@ Requires(postun): %{_sbindir}/update-alternatives
 %description servlet-%{servletspec}-api
 Apache Tomcat Servlet API implementation classes.
 
+%package el-%{elspec}-api
+Group: Development/Libraries/Java
+Summary: Expression Language v1.0 API
+Provides: el_1_0_api = %{epoch}:%{version}-%{release}
+Provides: el_api = %{elspec}
+Requires(post): %{_sbindir}/update-alternatives
+Requires(postun): %{_sbindir}/update-alternatives
+
+%description el-%{elspec}-api
+Expression Language 1.0.
+
 %package webapps
 Group: System Environment/Applications
 Summary: The ROOT and examples web applications for Apache Tomcat
 Requires: %{name} = %{epoch}:%{version}-%{release}
-Requires(post): jakarta-taglibs-standard >= 0:1.1
+Requires: jakarta-taglibs-standard >= 0:1.1
 
 %description webapps
 The ROOT and examples web applications for Apache Tomcat.
@@ -180,43 +211,46 @@ The ROOT and examples web applications for Apache Tomcat.
 %setup -q -c -T -a 0
 # remove pre-built binaries and windows files
 find . -type f \( -name "*.bat" -o -name "*.class" -o -name Thumbs.db -o -name "*.gz" -o \
-          -name "*.jar" -o -name "*.war" -o -name "*.zip" \) | xargs -t %{__rm}
+   -name "*.jar" -o -name "*.war" -o -name "*.zip" \) | xargs -t %{__rm}
 pushd %{packdname}
 %patch0 -p0
 %patch1 -p0
+%patch2 -p0
+%{__ln_s} $(build-classpath jakarta-taglibs-core) webapps/examples/WEB-INF/lib/jstl.jar
+%{__ln_s} $(build-classpath jakarta-taglibs-standard) webapps/examples/WEB-INF/lib/standard.jar
 popd
 
 %build
 export CLASSPATH=
 export OPT_JAR_LIST="ant/ant-trax"
 pushd %{packdname}
-    # we don't care about the tarballs and we're going to replace
-    # tomcat-dbcp.jar with jakarta-commons-{collections,dbcp,pool}-tomcat5.jar
-    # so just create a dummy file for later removal
-    touch HACK
-    # who needs a build.properties file anyway
-    %{ant} -Dbase.path="." \
-        -Dbuild.compiler="modern" \
-        -Dcommons-collections.jar="$(build-classpath commons-collections)" \
-        -Dcommons-daemon.jar="$(build-classpath commons-daemon)" \
-        -Dcommons-daemon.jsvc.tar.gz="HACK" \
-        -Djasper-jdt.jar="$(build-classpath ecj)" \
-        -Djdt.jar="$(build-classpath ecj)" \
-        -Dtomcat-dbcp.jar="HACK" \
-        -Dtomcat-native.tar.gz="HACK" \
-        -Dversion="%{version}" \
-        -Dversion.build="%{micro_version}"
-    # javadoc generation
-    %{ant} -f dist.xml dist-prepare
-    %{ant} -f dist.xml dist-source
-    %{ant} -f dist.xml dist-javadoc
+   # we don't care about the tarballs and we're going to replace
+   # tomcat-dbcp.jar with jakarta-commons-{collections,dbcp,pool}-tomcat5.jar
+   # so just create a dummy file for later removal
+   touch HACK
+   # who needs a build.properties file anyway
+   %{ant} -Dbase.path="." \
+      -Dbuild.compiler="modern" \
+      -Dcommons-collections.jar="$(build-classpath commons-collections)" \
+      -Dcommons-daemon.jar="$(build-classpath commons-daemon)" \
+      -Dcommons-daemon.jsvc.tar.gz="HACK" \
+      -Djasper-jdt.jar="$(build-classpath ecj)" \
+      -Djdt.jar="$(build-classpath ecj)" \
+      -Dtomcat-dbcp.jar="HACK" \
+      -Dtomcat-native.tar.gz="HACK" \
+      -Dversion="%{version}" \
+      -Dversion.build="%{micro_version}"
+   # javadoc generation
+   %{ant} -f dist.xml dist-prepare
+   %{ant} -f dist.xml dist-source
+   %{ant} -f dist.xml dist-javadoc
     # remove some jars that we'll replace with symlinks later
-    %{__rm} output/build/bin/commons-daemon.jar \
-            output/build/lib/ecj.jar
+   %{__rm} output/build/bin/commons-daemon.jar \
+      output/build/lib/ecj.jar
     # remove the cruft we created
-    %{__rm} output/build/bin/HACK \
-            output/build/bin/tomcat-native.tar.gz \
-            output/build/lib/HACK
+   %{__rm} output/build/bin/HACK \
+      output/build/bin/tomcat-native.tar.gz \
+      output/build/lib/HACK
 popd
 pushd %{packdname}/output/dist/src/webapps/docs/appdev/sample/src
 %{__mkdir_p} ../web/WEB-INF/classes
@@ -231,6 +265,9 @@ mkdir -p META-INF
 cp -p %{SOURCE8} META-INF/MANIFEST.MF
 touch META-INF/MANIFEST.MF
 zip -u %{packdname}/output/build/lib/servlet-api.jar META-INF/MANIFEST.MF
+cp -p %{SOURCE9} META-INF/MANIFEST.MF
+touch META-INF/MANIFEST.MF
+zip -u %{packdname}/output/build/lib/jsp-api.jar META-INF/MANIFEST.MF
 
 %install
 %{__rm} -rf $RPM_BUILD_ROOT
@@ -243,16 +280,19 @@ zip -u %{packdname}/output/build/lib/servlet-api.jar META-INF/MANIFEST.MF
 %{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
 %{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{appdir}
 %{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{bindir}
-%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{confdir}
-%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{confdir}/Catalina/localhost
+%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{confdir}
+%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{confdir}/Catalina/localhost
 %{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{libdir}
-%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{logdir}
-%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{homedir}
-%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{tempdir}
-%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{workdir}
+%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{logdir}
+%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{homedir}
+%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{tempdir}
+%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{workdir}
+
 # move things into place
+# First copy supporting libs to tomcat lib
 pushd %{packdname}/output/build
     %{__cp} -a bin/*.{jar,xml} ${RPM_BUILD_ROOT}%{bindir}
+    %{__cp} %{SOURCE10} conf/log4j.properties
     %{__cp} -a conf/*.{policy,properties,xml} ${RPM_BUILD_ROOT}%{confdir}
     %{__cp} -a lib/*.jar ${RPM_BUILD_ROOT}%{libdir}
     %{__cp} -a webapps/* ${RPM_BUILD_ROOT}%{appdir}
@@ -262,12 +302,12 @@ pushd %{packdname}/output/dist/webapps
     %{__cp} -a docs/api/* ${RPM_BUILD_ROOT}%{_javadocdir}/%{name}
 popd
 %{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-         -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-         -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE1} \
+   -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
+   -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE1} \
     > ${RPM_BUILD_ROOT}%{confdir}/%{name}.conf
 %{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-         -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-         -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE3} \
+   -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
+   -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE3} \
     > ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{name}
 %{__install} -m 0644 %{SOURCE2} \
     ${RPM_BUILD_ROOT}%{_initrddir}/%{name}
@@ -277,41 +317,60 @@ popd
 %{__sed} -e "s|\@\@\@TCLOG\@\@\@|%{logdir}|g" %{SOURCE5} \
     > ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}
 %{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-         -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-         -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE6} \
+   -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
+   -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE6} \
     > ${RPM_BUILD_ROOT}%{_bindir}/%{name}-digest
 %{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-         -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-         -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE7} \
+   -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
+   -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE7} \
     > ${RPM_BUILD_ROOT}%{_bindir}/%{name}-tool-wrapper
 # create jsp and servlet API symlinks
 pushd ${RPM_BUILD_ROOT}%{_javadir}
-    %{__mv} %{name}/jsp-api.jar %{name}-jsp-%{jspspec}-api-%{version}.jar
-    %{__mv} %{name}/servlet-api.jar \
-        %{name}-servlet-%{servletspec}-api-%{version}.jar
-    %{__ln_s} %{name}-jsp-%{jspspec}-api-%{version}.jar \
-        %{name}-jsp-%{jspspec}-api.jar
-    %{__ln_s} %{name}-servlet-%{servletspec}-api-%{version}.jar \
-        %{name}-servlet-%{servletspec}-api.jar
+   %{__mv} %{name}/jsp-api.jar %{name}-jsp-%{jspspec}-api-%{version}.jar
+   %{__mv} %{name}/servlet-api.jar \
+      %{name}-servlet-%{servletspec}-api-%{version}.jar
+   %{__mv} %{name}/el-api.jar %{name}-el-%{elspec}-api-%{version}.jar
+   %{__ln_s} %{name}-jsp-%{jspspec}-api-%{version}.jar \
+      %{name}-jsp-%{jspspec}-api.jar
+   %{__ln_s} %{name}-servlet-%{servletspec}-api-%{version}.jar \
+      %{name}-servlet-%{servletspec}-api.jar
+   %{__ln_s} %{name}-el-%{elspec}-api-%{version}.jar %{name}-el-%{elspec}-api.jar
+popd
+
+pushd %{packdname}/output/build
+   %{_bindir}/build-jar-repository lib commons-collections-tomcat5 \
+    commons-dbcp-tomcat5 commons-pool-tomcat5 ecj 2>&1
+# need to use -p here with b-j-r otherwise the examples webapp fails to
+# load with a java.io.IOException
+   %{_bindir}/build-jar-repository -p webapps/examples/WEB-INF/lib \
+    taglibs-core.jar taglibs-standard.jar 2>&1
 popd
+
 pushd ${RPM_BUILD_ROOT}%{libdir}
-    # fix up jars to include version number
-    for i in *.jar; do
-        j="$(echo $i | %{__sed} -e 's,\.jar$,,')"
-        %{__mv} ${j}.jar ${j}-%{version}.jar
-        %{__ln_s} ${j}-%{version}.jar ${j}.jar
+   # fix up jars to include version number
+   for i in *.jar; do
+      j="$(echo $i | %{__sed} -e 's,\.jar$,,')"
+      %{__mv} ${j}.jar ${j}-%{version}.jar
+      %{__ln_s} ${j}-%{version}.jar ${j}.jar
     done
     # symlink JSP and servlet API jars
     %{__ln_s} ../%{name}-jsp-%{jspspec}-api-%{version}.jar .
     %{__ln_s} ../%{name}-servlet-%{servletspec}-api-%{version}.jar .
+    %{__ln_s} ../%{name}-el-%{elspec}-api-%{version}.jar
+    %{__cp} -p $(build-classpath commons-collections-tomcat5) .
+    %{__cp} -p $(build-classpath log4j) .
+    %{__ln_s} log4j log4j-%{version}.jar
+    %{__ln_s} $(build-classpath commons-dbcp-tomcat5) .
+    %{__ln_s} $(build-classpath commons-pool-tomcat5) .
+    %{__ln_s} $(build-classpath ecj) jasper-jdt.jar
 popd
 pushd ${RPM_BUILD_ROOT}%{bindir}
-    # fix up jars to include version number
-    for i in *.jar; do
-        j="$(echo $i | %{__sed} -e 's,\.jar$,,')"
-        %{__mv} ${j}.jar ${j}-%{version}.jar
-        %{__ln_s} ${j}-%{version}.jar ${j}.jar
-    done
+   # fix up jars to include version number
+   for i in *.jar; do
+      j="$(echo $i | %{__sed} -e 's,\.jar$,,')"
+      %{__mv} ${j}.jar ${j}-%{version}.jar
+      %{__ln_s} ${j}-%{version}.jar ${j}.jar
+   done
 popd
 # symlink to the FHS locations where we've installed things
 pushd ${RPM_BUILD_ROOT}%{homedir}
@@ -330,6 +389,47 @@ pushd ${RPM_BUILD_ROOT}%{appdir}/sample
 popd
 %{__rm} ${RPM_BUILD_ROOT}%{appdir}/docs/appdev/sample/sample.war
 
+# Link the juli jars into /usr/share/java/tomcat6
+pushd ${RPM_BUILD_ROOT}%{libdir}
+%{__ln_s} %{bindir}/tomcat-juli* .
+popd
+
+# Install the maven metadata
+%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_mavenpomdir}
+pushd %{packdname}/output/dist/src/res/maven
+for file in *.pom; do
+   base=`basename $file .pom`
+   # Some POMs don't actually have corresponding jar files in the current RPM
+   if [ $base != 'dbcp' -a $base != 'juli-adapters' -a $base != 'juli-extras' ]; then
+      sed -i 's/@MAVEN.DEPLOY.VERSION@/%{version}/g' $file
+      %{__cp} -a $file ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP-%{name}-$file
+      # Some jar files have tomcat6 prepended and some don't, and some have their
+      # canonical home outside of the tomcat6 subdirectory
+      jppdir="JPP/%{name}"
+      if [ $base = 'coyote' -o $base = 'jsp-api' -o $base = 'servlet-api' ]; then
+         jpp="%{name}-$base"
+         jppdir="JPP"
+      else
+         if [ $base = 'tribes' ]; then
+            jpp=catalina-$base
+         else
+            if [ $base = 'juli' -o $base = 'coyote' ]; then
+               jpp=tomcat-$base
+            else
+               jpp=$base
+            fi
+         fi
+      fi
+
+      if [ $base = 'jasper-jdt' ]; then
+         %add_to_maven_depmap org.apache.tomcat $base %{version} JPP ecj 3.4.2
+      else
+         %add_to_maven_depmap org.apache.tomcat $base %{version} $jppdir $jpp %{version}
+      fi
+   fi
+done
+
+
 %clean
 %{__rm} -rf $RPM_BUILD_ROOT
 
@@ -342,38 +442,51 @@ popd
 %post
 # install but don't activate
 /sbin/chkconfig --add %{name}
+%update_maven_depmap
 
 %post jsp-%{jspspec}-api
 %{_sbindir}/update-alternatives --install %{_javadir}/jsp.jar jsp \
     %{_javadir}/%{name}-jsp-%{jspspec}-api.jar 20100
 
-%post lib
-%{_bindir}/build-jar-repository %{libdir} commons-collections-tomcat5 \
-    commons-dbcp-tomcat5 commons-pool-tomcat5 ecj 2>&1
+#%post lib
+#%{_bindir}/build-jar-repository %{libdir} commons-collections-tomcat5 \
+#    commons-dbcp-tomcat5 commons-pool-tomcat5 ecj 2>&1
 
 %post servlet-%{servletspec}-api
 %{_sbindir}/update-alternatives --install %{_javadir}/servlet.jar servlet \
     %{_javadir}/%{name}-servlet-%{servletspec}-api.jar 20500
 
-%post webapps
-%{_bindir}/build-jar-repository %{appdir}/examples/WEB-INF/lib \
-    taglibs-core.jar taglibs-standard.jar 2>&1
+%post el-%{elspec}-api
+%{_sbindir}/update-alternatives --install %{_javadir}/elspec.jar elspec \
+   %{_javadir}/%{name}-el-%{elspec}-api.jar 20250
+
+#%post webapps
+# need to use -p here with b-j-r otherwise the examples webapp fails to
+# load with a java.io.IOException
+#%{_bindir}/build-jar-repository -p %{appdir}/examples/WEB-INF/lib \
+#    taglibs-core.jar taglibs-standard.jar 2>&1
 
 %preun
 # clean tempdir and workdir on removal or upgrade
-%{__rm} -rf %{workdir}/* %{tempdir}/*
+%{__rm} -rf %{workdir} %{tempdir}
 if [ "$1" = "0" ]; then
     %{_initrddir}/%{name} stop >/dev/null 2>&1
     /sbin/chkconfig --del %{name}
 fi
 
-%preun lib
-if [ "$1" = "0" ]; then
-    %{__rm} -f %{libdir}/\[commons-collections-tomcat5\].jar \
-        %{libdir}/\[commons-dbcp-tomcat5\].jar \
-        %{libdir}/\[commons-pool-tomcat5\].jar \
-        %{libdir}/\[ecj\].jar >/dev/null 2>&1
-fi
+#%preun lib
+#if [ "$1" = "0" ]; then
+#    %{__rm} -f %{libdir}/\[commons-collections-tomcat5\].jar \
+#        %{libdir}/\[commons-dbcp-tomcat5\].jar \
+#        %{libdir}/\[commons-pool-tomcat5\].jar \
+#        %{libdir}/\[ecj\].jar >/dev/null 2>&1
+#fi
+
+%postun
+%update_maven_depmap
+%{__rm} -rf %{appdir}
+%{__rm} -rf %{confdir}
+%{__rm} -rf %{libdir}
 
 %postun jsp-%{jspspec}-api
 if [ "$1" = "0" ]; then
@@ -387,36 +500,60 @@ if [ "$1" = "0" ]; then
         %{_javadir}/%{name}-servlet-%{servletspec}-api.jar
 fi
 
+%postun el-%{elspec}-api
+if [ "$1" = "0" ]; then
+    %{_sbindir}/update-alternatives --remove elspec \
+        %{_javadir}/%{name}-el-%{elspec}-api.jar
+fi
+
 %files
-%defattr(0644,root,root,0755)
+%defattr(0644,root,tomcat,0775)
 %doc %{packdname}/{LICENSE,NOTICE,RELEASE*}
 %attr(0755,root,root) %{_bindir}/%{name}-digest
 %attr(0755,root,root) %{_bindir}/%{name}-tool-wrapper
 %attr(0755,root,root) %{_sbindir}/d%{name}
 %attr(0755,root,root) %{_sbindir}/%{name}
-%attr(0775,root,tomcat) %dir %{logdir}
 %attr(0755,root,root) %{_initrddir}/%{name}
 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
 %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
-%dir %{basedir}
-%attr(0775,root,tomcat) %dir %{appdir}
-%dir %{confdir}
-%dir %{confdir}/Catalina
-%attr(0775,root,tomcat) %dir %{confdir}/Catalina/localhost
+%attr(0765,root,tomcat) %dir %{basedir}
+%attr(0765,root,tomcat) %dir %{appdir}
+%attr(0765,root,tomcat) %dir %{confdir}
+%attr(0765,root,tomcat) %dir %{confdir}/Catalina
+#%dir %{confdir}
+#%dir %{confdir}/Catalina
+%attr(0765,root,tomcat) %dir %{confdir}/Catalina/localhost
 %config(noreplace) %{confdir}/%{name}.conf
 %config(noreplace) %{confdir}/*.policy
 %config(noreplace) %{confdir}/*.properties
 %config(noreplace) %{confdir}/context.xml
 %config(noreplace) %{confdir}/server.xml
-%attr(0660,root,tomcat) %config(noreplace) %{confdir}/tomcat-users.xml
+%attr(0664,root,tomcat) %config(noreplace) %{confdir}/tomcat-users.xml
 %config(noreplace) %{confdir}/web.xml
-%attr(0775,root,tomcat) %dir %{cachedir}
-%attr(0775,root,tomcat) %dir %{tempdir}
-%attr(0775,root,tomcat) %dir %{workdir}
-%{homedir}
+%attr(0765,tomcat,root) %dir %{cachedir}
+%attr(0765,tomcat,root) %dir %{tempdir}
+%attr(0765,tomcat,root) %dir %{workdir}
+%attr(0765,root,tomcat) %dir %{logdir}
+%dir %{homedir}
+#%attr(0765,root,tomcat) %{homedir}/conf
+%{bindir}/bootstrap-%{version}.jar
+%{bindir}/bootstrap.jar
+%{bindir}/catalina-tasks.xml
+%{bindir}/tomcat-juli-%{version}.jar
+%{bindir}/tomcat-juli.jar
+%{homedir}/lib
+%{homedir}/temp
+%{homedir}/webapps
+%{homedir}/work
+%{homedir}/logs
+%{homedir}/conf
+%{_mavendepmapfragdir}/*
+%{_mavenpomdir}/*.pom
+# Exclude the POMs that are in sub-packages
+%exclude %{_mavenpomdir}/*api*
 
 %files admin-webapps
-%defattr(0644,root,root,0755)
+%defattr(0644,root,root,0775)
 %{appdir}/host-manager
 %{appdir}/manager
 
@@ -430,7 +567,14 @@ fi
 
 %files jsp-%{jspspec}-api
 %defattr(0644,root,root,0755)
-%{_javadir}/%{name}-jsp*.jar
+%{_javadir}/%{name}-jsp-%{jspspec}*.jar
+%{_mavenpomdir}/JPP-%{name}-jsp-api.pom
+
+%files log4j
+%defattr(0644,root,tomcat,0775)
+%config(noreplace) %{confdir}/log4j.properties
+%{libdir}/log4j.jar
+%{libdir}/log4j-%{version}.jar
 
 %files lib
 %defattr(0644,root,root,0755)
@@ -438,25 +582,83 @@ fi
 
 %files servlet-%{servletspec}-api
 %defattr(0644,root,root,0755)
-%{_javadir}/%{name}-servlet*.jar
+%{_javadir}/%{name}-servlet-%{servletspec}*.jar
+%{_mavenpomdir}/JPP-%{name}-servlet-api.pom
+
+%files el-%{elspec}-api
+%defattr(0665,root,root,0755)
+%{_javadir}/%{name}-el-%{elspec}-api-%{version}.jar
+%{_javadir}/%{name}-el-%{elspec}-api.jar
+%{_javadir}/%{name}/%{name}-el-%{elspec}-api-%{version}.jar
+%{_mavenpomdir}/JPP-%{name}-el-api.pom
 
 %files webapps
-%defattr(0644,root,root,0755)
+%defattr(0644,root,tomcat,0775)
 %{appdir}/ROOT
 %{appdir}/examples
 %{appdir}/sample
 
 %changelog
 * Thu Oct 07 2010 David Knox <dknox at redhat.com> 0:6.0.26-1
-- uploaded new sources for 6.0.26
+- copied spec and patches from f13 to bring f12 up to date
+- with all tomcat6 fedora.
+
+* Mon Oct 04 2010 David Knox <dknox at redhat.com> 0:6.0.26-10
+- ant-nodeps is breaking the build. Put ant-nodeps on the 
+- OPT_JAR_LIST
+
+* Fri Oct 01 2010 David Knox <dknox at rehat.com> 0:6.0.26-9
+- Resolves rhbz#575341 - Additionally created instances of Tomcat 
+- are broken
+
+* Fri Jul 02 2010 David Knox <dknox at rehat.com> 0:6.0.26-8
+- LSB initscript compliance 
+
+* Thu Jul 01 2010 David Knox <dknox at redhat.com> 0:6.0.26-7
+- Made elspec the standard for elspec %post and %postun.
+
+* Tue Jun 29 2010 David Knox <dknox at redhat.com> 0:6.0.26-6
+- Completed package and file sections. Added el-spec. Fixed
+- directory permission problems.
+
+* Thu May 6 2010 David Knox <dknox at redhat.com> 0:6.0.26-5
+- Working on 589145. Tomcat can't find java compiler for java.
+
+* Tue Apr 08 2010 David Knox <dknox at redhat.com> 0:6.0.26-4
+- Moved build-jar-repository to later in the install process.  
+
+* Tue Apr 06 2010 David Knox <dknox at redhat.com> 0:6.0.26-3
+- Incremented the Release tag to 3 to avoid any confusion about which
+- is the most recent
+
+* Tue Apr 06 2010 David Knox <dknox at redhat.com> 0:6.0.26-1
+- Solved packaging problems involving taglibs-standard
+- Solved packaging problems involving jakarta-commons
+- Corrected Requires(post) to Requires and checked companion BuildRequires
+
+* Mon Mar 29 2010 David Knox <dknox at redhat.com> 0:6.0.26-2
+- Update source to tomcat6.0.26
+- Bugzilla 572357 - Please retest. 
+- OSGi manifests for servlet-api and jsp-api
+
+
+* Fri Mar 26 2010 Mary Ellen Foster <mefoster at gmail.com> 0:6.0.24-2
+- Add maven POMs and metadata
+- Link tomcat6-juli into /usr/share/java/tomcat6
+
+* Mon Mar 1 2010 Alexander Kurtakov <akurtako at redhat.com> 0:6.0.24-1
+- Update to 6.0.24.
+
+* Tue Dec 22 2009 Alexander Kurtakov <akurtako at redhat.com> 0:6.0.20-2
+- Drop file requires on /usr/share/java/ecj.jar.
 
-* Mon Nov 9 2009 Alexander Kurtakov <akurtako at redhat.com> 0:%{major_version}.%{minor_version}.%{micro_version}-1
+* Mon Nov 9 2009 Alexander Kurtakov <akurtako at redhat.com> 0:6.0.20-1
 - Update to 6.0.20. Fixes CVE-2009-0033,CVE-2009-0580. 
 
 * Sun Jul 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0:6.0.18-10.2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 
-* Wed Apr 1 2009 akurtakov <akurtakov at dhcp-lab-180.englab.brq.redhat.com> 0:6.0.18-9.2
+* Wed Apr 1 2009 Alexander Kurtakov <akurtako at redhat.com> 0:6.0.18-9.2
 - Add OSGi manifest for servlet-api.
 
 * Wed Feb 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0:6.0.18-9.1


More information about the scm-commits mailing list