%bcond_with bootstrap
Name: osgi-compendium
Version: 7.0.0
Release: %autorelease
Summary: Interfaces and Classes for use in compiling OSGi bundles
License: Apache-2.0
URL: http://www.osgi.org
BuildArch: noarch
ExclusiveArch: %{java_arches} noarch
Source0: https://osgi.org/download/r7/osgi.cmpn-%{version}.jar
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
BuildRequires: maven-local
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.osgi:osgi.annotation)
BuildRequires: mvn(org.osgi:osgi.core)
%endif
%description
OSGi Compendium, Interfaces and Classes for use in compiling bundles.
%package javadoc
Summary: API documentation for %{name}
%description javadoc
This package provides %{summary}.
%prep
%autosetup -p1 -c
# Delete pre-built binaries
rm -r org
find -name '*.class' -delete
mkdir -p src/main/{java,resources}
mv OSGI-OPT/src/org src/main/java/
mv xmlns src/main/resources
# J2ME stuff
rm -r src/main/java/org/osgi/service/io
mv META-INF/maven/org.osgi/osgi.cmpn/pom.xml .
%pom_xpath_inject pom:project '
bundle
UTF-8
org.apache.felix
maven-bundle-plugin
true
${project.artifactId}
${project.artifactId}
'
%pom_add_dep org.osgi:osgi.annotation::provided
%pom_add_dep org.osgi:osgi.core::provided
# Don't compile in Servlet, Jax RS and JPA support
rm -r src/main/java/org/osgi/service/http
rm -r src/main/java/org/osgi/service/jaxrs
rm -r src/main/java/org/osgi/service/jpa
rm -r src/main/java/org/osgi/service/transaction/control/jpa
%build
%mvn_build -- -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8
%install
%mvn_install
%files -f .mfiles
%license LICENSE
%doc about.html
%files javadoc -f .mfiles-javadoc
%license LICENSE
%changelog
%autochangelog