0797b1
# Copyright (c) 2000-2008, JPackage Project
0797b1
# All rights reserved.
0797b1
#
0797b1
# Redistribution and use in source and binary forms, with or without
0797b1
# modification, are permitted provided that the following conditions
0797b1
# are met:
0797b1
#
0797b1
# 1. Redistributions of source code must retain the above copyright
0797b1
#    notice, this list of conditions and the following disclaimer.
0797b1
# 2. Redistributions in binary form must reproduce the above copyright
0797b1
#    notice, this list of conditions and the following disclaimer in the
0797b1
#    documentation and/or other materials provided with the
0797b1
#    distribution.
0797b1
# 3. Neither the name of the JPackage Project nor the names of its
0797b1
#    contributors may be used to endorse or promote products derived
0797b1
#    from this software without specific prior written permission.
0797b1
#
0797b1
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0797b1
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0797b1
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0797b1
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0797b1
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0797b1
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0797b1
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0797b1
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0797b1
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0797b1
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0797b1
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0797b1
#
0797b1
0797b1
%global jspspec 2.3
0797b1
%global major_version 9
0797b1
%global minor_version 0
0797b1
%global micro_version 62
0797b1
%global packdname apache-tomcat-%{version}-src
0797b1
%global servletspec 4.0
0797b1
%global elspec 3.0
0797b1
%global tcuid 53
0797b1
# Recommended version is specified in java/org/apache/catalina/core/AprLifecycleListener.java
0797b1
%global native_version 1.2.21
0797b1
0797b1
0797b1
# FHS 2.3 compliant tree structure - http://www.pathname.com/fhs/2.3/
0797b1
%global basedir %{_var}/lib/%{name}
0797b1
%global appdir %{basedir}/webapps
0797b1
%global homedir %{_datadir}/%{name}
0797b1
%global bindir %{homedir}/bin
0797b1
%global confdir %{_sysconfdir}/%{name}
0797b1
%global libdir %{_javadir}/%{name}
0797b1
%global logdir %{_var}/log/%{name}
0797b1
%global cachedir %{_var}/cache/%{name}
0797b1
%global tempdir %{cachedir}/temp
0797b1
%global workdir %{cachedir}/work
0797b1
%global _systemddir /lib/systemd/system
0797b1
0797b1
Name:          tomcat
0797b1
Epoch:         1
0797b1
Version:       %{major_version}.%{minor_version}.%{micro_version}
0797b1
Release:       5%{?dist}
0797b1
Summary:       Apache Servlet/JSP Engine, RI for Servlet %{servletspec}/JSP %{jspspec} API
0797b1
0797b1
License:       ASL 2.0
0797b1
URL:           http://tomcat.apache.org/
0797b1
Source0:       http://www.apache.org/dist/tomcat/tomcat-%{major_version}/v%{version}/src/%{packdname}.tar.gz
0797b1
Source1:       %{name}-%{major_version}.%{minor_version}.conf
0797b1
Source3:       %{name}-%{major_version}.%{minor_version}.sysconfig
0797b1
Source4:       %{name}-%{major_version}.%{minor_version}.wrapper
0797b1
Source5:       %{name}-%{major_version}.%{minor_version}.logrotate
0797b1
Source6:       %{name}-%{major_version}.%{minor_version}-digest.script
0797b1
Source7:       %{name}-%{major_version}.%{minor_version}-tool-wrapper.script
0797b1
Source11:      %{name}-%{major_version}.%{minor_version}.service
0797b1
Source21:      tomcat-functions
0797b1
Source30:      tomcat-preamble
0797b1
Source31:      tomcat-server
0797b1
Source32:      tomcat-named.service
0797b1
Source33:      java-9-start-up-parameters.conf
0797b1
0797b1
Patch0:        %{name}-%{major_version}.%{minor_version}-bootstrap-MANIFEST.MF.patch
0797b1
Patch1:        %{name}-%{major_version}.%{minor_version}-tomcat-users-webapp.patch
0797b1
Patch2:        %{name}-build.patch
0797b1
Patch3:        %{name}-%{major_version}.%{minor_version}-catalina-policy.patch
0797b1
Patch4:        rhbz-1857043.patch
0797b1
Patch5:        %{name}-%{major_version}.%{minor_version}-JDTCompiler.patch
0797b1
# remove bnd dependency which version is too low on rhel8
0797b1
Patch6:        remove-bnd-annotation.patch
0797b1
# The fixes for memory leak which have been fixed in 9.0.64, remove this patch in the next tomcat update
0797b1
Patch7:        %{name}-%{major_version}.%{minor_version}-memory-leak.patch
0797b1
Patch8:        fix-malformed-dtd.patch
0797b1
0797b1
BuildArch:     noarch
0797b1
0797b1
BuildRequires: ant
0797b1
BuildRequires: ecj >= 1:4.10
0797b1
BuildRequires: findutils
0797b1
BuildRequires: java-devel >= 1:1.8.0
0797b1
BuildRequires: javapackages-local
0797b1
BuildRequires: aqute-bnd
0797b1
BuildRequires: aqute-bndlib
0797b1
BuildRequires: systemd
0797b1
0797b1
Requires:      java-headless >= 1:1.8.0
0797b1
Requires:      javapackages-tools
0797b1
Requires:      %{name}-lib = %{epoch}:%{version}-%{release}
0797b1
%if 0%{?fedora} || 0%{?rhel} > 7
0797b1
Recommends:    tomcat-native >= %{native_version}
0797b1
%endif
0797b1
Requires(pre):    shadow-utils
0797b1
Requires(post):   systemd
0797b1
Requires(preun):  systemd
0797b1
Requires(postun): systemd
0797b1
0797b1
# We will change it to an obsoletes whenever the pki team is able to make the switch
0797b1
Conflicts: pki-servlet-engine <= 1:9.0.50
0797b1
0797b1
# added after log4j sub-package was removed
0797b1
Provides:         %{name}-log4j = %{epoch}:%{version}-%{release}
0797b1
0797b1
%description
0797b1
Tomcat is the servlet container that is used in the official Reference
0797b1
Implementation for the Java Servlet and JavaServer Pages technologies.
0797b1
The Java Servlet and JavaServer Pages specifications are developed by
0797b1
Sun under the Java Community Process.
0797b1
0797b1
Tomcat is developed in an open and participatory environment and
0797b1
released under the Apache Software License version 2.0. Tomcat is intended
0797b1
to be a collaboration of the best-of-breed developers from around the world.
0797b1
0797b1
%package admin-webapps
0797b1
Summary: The host-manager and manager web applications for Apache Tomcat
0797b1
Requires: %{name} = %{epoch}:%{version}-%{release}
0797b1
0797b1
%description admin-webapps
0797b1
The host-manager and manager web applications for Apache Tomcat.
0797b1
0797b1
%package docs-webapp
0797b1
Summary: The docs web application for Apache Tomcat
0797b1
Requires: %{name} = %{epoch}:%{version}-%{release}
0797b1
0797b1
%description docs-webapp
0797b1
The docs web application for Apache Tomcat.
0797b1
0797b1
%package jsp-%{jspspec}-api
0797b1
Summary: Apache Tomcat JavaServer Pages v%{jspspec} API Implementation Classes
0797b1
Provides: jsp = %{jspspec}
0797b1
Obsoletes: %{name}-jsp-2.2-api
0797b1
Requires: %{name}-servlet-%{servletspec}-api = %{epoch}:%{version}-%{release}
0797b1
Requires: %{name}-el-%{elspec}-api = %{epoch}:%{version}-%{release}
0797b1
Conflicts: pki-servlet-engine <= 1:9.0.50
0797b1
0797b1
%description jsp-%{jspspec}-api
0797b1
Apache Tomcat JSP API Implementation Classes.
0797b1
0797b1
%package lib
0797b1
Summary: Libraries needed to run the Tomcat Web container
0797b1
Requires: %{name}-jsp-%{jspspec}-api = %{epoch}:%{version}-%{release}
0797b1
Requires: %{name}-servlet-%{servletspec}-api = %{epoch}:%{version}-%{release}
0797b1
Requires: %{name}-el-%{elspec}-api = %{epoch}:%{version}-%{release}
0797b1
Requires: ecj >= 1:4.10
0797b1
Requires(preun): coreutils
0797b1
Conflicts: pki-servlet-engine <= 1:9.0.50
0797b1
0797b1
%description lib
0797b1
Libraries needed to run the Tomcat Web container.
0797b1
0797b1
%package servlet-%{servletspec}-api
0797b1
Summary: Apache Tomcat Java Servlet v%{servletspec} API Implementation Classes
0797b1
Provides: servlet = %{servletspec}
0797b1
Provides: servlet6
0797b1
Provides: servlet3
0797b1
Obsoletes: %{name}-servlet-3.1-api
0797b1
Conflicts: pki-servlet-4.0-api <= 1:9.0.50
0797b1
0797b1
%description servlet-%{servletspec}-api
0797b1
Apache Tomcat Servlet API Implementation Classes.
0797b1
0797b1
%package el-%{elspec}-api
0797b1
Summary: Apache Tomcat Expression Language v%{elspec} API Implementation Classes
0797b1
Provides: el_api = %{elspec}
0797b1
Obsoletes: %{name}-el-2.2-api
0797b1
Conflicts: pki-servlet-engine <= 1:9.0.50 and pki-servlet-container <= 1:9.0.7
0797b1
0797b1
%description el-%{elspec}-api
0797b1
Apache Tomcat EL API Implementation Classes.
0797b1
0797b1
%package webapps
0797b1
Summary: The ROOT web application for Apache Tomcat
0797b1
Requires: %{name} = %{epoch}:%{version}-%{release}
0797b1
0797b1
%description webapps
0797b1
The ROOT web application for Apache Tomcat.
0797b1
0797b1
%prep
0797b1
%setup -q -n %{packdname}
0797b1
# remove pre-built binaries and windows files
0797b1
find . -type f \( -name "*.bat" -o -name "*.class" -o -name Thumbs.db -o -name "*.gz" -o \
0797b1
   -name "*.jar" -o -name "*.war" -o -name "*.zip" \) -delete
0797b1
0797b1
%patch0 -p0
0797b1
%patch1 -p0
0797b1
%patch2 -p0
0797b1
%patch3 -p0
0797b1
%patch4 -p0
0797b1
%patch5 -p0
0797b1
%patch6 -p1
0797b1
%patch7 -p1
0797b1
%patch8 -p1
0797b1
0797b1
# Remove webservices naming resources as it's generally unused
0797b1
%{__rm} -rf java/org/apache/naming/factory/webservices
0797b1
0797b1
# Configure maven files
0797b1
%mvn_package ":tomcat-el-api" tomcat-el-api
0797b1
%mvn_alias "org.apache.tomcat:tomcat-el-api" "org.eclipse.jetty.orbit:javax.el"
0797b1
%mvn_package ":tomcat-jsp-api" tomcat-jsp-api
0797b1
%mvn_alias "org.apache.tomcat:tomcat-jsp-api" "org.eclipse.jetty.orbit:javax.servlet.jsp"
0797b1
%mvn_package ":tomcat-servlet-api" tomcat-servlet-api
0797b1
0797b1
0797b1
%build
0797b1
export OPT_JAR_LIST="xalan-j2-serializer"
0797b1
# we don't care about the tarballs and we're going to replace
0797b1
# tomcat-dbcp.jar with apache-commons-{collections,dbcp,pool}-tomcat5.jar
0797b1
# so just create a dummy file for later removal
0797b1
touch HACK
0797b1
0797b1
# who needs a build.properties file anyway
0797b1
%{ant} -Dbase.path="." \
0797b1
  -Dbuild.compiler="modern" \
0797b1
  -Dcommons-daemon.jar="HACK" \
0797b1
  -Dcommons-daemon.native.src.tgz="HACK" \
0797b1
  -Djdt.jar="$(build-classpath ecj/ecj)" \
0797b1
  -Dtomcat-native.tar.gz="HACK" \
0797b1
  -Dtomcat-native.home="." \
0797b1
  -Dcommons-daemon.native.win.mgr.exe="HACK" \
0797b1
  -Dnsis.exe="HACK" \
0797b1
  -Djaxrpc-lib.jar="HACK" \
0797b1
  -Dwsdl4j-lib.jar="HACK" \
0797b1
  -Dbnd.jar="HACK" \
0797b1
  -Dversion="%{version}" \
0797b1
  -Dversion.build="%{micro_version}" \
0797b1
  deploy
0797b1
0797b1
# remove some jars that we'll replace with symlinks later
0797b1
%{__rm} output/build/bin/commons-daemon.jar output/build/lib/ecj.jar
0797b1
# Remove the example webapps per Apache Tomcat Security Considerations
0797b1
# see https://tomcat.apache.org/tomcat-9.0-doc/security-howto.html
0797b1
%{__rm} -rf output/build/webapps/examples
0797b1
0797b1
0797b1
%install
0797b1
# build initial path structure
0797b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_bindir}
0797b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_sbindir}
0797b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_systemddir}
0797b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d
0797b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
0797b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{appdir}
0797b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{bindir}
0797b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{confdir}
0797b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{confdir}/Catalina/localhost
0797b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{confdir}/conf.d
0797b1
/bin/echo "Place your custom *.conf files here. Shell expansion is supported." > ${RPM_BUILD_ROOT}%{confdir}/conf.d/README
0797b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{libdir}
0797b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{logdir}
0797b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{_localstatedir}/lib/tomcats
0797b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{homedir}
0797b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{tempdir}
0797b1
%{__install} -d -m 0775 ${RPM_BUILD_ROOT}%{workdir}
0797b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_unitdir}
0797b1
%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_libexecdir}/%{name}
0797b1
0797b1
# move things into place
0797b1
# First copy supporting libs to tomcat lib
0797b1
pushd output/build
0797b1
    %{__cp} -a bin/*.{jar,xml} ${RPM_BUILD_ROOT}%{bindir}
0797b1
    %{__cp} -a conf/*.{policy,properties,xml,xsd} ${RPM_BUILD_ROOT}%{confdir}
0797b1
    %{__cp} -a lib/*.jar ${RPM_BUILD_ROOT}%{libdir}
0797b1
    %{__cp} -a webapps/* ${RPM_BUILD_ROOT}%{appdir}
0797b1
popd
0797b1
0797b1
%{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
0797b1
   -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
0797b1
   -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE1} \
0797b1
    > ${RPM_BUILD_ROOT}%{confdir}/%{name}.conf
0797b1
%{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
0797b1
   -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
0797b1
   -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE3} \
0797b1
    > ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/%{name}
0797b1
%{__install} -m 0644 %{SOURCE4} \
0797b1
    ${RPM_BUILD_ROOT}%{_sbindir}/%{name}
0797b1
%{__install} -m 0644 %{SOURCE11} \
0797b1
    ${RPM_BUILD_ROOT}%{_unitdir}/%{name}.service
0797b1
%{__sed} -e "s|\@\@\@TCLOG\@\@\@|%{logdir}|g" %{SOURCE5} \
0797b1
    > ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}.disabled
0797b1
%{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
0797b1
   -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
0797b1
   -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE6} \
0797b1
    > ${RPM_BUILD_ROOT}%{_bindir}/%{name}-digest
0797b1
%{__sed} -e "s|\@\@\@TCHOME\@\@\@|%{homedir}|g" \
0797b1
   -e "s|\@\@\@TCTEMP\@\@\@|%{tempdir}|g" \
0797b1
   -e "s|\@\@\@LIBDIR\@\@\@|%{_libdir}|g" %{SOURCE7} \
0797b1
    > ${RPM_BUILD_ROOT}%{_bindir}/%{name}-tool-wrapper
0797b1
0797b1
%{__install} -m 0644 %{SOURCE21} \
0797b1
    ${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/functions
0797b1
%{__install} -m 0755 %{SOURCE30} \
0797b1
    ${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/preamble
0797b1
%{__install} -m 0755 %{SOURCE31} \
0797b1
    ${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/server
0797b1
%{__install} -m 0644 %{SOURCE32} \
0797b1
    ${RPM_BUILD_ROOT}%{_unitdir}/%{name}@.service
0797b1
0797b1
%{__install} -m 0644 %{SOURCE33} ${RPM_BUILD_ROOT}%{confdir}/conf.d/
0797b1
0797b1
# Substitute libnames in catalina-tasks.xml
0797b1
sed -i \
0797b1
   "s,el-api.jar,%{name}-el-%{elspec}-api.jar,;
0797b1
    s,servlet-api.jar,%{name}-servlet-%{servletspec}-api.jar,;
0797b1
    s,jsp-api.jar,%{name}-jsp-%{jspspec}-api.jar,;" \
0797b1
    ${RPM_BUILD_ROOT}%{bindir}/catalina-tasks.xml
0797b1
0797b1
# create jsp and servlet API symlinks
0797b1
pushd ${RPM_BUILD_ROOT}%{_javadir}
0797b1
   %{__mv} %{name}/jsp-api.jar %{name}-jsp-%{jspspec}-api.jar
0797b1
   %{__ln_s} %{name}-jsp-%{jspspec}-api.jar %{name}-jsp-api.jar
0797b1
   %{__mv} %{name}/servlet-api.jar %{name}-servlet-%{servletspec}-api.jar
0797b1
   %{__ln_s} %{name}-servlet-%{servletspec}-api.jar %{name}-servlet-api.jar
0797b1
   %{__mv} %{name}/el-api.jar %{name}-el-%{elspec}-api.jar
0797b1
   %{__ln_s} %{name}-el-%{elspec}-api.jar %{name}-el-api.jar
0797b1
popd
0797b1
0797b1
pushd output/build
0797b1
    %{_bindir}/build-jar-repository lib ecj 2>&1
0797b1
popd
0797b1
0797b1
pushd ${RPM_BUILD_ROOT}%{libdir}
0797b1
    # symlink JSP and servlet API jars
0797b1
    %{__ln_s} ../../java/%{name}-jsp-%{jspspec}-api.jar .
0797b1
    %{__ln_s} ../../java/%{name}-servlet-%{servletspec}-api.jar .
0797b1
    %{__ln_s} ../../java/%{name}-el-%{elspec}-api.jar .
0797b1
    %{__ln_s} $(build-classpath ecj/ecj) jasper-jdt.jar
0797b1
popd
0797b1
0797b1
# symlink to the FHS locations where we've installed things
0797b1
pushd ${RPM_BUILD_ROOT}%{homedir}
0797b1
    %{__ln_s} %{appdir} webapps
0797b1
    %{__ln_s} %{confdir} conf
0797b1
    %{__ln_s} %{libdir} lib
0797b1
    %{__ln_s} %{logdir} logs
0797b1
    %{__ln_s} %{tempdir} temp
0797b1
    %{__ln_s} %{workdir} work
0797b1
popd
0797b1
0797b1
# Install the maven metadata for the spec impl artifacts as other projects use them
0797b1
#%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_mavenpomdir}
0797b1
pushd res/maven
0797b1
    for pom in tomcat-el-api.pom tomcat-jsp-api.pom tomcat-servlet-api.pom; do
0797b1
        # fix-up version in all pom files
0797b1
        sed -i 's/@MAVEN.DEPLOY.VERSION@/%{version}/g' $pom
0797b1
    done
0797b1
popd
0797b1
0797b1
# Configure and install maven artifacts
0797b1
%mvn_artifact res/maven/tomcat-el-api.pom output/build/lib/el-api.jar
0797b1
%mvn_artifact res/maven/tomcat-jsp-api.pom output/build/lib/jsp-api.jar
0797b1
%mvn_artifact res/maven/tomcat-servlet-api.pom output/build/lib/servlet-api.jar
0797b1
%mvn_install
0797b1
0797b1
%pre
0797b1
# add the tomcat user and group
0797b1
getent group tomcat >/dev/null || %{_sbindir}/groupadd -f -g %{tcuid} -r tomcat
0797b1
if ! getent passwd tomcat >/dev/null ; then
0797b1
    if ! getent passwd %{tcuid} >/dev/null ; then
0797b1
        %{_sbindir}/useradd -r -u %{tcuid} -g tomcat -d %{homedir} -s /sbin/nologin -c "Apache Tomcat" tomcat
0797b1
        # Tomcat uses a reserved ID, so there should never be an else
0797b1
    fi
0797b1
fi
0797b1
exit 0
0797b1
0797b1
%post
0797b1
# install but don't activate
0797b1
%systemd_post %{name}.service
0797b1
0797b1
%post jsp-%{jspspec}-api
0797b1
%{_sbindir}/update-alternatives --install %{_javadir}/jsp.jar jsp \
0797b1
    %{_javadir}/%{name}-jsp-%{jspspec}-api.jar 20200
0797b1
0797b1
%post servlet-%{servletspec}-api
0797b1
%{_sbindir}/update-alternatives --install %{_javadir}/servlet.jar servlet \
0797b1
    %{_javadir}/%{name}-servlet-%{servletspec}-api.jar 30000
0797b1
0797b1
%post el-%{elspec}-api
0797b1
%{_sbindir}/update-alternatives --install %{_javadir}/elspec.jar elspec \
0797b1
   %{_javadir}/%{name}-el-%{elspec}-api.jar 20300
0797b1
0797b1
%preun
0797b1
# clean tempdir and workdir on removal or upgrade
0797b1
%{__rm} -rf %{workdir}/* %{tempdir}/*
0797b1
%systemd_preun %{name}.service
0797b1
0797b1
%postun
0797b1
%systemd_postun_with_restart %{name}.service 
0797b1
0797b1
%postun jsp-%{jspspec}-api
0797b1
if [ "$1" = "0" ]; then
0797b1
    %{_sbindir}/update-alternatives --remove jsp \
0797b1
        %{_javadir}/%{name}-jsp-%{jspspec}-api.jar
0797b1
fi
0797b1
0797b1
%postun servlet-%{servletspec}-api
0797b1
if [ "$1" = "0" ]; then
0797b1
    %{_sbindir}/update-alternatives --remove servlet \
0797b1
        %{_javadir}/%{name}-servlet-%{servletspec}-api.jar
0797b1
fi
0797b1
0797b1
%postun el-%{elspec}-api
0797b1
if [ "$1" = "0" ]; then
0797b1
    %{_sbindir}/update-alternatives --remove elspec \
0797b1
        %{_javadir}/%{name}-el-%{elspec}-api.jar
0797b1
fi
0797b1
0797b1
%files 
0797b1
%defattr(0664,root,tomcat,0755)
0797b1
%doc {LICENSE,NOTICE,RELEASE*}
0797b1
%attr(0755,root,root) %{_bindir}/%{name}-digest
0797b1
%attr(0755,root,root) %{_bindir}/%{name}-tool-wrapper
0797b1
%attr(0755,root,root) %{_sbindir}/%{name}
0797b1
%attr(0644,root,root) %{_unitdir}/%{name}.service
0797b1
%attr(0644,root,root) %{_unitdir}/%{name}@.service
0797b1
%attr(0755,root,root) %dir %{_libexecdir}/%{name}
0797b1
%attr(0755,root,root) %dir %{_localstatedir}/lib/tomcats
0797b1
%attr(0644,root,root) %{_libexecdir}/%{name}/functions
0797b1
%attr(0755,root,root) %{_libexecdir}/%{name}/preamble
0797b1
%attr(0755,root,root) %{_libexecdir}/%{name}/server
0797b1
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/%{name}
0797b1
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}.disabled
0797b1
%attr(0755,root,tomcat) %dir %{basedir}
0797b1
%attr(0755,root,tomcat) %dir %{confdir}
0797b1
0797b1
%defattr(0664,tomcat,root,0770)
0797b1
%attr(0770,tomcat,root) %dir %{logdir}
0797b1
0797b1
%defattr(0664,root,tomcat,0770)
0797b1
%attr(0770,root,tomcat) %dir %{cachedir}
0797b1
%attr(0770,root,tomcat) %dir %{tempdir}
0797b1
%attr(0770,root,tomcat) %dir %{workdir}
0797b1
0797b1
%defattr(0644,root,tomcat,0775)
0797b1
%attr(0775,root,tomcat) %dir %{appdir}
0797b1
%attr(0775,root,tomcat) %dir %{confdir}/Catalina
0797b1
%attr(0775,root,tomcat) %dir %{confdir}/Catalina/localhost
0797b1
%attr(0755,root,tomcat) %dir %{confdir}/conf.d
0797b1
%{confdir}/conf.d/README
0797b1
%{confdir}/conf.d/java-9-start-up-parameters.conf
0797b1
%config(noreplace) %{confdir}/%{name}.conf
0797b1
%config(noreplace) %{confdir}/*.policy
0797b1
%config(noreplace) %{confdir}/*.properties
0797b1
%config(noreplace) %{confdir}/context.xml
0797b1
%config(noreplace) %{confdir}/server.xml
0797b1
%attr(0640,root,tomcat) %config(noreplace) %{confdir}/tomcat-users.xml
0797b1
%attr(0664,root,tomcat) %{confdir}/tomcat-users.xsd
0797b1
%attr(0664,root,tomcat) %config(noreplace) %{confdir}/jaspic-providers.xml
0797b1
%attr(0664,root,tomcat) %{confdir}/jaspic-providers.xsd
0797b1
%config(noreplace) %{confdir}/web.xml
0797b1
%dir %{homedir}
0797b1
%{bindir}/bootstrap.jar
0797b1
%{bindir}/catalina-tasks.xml
0797b1
%{homedir}/lib
0797b1
%{homedir}/temp
0797b1
%{homedir}/webapps
0797b1
%{homedir}/work
0797b1
%{homedir}/logs
0797b1
%{homedir}/conf
0797b1
0797b1
%files admin-webapps
0797b1
%defattr(0664,root,tomcat,0755)
0797b1
%{appdir}/host-manager
0797b1
%{appdir}/manager
0797b1
0797b1
%files docs-webapp
0797b1
%{appdir}/docs
0797b1
0797b1
%files lib
0797b1
%dir %{libdir}
0797b1
%{libdir}/*.jar
0797b1
%{_javadir}/*.jar
0797b1
%{bindir}/tomcat-juli.jar
0797b1
%exclude %{libdir}/%{name}-el-%{elspec}-api.jar
0797b1
%exclude %{_javadir}/%{name}-servlet-%{servletspec}*.jar
0797b1
%exclude %{_javadir}/%{name}-el-%{elspec}-api.jar
0797b1
%exclude %{_javadir}/%{name}-jsp-%{jspspec}*.jar
0797b1
0797b1
%files jsp-%{jspspec}-api -f .mfiles-tomcat-jsp-api
0797b1
%{_javadir}/%{name}-jsp-%{jspspec}*.jar
0797b1
0797b1
%files servlet-%{servletspec}-api -f .mfiles-tomcat-servlet-api
0797b1
%doc LICENSE
0797b1
%{_javadir}/%{name}-servlet-%{servletspec}*.jar
0797b1
0797b1
%files el-%{elspec}-api -f .mfiles-tomcat-el-api
0797b1
%doc LICENSE
0797b1
%{_javadir}/%{name}-el-%{elspec}-api.jar
0797b1
%{libdir}/%{name}-el-%{elspec}-api.jar
0797b1
0797b1
%files webapps
0797b1
%defattr(0644,tomcat,tomcat,0755)
0797b1
%{appdir}/ROOT
0797b1
0797b1
0797b1
%changelog
0797b1
* Thu Feb 16 2023 Coty Sutherland <csutherl@redhat.com> - 1:9.0.62-5
0797b1
- Related: #2160455 Add conflicts to subpackage
0797b1
0797b1
* Wed Feb 15 2023 Hui Wang <huwang@redhat.com> - 1:9.0.62-4
0797b1
- Resolves: #2160455 Add Tomcat 9 to RHEL8