%define with_maven 1 Name: aalto-xml Version: 0.9.7 Release: %mkrel 1 Summary: Ultra-high performance non-blocking XML processor (Stax API + extensions) Group: Development/Java License: ASL 2.0 Url: https://github.com/FasterXML/aalto-xml # mkdir -p aalto-xml-0.9.7 # git clone git://github.com/FasterXML/aalto-xml.git # cd aalto-xml # git archive aalto-xml-0.9.7 | tar -x -C ../aalto-xml-0.9.7 # cd .. # tar czf aalto-xml-0.9.7-src-git.tar.gz aalto-xml-0.9.7 Source0: aalto-xml-0.9.7-src-git.tar.gz Source1: aalto-xml-0.9.7-OSGi-MANIFEST.MF BuildRequires: java-devel BuildRequires: jpackage-utils BuildRequires: sonatype-oss-parent %if !%with_maven BuildRequires: ant BuildRequires: junit BuildRequires: bea-stax-api %else BuildRequires: junit4 BuildRequires: maven-compiler-plugin BuildRequires: maven-gpg-plugin BuildRequires: maven-javadoc-plugin BuildRequires: maven-plugin-bundle BuildRequires: maven-release-plugin BuildRequires: maven-source-plugin BuildRequires: maven-surefire-plugin %endif BuildRequires: woodstox Requires: woodstox Requires: jpackage-utils Requires(post): jpackage-utils Requires(postun): jpackage-utils Requires: java BuildArch: noarch %description Ultra-high performance non-blocking XML processor (Stax/Stax2, SAX/SAX2). %package javadoc Summary: Javadocs for %{name} Group: Development/Java Requires: jpackage-utils %description javadoc This package contains the API documentation for %{name}. %prep %setup -q find . -iname '*.jar' -delete find . -iname '*.class' -delete %if !%with_maven ln -sf $(build-classpath junit) lib/test/junit-3.8.1.jar # lib/test/stax2test-3.1.1.jar ln -sf $(build-classpath woodstox-stax2-api) lib/stax2-api-3.1.1.jar ln -sf $(build-classpath bea-stax-api) lib/stax-api-1.0.1.jar sed -i "s|0.9.5|%{version}|" build.xml # FIXME mkdir -p build/classes/META-INF # cp -pr src/main/resources/* build/classes/META-INF %endif %build %if !%with_maven # ant jars javadoc test # mkdir -p META-INF # cp -p %{SOURCE1} META-INF/MANIFEST.MF # touch META-INF/MANIFEST.MF # zip -u build/aalto-gpl-%{version}.jar META-INF/MANIFEST.MF %else mvn-rpmbuild -e \ install javadoc:javadoc %endif %install [ %{buildroot} != / ] && rm -rf %{buildroot} mkdir -p %{buildroot}%{_javadir} install -pm 644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar mkdir -p %{buildroot}%{_mavenpomdir} install -pm 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom %add_maven_depmap JPP-%{name}.pom %{name}.jar mkdir -p %{buildroot}%{_javadocdir}/%{name} cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name} %post %update_maven_depmap %preun %update_maven_depmap %files %{_javadir}/%{name}.jar %{_mavenpomdir}/* %{_mavendepmapfragdir}/* %doc README release-notes/* %files javadoc %{_javadocdir}/%{name}