diff --git a/felix-utils-build.xml b/felix-utils-build.xml new file mode 100644 index 0000000..2b648cc --- /dev/null +++ b/felix-utils-build.xml @@ -0,0 +1,240 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =================================== WARNING =================================== + JUnit is not present in the test classpath or your $ANT_HOME/lib directory. Tests not executed. + =============================================================================== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/felix-utils.spec b/felix-utils.spec index ec0729d..1c5213d 100644 --- a/felix-utils.spec +++ b/felix-utils.spec @@ -1,7 +1,7 @@ # # spec file for package felix-utils # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,6 +17,7 @@ %global bundle org.apache.felix.utils +%bcond_with tests Name: felix-utils Version: 1.10.4 Release: 0 @@ -25,42 +26,70 @@ License: Apache-2.0 Group: Development/Libraries/Java URL: http://felix.apache.org Source0: http://repo1.maven.org/maven2/org/apache/felix/%{bundle}/%{version}/%{bundle}-%{version}-source-release.tar.gz +Source1: %{name}-build.xml +BuildRequires: ant BuildRequires: fdupes -BuildRequires: maven-local +BuildRequires: felix-osgi-compendium +BuildRequires: felix-osgi-core +BuildRequires: javapackages-local BuildRequires: mvn(org.apache.felix:felix-parent:pom:) -BuildRequires: mvn(org.osgi:org.osgi.compendium) -BuildRequires: mvn(org.osgi:org.osgi.core) +Requires: mvn(org.apache.felix:felix-parent:pom:) BuildArch: noarch +%if %{with tests} +BuildRequires: ant-junit +BuildRequires: hamcrest-core +BuildRequires: mockito +%endif %description Utility classes for OSGi %package javadoc Summary: API documentation for %{name} -Group: Development/Libraries/Java +Group: Documentation/HTML %description javadoc This package contains the API documentation for %{name}. %prep %setup -q -n %{bundle}-%{version} +cp -p %{SOURCE1} build.xml +mkdir -p lib +build-jar-repository -s lib felix +%if %{with tests} +build-jar-repository -s lib junit hamcrest/core mockito +%endif %pom_remove_plugin :apache-rat-plugin -%{mvn_file} :%{bundle} "felix/%{bundle}" +#%{mvn_file} :%{bundle} "felix/%{bundle}" %build -%mvn_build -f +%{ant} \ +%if %{without tests} + -Dtest.skip=true \ +%endif + package javadoc %install -%mvn_install +# jar +install -dm 0755 %{buildroot}%{_javadir}/felix +install -pm 0644 target/%{bundle}-%{version}.jar %{buildroot}%{_javadir}/felix/%{bundle}.jar +# pom +install -dm 0755 %{buildroot}%{_mavenpomdir}/felix +install -pm 0644 pom.xml %{buildroot}%{_mavenpomdir}/felix/%{bundle}.pom +%add_maven_depmap felix/%{bundle}.pom felix/%{bundle}.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 NOTICE %doc DEPENDENCIES -%files javadoc -f .mfiles-javadoc +%files javadoc %license LICENSE NOTICE +%{_javadocdir}/%{name} %changelog