%define repodir %{_javadir}/repository.jboss.com/apache-xerces/%{version}-brew %define repodirlib %{repodir}/lib %define repodirsrc %{repodir}/src %define pkgver %(echo %version | tr . _) %define javahome %{_jvmdir}/jdk #%define gcj_ver %(gcj --version | head -n1 | awk '{ print $3 }') %define bootstrap 0 Name: xerces-j2 Version: 2.11.0 Release: 2mamba Summary: High performance, fully compliant XML parser Group: Applications/Publishing Vendor: openmamba Distribution: openmamba Packager: Silvan Calarco URL: http://xerces.apache.org/ Source0: http://84.233.242.93/mirror/apache/xerces/j/Xerces-J-src.%{version}.tar.gz # http://archive.apache.org/dist/xml/xerces-j/Xerces-J-src.%{version}.tar.gz #Source0: Xerces-J_2_11_0-src-svn.tar.gz Source1: Xerces-J2-version.sh Source2: Xerces-J2-constants.sh Source3: https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_%{pkgver}/tools/src/XJavac.java Source4: https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_%{pkgver}/tools/src/ExperimentalTaglet.java Source5: https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_%{pkgver}/tools/src/InternalTaglet.java Source6: xercesImpl-%{version}.pom Source7: java-component-info8.xml Source8: https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_%{pkgver}/tools/xml-commons-external-src.zip Source9: https://svn.apache.org/repos/asf/xerces/java/tags/Xerces-J_%{pkgver}/build.sh #Source8: xerces-j2-2.9.0-MANIFEST.MF Patch0: xerces-J2-2.11.0-build_xml.patch Patch1: xerces-J2-2.11.0-OSGi-Manifest.patch Patch2: xerces-J2-2.11.0-XJavac-javavendors.patch Patch3: xerces-J2-2.11.0-java-1.7.patch License: Apache Software License 2.0 BuildRequires: apache-ant BuildRequires: apache-ant-junit %if "%{stage1}" != "1" BuildRequires: apache-ant-nodeps BuildRequires: apache-batik BuildRequires: apache-xml-stylebook BuildRequires: java-icu4j4 %endif BuildRequires: xalan-j2 BuildRequires: coreutils BuildRequires: java-junit3 BuildRequires: jpackage-utils BuildRequires: xml-commons-apis BuildRequires: xml-commons-resolver Requires: xml-commons-apis BuildRoot: %{_tmppath}/%{name}-%{version}-root %description Welcome to the future! Xerces2 is the next generation of high performance, fully compliant XML parsers in the Apache Xerces family. This new version of Xerces introduces the Xerces Native Interface (XNI), a complete framework for building parser components and configurations that is extremely modular and easy to program. The Apache Xerces2 parser is the reference implementation of XNI but other parser components, configurations, and parsers can be written using the Xerces Native Interface. For complete design and implementation documents, refer to the XNI Manual. Xerces 2 is a fully conforming XML Schema processor. For more information, refer to the XML Schema page. Xerces 2 also provides a partial implementation of Document Object Model Level 3 Core, Load and Save and Abstract Schemas [deprecated] Working Drafts. For more information, refer to the DOM Level 3 Implementation page. %package javadoc-impl Summary: Javadoc for %{name} implementation Group: Documentation %description javadoc-impl High performance, fully compliant XML parser. This package contains javadoc for %{name} implementation. %package javadoc-apis Summary: Javadoc for %{name} apis Group: Documentation %description javadoc-apis High performance, fully compliant XML parser. This package contains javadoc for %{name} apis. %package javadoc-xni Summary: Javadoc for %{name} xni Group: Documentation %description javadoc-xni High performance, fully compliant XML parser. This package contains javadoc for %{name} xni. %package javadoc-other Summary: Javadoc for other %{name} components Group: Documentation %description javadoc-other High performance, fully compliant XML parser. This package contains javadoc for other %{name} components. %package javadoc-xs Summary: Javadoc for XML Schema %{name} components Group: Documentation %description javadoc-xs High performance, fully compliant XML parser. This package contains javadoc for XML Schema %{name} components. %package manual Group: Documentation Summary: Documents for %{name} Requires: %{name}-javadoc-impl = %{version}-%{release} Requires: %{name}-javadoc-apis = %{version}-%{release} Requires: %{name}-javadoc-xni = %{version}-%{release} Requires: %{name}-javadoc-other = %{version}-%{release} Requires: %{name}-javadoc-xs = %{version}-%{release} %description manual High performance, fully compliant XML parser. This package contains Java XML parser documentation %package demo Summary: Demo for %{name} Group: Applications/Publishing Requires: %{name} = %{version}-%{release} %description demo High performance, fully compliant XML parser. This package contains demonstrations and samples for %{name}. %package scripts Summary: Additional utility scripts for %{name} Group: Applications/Publishing Requires: %{name} = %{version}-%{release} %description scripts High performance, fully compliant XML parser. This package contains additional utility scripts for %{name}. %package repolib Group: Development/Libraries/Java Summary: Artifacts to be uploaded to a repository library %description repolib High performance, fully compliant XML parser. This package contains artifacts to be uploaded to a repository library. This package is not meant to be installed but so its contents can be extracted through rpm2cpio %prep %setup -q -n xerces-%{pkgver} #%setup -q -n Xerces-J_%{pkgver} %if %bootstrap %patch0 %endif %patch1 for j in $(find . -name "*.jar"); do mv $j $j.no done mkdir -p tools/org/apache/xerces/util mkdir -p tools/bin cp -a %{S:3} %{S:4} %{S:5} tools/org/apache/xerces/util # add gcj and OpenJDK support %if !%bootstrap %patch2 -p0 cp -a %{S:8} tools/ cp -a %{S:9} build.sh %endif %patch3 -p1 sed -i 's/\r//' LICENSE README NOTICE %build unset JAVA_HOME export JAVA_HOME=%{_jvmdir}/jdk pushd tools javac -classpath $(build-classpath ant-1.7.1) org/apache/xerces/util/XJavac.java mkdir -p bin && jar cf bin/xjavac.jar org/apache/xerces/util/XJavac.class javac -classpath $JAVA_HOME/lib/tools.jar org/apache/xerces/util/*Taglet.java jar cf bin/xerces2taglets.jar org/apache/xerces/util/*Taglet.class %if ! %bootstrap ln -sf $(build-classpath ant/ant-junit) ant-junit.jar ln -sf $(build-classpath ant-launcher) ant-launcher.jar ln -sf $(build-classpath ant/ant-nodeps) ant-nodeps.jar ln -sf $(build-classpath ant-1.7.1) ant.jar ln -sf $(build-classpath xercesImpl) xercesImpl.jar %endif ln -sf $(build-classpath xml-commons-apis) xml-apis.jar ln -sf $(build-classpath xml-commons-resolver) resolver.jar ln -sf $(build-classpath xalan-j2) xalan.jar ln -sf $(build-classpath xalan-j2-serializer) serializer.jar %if "%{stage1}" != "1" ln -sf $(build-classpath xml-stylebook) stylebook-1.0-b2.jar %endif ln -sf $(build-classpath icu4j/icu4j) icu4j.jar ln -sf $(build-classpath junit) junit.jar popd %if "%{stage1}" != "1" export CLASSPATH=tools/bin/xjavac.jar:$(build-classpath xercesImpl xml-stylebook batik-all):build/classes %else export CLASSPATH=tools/bin/xjavac.jar:$(build-classpath xercesImpl):build/classes %endif export ANT_OPTS="-Xmx256m -Djava.endorsed.dirs=$(pwd)/tools -Djava.awt.headless=true -Dbuild.sysclasspath=first -Ddisconnected=true" # deprecatedjar is needed for OpenJDK bootstrap %if "%{stage1}" != "1" XERCES_TARGET="clean jars dtdjar dvjar jar-schema11 javadocs sampjar deprecatedjar docs" %else XERCES_TARGET="clean jars dtdjar dvjar jar-schema11 javadocs sampjar deprecatedjar" %endif %if ! %bootstrap sh ./build.sh $XERCES_TARGET %else ant \ -Dbuild.compiler=modern \ -Dtools.dir=%{_javadir} \ -Djar.apis=xml-commons-apis.jar \ -Djar.resolver=xml-commons-resolver.jar \ -Djar.serializer=xalan-j2-serializer.jar \ -Ddoc.generator.package=tools/xml-stylebook.jar \ $XERCES_TARGET %endif %if "%{stage1}" != "1" sed -i 's/\r//' build/docs/download.cgi build/docs/resources/script.js %endif # pack-tools # bootstrap # -Dbuild.compiler=modern \ # -Djar.apis=xml-commons-apis.jar \ # -Djar.resolver=xml-commons-resolver.jar \ # clean jars javadocs sampjar #mkdir -p META-INF #cp -p %{SOURCE6} META-INF/MANIFEST.MF #touch META-INF/MANIFEST.MF #zip -u build/xercesImpl.jar META-INF/MANIFEST.MF %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" mkdir -p %{buildroot}%{_javadir} mkdir -p %{buildroot}%{_datadir}/maven2/poms install -pm 644 build/xercesImpl.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar ln -sf %{name}-%{version}.jar %{buildroot}%{_javadir}/xercesImpl-%{version}.jar #install -pm 644 build/xercesImpl.jar %{buildroot}%{_javadir}/xercesImpl-%{version}.jar %add_to_maven_depmap xerces xercesImpl %{version} JPP %{name} install -m 644 %{SOURCE6} %{buildroot}%{_datadir}/maven2/poms/JPP-%{name}.pom ( pushd %{buildroot}%{_javadir} for jar in *.jar; do ln -sf ${jar} dom3-${jar} done popd ) install -pm 644 build/schema11-xercesImpl.jar %{buildroot}%{_javadir}/schema11-xercesImpl-%{version}.jar install -pm 644 build/xercesDV.jar %{buildroot}%{_javadir}/xercesDV-%{version}.jar install -pm 644 build/xerces.jar %{buildroot}%{_javadir}/xerces-%{version}.jar install -pm 644 build/dtd-xercesImpl.jar %{buildroot}%{_javadir}/dtd-xercesImpl-%{version}.jar install -pm 644 build/xercesSamples.jar %{buildroot}%{_javadir}/xercesSamples-%{version}.jar ( pushd %{buildroot}%{_javadir} for jar in *-%{version}.jar; do ln -sf ${jar} `echo $jar| sed "s|-%{version}||g"` done popd ) mkdir -p %{buildroot}%{_javadocdir}/%{name}-impl-%{version} cp -pr build/docs/javadocs/xerces2/* %{buildroot}%{_javadocdir}/%{name}-impl-%{version} ln -s %{name}-impl-%{version} %{buildroot}%{_javadocdir}/%{name}-impl mkdir -p %{buildroot}%{_javadocdir}/%{name}-apis-%{version} cp -pr build/docs/javadocs/api/* %{buildroot}%{_javadocdir}/%{name}-apis-%{version} ln -s %{name}-apis-%{version} %{buildroot}%{_javadocdir}/%{name}-apis mkdir -p %{buildroot}%{_javadocdir}/%{name}-xs-%{version} cp -pr build/docs/javadocs/xs/* %{buildroot}%{_javadocdir}/%{name}-xs-%{version} ln -s %{name}-xs-%{version} %{buildroot}%{_javadocdir}/%{name}-xs mkdir -p %{buildroot}%{_javadocdir}/%{name}-xni-%{version} cp -pr build/docs/javadocs/xni/* %{buildroot}%{_javadocdir}/%{name}-xni-%{version} ln -s %{name}-xni-%{version} %{buildroot}%{_javadocdir}/%{name}-xni mkdir -p %{buildroot}%{_javadocdir}/%{name}-other-%{version} cp -pr build/docs/javadocs/other/* %{buildroot}%{_javadocdir}/%{name}-other-%{version} ln -s %{name}-other-%{version} %{buildroot}%{_javadocdir}/%{name}-other rm -rf build/docs/javadocs %if "%{stage1}" != "1" sed -i "s|javadocs/api/index.html|%{_javadocdir}/%{name}-apis|" build/docs/api.html sed -i "s|javadocs/xni/index.html|%{_javadocdir}/%{name}-xni|" build/docs/api.html sed -i "s|javadocs/xs/index.html|%{_javadocdir}/%{name}-xs|" build/docs/api.html sed -i "s|javadocs/xerces2/index.html|%{_javadocdir}/%{name}-impl|" build/docs/api.html sed -i "s|javadocs/other/index.html|%{_javadocdir}/%{name}-other|" build/docs/api.html mkdir -p %{buildroot}%{_defaultdocdir}/%{name}-%{version} cp -pr build/docs/* %{buildroot}%{_defaultdocdir}/%{name}-%{version}/ cp -pr LICENSE LICENSE*.txt NOTICE README Readme* %{buildroot}%{_defaultdocdir}/%{name}-%{version}/ %endif rm -rf %{buildroot}%{_defaultdocdir}/%{name}-%{version}//download.cgi mkdir -p %{buildroot}%{_bindir} install -m 755 %{S:1} %{buildroot}%{_bindir}/%{name}-version install -m 755 %{S:2} %{buildroot}%{_bindir}/%{name}-constants mkdir -p %{buildroot}%{_datadir}/%{name} cp -p build/xercesSamples.jar %{buildroot}%{_datadir}/%{name}/%{name}-samples.jar cp -pr data %{buildroot}%{_datadir}/%{name} # jaxp_parser_impl ghost symlink ln -s %{_sysconfdir}/alternatives \ %{buildroot}%{_javadir}/jaxp_parser_impl.jar mkdir -p %{buildroot}%{repodir} mkdir -p %{buildroot}%{repodirlib} install -pm 644 %{SOURCE7} %{buildroot}%{repodir}/component-info.xml sed -i "s/@NAME@/apache-xerces-component-info/g" %{buildroot}%{repodir}/component-info.xml sed -i "s/@ID@/apache-xerces/g" %{buildroot}%{repodir}/component-info.xml tag=`echo %{name}-%{version}-%{release} | sed 's|\.|_|g'` sed -i "s/@TAG@/$tag/g" %{buildroot}%{repodir}/component-info.xml sed -i 's/@VERSION@/%{version}-brew/g' %{buildroot}%{repodir}/component-info.xml sed -i "s/@LICENSE@/Apache Software License 2.0/g" %{buildroot}%{repodir}/component-info.xml sed -i "s|@PROJECTHOME@|%{url}|g" %{buildroot}%{repodir}/component-info.xml sed -i "s/@DESCRIPTION@/High performance, fully compliant XML parser/g" %{buildroot}%{repodir}/component-info.xml sed -i "s/@COMPONENTREF@/apache-xml-commons/g" %{buildroot}%{repodir}/component-info.xml sed -i "s/@VERSION_COMPONENTREF1@/1.4.01-brew/g" %{buildroot}%{repodir}/component-info.xml sed -i "s/@VERSION_COMPONENTREF2@/1.4.01-brew/g" %{buildroot}%{repodir}/component-info.xml sed -i "s/@ARTIFACTID@/xercesImpl.jar/g" %{buildroot}%{repodir}/component-info.xml sed -i "s/@INCLUDEINPUT@/xercesImpl.jar/g" %{buildroot}%{repodir}/component-info.xml mkdir -p %{buildroot}%{repodirsrc} install -pm 644 %{PATCH0} %{buildroot}%{repodirsrc} install -pm 644 %{PATCH1} %{buildroot}%{repodirsrc} install -pm 644 %{SOURCE0} %{buildroot}%{repodirsrc} install -pm 644 %{SOURCE3} %{buildroot}%{repodirsrc} install -pm 644 %{SOURCE4} %{buildroot}%{repodirsrc} install -pm 644 %{SOURCE5} %{buildroot}%{repodirsrc} cp -p %{buildroot}%{_javadir}/xerces-j2-%{version}.jar %{buildroot}%{repodirlib}/xercesImpl.jar #%{_bindir}/aot-compile-rpm %clean [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" %post %update_maven_depmap #[ -L %{_javadir}/jaxp_parser_impl.jar ] || rm -rf %{_javadir}/jaxp_parser_impl.jar /usr/sbin/update-alternatives --install %{_javadir}/jaxp_parser_impl.jar jaxp_parser_impl %{_javadir}/%{name}.jar 40 %postun %update_maven_depmap %preun { [ $1 = 0 ] || exit 0 /usr/sbin/update-alternatives --remove jaxp_parser_impl %{_javadir}/%{name}.jar } >/dev/null 2>&1 || : %files %defattr(-,root,root) %{_javadir}/xercesImpl.jar %{_javadir}/xercesImpl-%{version}.jar %{_javadir}/xerces-j2-%{version}.jar %{_javadir}/xerces-j2.jar %{_javadir}/dom3-xercesImpl-%{version}.jar %{_javadir}/dom3-xercesImpl.jar %{_javadir}/dom3-xerces-j2-%{version}.jar %{_javadir}/dom3-xerces-j2.jar %{_javadir}/dtd-xercesImpl-%{version}.jar %{_javadir}/xercesSamples-%{version}.jar %{_javadir}/dtd-xercesImpl.jar %{_javadir}/xercesSamples.jar %{_javadir}/schema11-xercesImpl-%{version}.jar %{_javadir}/xercesDV-%{version}.jar %{_javadir}/xerces-%{version}.jar %{_javadir}/schema11-xercesImpl.jar %{_javadir}/xercesDV.jar %{_javadir}/xerces.jar %ghost %{_javadir}/jaxp_parser_impl.jar %{_datadir}/maven2/poms %{_mavendepmapfragdir} %if "%{stage1}" != "1" %dir %{_defaultdocdir}/%{name}-%{version} %doc %{_defaultdocdir}/%{name}-%{version}/LICENSE %doc %{_defaultdocdir}/%{name}-%{version}/LICENSE*.txt %doc %{_defaultdocdir}/%{name}-%{version}/NOTICE %doc %{_defaultdocdir}/%{name}-%{version}/README %endif %files javadoc-impl %defattr(-,root,root) %{_javadocdir}/%{name}-impl-%{version} %{_javadocdir}/%{name}-impl %files javadoc-apis %defattr(-,root,root) %{_javadocdir}/%{name}-apis-%{version} %{_javadocdir}/%{name}-apis %files javadoc-other %defattr(-,root,root) %{_javadocdir}/%{name}-other-%{version} %{_javadocdir}/%{name}-other %files javadoc-xni %defattr(-,root,root) %{_javadocdir}/%{name}-xni-%{version} %{_javadocdir}/%{name}-xni %files javadoc-xs %defattr(-,root,root) %{_javadocdir}/%{name}-xs-%{version} %{_javadocdir}/%{name}-xs %if "%{stage1}" != "1" %files manual %defattr(-,root,root) %doc %{_defaultdocdir}/%{name}-%{version}/*.html %doc %{_defaultdocdir}/%{name}-%{version}/graphics %doc %{_defaultdocdir}/%{name}-%{version}/images %doc %{_defaultdocdir}/%{name}-%{version}/resources %endif %files demo %defattr(-,root,root) %{_datadir}/%{name} %files scripts %defattr(-,root,root) %{_bindir}/%{name}-constants %{_bindir}/%{name}-version %files repolib %defattr(-,root,root) %{repodir} %changelog * Thu Feb 10 2011 gil 2.11.0-2mamba - add java-icu4j4 support * Wed Dec 22 2010 gil 2.11.0-1mamba - update to 2.11.0 * Tue Aug 24 2010 gil 2.10.0-3mamba - added osgi manifest * Fri Jul 09 2010 gil 2.10.0-2mamba - add maven2 pom * Fri Jul 09 2010 gil 2.10.0-1mamba - update to 2.10.0 - new build requires apache batik - bootstrap * Tue Nov 24 2009 gil 2.9.1-5mamba - added java-xml-stylebook support - added new sub package: repolib * Mon Jun 29 2009 gil 2.9.1-4mamba - rebuilt * Mon Jun 08 2009 gil 2.9.1-3mamba - rebuilt * Mon Jun 08 2009 gil 2.9.1-2mamba - rebuilt * Sat Mar 21 2009 gil 2.9.1-1mamba - update to 2.9.1 * Thu Feb 26 2009 gil 2.9.0-1mamba - rebuilt * Thu Feb 26 2009 gil 2.9.0-1mamba - update to 2.9.0 * Wed Feb 25 2009 gil 2.7.1-3mamba - fixed some errors * Tue Feb 24 2009 gil 2.7.1-2mamba - rebuilt edit ant options * Mon Dec 22 2008 gil 2.7.1-1mamba - package created by autospec