# # spec file for package xalan-j2 # # Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via https://bugs.opensuse.org/ # %global flavor %{nil} %if "%{flavor}" == "extras" %bcond_without extras %else %bcond_with extras %endif %define cvs_version 2_7_3 %global base_name xalan-j2 Version: 2.7.3 Release: 3.2 Summary: Java XSLT processor License: Apache-2.0 Group: Development/Libraries/Java URL: https://xalan.apache.org/index.html Source0: %{base_name}-%{version}.tar.xz Source1: https://repo1.maven.org/maven2/xalan/xalan/%{version}/xalan-%{version}.pom Source2: https://repo1.maven.org/maven2/xalan/serializer/%{version}/serializer-%{version}.pom Source3: xsltc-%{version}.pom Source4: xalan-j2-serializer-MANIFEST.MF Source5: xalan-j2-MANIFEST.MF # OSGi manifests Patch0: %{base_name}-noxsltcdeps.patch Patch1: %{base_name}-manifest.patch Patch2: %{base_name}-crosslink.patch Patch3: openjdk-build.patch BuildRequires: ant BuildRequires: dos2unix BuildRequires: fdupes BuildRequires: java-devel >= 1.8 BuildRequires: javapackages-local >= 6 BuildRequires: xml-commons-apis-bootstrap #!BuildIgnore: apache-commons-lang3 #!BuildIgnore: java-cup #!BuildIgnore: xml-commons #!BuildIgnore: xml-commons-apis #!BuildIgnore: xml-commons-jaxp-1.3-apis #!BuildIgnore: xml-commons-resolver Requires: jaxp_parser_impl Requires(post): update-alternatives Requires(postun): update-alternatives Provides: jaxp_transform_impl BuildArch: noarch %if %{with extras} Name: %{base_name}-extras %else Name: %{base_name} %endif %if %{with extras} BuildRequires: bcel BuildRequires: dejavu-fonts BuildRequires: java-cup-bootstrap BuildRequires: jlex BuildRequires: regexp BuildRequires: servletapi5 BuildRequires: xalan-j2 BuildRequires: xerces-j2 BuildRequires: xml-stylebook %else #!BuildIgnore: xerces-j2 %endif %description Xalan is an XSLT processor for transforming XML documents into HTML, text, or other XML document types. It implements the W3C Recommendations for XSL Transformations (XSLT) and the XML Path Language (XPath). It can be used from the command line, in an applet or a servlet, or as a module in other program. %package -n %{base_name}-xsltc Summary: Java XSLT compiler Group: Development/Libraries/Java Requires: bcel Requires: java_cup Requires: jaxp_parser_impl Requires: jlex Requires: regexp %description -n %{base_name}-xsltc The XSLT Compiler is a Java-based tool for compiling XSLT stylesheets into lightweight and portable Java byte codes called translets. %package -n %{base_name}-manual Summary: Manual for xalan-j2 Group: Development/Libraries/Java %description -n %{base_name}-manual Xalan is an XSLT processor for transforming XML documents into HTML, text, or other XML document types. It implements the W3C Recommendations for XSL Transformations (XSLT) and the XML Path Language (XPath). It can be used from the command line, in an applet or a servlet, or as a module in other program. This package contains the manual for Xalan. %package -n %{base_name}-demo Summary: Demonstration and samples for xalan-j2 Group: Development/Libraries/Java Requires: %{base_name} = %{version}-%{release} Requires: servlet %description -n %{base_name}-demo Xalan is an XSLT processor for transforming XML documents into HTML, text, or other XML document types. It implements the W3C Recommendations for XSL Transformations (XSLT) and the XML Path Language (XPath). It can be used from the command line, in an applet or a servlet, or as a module in other program. This package contains demonstration and sample files for Xalan. %prep %setup -q -n %{base_name}-%{version} %patch -P 0 -p1 %patch -P 1 -p1 %patch -P 2 -p1 %patch -P 3 -p1 %build if [ ! -e "$JAVA_HOME" ] ; then export JAVA_HOME="%{java_home}" ; fi pushd lib %if %{with extras} ln -sf $(build-classpath java-cup-runtime) runtime.jar ln -sf $(build-classpath bcel) bcel-6.7.0.jar ln -sf $(build-classpath regexp) regexp.jar pushd endorsed ln -sf $(build-classpath xerces-j2) xercesImpl.jar ln -sf $(build-classpath xml-apis) xml-apis.jar popd %endif popd pushd tools ln -sf $(build-classpath ant) ant.jar %if %{with extras} ln -sf $(build-classpath java-cup) java_cup.jar ln -sf $(build-classpath jlex) JLex.jar ln -sf $(build-classpath xml-stylebook) stylebook-1.0-b3_xalan-2.jar %endif popd %if %{with extras} mkdir -p build pushd build ln -sf $(build-classpath %{base_name}) xalan-interpretive.jar popd %endif %{ant} \ -Dcompiler.source=1.8 -Dcompiler.target=1.8 \ -Djava.awt.headless=true \ -Dapi.j2se=%{_javadocdir}/java \ -Dbuild.xalan-interpretive.jar=build/xalan-interpretive.jar \ %if %{with extras} -Dservlet-api.jar=$(build-classpath servletapi5) \ xsltc.unbundledjar \ docs \ xsltc.docs \ samples \ servlet %else xalan-interpretive.jar # inject OSGi manifests jar --date="$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ)" \ --update --file=build/serializer.jar --manifest=%{SOURCE4} jar --date="$(date -u -d @${SOURCE_DATE_EPOCH:-$(date +%%s)} +%%Y-%%m-%%dT%%H:%%M:%%SZ)" \ --update --file=build/xalan-interpretive.jar --manifest=%{SOURCE5} %endif %install # jars install -d -m 755 %{buildroot}%{_javadir} %if %{without extras} install -p -m 644 build/xalan-interpretive.jar \ %{buildroot}%{_javadir}/%{base_name}.jar install -p -m 644 build/serializer.jar \ %{buildroot}%{_javadir}/%{base_name}-serializer.jar %else install -p -m 644 build/xsltc.jar \ %{buildroot}%{_javadir}/xsltc.jar %endif # pom install -d -m 755 %{buildroot}%{_mavenpomdir} %if %{without extras} %{mvn_install_pom} %{SOURCE1} %{buildroot}%{_mavenpomdir}/%{base_name}.pom %add_maven_depmap %{base_name}.pom %{base_name}.jar %{mvn_install_pom} %{SOURCE2} %{buildroot}%{_mavenpomdir}/%{base_name}-serializer.pom %add_maven_depmap %{base_name}-serializer.pom %{base_name}-serializer.jar # alternatives mkdir -p %{buildroot}%{_sysconfdir}/alternatives ln -sf %{_sysconfdir}/alternatives/jaxp_transform_impl.jar %{buildroot}%{_javadir}/jaxp_transform_impl.jar # bnc#485299 install -d -m 0755 %{buildroot}/%{_sysconfdir}/ant.d/ echo xalan-j2-serializer > %{buildroot}/%{_sysconfdir}/ant.d/serializer %else %{mvn_install_pom} %{SOURCE3} %{buildroot}%{_mavenpomdir}/xsltc.pom %add_maven_depmap xsltc.pom xsltc.jar -f xsltc # demo install -d -m 755 %{buildroot}%{_datadir}/%{base_name} install -p -m 644 build/xalansamples.jar \ %{buildroot}%{_datadir}/%{base_name}/%{base_name}-samples.jar install -p -m 644 build/xalanservlet.war \ %{buildroot}%{_datadir}/%{base_name}/%{base_name}-servlet.war cp -pr samples %{buildroot}%{_datadir}/%{base_name} %fdupes -s %{buildroot}%{_datadir}/%{base_name} # manual %fdupes -s build/docs %endif %if %{without extras} %post update-alternatives --install %{_javadir}/jaxp_transform_impl.jar \ jaxp_transform_impl %{_javadir}/%{base_name}.jar 30 %preun { [ $1 = 0 ] || exit 0 update-alternatives --remove jaxp_transform_impl %{_javadir}/%{base_name}.jar } >/dev/null 2>&1 || : %files -f .mfiles %defattr(0644,root,root,0755) %license LICENSE.txt %doc KEYS NOTICE.txt %config %{_sysconfdir}/ant.d/serializer %ghost %{_sysconfdir}/alternatives/jaxp_transform_impl.jar %{_javadir}/jaxp_transform_impl.jar %else %files -n %{base_name}-xsltc -f .mfiles-xsltc %files -n %{base_name}-manual %defattr(0644,root,root,0755) %doc build/docs/* %files -n %{base_name}-demo %defattr(0644,root,root,0755) %{_datadir}/%{base_name} %endif %changelog * Sun Sep 22 2024 Fridrich Strba - Use SOURCE_DATE_EPOCH for reproducible builds - Split into two _multibuild flavours to avoid use of binary jars and prevent build cycles - Fetch the sources from git and clean the tarball of binary jars - Modified patches: * openjdk-build.patch * xalan-j2-crosslink.patch * xalan-j2-manifest.patch * xalan-j2-noxsltcdeps.patch + adapt to different line-endings and to slightly changed context * Wed Feb 21 2024 Fridrich Strba - Use %%patch -P N instead of deprecated %%patchN. * Thu Aug 31 2023 Fridrich Strba - Update to upstream version 2.7.3 * Java 8 requirement + This XalanJ release, requires users to use Java minimum version 8 for working with XalanJ. * Fix for CVE-2022-34169 (bsc#1201684) An integer truncation issue when processing malicious XSLT stylesheets + This issue was fixed within XalanJ's XSLTC processor. This XalanJ issue, when present causes following problems: Malicious XSLT stylesheets may be written, which could result in XalanJ invalid translet Java byte code to be produced by XalanJ XSLTC processor. The XalanJ translet is a Java byte code compiled representation, of an XSLT transformation. * Upgrade to Apache Commons BCEL 6.7.0 + This XalanJ release, contains upgraded version of Apache Commons BCEL library. * Enhancements for, performing XalanJ build and running of XalanJ tests from source distribution + The XalanJ users, can now make XalanJ builds and perform XalanJ tests from the XalanJ source distribution. The XalanJ build scripts for the implementation and the tests, both for the Windows and Linux platforms, were enhanced to support building XalanJ with JDK 1.8. * Upgrade to Xerces-J 2.12.2 + This XalanJ release, contains upgraded versions of xercesImpl.jar and xml-apis.jar (Xerces-J 2.12.2). - Modified patches: * openjdk-build.patch * xalan-j2-manifest.patch + rediff to changed context * Fri Mar 18 2022 Fridrich Strba - Build with source/target levels 8 * Wed Mar 9 2022 Fridrich Strba - Do not link to the java_cup* compatibility links, but to the java-cup* ones * Tue Jul 6 2021 Fridrich Strba - Remove parent from the pom files, since we are not building with maven - Clean-up packaging * Fri Feb 1 2019 Fridrich Strba - Add xalan-j2-serializer-MANIFEST.MF and xalan-j2-MANIFEST.MF * Contain OSGi metadata required by Eclipse * Sun Nov 18 2018 Fridrich Strba - Add maven pom file for xsltc * Wed Nov 7 2018 Fridrich Strba - Add maven pom files for xalan-j2 and the serializer * Tue Oct 3 2017 fstrba@suse.com - Added patch: * openjdk-build.patch + Fix build with different versions of OpenJDK - Do not require gcc-java any more - Run fdupes * Mon Dec 8 2014 tchvatal@suse.com - Revert last commit, causes cycles. * Fri Dec 5 2014 p.drouand@gmail.com - Replace java-1_5_0-gcj-compat-devel with javapackages-tools * Mon Jul 21 2014 tchvatal@suse.com - Update-alternatives love. * Mon Jun 23 2014 tchvatal@suse.com - Cleanup with spec-cleaner. * Mon Jun 23 2014 tchvatal@suse.com - Version bump to 2.7.2 release: * various small fixes * Fix security bnc#870082 CVE-2014-0107 - Fix few rpmlint warnings - Deleted xalan-j2-java14compat.patch patch as we don't bother with 1.4 java anymore - Rebased patches on new code: * xalan-j2-crosslink.patch * xalan-j2-manifest.patch * xalan-j2-noxsltcdeps.patch * Wed Aug 28 2013 mvyskocil@suse.com - mark all files related to update-alternatives as ghost - reformat header of spec a bit * Fri Aug 23 2013 mvyskocil@suse.com - drop javadoc package * Mon Jan 7 2013 mvyskocil@suse.com - remove xerces-j2-bootstrap depenency (bnc#789163) * Mon Nov 8 2010 mvyskocil@suse.cz - ignore xml-commons-jaxp-1.3-apis * Mon May 4 2009 mvyskocil@suse.cz - build with java-cup-bootstrap instead obsolete java_cup * Wed Mar 18 2009 mvyskocil@suse.cz - bnc#485299: Ant tasks fail with NoClassDefFoundError: org/apache/xml/serializer/SerializerTrace * Mon Jul 28 2008 ro@suse.de - use xml-commons-apis-bootstrap instead of xml-commons-apis * Mon Jul 28 2008 coolo@suse.de - buildignore xml-commons (ant works without it) * Mon Jul 21 2008 coolo@suse.de - build against gcj to avoid bootstrap problems * Thu Sep 21 2006 skh@suse.de - update to version 2.7.0 from jpackage.org - don't use icecream - use target="1.4" for build with java 1.5 * Wed Jan 25 2006 mls@suse.de - converted neededforbuild to BuildRequires * Fri Jul 29 2005 jsmeix@suse.de - Adjustments in the spec file. * Wed Jul 20 2005 jsmeix@suse.de - Current version 2.6.0 from JPackage.org * Mon Jul 18 2005 jsmeix@suse.de - Current version 2.6.0 from JPackage.org * Thu Sep 16 2004 skh@suse.de - Fix prerequires * Thu Sep 2 2004 skh@suse.de - Initial package created with version 2.6.0 (JPackage 1.5)