diff --git a/snakeyaml-build.xml b/snakeyaml-build.xml new file mode 100644 index 0000000..439c757 --- /dev/null +++ b/snakeyaml-build.xml @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =================================== WARNING =================================== + JUnit is not present in the test classpath or your $ANT_HOME/lib directory. Tests not executed. + =============================================================================== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/snakeyaml.spec b/snakeyaml.spec index 821b59e..9543cce 100644 --- a/snakeyaml.spec +++ b/snakeyaml.spec @@ -17,15 +17,16 @@ %global vertag 70abb5efa4c0 -%bcond_with spring +%bcond_with tests Name: snakeyaml Version: 1.17 Release: 0 Summary: YAML parser and emitter for the Java programming language License: Apache-2.0 Group: Development/Libraries/Java -URL: https://bitbucket.org/asomov/%{name}/ +URL: https://bitbucket.org/asomov/snakeyaml/ Source0: https://bitbucket.org/asomov/snakeyaml/get/v%{version}.tar.bz2#/%{name}-%{version}.tar.bz2 +Source1: %{name}-build.xml # Upstream has forked gdata-java and base64 and refuses [1] to # consider replacing them by external dependencies. Bundled libraries # need to be removed and their use replaced by system libraries. @@ -35,15 +36,27 @@ Source0: https://bitbucket.org/asomov/snakeyaml/get/v%{version}.tar.bz2#/ Patch0: 0001-Replace-bundled-base64-implementation.patch # We don't have gdata-java in Fedora any longer, use commons-codec instead Patch1: 0002-Replace-bundled-gdata-java-client-classes-with-commo.patch +BuildRequires: ant +BuildRequires: apache-commons-codec +BuildRequires: base64coder BuildRequires: fdupes -BuildRequires: maven-local -BuildRequires: mvn(biz.source_code:base64coder) -BuildRequires: mvn(commons-codec:commons-codec) -BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) -BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin) +BuildRequires: javapackages-local +Requires: mvn(biz.source_code:base64coder) +Requires: mvn(commons-codec:commons-codec) BuildArch: noarch -%if %{with spring} -BuildRequires: mvn(org.springframework:spring-core) +%if %{with tests} +BuildRequires: ant-junit +BuildRequires: apache-commons-collections +BuildRequires: apache-commons-lang +BuildRequires: hamcrest-core +BuildRequires: joda-time +BuildRequires: junit +BuildRequires: oro +BuildRequires: velocity +# Differently sorted collections make fail some tests that rely on a particular order +BuildConflicts: java >= 9 +BuildConflicts: java-devel >= 9 +BuildConflicts: java-headless >= 9 %endif %description @@ -65,11 +78,10 @@ This package contains %{summary}. %prep %setup -q -n asomov-%{name}-%{vertag} +cp %{SOURCE1} build.xml %patch0 -p1 %patch1 -p1 -%{mvn_file} : %{name} - %pom_remove_plugin :cobertura-maven-plugin %pom_remove_plugin :maven-changes-plugin %pom_remove_plugin :maven-license-plugin @@ -84,9 +96,6 @@ rm -f src/test/java/examples/SpringTest.java # Re-add bundled base64coder %pom_add_dep biz.source_code:base64coder -# remove bundled stuff -rm -rf target - # fails in rpmbuild only due to different locale rm src/test/java/org/yaml/snakeyaml/issues/issue67/NonAsciiCharsInClassNameTest.java # fails after unbundling @@ -95,22 +104,39 @@ rm src/test/java/org/yaml/snakeyaml/issues/issue318/ContextClassLoaderTest.java # convert CR+LF to LF sed -i 's/\r//g' LICENSE.txt -%if %{without spring} %pom_remove_dep org.springframework rm -r src/test/java/org/yaml/snakeyaml/issues/issue9 -%endif %build -%{mvn_build} -f -- -Dsource=6 +mkdir -p lib +build-jar-repository -s lib base64coder commons-codec +%if %{with tests} +build-jar-repository -s lib junit hamcrest/core velocity commons-collections commons-lang oro joda-time +%endif +%{ant} \ +%if %{without tests} + -Dtest.skip=true \ +%endif + clean package javadoc %install -%mvn_install +# jar +install -dm 0755 %{buildroot}%{_javadir} +install -pm 0644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}.jar +# pom +install -dm 0755 %{buildroot}%{_mavenpomdir} +install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/%{name}.pom +%add_maven_depmap %{name}.pom %{name}.jar +# javadoc +install -dm 0755 %{buildroot}%{_javadocdir}/%{name} +cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/ %fdupes -s %{buildroot}%{_javadocdir} %files -f .mfiles %license LICENSE.txt -%files javadoc -f .mfiles-javadoc +%files javadoc %license LICENSE.txt +%{_javadocdir}/%{name} %changelog