diff --git a/tomcat.spec b/tomcat.spec index 3c95116..ae4a3fe 100644 --- a/tomcat.spec +++ b/tomcat.spec @@ -192,42 +192,50 @@ find . -type f \( -name "*.bat" -o -name "*.class" -o -name Thumbs.db -o -name " # Remove webservices naming resources as it's generally unused %{__rm} -rf java/org/apache/naming/factory/webservices +# Configure maven files +%mvn_package ":tomcat-el-api" tomcat-el-api +%mvn_alias "org.apache.tomcat:tomcat-el-api" "org.eclipse.jetty.orbit:javax.el" +%mvn_package ":tomcat-jsp-api" tomcat-jsp-api +%mvn_alias "org.apache.tomcat:tomcat-jsp-api" "org.eclipse.jetty.orbit:javax.servlet.jsp" +%mvn_package ":tomcat-servlet-api" tomcat-servlet-api + %build export OPT_JAR_LIST="xalan-j2-serializer" - # we don't care about the tarballs and we're going to replace - # tomcat-dbcp.jar with apache-commons-{collections,dbcp,pool}-tomcat5.jar - # so just create a dummy file for later removal - touch HACK +# we don't care about the tarballs and we're going to replace +# tomcat-dbcp.jar with apache-commons-{collections,dbcp,pool}-tomcat5.jar +# so just create a dummy file for later removal +touch HACK - # who needs a build.properties file anyway - %{ant} -Dbase.path="." \ - -Dbuild.compiler="modern" \ - -Dcommons-daemon.jar="HACK" \ - -Dcommons-daemon.native.src.tgz="HACK" \ - -Djdt.jar="$(build-classpath ecj/ecj)" \ - -Dtomcat-native.tar.gz="HACK" \ - -Dtomcat-native.home="." \ - -Dcommons-daemon.native.win.mgr.exe="HACK" \ - -Dnsis.exe="HACK" \ - -Djaxrpc-lib.jar="HACK" \ - -Dwsdl4j-lib.jar="$(build-classpath wsdl4j)" \ - -Dbnd.jar="$(build-classpath aqute-bnd/biz.aQute.bnd)" \ - -Dbndlib.jar="$(build-classpath aqute-bnd/biz.aQute.bndlib)" \ - -Dbndlibg.jar="$(build-classpath aqute-bnd/aQute.libg)" \ - -Dbndannotation.jar="$(build-classpath aqute-bnd/biz.aQute.bnd.annotation)" \ - -Dosgi-annotations.jar="$(build-classpath aqute-bnd/biz.aQute.bnd.annotation)" \ - -Dslf4j-api.jar="$(build-classpath slf4j/slf4j-api)" \ - -Dosgi-cmpn.jar="$(build-classpath osgi-compendium/osgi.cmpn)" \ - -Dversion="%{version}" \ - -Dversion.build="%{micro_version}" \ - deploy +# who needs a build.properties file anyway +%{ant} -Dbase.path="." \ + -Dbuild.compiler="modern" \ + -Dcommons-daemon.jar="HACK" \ + -Dcommons-daemon.native.src.tgz="HACK" \ + -Djdt.jar="$(build-classpath ecj/ecj)" \ + -Dtomcat-native.tar.gz="HACK" \ + -Dtomcat-native.home="." \ + -Dcommons-daemon.native.win.mgr.exe="HACK" \ + -Dnsis.exe="HACK" \ + -Djaxrpc-lib.jar="HACK" \ + -Dwsdl4j-lib.jar="$(build-classpath wsdl4j)" \ + -Dbnd.jar="$(build-classpath aqute-bnd/biz.aQute.bnd)" \ + -Dbndlib.jar="$(build-classpath aqute-bnd/biz.aQute.bndlib)" \ + -Dbndlibg.jar="$(build-classpath aqute-bnd/aQute.libg)" \ + -Dbndannotation.jar="$(build-classpath aqute-bnd/biz.aQute.bnd.annotation)" \ + -Dosgi-annotations.jar="$(build-classpath aqute-bnd/biz.aQute.bnd.annotation)" \ + -Dslf4j-api.jar="$(build-classpath slf4j/slf4j-api)" \ + -Dosgi-cmpn.jar="$(build-classpath osgi-compendium/osgi.cmpn)" \ + -Dversion="%{version}" \ + -Dversion.build="%{micro_version}" \ + deploy + +# remove some jars that we'll replace with symlinks later +%{__rm} output/build/bin/commons-daemon.jar output/build/lib/ecj.jar +# Remove the example webapps per Apache Tomcat Security Considerations +# see https://tomcat.apache.org/tomcat-9.0-doc/security-howto.html +%{__rm} -rf output/build/webapps/examples - # remove some jars that we'll replace with symlinks later - %{__rm} output/build/bin/commons-daemon.jar output/build/lib/ecj.jar - # Remove the example webapps per Apache Tomcat Security Considerations - # see https://tomcat.apache.org/tomcat-9.0-doc/security-howto.html - %{__rm} -rf output/build/webapps/examples %install # build initial path structure @@ -331,6 +339,20 @@ pushd ${RPM_BUILD_ROOT}%{homedir} %{__ln_s} %{workdir} work popd +# Install the maven metadata for the spec impl artifacts as other projects use them +#%{__install} -d -m 0755 ${RPM_BUILD_ROOT}%{_mavenpomdir} +pushd res/maven + for pom in tomcat-el-api.pom tomcat-jsp-api.pom tomcat-servlet-api.pom; do + # fix-up version in all pom files + sed -i 's/@MAVEN.DEPLOY.VERSION@/%{version}/g' $pom + done +popd + +# Configure and install maven artifacts +%mvn_artifact res/maven/tomcat-el-api.pom output/build/lib/el-api.jar +%mvn_artifact res/maven/tomcat-jsp-api.pom output/build/lib/jsp-api.jar +%mvn_artifact res/maven/tomcat-servlet-api.pom output/build/lib/servlet-api.jar +%mvn_install %pre # add the tomcat user and group @@ -445,9 +467,6 @@ fi %files docs-webapp %{appdir}/docs -%files jsp-%{jspspec}-api -%{_javadir}/%{name}-jsp-%{jspspec}*.jar - %files lib %dir %{libdir} %{libdir}/*.jar @@ -458,11 +477,14 @@ fi %exclude %{_javadir}/%{name}-el-%{elspec}-api.jar %exclude %{_javadir}/%{name}-jsp-%{jspspec}*.jar -%files servlet-%{servletspec}-api +%files jsp-%{jspspec}-api -f .mfiles-tomcat-jsp-api +%{_javadir}/%{name}-jsp-%{jspspec}*.jar + +%files servlet-%{servletspec}-api -f .mfiles-tomcat-servlet-api %doc LICENSE %{_javadir}/%{name}-servlet-%{servletspec}*.jar -%files el-%{elspec}-api +%files el-%{elspec}-api -f .mfiles-tomcat-el-api %doc LICENSE %{_javadir}/%{name}-el-%{elspec}-api.jar %{libdir}/%{name}-el-%{elspec}-api.jar @@ -472,8 +494,9 @@ fi %{appdir}/ROOT %changelog -* Fri Jun 04 2021 Coty Sutherland 1:9.0.45-4 +* Sat Jun 05 2021 Coty Sutherland 1:9.0.45-4 - Add back logrotate config file per devel list request +- Add mvn virtual provides back for the servlet, el, and jsp spec impls * Fri Jun 04 2021 Coty Sutherland 1:9.0.45-3 - Drop geronimo-jaxrpc, which provided the webservices naming factory resources that are generally unused