apache-tomcat/apache-tomcat.spec

801 lines
34 KiB
RPMSpec
Raw Permalink Normal View History

%define jsp_api_version 2.2
%define servlet_api_version 3.0
%define el_api_version 2.2
%define with_embed 1
%define pkgname apache-tomcat-%{version}-src
%define pkg_dir %{_builddir}/apache-tomcat-%{version}/%{pkgname}
%define tom_name tomcat7
%define native_ver 1.1.20
%define daemon_ver 1.0.5
%define logging_ver 1.1.1
%define dojo_ver 1.1.1
# FHS 2.3 compliant tree structure - http://www.pathname.com/fhs/2.3/
%define appdir %{_localstatedir}/lib/%{tom_name}/webapps
%define bindir %{_datadir}/%{tom_name}/bin
%define confdir %{_sysconfdir}/%{tom_name}
%define homedir %{_datadir}/%{tom_name}
%define libdir %{_javadir}/%{tom_name}
%define logdir %{_localstatedir}/log/%{tom_name}
%global cachedir %{_localstatedir}/cache/%{tom_name}
%define tempdir %{cachedir}/temp
%define workdir %{cachedir}/work
%define javahome /usr/lib/jvm/java
%define version_build %(echo %version | cut -d. -f 3-)
Name: apache-tomcat
Version: 7.0.20
Release: 1mamba
Summary: Apache Servlet/JSP Engine, RI for Servlet %{servlet_api_version}/JSP %{jsp_api_version} API
Group: System/Servers
Vendor: openmamba
Distribution: openmamba
Packager: gil <puntogil@libero.it>
URL: http://tomcat.apache.org
Source0: http://apache.fis.uniroma2.it/tomcat/tomcat-7/v%{version}/src/apache-tomcat-%{version}-src.tar.gz
# svn export http://svn.apache.org/repos/asf/tomcat/tc7.0.x/tags/TOMCAT_7_0_9/ apache-tomcat-7.0.9-src
#Source0: apache-tomcat-%{version}-src-svn.tar.gz
Source1: apache-tomcat-7.0.conf
Source2: apache-tomcat-7.0.init
Source3: apache-tomcat-7.0.sysconfig
Source4: apache-tomcat-7.0.wrapper
Source5: apache-tomcat-7.0.logrotate
Source6: apache-tomcat-7.0-digest.script
Source7: apache-tomcat-7.0-tool-wrapper.script
Source8: apache-tomcat-7.0-log4j.properties
Source9: http://archive.apache.org/dist/commons/logging/source/commons-logging-%{logging_ver}-src.tar.gz
Source10: apache-tomcat-7.0-build.properties
Source11: apache-tomcat-7.0-context-host-manager.xml
Source12: apache-tomcat-7.0-context-examples.xml
Source13: apache-tomcat-7.0-context-docs.xml
Source14: apache-tomcat-7.0-context-ROOT.xml
Source15: apache-tomcat-7.0-context-manager.xml
#Source16: http://download.dojotoolkit.org/release-%{dojo_ver}/dojo-release-%{dojo_ver}.tar.gz
Patch0: apache-tomcat-7.0.8-build_xml.patch
Patch1: apache-tomcat-7.0.8-bootstrap-MANIFEST.MF.patch
Patch2: apache-tomcat-7.0.8-tomcat-users-webapp.patch
Patch3: apache-tomcat-7.0.9-catalina_policy-javadir.patch
Patch4: apache-tomcat-7.0.9-server_xml-userdir.patch
Patch5: apache-tomcat-7.0.9-server_xml-URIEncoding-utf8.patch
Patch6: apache-tomcat-7.0.9-tomcat-users_xml-admin.patch
Patch7: apache-tomcat-7.0.9-LDAPUserDatabase.patch
License: Apache Software License Version 2.0
BuildRequires: apache-ant
BuildRequires: apache-ant-trax
BuildRequires: apache-log4j
BuildRequires: apache-commons-dbcp
BuildRequires: apache-geronimo-1.2-specs
BuildRequires: coreutils
BuildRequires: eclipse-ecj
BuildRequires: findutils
BuildRequires: jakarta-commons-collections
BuildRequires: jakarta-commons-collections-tomcat5
BuildRequires: apache-commons-daemon
BuildRequires: apache-commons-pool
BuildRequires: apache-tomcat-dbcp == %{version}
BuildRequires: jakarta-taglibs-standard
BuildRequires: java-checkstyle == 5.1
BuildRequires: java-excalibur-avalon-framework
BuildRequires: java-excalibur-avalon-logkit
BuildRequires: java-json
BuildRequires: java-junit3
BuildRequires: java-mysql-connector
BuildRequires: java-openjdk
BuildRequires: java-wsdl4j
BuildRequires: jpackage-utils
Requires: apache-geronimo-1.2-specs
Requires: apache-commons-daemon
Requires: apache-commons-daemon-jsvc
Requires: eclipse-ecj
Requires: jakarta-commons-logging == %{logging_ver}
Requires: java-checkstyle == 5.1
Requires: java-mysql-connector
Requires: java-openjdk-runtime
Requires: java-wsdl4j
Requires: libtomcat-native == %{native_ver}
Requires: lib%{tom_name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: procps
Requires: shadow-common
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
Tomcat is developed in an open and participatory environment and released under the Apache Software License 2.0. Tomcat is intended to be a collaboration of the best-of-breed developers from around the world.
We invite you to participate in this open development project.
%package admin
Group: System/Servers
Summary: The host-manager and manager web applications for Apache Tomcat
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
%description admin
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
The host-manager and manager web applications for Apache Tomcat.
%package webapps
Group: System/Servers
Summary: The ROOT and examples web applications for Apache Tomcat
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: jakarta-taglibs-standard
Obsoletes: %{name}-devel
Provides: %{name}-devel
%description webapps
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
The ROOT and examples web applications for Apache Tomcat.
%package el-%{el_api_version}-api
Group: Development/Libraries/Java
Summary: Expression Language v1.0 API
Provides: elapi7
%description el-%{el_api_version}-api
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This package contains the implementation classes of the Apache Tomcat Expression Language v1.0 API.
%package servlet-%{servlet_api_version}-api
Group: Development/Libraries/Java
Summary: Java API for Servlets
Provides: servletapi7
%description servlet-%{servlet_api_version}-api
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This subproject contains the source code for the implementation classes of the Java Servlet and JSP APIs (packages javax.servlet).
%package jsp-%{jsp_api_version}-api
Group: Development/Libraries/Java
Summary: Java API for JavaServer Pages
Requires: %{name}-servlet-%{servlet_api_version}-api = %{?epoch:%epoch:}%{version}-%{release}
Provides: jspapi7
%description jsp-%{jsp_api_version}-api
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
Contains the implementation classes of the Apache Tomcat JSP API (packages javax.servlet.jsp)
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
%description javadoc
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This package contains documentation for %{name}.
%package el-%{el_api_version}-api-javadoc
Group: Documentation
Summary: Javadoc for %{name}-el-%{el_api_version}-api
%description el-%{el_api_version}-api-javadoc
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This package contains documentation for %{name}-el-%{el_api_version}-api.
%package jsp-%{jsp_api_version}-api-javadoc
Group: Documentation
Summary: Javadoc for %{name}-jsp-%{jsp_api_version}-api
%description jsp-%{jsp_api_version}-api-javadoc
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This package contains documentation for %{name}-jsp-%{jsp_api_version}-api.
%package servlet-%{servlet_api_version}-api-javadoc
Group: Documentation
Summary: Javadoc for %{name}-servlet-%{servlet_api_version}-api
%description servlet-%{servlet_api_version}-api-javadoc
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This package contains documentation for %{name}-servlet-%{servlet_api_version}-api.
%package -n lib%{tom_name}
Group: Development/Languages
Summary: Libraries needed to run the Tomcat Web container
Requires: eclipse-ecj
Requires: jakarta-commons-collections-tomcat5
Requires: apache-commons-dbcp
Requires: apache-commons-pool
Requires: apache-tomcat-dbcp == %{version}
Requires: %{name}-jsp-%{jsp_api_version}-api = %{?epoch:%epoch:}%{version}-%{release}
Requires: %{name}-servlet-%{servlet_api_version}-api = %{?epoch:%epoch:}%{version}-%{release}
Requires: coreutils
%description -n lib%{tom_name}
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This package contains libraries needed to run the Tomcat Web container.
%package webapp-docs
Group: Documentation
Summary: The docs web application for Apache Tomcat
Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release}
Requires: jakarta-taglibs-standard
%description webapp-docs
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
The docs web application for Apache Tomcat.
%package log4j
Group: System/Servers
Summary: Log4j support for Apache Tomcat
Requires: apache-log4j
Requires: jakarta-commons-logging
%description log4j
Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies.
The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process.
This package contains Log4j support for Apache Tomcat
%prep
%setup -q -c -T -a 0
find . -type f \( -name "*.bat" -o -name "*.jar" -o -name "*.class" -o -name Thumbs.db -o -name "*.war" -o -name "*.gz" -o -name "*.zip" \) | xargs -t rm
pushd %{pkg_dir}/
%patch0 -p0
%patch1 -p0
%patch2 -p0
%patch3 -p0
%patch4 -p0
%patch5 -p0
%patch6 -p0
%patch7 -p0
mkdir -p tomcat-native-%{native_ver}/ output/extras-src-jars
mkdir -p tomcat7-deps/dbcp/
ln -sf %{_javadir}/tomcat7/tomcat-dbcp.jar tomcat7-deps/dbcp/tomcat-dbcp.jar
ln -sf $(build-classpath jakarta-taglibs-core) webapps/examples/WEB-INF/lib/jstl.jar
ln -sf $(build-classpath jakarta-taglibs-standard) webapps/examples/WEB-INF/lib/standard.jar
%if %with_embed
mkdir -p output/extras/logging
(
cd output/extras/logging
tar -xf %{SOURCE9}
)
%endif
cp %{SOURCE10} build.properties
popd
%build
export CLASSPATH=$(build-classpath wsdl4j ant/ant-trax)
pushd apache-tomcat-%{version}-src
ant -Dbase.path="." \
-Dbuild.compiler="modern" \
-Dcommons-collections.jar="$(build-classpath commons-collections)" \
-Dcommons-daemon.jar="$(build-classpath apache-commons-daemon)" \
-Djasper-jdt.jar="$(build-classpath eclipse-ecj)" \
-Dcheckstyle.jar="$(build-classpath checkstyle)" \
-Djdt.jar="$(build-classpath eclipse-ecj)" \
-Djson-lib.jar="$(build-classpath json)" \
-Djaxrpc-lib.jar="$(build-classpath geronimo/jaxrpc-1.1-api)" \
-Dlogkit.jar="$(build-classpath excalibur/avalon-logkit)" \
-Dlog4j.jar="$(build-classpath log4j)" \
-Davalon-framework.jar="$(build-classpath excalibur/avalon-framework)" \
-Djunit.jar="$(build-classpath junit)" \
-Dversion="%{version}" \
-Dno.build.dbcp=true \
-Dtrydownload.run=false \
-Dversion.build="%{version_build}"
ant dist-prepare
%if %with_embed
CLASSPATH=$CLASSPATH:$(build-classpath excalibur/avalon-framework excalibur/avalon-logkit log4j commons-logging)
CLASSPATH=$CLASSPATH::%{pkg_dir}/output/build/lib/jsp-api.jar:%{pkg_dir}/output/build/lib/servlet-api.jar
ant -Dservletapi.jar=%{pkg_dir}/output/build/lib/servlet-api.jar -Dlog4j12.present=true embed-jars embed-extras
%endif
ant dist-source
ant javadoc
rm output/build/lib/*ecj.jar
rm -rf output/build/bin/tomcat-native.tar.gz output/build/bin/commons-daemon.jar
# this file is in apache-tomcat-dbcp package
rm output/build/lib/tomcat-dbcp.jar
popd
pushd apache-tomcat-%{version}-src/output
pushd dist/src/webapps/docs/appdev/sample/src
mkdir -p ../web/WEB-INF/classes
javac -cp ../../../../../../../../output/build/lib/servlet-api.jar -d ../web/WEB-INF/classes mypackage/Hello.java
pushd ../web
jar cf ../../../../../../../../output/build/webapps/docs/appdev/sample/sample.war *
popd
popd
popd
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
install -d -m 0755 %{buildroot}%{_bindir}
install -d -m 0755 %{buildroot}%{_sbindir}
install -d -m 0755 %{buildroot}%{_javadocdir}/%{tom_name}
install -d -m 0755 %{buildroot}%{_javadocdir}/elapi7
install -d -m 0755 %{buildroot}%{_javadocdir}/jspapi7
install -d -m 0755 %{buildroot}%{_javadocdir}/servletapi7
install -d -m 0755 %{buildroot}%{_initrddir}
install -d -m 0755 %{buildroot}%{_sysconfdir}/logrotate.d
install -d -m 0755 %{buildroot}%{_sysconfdir}/sysconfig
install -d -m 0755 %{buildroot}%{appdir}
install -d -m 0755 %{buildroot}%{bindir}
install -d -m 0755 %{buildroot}%{confdir}
install -d -m 0755 %{buildroot}%{confdir}/Catalina/localhost
install -d -m 0755 %{buildroot}%{libdir}
install -d -m 0755 %{buildroot}%{logdir}
install -d -m 0755 %{buildroot}%{homedir}
install -d -m 0755 %{buildroot}%{tempdir}
install -d -m 0755 %{buildroot}%{workdir}
cp -a %{SOURCE11} %{buildroot}%{confdir}/Catalina/localhost/host-manager.xml
cp -a %{SOURCE12} %{buildroot}%{confdir}/Catalina/localhost/examples.xml
cp -a %{SOURCE13} %{buildroot}%{confdir}/Catalina/localhost/docs.xml
cp -a %{SOURCE14} %{buildroot}%{confdir}/Catalina/localhost/ROOT.xml
cp -a %{SOURCE15} %{buildroot}%{confdir}/Catalina/localhost/manager.xml
pushd %{pkg_dir}/output/build
ln -sf $(build-classpath eclipse-ecj) lib/ecj.jar
ln -sf %{_javadir}/commons-collections-tomcat5.jar lib/commons-collections-tomcat5.jar
ln -sf %{_javadir}/dbcp/commons-dbcp.jar lib/apache-commons-dbcp.jar
ln -sf %{_javadir}/pool/commons-pool.jar lib/apache-commons-pool.jar
ln -sf $(build-classpath apache-commons-daemon) lib/
build-jar-repository -p webapps/examples/WEB-INF/lib taglibs-core.jar taglibs-standard.jar 2>&1
cp -a bin/*.{jar,xml} %{buildroot}%{bindir}
ln -sf $(build-classpath apache-commons-daemon) %{buildroot}%{bindir}/commons-daemon.jar
cp -a %{SOURCE8} conf/log4j.properties
cp -a conf/*.{policy,properties,xml} %{buildroot}%{confdir}
cp -a lib/*.jar %{buildroot}%{libdir}
cp -a webapps/* %{buildroot}%{appdir}
popd
%if %with_embed
pushd %{pkg_dir}/output/
cp -a extras/catalina-jmx-remote.jar %{buildroot}%{libdir}
cp -a extras/catalina-ws.jar %{buildroot}%{libdir}
cp -a extras/tomcat-juli-adapters.jar %{buildroot}%{libdir}/tomcat-extras-juli-adapters.jar
cp -a extras/tomcat-juli.jar %{buildroot}%{libdir}/tomcat-extras-juli.jar
cp -a embed/*.jar %{buildroot}%{libdir}
popd
%endif
pushd %{pkg_dir}/output/dist/webapps
cp -a docs/api/* %{buildroot}%{_javadocdir}/%{tom_name}
cp -a docs/elapi/* %{buildroot}%{_javadocdir}/elapi7
cp -a docs/jspapi/* %{buildroot}%{_javadocdir}/jspapi7
cp -a docs/servletapi/* %{buildroot}%{_javadocdir}/servletapi7
popd
sed -e "s|\@\@\@JAVAHOME\@\@\@|%{javahome}|g" \
-e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE1} \
> %{buildroot}%{confdir}/%{tom_name}.conf
sed -e "s|\@\@\@JAVAHOME\@\@\@|%{javahome}|g" \
-e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE3} \
> %{buildroot}%{_sysconfdir}/sysconfig/%{tom_name}
install -m 0644 %{SOURCE2} \
%{buildroot}%{_initrddir}/%{tom_name}
install -m 0644 %{SOURCE4} \
%{buildroot}%{_sbindir}/%{tom_name}
ln -s %{tom_name} %{buildroot}%{_sbindir}/d%{tom_name}
sed -e "s|\@\@\@TCLOG\@\@\@|%{logdir}|g" %{SOURCE5} \
> %{buildroot}%{_sysconfdir}/logrotate.d/%{tom_name}
sed -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE6} \
> %{buildroot}%{_bindir}/%{tom_name}-digest
sed -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
-e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
-e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE7} \
> %{buildroot}%{_bindir}/%{tom_name}-tool-wrapper
pushd %{buildroot}%{_javadir}
mv %{tom_name}/jsp-api.jar %{tom_name}-jsp-%{jsp_api_version}-api-%{version}.jar
mv %{tom_name}/servlet-api.jar \
%{tom_name}-servlet-%{servlet_api_version}-api-%{version}.jar
mv %{tom_name}/el-api.jar %{tom_name}-el-%{el_api_version}-api-%{version}.jar
ln -s %{tom_name}-jsp-%{jsp_api_version}-api-%{version}.jar \
%{tom_name}-jsp-%{jsp_api_version}-api.jar
ln -s %{tom_name}-jsp-%{jsp_api_version}-api-%{version}.jar \
jspapi7-%{version}.jar
ln -s %{tom_name}-jsp-%{jsp_api_version}-api-%{version}.jar \
jspapi7.jar
ln -s %{tom_name}-servlet-%{servlet_api_version}-api-%{version}.jar \
%{tom_name}-servlet-%{servlet_api_version}-api.jar
ln -s %{tom_name}-servlet-%{servlet_api_version}-api-%{version}.jar \
servletapi7-%{version}.jar
ln -s %{tom_name}-servlet-%{servlet_api_version}-api-%{version}.jar \
servletapi7.jar
ln -s %{tom_name}-el-%{el_api_version}-api-%{version}.jar \
%{tom_name}-el-%{el_api_version}-api.jar
ln -s %{tom_name}-el-%{el_api_version}-api-%{version}.jar \
elapi7-%{version}.jar
ln -s %{tom_name}-el-%{el_api_version}-api-%{version}.jar \
elapi7.jar
popd
pushd %{buildroot}%{libdir}
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
ln -s ../%{tom_name}-jsp-%{jsp_api_version}-api-%{version}.jar .
ln -s ../%{tom_name}-servlet-%{servlet_api_version}-api-%{version}.jar .
ln -s ../%{tom_name}-el-%{el_api_version}-api-%{version}.jar .
cp -p $(build-classpath commons-collections) .
cp -p $(build-classpath log4j) .
ln -sf log4j.jar log4j-%{version}.jar
ln -sf $(build-classpath dbcp/commons-dbcp) commons-dbcp.jar
# ln -sf $(build-classpath pool/commons-pool) commons-pool.jar
ln -sf $(build-classpath commons-collections-tomcat5) .
ln -sf $(build-classpath checkstyle-all) checkstyle.jar
# ln -sf $(build-classpath dbcp/commons-dbcp) apache-commons-dbcp.jar
ln -sf $(build-classpath eclipse-ecj) eclipse-ecj.jar
ln -sf $(build-classpath eclipse-ecj) jasper-jdt.jar
ln -s ../../tomcat7/bin/tomcat-juli.jar tomcat-juli-%{version}.jar
ln -s ../../tomcat7/bin/tomcat-juli.jar tomcat-juli.jar
ln -sf $(build-classpath apache-commons-daemon) commons-daemon.jar
%if %with_embed
ln -sf $(build-classpath geronimo/jaxrpc-1.1-api) jaxrpc.jar
ln -sf $(build-classpath wsdl4j) wsdl4j.jar
ln -sf $(build-classpath wsdl4j) jsr109.jar
%endif
popd
pushd %{buildroot}%{homedir}
ln -s %{appdir} webapps
ln -s %{confdir} conf
ln -s %{libdir} lib
ln -s %{logdir} logs
ln -s %{tempdir} temp
ln -s %{workdir} work
popd
mkdir -p %{buildroot}%{appdir}/sample
pushd %{buildroot}%{appdir}/sample
jar xf %{buildroot}%{appdir}/docs/appdev/sample/sample.war
popd
rm %{buildroot}%{appdir}/docs/appdev/sample/sample.war
mkdir -p %{buildroot}%{_mavenpomdir}
# for backwards compatibility
%add_to_maven_depmap javax.servlet servlet-api %{servlet_api_version} JPP %{tom_name}-servlet-%{servlet_api_version}-api
%add_to_maven_depmap org.apache.tomcat tomcat-servlet-api %{version} JPP %{tom_name}-servlet-%{servlet_api_version}-api
mv %{buildroot}%{_mavendepmapfragdir}/%{name} %{buildroot}%{_mavendepmapfragdir}/%{name}-servlet-api
pushd %{pkg_dir}/output/dist/src/res/maven
# this file is in apache-tomcat-dbcp package
rm -rf tomcat-dbcp.pom
for pom in *.pom; do
sed -i 's/@MAVEN.DEPLOY.VERSION@/%{version}/g' $pom
done
for pom in tomcat-annotations-api.pom \
tomcat-jasper-el.pom \
tomcat-jasper.pom \
tomcat-catalina-ant.pom \
tomcat-catalina-ha.pom \
tomcat-catalina-jmx-remote.pom \
tomcat-catalina-ws.pom \
tomcat-catalina.pom; do
artifact=`echo $pom | sed -e s:^tomcat-::g`
cp -a $pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-$artifact
%add_to_maven_depmap org.apache.tomcat $pom %{version} JPP/%{tom_name} $artifact
done
cp -a tomcat-tribes.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-catalina-tribes.pom
%add_to_maven_depmap org.apache.tomcat tomcat-catalina %{version} JPP/%{tom_name} catalina-tribes
cp -a tomcat-servlet-api.pom %{buildroot}%{_mavenpomdir}/JPP-%{tom_name}-servlet-%{servlet_api_version}-api.pom
cp -a tomcat-jsp-api.pom %{buildroot}%{_mavenpomdir}/JPP-%{tom_name}-jsp-%{jsp_api_version}-api.pom
%add_to_maven_depmap javax.servlet.jsp jsp-api %{jsp_api_version} JPP %{tom_name}-jsp-%{jsp_api_version}-api
%add_to_maven_depmap org.apache.tomcat jsp-api %{jsp_api_version} JPP %{tom_name}-jsp-%{jsp_api_version}-api
%add_to_maven_depmap org.apache.tomcat tomcat-jsp-api %{version} JPP %{tom_name}-jsp-%{jsp_api_version}-api
cp -a tomcat-el-api.pom %{buildroot}%{_mavenpomdir}/JPP-%{tom_name}-el-%{el_api_version}-api.pom
%add_to_maven_depmap javax.el el-api %{el_api_version} JPP %{tom_name}-el-%{el_api_version}-api
%add_to_maven_depmap org.apache.tomcat el-api %{el_api_version} JPP %{tom_name}-el-%{el_api_version}-api
%add_to_maven_depmap org.apache.tomcat tomcat-el-api %{version} JPP %{tom_name}-el-%{el_api_version}-api
for pom in tomcat-api.pom \
tomcat-coyote.pom \
tomcat-i18n-es.pom \
tomcat-i18n-fr.pom \
tomcat-i18n-ja.pom \
tomcat-juli.pom \
tomcat-util.pom; do
cp -a $pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-$pom
artifact=`basename $pom .pom`
%add_to_maven_depmap org.apache.tomcat $artifact %{version} JPP/%{tom_name} $artifact
done
cp -a tomcat-tribes.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-catalina-tribes.pom
%add_to_maven_depmap org.apache.tomcat tribes %{version} JPP/%{tom_name} catalina-tribes
%add_to_maven_depmap org.apache.tomcat tomcat-tribes %{version} JPP/%{tom_name} catalina-tribes
%if %with_embed
cp -a tomcat-embed-logging-log4j.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-logging-log4j.pom
%add_to_maven_depmap org.apache.tomcat.embed tomcat-embed-logging-log4j %{version} JPP/%{tom_name} tomcat-embed-logging-log4j
cp -a tomcat-embed-core.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-core.pom
%add_to_maven_depmap org.apache.tomcat.embed tomcat-embed-core %{version} JPP/%{tom_name} tomcat-embed-core
cp -a tomcat-embed-jasper.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-jasper.pom
%add_to_maven_depmap org.apache.tomcat.embed tomcat-embed-jasper %{version} JPP/%{tom_name} tomcat-embed-jasper
cp -a tomcat-embed-logging-juli.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-logging-juli.pom
%add_to_maven_depmap org.apache.tomcat.embed tomcat-embed-logging-juli %{version} JPP/%{tom_name} tomcat-embed-logging-juli
cp -a tomcat-extras-juli-adapters.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-tomcat-extras-juli-adapters.pom
%add_to_maven_depmap org.apache.tomcat.extras tomcat-extras-juli-adapters %{version} JPP%{tom_name} tomcat-extras-juli-adapters
cp -a tomcat-extras-juli.pom %{buildroot}%{_mavenpomdir}/JPP.%{tom_name}-tomcat-extras-juli.pom
%add_to_maven_depmap org.apache.tomcat.extras tomcat-extras-juli %{version} JPP/%{tom_name} tomcat-extras-juli
%endif
popd
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%pre
%{_sbindir}/groupadd -g 91 -r tomcat 2>/dev/null || :
%{_sbindir}/useradd -c "Apache Tomcat" -u 91 -g tomcat -s /bin/sh -r -d %{homedir} tomcat 2>/dev/null || :
%post
/sbin/chkconfig --add %{tom_name}
%update_maven_depmap
%post jsp-%{jsp_api_version}-api
%{_sbindir}/update-alternatives --install %{_javadir}/jsp.jar jsp %{_javadir}/%{tom_name}-jsp-%{jsp_api_version}-api.jar 20700
%post servlet-%{servlet_api_version}-api
%{_sbindir}/update-alternatives --install %{_javadir}/servlet.jar servlet %{_javadir}/%{tom_name}-servlet-%{servlet_api_version}-api.jar 20700
%post el-%{el_api_version}-api
%{_sbindir}/update-alternatives --install %{_javadir}/elspec.jar elspec %{_javadir}/%{tom_name}-el-%{el_api_version}-api.jar 20700
%preun
%{__rm} -rf %{workdir}/* %{tempdir}/*
if [ "$1" = "0" ]; then
%{_initrddir}/%{tom_name} stop >/dev/null 2>&1
/sbin/chkconfig --del %{tom_name}
fi
%postun
%update_maven_depmap
%postun jsp-%{jsp_api_version}-api
if [ "$1" = "0" ]; then
%{_sbindir}/update-alternatives --remove jsp %{_javadir}/%{tom_name}-jsp-%{jsp_api_version}-api.jar
fi
%postun servlet-%{servlet_api_version}-api
if [ "$1" = "0" ]; then
%{_sbindir}/update-alternatives --remove servlet %{_javadir}/%{tom_name}-servlet-%{servlet_api_version}-api.jar
fi
%postun el-%{el_api_version}-api
if [ "$1" = "0" ]; then
%{_sbindir}/update-alternatives --remove elspec %{_javadir}/%{tom_name}-el-%{el_api_version}-api.jar
fi
%files
%defattr(-,root,root)
%attr(0755,root,root) %{_initrddir}/tomcat7
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/tomcat7
%config(noreplace) %{_sysconfdir}/sysconfig/tomcat7
%attr(0775,root,tomcat) %dir %{logdir}
%attr(0775,root,tomcat) %dir %{confdir}
%attr(0775,root,tomcat) %dir %{confdir}/Catalina/
%attr(0775,root,tomcat) %dir %{confdir}/Catalina/localhost
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/catalina.policy
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/catalina.properties
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/context.xml
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/logging.properties
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/server.xml
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/tomcat-users.xml
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/tomcat7.conf
%config(noreplace) %attr(660,root,tomcat) %verify(not md5 mtime size) %{confdir}/web.xml
%attr(0775,root,tomcat) %dir %{cachedir}
%attr(0775,root,tomcat) %dir %{tempdir}
%attr(0775,root,tomcat) %dir %{workdir}
%attr(0755,root,root) %{_bindir}/tomcat7-digest
%attr(0755,root,root) %{_bindir}/tomcat7-tool-wrapper
%attr(0755,root,root) %{_sbindir}/dtomcat7
%attr(0755,root,root) %{_sbindir}/tomcat7
%{bindir}/bootstrap.jar
%{bindir}/commons-daemon.jar
%{bindir}/catalina-tasks.xml
%{bindir}/tomcat-juli.jar
%{libdir}/tomcat-juli-%{version}.jar
%{libdir}/tomcat-juli.jar
%{homedir}/conf
%{homedir}/lib
%{homedir}/logs
%{homedir}/temp
%{homedir}/webapps
%{homedir}/work
%{_mavendepmapfragdir}/*
%doc apache-tomcat-%{version}-src/{LICENSE,NOTICE,RELEASE*}
%files admin
%defattr(-,root,root)
%config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{confdir}/Catalina/localhost/*manager.xml
%{appdir}/host-manager
%{appdir}/manager
%files webapps
%defattr(-,root,root)
%config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{confdir}/Catalina/localhost/examples.xml
%config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{confdir}/Catalina/localhost/ROOT.xml
%{appdir}/ROOT
%{appdir}/examples
%{appdir}/sample
%files el-%{el_api_version}-api
%defattr(-,root,root)
%{libdir}/%{tom_name}-el-%{el_api_version}-api-%{version}.jar
%{_javadir}/%{tom_name}-el-%{el_api_version}-api-%{version}.jar
%{_javadir}/%{tom_name}-el-%{el_api_version}-api.jar
%{_javadir}/elapi7-%{version}.jar
%{_javadir}/elapi7.jar
%{_mavenpomdir}/JPP-tomcat7-el-%{el_api_version}-api.pom
%files servlet-%{servlet_api_version}-api
%defattr(-,root,root)
%{libdir}/%{tom_name}-servlet-%{servlet_api_version}-api-%{version}.jar
%{_javadir}/%{tom_name}-servlet-%{servlet_api_version}-api-%{version}.jar
%{_javadir}/%{tom_name}-servlet-%{servlet_api_version}-api.jar
%{_javadir}/servletapi7-%{version}.jar
%{_javadir}/servletapi7.jar
%{_mavenpomdir}/JPP-tomcat7-servlet-%{servlet_api_version}-api.pom
%files jsp-%{jsp_api_version}-api
%defattr(-,root,root)
%{libdir}/%{tom_name}-jsp-%{jsp_api_version}-api-%{version}.jar
%{_javadir}/%{tom_name}-jsp-%{jsp_api_version}-api-%{version}.jar
%{_javadir}/%{tom_name}-jsp-%{jsp_api_version}-api.jar
%{_javadir}/jspapi7-%{version}.jar
%{_javadir}/jspapi7.jar
%{_mavenpomdir}/JPP-tomcat7-jsp-%{jsp_api_version}-api.pom
%files javadoc
%defattr(-,root,root)
%{_javadocdir}/%{tom_name}
%files el-%{el_api_version}-api-javadoc
%defattr(-,root,root)
%{_javadocdir}/elapi7
%files jsp-%{jsp_api_version}-api-javadoc
%defattr(-,root,root)
%{_javadocdir}/jspapi7
%files servlet-%{servlet_api_version}-api-javadoc
%defattr(-,root,root)
%{_javadocdir}/servletapi7
%files -n lib%{tom_name}
%defattr(-,root,root)
%{libdir}/annotations-api-%{version}.jar
%{libdir}/annotations-api.jar
%{libdir}/catalina-%{version}.jar
%{libdir}/catalina-ant-%{version}.jar
%{libdir}/catalina-ant.jar
%{libdir}/catalina-ha-%{version}.jar
%{libdir}/catalina-ha.jar
%{libdir}/catalina-tribes-%{version}.jar
%{libdir}/catalina-tribes.jar
%{libdir}/catalina.jar
%{libdir}/catalina-jmx-remote-%{version}.jar
%{libdir}/catalina-jmx-remote.jar
%{libdir}/catalina-ws-%{version}.jar
%{libdir}/catalina-ws.jar
%{libdir}/tomcat-api-%{version}.jar
%{libdir}/tomcat-api.jar
%{libdir}/tomcat-util-%{version}.jar
%{libdir}/tomcat-util.jar
%{libdir}/jasper-%{version}.jar
%{libdir}/jasper.jar
%{libdir}/jasper-el-%{version}.jar
%{libdir}/jasper-el.jar
%{libdir}/tomcat-coyote-%{version}.jar
%{libdir}/tomcat-coyote.jar
%{libdir}/tomcat-i18n-es-%{version}.jar
%{libdir}/tomcat-i18n-es.jar
%{libdir}/tomcat-i18n-fr-%{version}.jar
%{libdir}/tomcat-i18n-fr.jar
%{libdir}/tomcat-i18n-ja-%{version}.jar
%{libdir}/tomcat-i18n-ja.jar
%{libdir}/checkstyle.jar
%{libdir}/apache-commons-daemon-%{version}.jar
%{libdir}/apache-commons-daemon.jar
%{libdir}/apache-commons-dbcp-%{version}.jar
%{libdir}/apache-commons-dbcp.jar
%{libdir}/apache-commons-pool-%{version}.jar
%{libdir}/apache-commons-pool.jar
%{libdir}/commons-collections-tomcat5-%{version}.jar
%{libdir}/commons-collections-tomcat5.jar
%{libdir}/commons-collections.jar
%{libdir}/commons-daemon.jar
%{libdir}/commons-dbcp.jar
%{libdir}/ecj-%{version}.jar
%{libdir}/ecj.jar
%{libdir}/eclipse-ecj-%{version}.jar
%{libdir}/eclipse-ecj.jar
%{libdir}/jasper-jdt.jar
%{_datadir}/java/%{tom_name}/tomcat-jdbc-%{version}.jar
%{_datadir}/java/%{tom_name}/tomcat-jdbc.jar
%{_mavenpomdir}/JPP.%{tom_name}-annotations-api.pom
%{_mavenpomdir}/JPP.%{tom_name}-catalina-ant.pom
%{_mavenpomdir}/JPP.%{tom_name}-catalina-ha.pom
%{_mavenpomdir}/JPP.%{tom_name}-catalina-jmx-remote.pom
%{_mavenpomdir}/JPP.%{tom_name}-catalina-tribes.pom
%{_mavenpomdir}/JPP.%{tom_name}-catalina-ws.pom
%{_mavenpomdir}/JPP.%{tom_name}-catalina.pom
%{_mavenpomdir}/JPP.%{tom_name}-jasper-el.pom
%{_mavenpomdir}/JPP.%{tom_name}-jasper.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-api.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-coyote.pom
%if %with_embed
%{libdir}/tomcat-embed-core-%{version}.jar
%{libdir}/tomcat-embed-core.jar
%{libdir}/tomcat-embed-jasper-%{version}.jar
%{libdir}/tomcat-embed-jasper.jar
%{libdir}/tomcat-embed-logging-juli-%{version}.jar
%{libdir}/tomcat-embed-logging-juli.jar
%{libdir}/tomcat-embed-logging-log4j-%{version}.jar
%{libdir}/tomcat-embed-logging-log4j.jar
%{libdir}/tomcat-extras-juli-%{version}.jar
%{libdir}/tomcat-extras-juli.jar
%{libdir}/tomcat-extras-juli-adapters-%{version}.jar
%{libdir}/tomcat-extras-juli-adapters.jar
%{libdir}/jaxrpc.jar
%{libdir}/jsr109.jar
%{libdir}/wsdl4j.jar
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-core.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-jasper.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-logging-juli.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-embed-logging-log4j.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-extras-juli-adapters.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-extras-juli.pom
%endif
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-i18n-es.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-i18n-fr.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-i18n-ja.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-juli.pom
%{_mavenpomdir}/JPP.%{tom_name}-tomcat-util.pom
%files webapp-docs
%defattr(0644,root,root,0755)
%config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{confdir}/Catalina/localhost/docs.xml
%{appdir}/docs
%files log4j
%defattr(0644,root,tomcat,0775)
%config(noreplace) %attr(664,root,tomcat) %verify(not md5 mtime size) %{confdir}/log4j.properties
%{libdir}/log4j-%{version}.jar
%{libdir}/log4j.jar
%changelog
* Fri Aug 26 2011 Automatic Build System <autodist@mambasoft.it> 7.0.20-1mamba
- update to 7.0.20
* Tue Mar 01 2011 gil <puntogil@libero.it> 7.0.9-1mamba
- update to 7.0.9
* Sun Feb 27 2011 gil <puntogil@libero.it> 7.0.8-1mamba
- update to 7.0.8