forked from pool/tomcat
Accepting request 671956 from home:mateialbu:branches:Java:packages
- Move webapps bundled with Tomcat to /usr/share/tomcat/tomcat-webapps (bsc#1092341). Affected packages: - tomcat-webapps - tomcat-admin-webapps - tomcat-docs-webapp - Remove %doc directive from tomcat-docs-webapps files section so that zypper installs files even if rpm.install.excludedocs is set to yes. OBS-URL: https://build.opensuse.org/request/show/671956 OBS-URL: https://build.opensuse.org/package/show/Java:packages/tomcat?expand=0&rev=149
This commit is contained in:
parent
612d45ac23
commit
59ec06a2d1
@ -1,4 +1,2 @@
|
|||||||
#fix of bnc#520532
|
#fix of bnc#520532
|
||||||
addFilter(".*non-etc-or-var-file-marked-as-conffile /srv/tomcat/webapps/ROOT.*")
|
addFilter(".*non-etc-or-var-file-marked-as-conffile /usr/share/tomcat/tomcat-webapps/ROOT.*")
|
||||||
addFilter(".*non-etc-or-var-file-marked-as-conffile /srv/tomcat/webapps/host-manager/META-INF/context.xml")
|
|
||||||
addFilter(".*non-etc-or-var-file-marked-as-conffile /srv/tomcat/webapps/manager/META-INF/context.xml")
|
|
||||||
|
47
tomcat-serverxml-tool.sh
Normal file
47
tomcat-serverxml-tool.sh
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
JAR=/usr/lib/tomcat/serverxmltool.jar
|
||||||
|
SERVERXML=/etc/tomcat/server.xml
|
||||||
|
|
||||||
|
function usage {
|
||||||
|
echo "Usage: <script> add|remove docBase path [contextXmlFile]"
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ -z "$1" || -z "$2" ]]; then
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
CMD="$1"
|
||||||
|
DOCBASE="$2"
|
||||||
|
CTXPATH="$3"
|
||||||
|
CONTEXTXML=${4:-''}
|
||||||
|
|
||||||
|
if [ "$CMD" = "add" ]; then
|
||||||
|
XSLT="add-context.xslt"
|
||||||
|
elif [ "$CMD" = "remove" ]; then
|
||||||
|
XSLT="remove-context.xslt"
|
||||||
|
else
|
||||||
|
usage
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
SUFIX=$(date +%H%M%S%N)
|
||||||
|
rm -f ${SERVERXML}.new${SUFIX} ${SERVERXML}.old${SUFIX}
|
||||||
|
|
||||||
|
/usr/bin/java -jar $JAR $XSLT $SERVERXML $DOCBASE $CTXPATH $CONTEXTXML > ${SERVERXML}.new${SUFIX}
|
||||||
|
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
mv $SERVERXML ${SERVERXML}.old${SUFIX}
|
||||||
|
mv ${SERVERXML}.new${SUFIX} $SERVERXML
|
||||||
|
rm ${SERVERXML}.old${SUFIX}
|
||||||
|
if [ "$CMD" = "add" ]; then
|
||||||
|
echo "Added webapp $CTXPATH from $DOCBASE to $SERVERXML."
|
||||||
|
else
|
||||||
|
echo "Removed webapp $CTXPATH from $SERVERXML."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "$SERVERXML was not modified."
|
||||||
|
rm ${SERVERXML}.new${SUFIX}
|
||||||
|
exit 2
|
||||||
|
fi
|
3
tomcat-serverxml-tool.tar.gz
Normal file
3
tomcat-serverxml-tool.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:c28653dcbbfbd98ea22f58ac537d5ca3667dcad0897321129d10ff7869affc63
|
||||||
|
size 2352
|
@ -1,3 +1,14 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Feb 5 09:50:35 UTC 2019 - malbu@suse.com
|
||||||
|
|
||||||
|
- Move webapps bundled with Tomcat to /usr/share/tomcat/tomcat-webapps
|
||||||
|
(bsc#1092341). Affected packages:
|
||||||
|
- tomcat-webapps
|
||||||
|
- tomcat-admin-webapps
|
||||||
|
- tomcat-docs-webapp
|
||||||
|
- Remove %doc directive from tomcat-docs-webapps files section so that
|
||||||
|
zypper installs files even if rpm.install.excludedocs is set to yes.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Feb 4 15:35:43 UTC 2019 - malbu@suse.com
|
Mon Feb 4 15:35:43 UTC 2019 - malbu@suse.com
|
||||||
|
|
||||||
|
85
tomcat.spec
85
tomcat.spec
@ -35,6 +35,8 @@
|
|||||||
%define cachedir %{_localstatedir}/cache/%{name}
|
%define cachedir %{_localstatedir}/cache/%{name}
|
||||||
%define tempdir %{cachedir}/temp
|
%define tempdir %{cachedir}/temp
|
||||||
%define workdir %{cachedir}/work
|
%define workdir %{cachedir}/work
|
||||||
|
%define tomcatappdir %{_datadir}/%{name}/tomcat-webapps
|
||||||
|
%define serverxmltool %{_libexecdir}/%{name}/serverxml-tool.sh
|
||||||
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
||||||
%if ! %{defined _fillupdir}
|
%if ! %{defined _fillupdir}
|
||||||
%define _fillupdir %{_localstatedir}/adm/fillup-templates
|
%define _fillupdir %{_localstatedir}/adm/fillup-templates
|
||||||
@ -68,6 +70,8 @@ Source21: tomcat-functions
|
|||||||
Source30: tomcat-preamble
|
Source30: tomcat-preamble
|
||||||
Source31: tomcat-server
|
Source31: tomcat-server
|
||||||
Source32: tomcat-named.service
|
Source32: tomcat-named.service
|
||||||
|
Source33: tomcat-serverxml-tool.tar.gz
|
||||||
|
Source34: tomcat-serverxml-tool.sh
|
||||||
Source1000: tomcat-rpmlintrc
|
Source1000: tomcat-rpmlintrc
|
||||||
Source1001: https://archive.apache.org/dist/tomcat/tomcat-%{major_version}/v%{version}/src/%{packdname}.tar.gz.asc
|
Source1001: https://archive.apache.org/dist/tomcat/tomcat-%{major_version}/v%{version}/src/%{packdname}.tar.gz.asc
|
||||||
Source1002: %{name}.keyring
|
Source1002: %{name}.keyring
|
||||||
@ -85,6 +89,7 @@ Patch3: %{name}-%{major_version}.%{minor_version}-sle.catalina.policy.pa
|
|||||||
Patch4: %{name}-%{major_version}.%{minor_version}-javadoc.patch
|
Patch4: %{name}-%{major_version}.%{minor_version}-javadoc.patch
|
||||||
# PATCH-FIX-OPENSUSE: disable adding OSGi metadata to JAR files because bndtools is not avalable in SLES/OpenSUSE
|
# PATCH-FIX-OPENSUSE: disable adding OSGi metadata to JAR files because bndtools is not avalable in SLES/OpenSUSE
|
||||||
Patch5: tomcat-9.0-disable-osgi-build.patch
|
Patch5: tomcat-9.0-disable-osgi-build.patch
|
||||||
|
|
||||||
BuildRequires: ant >= 1.8.1
|
BuildRequires: ant >= 1.8.1
|
||||||
BuildRequires: ant-antlr
|
BuildRequires: ant-antlr
|
||||||
BuildRequires: apache-commons-collections
|
BuildRequires: apache-commons-collections
|
||||||
@ -250,6 +255,8 @@ The ROOT and examples web applications for Apache Tomcat
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{packdname}
|
%setup -q -n %{packdname}
|
||||||
|
%setup -q -D -T -n %{packdname} -b 33
|
||||||
|
|
||||||
# remove pre-built binaries and windows files
|
# remove pre-built binaries and windows files
|
||||||
find . -type f \( -name "*.bat" -o -name "*.class" -o -name Thumbs.db -o -name "*.gz" -o \
|
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 -f
|
-name "*.jar" -o -name "*.war" -o -name "*.zip" \) | xargs -t rm -f
|
||||||
@ -321,6 +328,11 @@ jar ufm output/build/lib/jasper.jar %{SOURCE14}
|
|||||||
jar ufm output/build/lib/tomcat-api.jar %{SOURCE15}
|
jar ufm output/build/lib/tomcat-api.jar %{SOURCE15}
|
||||||
jar ufm output/build/bin/tomcat-juli.jar %{SOURCE16}
|
jar ufm output/build/bin/tomcat-juli.jar %{SOURCE16}
|
||||||
|
|
||||||
|
pushd %{_builddir}/tomcat-serverxml-tool
|
||||||
|
javac com/suse/tcserverxml/ApplyStylesheet.java
|
||||||
|
jar cfe serverxmltool.jar com.suse.tcserverxml.ApplyStylesheet com/suse/tcserverxml/ApplyStylesheet.class com/suse/tcserverxml/add-context.xslt com/suse/tcserverxml/remove-context.xslt
|
||||||
|
popd
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%if 0%{?suse_version} == 1110
|
%if 0%{?suse_version} == 1110
|
||||||
export NO_BRP_CHECK_BYTECODE_VERSION=true
|
export NO_BRP_CHECK_BYTECODE_VERSION=true
|
||||||
@ -334,6 +346,7 @@ install -d -m 0755 %{buildroot}%{_systemddir}
|
|||||||
install -d -m 0755 %{buildroot}%{_sysconfdir}/logrotate.d
|
install -d -m 0755 %{buildroot}%{_sysconfdir}/logrotate.d
|
||||||
install -d -m 0755 %{buildroot}%{_sysconfdir}/sysconfig
|
install -d -m 0755 %{buildroot}%{_sysconfdir}/sysconfig
|
||||||
install -d -m 0755 %{buildroot}%{appdir}
|
install -d -m 0755 %{buildroot}%{appdir}
|
||||||
|
install -d -m 0755 %{buildroot}%{tomcatappdir}
|
||||||
install -d -m 0755 %{buildroot}%{bindir}
|
install -d -m 0755 %{buildroot}%{bindir}
|
||||||
install -d -m 0775 %{buildroot}%{confdir}
|
install -d -m 0775 %{buildroot}%{confdir}
|
||||||
install -d -m 0755 %{buildroot}%{cachedir}/Catalina/localhost
|
install -d -m 0755 %{buildroot}%{cachedir}/Catalina/localhost
|
||||||
@ -358,7 +371,7 @@ pushd output/build
|
|||||||
cp %{SOURCE10} conf/log4j.properties
|
cp %{SOURCE10} conf/log4j.properties
|
||||||
cp -a conf/*.{policy,properties,xml} %{buildroot}%{confdir}
|
cp -a conf/*.{policy,properties,xml} %{buildroot}%{confdir}
|
||||||
cp -a lib/*.jar %{buildroot}%{libdir}
|
cp -a lib/*.jar %{buildroot}%{libdir}
|
||||||
cp -a webapps/* %{buildroot}%{appdir}
|
cp -a webapps/* %{buildroot}%{tomcatappdir}
|
||||||
popd
|
popd
|
||||||
# tomcat embedded
|
# tomcat embedded
|
||||||
pushd output/embed
|
pushd output/embed
|
||||||
@ -456,26 +469,26 @@ pushd %{buildroot}%{homedir}
|
|||||||
popd
|
popd
|
||||||
|
|
||||||
# install sample webapp
|
# install sample webapp
|
||||||
mkdir -p %{buildroot}%{appdir}/sample
|
mkdir -p %{buildroot}%{tomcatappdir}/sample
|
||||||
pushd %{buildroot}%{appdir}/sample
|
pushd %{buildroot}%{tomcatappdir}/sample
|
||||||
%jar xf %{buildroot}%{appdir}/docs/appdev/sample/sample.war
|
%jar xf %{buildroot}%{tomcatappdir}/docs/appdev/sample/sample.war
|
||||||
popd
|
popd
|
||||||
|
|
||||||
# Allow linking for example webapp
|
# Allow linking for example webapp
|
||||||
mkdir -p %{buildroot}%{appdir}/examples/META-INF
|
mkdir -p %{buildroot}%{tomcatappdir}/examples/META-INF
|
||||||
pushd %{buildroot}%{appdir}/examples/META-INF
|
pushd %{buildroot}%{tomcatappdir}/examples/META-INF
|
||||||
echo '<?xml version="1.0" encoding="UTF-8"?>'>context.xml
|
echo '<?xml version="1.0" encoding="UTF-8"?>'>context.xml
|
||||||
echo '<Context>'>>context.xml
|
echo '<Context>'>>context.xml
|
||||||
echo ' <Resources allowLinking="true" />'>>context.xml
|
echo ' <Resources allowLinking="true" />'>>context.xml
|
||||||
echo '</Context>'>>context.xml
|
echo '</Context>'>>context.xml
|
||||||
popd
|
popd
|
||||||
|
|
||||||
pushd %{buildroot}%{appdir}/examples/WEB-INF/lib
|
pushd %{buildroot}%{tomcatappdir}/examples/WEB-INF/lib
|
||||||
ln -s -f $(build-classpath jakarta-taglibs-core) jstl.jar
|
ln -s -f $(build-classpath jakarta-taglibs-core) jstl.jar
|
||||||
ln -s -f $(build-classpath jakarta-taglibs-standard) standard.jar
|
ln -s -f $(build-classpath jakarta-taglibs-standard) standard.jar
|
||||||
popd
|
popd
|
||||||
|
|
||||||
rm %{buildroot}%{appdir}/docs/appdev/sample/sample.war
|
rm %{buildroot}%{tomcatappdir}/docs/appdev/sample/sample.war
|
||||||
|
|
||||||
# Install the maven metadata
|
# Install the maven metadata
|
||||||
install -d -m 0755 %{buildroot}%{_mavenpomdir}
|
install -d -m 0755 %{buildroot}%{_mavenpomdir}
|
||||||
@ -573,6 +586,13 @@ cat > %{buildroot}%{_tmpfilesdir}/%{name}.conf <<EOF
|
|||||||
f %{_localstatedir}/run/%{name}.pid 0644 tomcat tomcat -
|
f %{_localstatedir}/run/%{name}.pid 0644 tomcat tomcat -
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# Install tool used to edit server.xml
|
||||||
|
pushd %{_builddir}/tomcat-serverxml-tool
|
||||||
|
install -m 0755 %{SOURCE34} \
|
||||||
|
%{buildroot}%{_libexecdir}/%{name}/serverxml-tool.sh
|
||||||
|
cp serverxmltool.jar %{buildroot}%{_libexecdir}/%{name}/
|
||||||
|
popd
|
||||||
|
|
||||||
%pre
|
%pre
|
||||||
# add the tomcat user and group
|
# add the tomcat user and group
|
||||||
%{_sbindir}/groupadd -r tomcat 2>/dev/null || :
|
%{_sbindir}/groupadd -r tomcat 2>/dev/null || :
|
||||||
@ -641,6 +661,36 @@ rm -f \
|
|||||||
%{libdir}/\[commons-pool-tomcat5\].jar \
|
%{libdir}/\[commons-pool-tomcat5\].jar \
|
||||||
%{libdir}/\[ecj\].jar >/dev/null 2>&1
|
%{libdir}/\[ecj\].jar >/dev/null 2>&1
|
||||||
|
|
||||||
|
%post webapps
|
||||||
|
%{serverxmltool} add %{tomcatappdir}/ROOT /
|
||||||
|
%{serverxmltool} add %{tomcatappdir}/sample /sample
|
||||||
|
%{serverxmltool} add %{tomcatappdir}/examples /examples
|
||||||
|
|
||||||
|
%postun webapps
|
||||||
|
if [ $1 -eq 0 ]; then # uninstall only
|
||||||
|
%{serverxmltool} remove %{tomcatappdir}/ROOT /
|
||||||
|
%{serverxmltool} remove %{tomcatappdir}/sample /sample
|
||||||
|
%{serverxmltool} remove %{tomcatappdir}/examples /example
|
||||||
|
fi
|
||||||
|
|
||||||
|
%post admin-webapps
|
||||||
|
%{serverxmltool} add %{tomcatappdir}/host-manager /host-manager %{tomcatappdir}/host-manager/META-INF/context.xml
|
||||||
|
%{serverxmltool} add %{tomcatappdir}/manager /manager %{tomcatappdir}/manager/META-INF/context.xml
|
||||||
|
|
||||||
|
%postun admin-webapps
|
||||||
|
if [ $1 -eq 0 ]; then # uninstall only
|
||||||
|
%{serverxmltool} remove %{tomcatappdir}/host-manager /host-manager
|
||||||
|
%{serverxmltool} remove %{tomcatappdir}/manager /manager
|
||||||
|
fi
|
||||||
|
|
||||||
|
%post docs-webapp
|
||||||
|
%{serverxmltool} add %{tomcatappdir}/docs /docs
|
||||||
|
|
||||||
|
%postun docs-webapp
|
||||||
|
if [ $1 -eq 0 ]; then # uninstall only
|
||||||
|
%{serverxmltool} remove %{tomcatappdir}/docs /docs
|
||||||
|
fi
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(0664,root,tomcat,0755)
|
%defattr(0664,root,tomcat,0755)
|
||||||
%doc {LICENSE,NOTICE,RELEASE*}
|
%doc {LICENSE,NOTICE,RELEASE*}
|
||||||
@ -655,6 +705,8 @@ rm -f \
|
|||||||
%attr(0755,root,root) %{_libexecdir}/%{name}/functions
|
%attr(0755,root,root) %{_libexecdir}/%{name}/functions
|
||||||
%attr(0755,root,root) %{_libexecdir}/%{name}/preamble
|
%attr(0755,root,root) %{_libexecdir}/%{name}/preamble
|
||||||
%attr(0755,root,root) %{_libexecdir}/%{name}/server
|
%attr(0755,root,root) %{_libexecdir}/%{name}/server
|
||||||
|
%attr(0755,root,root) %{_libexecdir}/%{name}/serverxml-tool.sh
|
||||||
|
%attr(0644,root,root) %{_libexecdir}/%{name}/serverxmltool.jar
|
||||||
#bnc#565901
|
#bnc#565901
|
||||||
%{bindir}/catalina.sh
|
%{bindir}/catalina.sh
|
||||||
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
%attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
||||||
@ -668,6 +720,7 @@ rm -f \
|
|||||||
%defattr(0664,root,tomcat,0770)
|
%defattr(0664,root,tomcat,0770)
|
||||||
%attr(0770,root,tomcat) %dir %{tempdir}
|
%attr(0770,root,tomcat) %dir %{tempdir}
|
||||||
%attr(0770,root,tomcat) %dir %{workdir}
|
%attr(0770,root,tomcat) %dir %{workdir}
|
||||||
|
%attr(0775,root,tomcat) %dir %{tomcatappdir}
|
||||||
# tomcat group writtable dirs - bnc#625415
|
# tomcat group writtable dirs - bnc#625415
|
||||||
%defattr(0664,root,tomcat,0775)
|
%defattr(0664,root,tomcat,0775)
|
||||||
%{confdir}/Catalina
|
%{confdir}/Catalina
|
||||||
@ -694,13 +747,13 @@ rm -f \
|
|||||||
%{_fillupdir}/sysconfig.%{name}
|
%{_fillupdir}/sysconfig.%{name}
|
||||||
|
|
||||||
%files admin-webapps
|
%files admin-webapps
|
||||||
%{appdir}/host-manager
|
%{tomcatappdir}/host-manager
|
||||||
%config(noreplace) %{appdir}/host-manager/META-INF/context.xml
|
%config(noreplace) %{tomcatappdir}/host-manager/META-INF/context.xml
|
||||||
%{appdir}/manager
|
%{tomcatappdir}/manager
|
||||||
%config(noreplace) %{appdir}/manager/META-INF/context.xml
|
%config(noreplace) %{tomcatappdir}/manager/META-INF/context.xml
|
||||||
|
|
||||||
%files docs-webapp
|
%files docs-webapp
|
||||||
%doc %{appdir}/docs
|
%{tomcatappdir}/docs
|
||||||
|
|
||||||
%files el-3_0-api -f output/dist/src/res/maven/.mfiles-el-api
|
%files el-3_0-api -f output/dist/src/res/maven/.mfiles-el-api
|
||||||
%{_javadir}/%{name}-el-%{elspec}-api.jar
|
%{_javadir}/%{name}-el-%{elspec}-api.jar
|
||||||
@ -742,9 +795,9 @@ rm -f \
|
|||||||
|
|
||||||
%files webapps
|
%files webapps
|
||||||
#bnc#520532
|
#bnc#520532
|
||||||
%config(noreplace) %{appdir}/ROOT
|
%config(noreplace) %{tomcatappdir}/ROOT
|
||||||
%{appdir}/examples
|
%{tomcatappdir}/examples
|
||||||
%{appdir}/sample
|
%{tomcatappdir}/sample
|
||||||
|
|
||||||
%files jsvc
|
%files jsvc
|
||||||
%defattr(755,root,root,0755)
|
%defattr(755,root,root,0755)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user