Blame SPECS/pki-servlet-engine.spec

d625b1
# Copyright (c) 2000-2008, JPackage Project
d625b1
# All rights reserved.
d625b1
#
d625b1
# Redistribution and use in source and binary forms, with or without
d625b1
# modification, are permitted provided that the following conditions
d625b1
# are met:
d625b1
#
d625b1
# 1. Redistributions of source code must retain the above copyright
d625b1
#    notice, this list of conditions and the following disclaimer.
d625b1
# 2. Redistributions in binary form must reproduce the above copyright
d625b1
#    notice, this list of conditions and the following disclaimer in the
d625b1
#    documentation and/or other materials provided with the
d625b1
#    distribution.
d625b1
# 3. Neither the name of the JPackage Project nor the names of its
d625b1
#    contributors may be used to endorse or promote products derived
d625b1
#    from this software without specific prior written permission.
d625b1
#
d625b1
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
d625b1
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
d625b1
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
d625b1
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
d625b1
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
d625b1
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
d625b1
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
d625b1
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
d625b1
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
d625b1
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
d625b1
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
d625b1
#
d625b1
d625b1
%global major_version 9
d625b1
%global minor_version 0
d625b1
%global micro_version 30
d625b1
%global redhat_version 4
d625b1
%global packdname apache-tomcat-%{version}.redhat-%{redhat_version}-src
d625b1
d625b1
# Specification versions
d625b1
%global servletspec 4.0
d625b1
%global jspspec 2.3
d625b1
%global elspec 3.0
d625b1
d625b1
%global tcuid 91
d625b1
d625b1
# FHS 2.3 compliant tree structure - http://www.pathname.com/fhs/2.3/
d625b1
%global basedir %{_var}/lib/tomcat
d625b1
%global appdir %{basedir}/webapps
d625b1
%global homedir %{_datadir}/tomcat
d625b1
%global bindir %{homedir}/bin
d625b1
%global confdir %{_sysconfdir}/tomcat
d625b1
%global libdir %{_javadir}/tomcat
d625b1
%global logdir %{_var}/log/tomcat
d625b1
%global cachedir %{_var}/cache/tomcat
d625b1
%global tempdir %{cachedir}/temp
d625b1
%global workdir %{cachedir}/work
d625b1
%global _initrddir %{_sysconfdir}/init.d
d625b1
%global _systemddir /lib/systemd/system
d625b1
d625b1
Name:          pki-servlet-engine
d625b1
Epoch:         1
d625b1
Version:       %{major_version}.%{minor_version}.%{micro_version}
d625b1
Release:       1%{?dist}
d625b1
Summary:       Apache Servlet/JSP Engine, RI for Servlet %{servletspec}/JSP %{jspspec} API
d625b1
Group:         System Environment/Daemons
d625b1
License:       ASL 2.0
d625b1
URL:           http://tomcat.apache.org/
d625b1
d625b1
#Source0:       http://www.apache.org/dist/tomcat/tomcat-%%{major_version}/v%%{version}/src/%%{packdname}.tar.gz
d625b1
Source0:       tomcat-%{version}.redhat-%{redhat_version}-src.zip
d625b1
Source1:       tomcat-%{major_version}.%{minor_version}.conf
d625b1
Source3:       tomcat-%{major_version}.%{minor_version}.sysconfig
d625b1
Source4:       tomcat-%{major_version}.%{minor_version}.wrapper
d625b1
Source6:       tomcat-%{major_version}.%{minor_version}-digest.script
d625b1
Source7:       tomcat-%{major_version}.%{minor_version}-tool-wrapper.script
d625b1
Source8:       tomcat-%{major_version}.%{minor_version}.service
d625b1
Source21:      tomcat-functions
d625b1
Source30:      tomcat-preamble
d625b1
Source31:      tomcat-server
d625b1
Source32:      tomcat-named.service
d625b1
d625b1
Patch0:        tomcat-%{major_version}.%{minor_version}-bootstrap-MANIFEST.MF.patch
d625b1
Patch1:        tomcat-%{major_version}.%{minor_version}-tomcat-users-webapp.patch
d625b1
Patch2:        tomcat-9.0.30-CompilerOptionsRemoval.patch
d625b1
Patch3:        tomcat-%{major_version}.%{minor_version}-catalina-policy.patch
d625b1
Patch4:        removeUnusedDependencies.patch
d625b1
d625b1
BuildArch:     noarch
d625b1
d625b1
BuildRequires: ant
d625b1
BuildRequires: findutils
d625b1
BuildRequires: java-devel >= 1:1.8.0
d625b1
BuildRequires: jpackage-utils >= 0:1.7.0
d625b1
BuildRequires: maven-local
d625b1
BuildRequires: systemd-units
d625b1
d625b1
Requires:      ant
d625b1
Requires:      java-headless >= 1:1.8.0
d625b1
Requires:      java-devel >= 1:1.8.0
d625b1
Requires:      jpackage-utils
d625b1
Requires:      procps
d625b1
Requires(pre):    shadow-utils
d625b1
Requires(post):   chkconfig
d625b1
Requires(postun): chkconfig
d625b1
Requires(preun):  chkconfig
d625b1
Requires(post):   systemd-units
d625b1
Requires(preun):  systemd-units
d625b1
Requires(postun): systemd-units
d625b1
Requires(preun): coreutils
d625b1
Requires: pki-servlet-%{servletspec}-api = %{epoch}:%{version}-%{release}
d625b1
d625b1
# Add bundled so that everyone knows this is Tomcat
d625b1
Provides: bundled(tomcat) = 9.0.30.redhat-%{redhat_version}
d625b1
d625b1
Obsoletes:        pki-servlet-container
d625b1
d625b1
%description
d625b1
Tomcat is the servlet engine that is used in the official Reference
d625b1
Implementation for the Java Servlet and JavaServer Pages technologies.
d625b1
The Java Servlet and JavaServer Pages specifications are developed by
d625b1
Sun under the Java Community Process.
d625b1
d625b1
Tomcat is developed in an open and participatory environment and
d625b1
released under the Apache Software License version 2.0. Tomcat is intended
d625b1
to be a collaboration of the best-of-breed developers from around the world.
d625b1
d625b1
%package -n pki-servlet-%{servletspec}-api
d625b1
Group: Development/Libraries
d625b1
Summary: Apache Tomcat Java Servlet v%{servletspec} API Implementation Classes
d625b1
Requires(post): chkconfig
d625b1
Requires(postun): chkconfig
d625b1
d625b1
%description -n pki-servlet-%{servletspec}-api
d625b1
Apache Tomcat Servlet API Implementation Classes.
d625b1
d625b1
%prep
d625b1
%setup -q -n %{packdname}
d625b1
d625b1
# remove pre-built binaries and windows files
d625b1
find . -type f \( -name "*.bat" -o -name "*.class" -o -name Thumbs.db -o -name "*.gz" -o \
d625b1
   -name "*.jar" -o -name "*.war" -o -name "*.zip" \) -delete
d625b1
d625b1
%patch0 -p0
d625b1
%patch1 -p0
d625b1
%patch2 -p0
d625b1
%patch3 -p0
d625b1
%patch4 -p0
d625b1
d625b1
# Since we don't support ECJ in RHEL anymore, remove the class that requires it
d625b1
%{__rm} -f java/org/apache/jasper/compiler/JDTCompiler.java
d625b1
d625b1
%build
d625b1
export OPT_JAR_LIST="xalan-j2-serializer"
d625b1
d625b1
# Create a dummy file for later removal
d625b1
touch HACK
d625b1
d625b1
# who needs a build.properties file anyway
d625b1
%{ant} -Dbase.path="." \
d625b1
  -Dbuild.compiler="modern" \
d625b1
  -Dcommons-daemon.jar="HACK" \
d625b1
  -Dcommons-daemon.native.src.tgz="HACK" \
d625b1
  -Djdt.jar="HACK" \
d625b1
  -Dtomcat-native.tar.gz="HACK" \
d625b1
  -Dtomcat-native.home="." \
d625b1
  -Dcommons-daemon.native.win.mgr.exe="HACK" \
d625b1
  -Dnsis.exe="HACK" \
d625b1
  deploy dist-prepare dist-source
d625b1
d625b1
# remove some jars that we don't need
d625b1
#%%{__rm} output/build/bin/commons-daemon.jar
d625b1
d625b1
%install
d625b1
# build initial path structure
d625b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_bindir}
d625b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_sbindir}
d625b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_initrddir}
d625b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_systemddir}
d625b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
d625b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{appdir}
d625b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{bindir}
d625b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{confdir}
d625b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{confdir}/Catalina/localhost
d625b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{confdir}/conf.d
d625b1
/bin/echo "Place your custom *.conf files here. Shell expansion is supported." > ${RPM_BUILD_ROOT}%{confdir}/conf.d/README
d625b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{libdir}
d625b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{logdir}
d625b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{_localstatedir}/lib/tomcats
d625b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{homedir}
d625b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{tempdir}
d625b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{workdir}
d625b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_unitdir}
d625b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_libexecdir}/tomcat
d625b1
d625b1
# move things into place
d625b1
# First copy supporting libs to tomcat lib
d625b1
pushd output/build
d625b1
    %{__cp} -a bin/*.{jar,xml} ${RPM_BUILD_ROOT}%{bindir}
d625b1
    %{__cp} -a conf/*.{policy,properties,xml,xsd} ${RPM_BUILD_ROOT}%{confdir}
d625b1
    %{__cp} -a lib/*.jar ${RPM_BUILD_ROOT}%{libdir}
d625b1
popd
d625b1
d625b1
%{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
d625b1
   -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
d625b1
   -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE1} \
d625b1
    > ${RPM_BUILD_ROOT}%{confdir}/tomcat.conf
d625b1
%{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
d625b1
   -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
d625b1
   -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE3} \
d625b1
    > ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/tomcat
d625b1
%{__install} -m 0644 %{SOURCE4} \
d625b1
    ${RPM_BUILD_ROOT}%{_sbindir}/tomcat
d625b1
%{__install} -m 0644 %{SOURCE8} \
d625b1
    ${RPM_BUILD_ROOT}%{_unitdir}/tomcat.service
d625b1
%{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
d625b1
   -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
d625b1
   -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE6} \
d625b1
    > ${RPM_BUILD_ROOT}%{_bindir}/tomcat-digest
d625b1
%{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
d625b1
   -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
d625b1
   -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE7} \
d625b1
    > ${RPM_BUILD_ROOT}%{_bindir}/tomcat-tool-wrapper
d625b1
d625b1
%{__install} -m 0644 %{SOURCE21} \
d625b1
    ${RPM_BUILD_ROOT}%{_libexecdir}/tomcat/functions
d625b1
%{__install} -m 0755 %{SOURCE30} \
d625b1
    ${RPM_BUILD_ROOT}%{_libexecdir}/tomcat/preamble
d625b1
%{__install} -m 0755 %{SOURCE31} \
d625b1
    ${RPM_BUILD_ROOT}%{_libexecdir}/tomcat/server
d625b1
%{__install} -m 0644 %{SOURCE32} \
d625b1
    ${RPM_BUILD_ROOT}%{_unitdir}/tomcat@.service
d625b1
d625b1
# Substitute libnames in catalina-tasks.xml
d625b1
sed -i \
d625b1
   "s,el-api.jar,tomcat-el-%{elspec}-api.jar,;
d625b1
    s,servlet-api.jar,tomcat-servlet-%{servletspec}-api.jar,;
d625b1
    s,jsp-api.jar,tomcat-jsp-%{jspspec}-api.jar,;" \
d625b1
    ${RPM_BUILD_ROOT}%{bindir}/catalina-tasks.xml
d625b1
d625b1
# create jsp and servlet API symlinks
d625b1
pushd ${RPM_BUILD_ROOT}%{_javadir}
d625b1
   %{__mv} tomcat/jsp-api.jar tomcat-jsp-%{jspspec}-api.jar
d625b1
   %{__ln_s} tomcat-jsp-%{jspspec}-api.jar tomcat-jsp-api.jar
d625b1
   %{__mv} tomcat/servlet-api.jar tomcat-servlet-%{servletspec}-api.jar
d625b1
   %{__ln_s} tomcat-servlet-%{servletspec}-api.jar tomcat-servlet-api.jar
d625b1
   %{__mv} tomcat/el-api.jar tomcat-el-%{elspec}-api.jar
d625b1
   %{__ln_s} tomcat-el-%{elspec}-api.jar tomcat-el-api.jar
d625b1
popd
d625b1
d625b1
pushd ${RPM_BUILD_ROOT}%{libdir}
d625b1
    # symlink JSP and servlet API jars
d625b1
    %{__ln_s} ../../java/tomcat-jsp-%{jspspec}-api.jar .
d625b1
    %{__ln_s} ../../java/tomcat-servlet-%{servletspec}-api.jar .
d625b1
    %{__ln_s} ../../java/tomcat-el-%{elspec}-api.jar .
d625b1
d625b1
    # Temporary copy the juli jar here from /usr/share/java/tomcat (for maven depmap)
d625b1
    %{__cp} -a ${RPM_BUILD_ROOT}%{bindir}/tomcat-juli.jar ./
d625b1
popd
d625b1
d625b1
# symlink to the FHS locations where we've installed things
d625b1
pushd ${RPM_BUILD_ROOT}%{homedir}
d625b1
    %{__ln_s} %{appdir} webapps
d625b1
    %{__ln_s} %{confdir} conf
d625b1
    %{__ln_s} %{libdir} lib
d625b1
    %{__ln_s} %{logdir} logs
d625b1
    %{__ln_s} %{tempdir} temp
d625b1
    %{__ln_s} %{workdir} work
d625b1
popd
d625b1
d625b1
# Install the maven metadata
d625b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_mavenpomdir}
d625b1
pushd output/dist/src/res/maven
d625b1
for pom in *.pom; do
d625b1
    # fix-up version in all pom files
d625b1
    sed -i 's/@MAVEN.DEPLOY.VERSION@/%{version}/g' $pom
d625b1
done
d625b1
d625b1
# we won't install dbcp, juli-adapters and juli-extras pom files
d625b1
for libname in annotations-api catalina jasper-el jasper catalina-ha; do
d625b1
    %{__cp} -a tomcat-$libname.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP.tomcat-$libname.pom
d625b1
    %add_maven_depmap JPP.tomcat-$libname.pom tomcat/$libname.jar
d625b1
done
d625b1
d625b1
# tomcat-util-scan
d625b1
%{__cp} -a tomcat-util-scan.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP.tomcat-util-scan.pom
d625b1
%add_maven_depmap JPP.tomcat-util-scan.pom tomcat/tomcat-util-scan.jar
d625b1
d625b1
# tomcat-jni
d625b1
%{__cp} -a tomcat-jni.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP.tomcat-jni.pom
d625b1
%add_maven_depmap JPP.tomcat-jni.pom tomcat/tomcat-jni.jar
d625b1
d625b1
# servlet-api jsp-api and el-api are not in tomcat subdir, since they are widely re-used elsewhere
d625b1
%{__cp} -a tomcat-jsp-api.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP-tomcat-jsp-api.pom
d625b1
%add_maven_depmap JPP-tomcat-jsp-api.pom tomcat-jsp-api.jar -a "org.eclipse.jetty.orbit:javax.servlet.jsp"
d625b1
d625b1
%{__cp} -a tomcat-el-api.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP-tomcat-el-api.pom
d625b1
%add_maven_depmap JPP-tomcat-el-api.pom tomcat-el-api.jar -a "org.eclipse.jetty.orbit:javax.el"
d625b1
d625b1
%{__cp} -a tomcat-servlet-api.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP-tomcat-servlet-api.pom
d625b1
# Generate a depmap fragment javax.servlet:servlet-api pointing to
d625b1
# tomcat-servlet-3.0-api for backwards compatibility
d625b1
# also provide jetty depmap (originally in jetty package, but it's cleaner to have it here
d625b1
%add_maven_depmap JPP-tomcat-servlet-api.pom tomcat-servlet-%{servletspec}-api.jar -f "tomcat-servlet-api"
d625b1
d625b1
# replace temporary copy with link
d625b1
%{__ln_s} -f $(abs2rel %{bindir}/tomcat-juli.jar %{libdir}) ${RPM_BUILD_ROOT}%{libdir}/
d625b1
d625b1
# two special pom where jar files have different names
d625b1
%{__cp} -a tomcat-tribes.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP.tomcat-catalina-tribes.pom
d625b1
%add_maven_depmap JPP.tomcat-catalina-tribes.pom tomcat/catalina-tribes.jar
d625b1
d625b1
%{__cp} -a tomcat-coyote.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP.tomcat-tomcat-coyote.pom
d625b1
%add_maven_depmap JPP.tomcat-tomcat-coyote.pom tomcat/tomcat-coyote.jar
d625b1
d625b1
%{__cp} -a tomcat-juli.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP.tomcat-tomcat-juli.pom
d625b1
%add_maven_depmap JPP.tomcat-tomcat-juli.pom tomcat/tomcat-juli.jar
d625b1
d625b1
%{__cp} -a tomcat-api.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP.tomcat-tomcat-api.pom
d625b1
%add_maven_depmap JPP.tomcat-tomcat-api.pom tomcat/tomcat-api.jar
d625b1
d625b1
%{__cp} -a tomcat-util.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP.tomcat-tomcat-util.pom
d625b1
%add_maven_depmap JPP.tomcat-tomcat-util.pom tomcat/tomcat-util.jar
d625b1
d625b1
%{__cp} -a tomcat-jdbc.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP.tomcat-tomcat-jdbc.pom
d625b1
%add_maven_depmap JPP.tomcat-tomcat-jdbc.pom tomcat/tomcat-jdbc.jar
d625b1
d625b1
# tomcat-websocket-api
d625b1
%{__cp} -a tomcat-websocket-api.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP.tomcat-websocket-api.pom
d625b1
%add_maven_depmap JPP.tomcat-websocket-api.pom tomcat/websocket-api.jar
d625b1
d625b1
# tomcat-tomcat-websocket
d625b1
%{__cp} -a tomcat-websocket.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP.tomcat-tomcat-websocket.pom
d625b1
%add_maven_depmap JPP.tomcat-tomcat-websocket.pom tomcat/tomcat-websocket.jar
d625b1
d625b1
# tomcat-jaspic-api
d625b1
%{__cp} -a tomcat-jaspic-api.pom ${RPM_BUILD_ROOT}%{_mavenpomdir}/JPP.tomcat-jaspic-api.pom
d625b1
%add_maven_depmap JPP.tomcat-jaspic-api.pom tomcat/jaspic-api.jar
d625b1
d625b1
# Manually change the metadata filenames
d625b1
%{__mv} ${RPM_BUILD_ROOT}%{_datadir}/maven-metadata/%{name}.xml ${RPM_BUILD_ROOT}%{_datadir}/maven-metadata/tomcat.xml
d625b1
%{__mv} ${RPM_BUILD_ROOT}%{_datadir}/maven-metadata/%{name}-tomcat-servlet-api.xml ${RPM_BUILD_ROOT}%{_datadir}/maven-metadata/tomcat-servlet-api.xml
d625b1
d625b1
%pre
d625b1
# add the tomcat user and group
d625b1
%{_sbindir}/groupadd -g %{tcuid} -r tomcat 2>/dev/null || :
d625b1
%{_sbindir}/useradd -c "Apache Tomcat" -u %{tcuid} -g tomcat \
d625b1
    -s /sbin/nologin -r -d %{homedir} tomcat 2>/dev/null || :
d625b1
d625b1
%post
d625b1
# install but don't activate
d625b1
%systemd_post tomcat.service
d625b1
d625b1
# Collapse all of the alternatives installations into one
d625b1
%{_sbindir}/update-alternatives --install %{_javadir}/jsp.jar jsp \
d625b1
    %{_javadir}/tomcat-jsp-%{jspspec}-api.jar 20200
d625b1
%{_sbindir}/update-alternatives --install %{_javadir}/servlet.jar servlet \
d625b1
    %{_javadir}/tomcat-servlet-%{servletspec}-api.jar 30000
d625b1
%{_sbindir}/update-alternatives --install %{_javadir}/elspec.jar elspec \
d625b1
   %{_javadir}/tomcat-el-%{elspec}-api.jar 20300
d625b1
d625b1
%preun
d625b1
# clean tempdir and workdir on removal or upgrade
d625b1
%{__rm} -rf %{workdir}/* %{tempdir}/*
d625b1
%systemd_preun tomcat.service
d625b1
d625b1
%postun
d625b1
%systemd_postun_with_restart tomcat.service
d625b1
d625b1
# Collapse all of the alternatives removals into one
d625b1
if [ "$1" = "0" ]; then
d625b1
    %{_sbindir}/update-alternatives --remove jsp \
d625b1
        %{_javadir}/tomcat-jsp-%{jspspec}-api.jar
d625b1
    %{_sbindir}/update-alternatives --remove servlet \
d625b1
        %{_javadir}/tomcat-servlet-%{servletspec}-api.jar
d625b1
    %{_sbindir}/update-alternatives --remove elspec \
d625b1
        %{_javadir}/tomcat-el-%{elspec}-api.jar
d625b1
fi
d625b1
d625b1
%files 
d625b1
%defattr(0664,root,tomcat,0755)
d625b1
%doc {LICENSE,NOTICE,RELEASE*}
d625b1
%attr(0755,root,root) %{_bindir}/tomcat-digest
d625b1
%attr(0755,root,root) %{_bindir}/tomcat-tool-wrapper
d625b1
%attr(0755,root,root) %{_sbindir}/tomcat
d625b1
%attr(0644,root,root) %{_unitdir}/tomcat.service
d625b1
%attr(0644,root,root) %{_unitdir}/tomcat@.service
d625b1
%attr(0755,root,root) %dir %{_libexecdir}/tomcat
d625b1
%attr(0755,root,root) %dir %{_localstatedir}/lib/tomcats
d625b1
%attr(0644,root,root) %{_libexecdir}/tomcat/functions
d625b1
%attr(0755,root,root) %{_libexecdir}/tomcat/preamble
d625b1
%attr(0755,root,root) %{_libexecdir}/tomcat/server
d625b1
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/tomcat
d625b1
%attr(0755,root,tomcat) %dir %{basedir}
d625b1
%attr(0755,root,tomcat) %dir %{confdir}
d625b1
d625b1
%defattr(0664,tomcat,root,0770)
d625b1
%attr(0770,tomcat,root) %dir %{logdir}
d625b1
d625b1
%defattr(0664,root,tomcat,0770)
d625b1
%attr(0770,root,tomcat) %dir %{cachedir}
d625b1
%attr(0770,root,tomcat) %dir %{tempdir}
d625b1
%attr(0770,root,tomcat) %dir %{workdir}
d625b1
d625b1
%defattr(0644,root,tomcat,0775)
d625b1
%attr(0775,root,tomcat) %dir %{appdir}
d625b1
%attr(0775,root,tomcat) %dir %{confdir}/Catalina
d625b1
%attr(0775,root,tomcat) %dir %{confdir}/Catalina/localhost
d625b1
%attr(0755,root,tomcat) %dir %{confdir}/conf.d
d625b1
%{confdir}/conf.d/README
d625b1
%config(noreplace) %{confdir}/tomcat.conf
d625b1
%config(noreplace) %{confdir}/*.policy
d625b1
%config(noreplace) %{confdir}/*.properties
d625b1
%config(noreplace) %{confdir}/context.xml
d625b1
%config(noreplace) %{confdir}/server.xml
d625b1
%attr(0640,root,tomcat) %config(noreplace) %{confdir}/tomcat-users.xml
d625b1
%attr(0664,root,tomcat) %{confdir}/tomcat-users.xsd
d625b1
%attr(0664,root,tomcat) %config(noreplace) %{confdir}/jaspic-providers.xml
d625b1
%attr(0664,root,tomcat) %{confdir}/jaspic-providers.xsd
d625b1
%config(noreplace) %{confdir}/web.xml
d625b1
%dir %{homedir}
d625b1
%{bindir}/bootstrap.jar
d625b1
%{bindir}/catalina-tasks.xml
d625b1
%{homedir}/lib
d625b1
%{homedir}/temp
d625b1
%{homedir}/webapps
d625b1
%{homedir}/work
d625b1
%{homedir}/logs
d625b1
%{homedir}/conf
d625b1
d625b1
%defattr(-,root,root,-)
d625b1
%dir %{libdir}
d625b1
%{libdir}/*.jar
d625b1
%{_javadir}/*.jar
d625b1
%{bindir}/tomcat-juli.jar
d625b1
%{_mavenpomdir}/JPP.tomcat-annotations-api.pom
d625b1
%{_mavenpomdir}/JPP.tomcat-catalina-ha.pom
d625b1
%{_mavenpomdir}/JPP.tomcat-catalina-tribes.pom
d625b1
%{_mavenpomdir}/JPP.tomcat-catalina.pom
d625b1
%{_mavenpomdir}/JPP.tomcat-jasper-el.pom
d625b1
%{_mavenpomdir}/JPP.tomcat-jasper.pom
d625b1
%{_mavenpomdir}/JPP.tomcat-tomcat-api.pom
d625b1
%{_mavenpomdir}/JPP.tomcat-tomcat-juli.pom
d625b1
%{_mavenpomdir}/JPP.tomcat-tomcat-coyote.pom
d625b1
%{_mavenpomdir}/JPP.tomcat-tomcat-util.pom
d625b1
%{_mavenpomdir}/JPP.tomcat-tomcat-jdbc.pom
d625b1
%{_mavenpomdir}/JPP.tomcat-websocket-api.pom
d625b1
%{_mavenpomdir}/JPP.tomcat-tomcat-websocket.pom
d625b1
%{_mavenpomdir}/JPP.tomcat-jaspic-api.pom
d625b1
%{_mavenpomdir}/JPP.tomcat-jni.pom
d625b1
%{_mavenpomdir}/JPP.tomcat-util-scan.pom
d625b1
%{_mavenpomdir}/JPP-tomcat-jsp-api.pom
d625b1
%{_mavenpomdir}/JPP-tomcat-el-api.pom
d625b1
%{_datadir}/maven-metadata/tomcat.xml
d625b1
%exclude %{_javadir}/tomcat-servlet-%{servletspec}*.jar
d625b1
d625b1
%files -n pki-servlet-%{servletspec}-api
d625b1
%defattr(-,root,root,-)
d625b1
%doc LICENSE
d625b1
%{_javadir}/tomcat-servlet-%{servletspec}*.jar
d625b1
%{_datadir}/maven-metadata/tomcat-servlet-api.xml
d625b1
%{_mavenpomdir}/JPP-tomcat-servlet-api.pom
d625b1
d625b1
%changelog
d625b1
* Thu Apr 23 2020 Coty Sutherland <csutherl@redhat.com> - 1:9.0.30-1
d625b1
- Resolves: rhbz#1721684 Rebase pki-servlet-engine to 9.0.30
d625b1
- Update to JWS 5.3.0 distribution
d625b1
- Remove new dependencies that PKI doesn't need (and are not provided by RHEL 8)
d625b1
d625b1
* Fri May 31 2019 Endi S. Dewata <edewata@redhat.com> - 1:9.0.7-16
d625b1
- Obsoleted pki-servlet-container
d625b1
d625b1
* Tue Apr 23 2019 Endi S. Dewata <edewata@redhat.com> - 1:9.0.7-15
d625b1
- Rename pki-servlet-container into pki-servlet-engine
d625b1
d625b1
* Mon Mar 04 2019 Coty Sutherland <csutherl@redhat.com> - 1:9.0.7-14
d625b1
- Update to JWS 5.0.2 distribution
d625b1
- Resolves: rhbz#1658846 CVE-2018-8034 pki-servlet-container: tomcat: host name verification missing in WebSocket client
d625b1
- Resolves: rhbz#1579614 CVE-2018-8014 pki-servlet-container: tomcat: Insecure defaults in CORS filter enable 'supportsCredentials' for all origins
d625b1
- Resolves: rhbz#1619232 - CVE-2018-8037 pki-servlet-container: tomcat: Due to a mishandling of close in NIO/NIO2 connectors user sessions can get mixed up
d625b1
- Resolves: rhbz#1641874 - CVE-2018-11784 pki-servlet-container: tomcat: Open redirect in default servlet
d625b1
d625b1
* Fri Aug 03 2018 Fraser Tweedale <ftweedal@redhat.com> - 1:9.0.7-13
d625b1
- Reinstate Maven artifacts and fix maven-metadata JAR path
d625b1
d625b1
* Fri Jul 20 2018 Jean-Frederic Clere <jclere@redhat.com> - 1:9.0.7-12
d625b1
- Add missing BuildRequires: systemd-units
d625b1
d625b1
* Fri Jun 22 2018 Coty Sutherland <csutherl@redhat.com> - 1:9.0.7-11
d625b1
- Resolves: rhbz#1594139 Cleanup Provides and Requires
d625b1
d625b1
* Thu Jun 07 2018 Coty Sutherland <csutherl@redhat.com> - 1:9.0.7-10
d625b1
- Create packages for FreeIPA that wrap the JWS distribution of Tomcat