%global project felix
%global bundle org.apache.felix.scr
Name: felix-scr
Version: 1.6.2
Release: 3%{?dist}
Summary: Apache Felix Declarative Services Runtime
License: ASL 2.0
URL: http://felix.apache.org/documentation/subprojects/apache-felix-service-component-runtime.html
# Latest release use org.osgi:org.osgi.enterprise:jar:5.0.0 & org.osgi:org.osgi.core:jar:5.0.0
# To build tarball from vcs use:
# svn export http://svn.apache.org/repos/asf/felix/releases/org.apache.felix.scr-1.6.2
# tar -czvf org.apache.felix.scr-1.6.2.tar.gz org.apache.felix.scr-1.6.2
Source0: %{bundle}-%{version}.tar.gz
BuildRequires: maven-local
BuildRequires: mvn(net.sf.kxml:kxml2)
BuildRequires: mvn(org.apache.felix:felix-parent:pom:)
BuildRequires: mvn(org.apache.felix:org.apache.felix.framework)
BuildRequires: mvn(org.apache.felix:org.apache.felix.gogo.runtime)
BuildRequires: mvn(org.apache.felix:org.apache.felix.shell)
BuildRequires: mvn(org.apache.felix:org.apache.felix.utils)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-failsafe-plugin)
BuildRequires: mvn(org.osgi:org.osgi.compendium)
BuildRequires: mvn(org.osgi:org.osgi.core)
BuildArch: noarch
%description
Implementation of the Declarative Services specification 1.2.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q -n %{bundle}-%{version}
cp src/main/appended-resources/META-INF/LICENSE ./
cp src/main/appended-resources/META-INF/NOTICE ./
%pom_remove_plugin :animal-sniffer-maven-plugin
%pom_xpath_remove "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-bundle-plugin']/pom:configuration/pom:instructions/pom:Private-Package"
%pom_xpath_remove "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-bundle-plugin']/pom:configuration/pom:instructions/pom:Embed-Dependency"
%pom_xpath_remove "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-bundle-plugin']/pom:configuration/pom:instructions/pom:Export-Package"
%pom_xpath_inject "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-bundle-plugin']/pom:configuration/pom:instructions" '
org.apache.felix.scr;version=1.7,
org.apache.felix.scr.component;version=1.0;
mandatory:="status"; status="provisional"
'
%pom_xpath_remove "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-bundle-plugin']/pom:configuration/pom:instructions/pom:Import-Package"
%pom_xpath_inject "pom:project/pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-bundle-plugin']/pom:configuration/pom:instructions" '
org.apache.felix.service.command;resolution:=optional,
org.apache.felix.shell;provide:=true;resolution:=optional,
org.osgi.framework;version="[1.4,2)",
org.osgi.service.log;version="[1.3,2)";resolution:=optional,
org.osgi.service.packageadmin;version="[1.2,2)";resolution:=optional,
org.osgi.service.component;provide:=true,
org.apache.felix.scr;provide:=true,
org.kxml2.io,
org.osgi.util.tracker, org.xmlpull.v1
'
%pom_xpath_remove "pom:project/pom:dependencies/pom:dependency[pom:scope='test']"
%pom_remove_dep org.ops4j.base:
# error: type ServiceReference does not take parameters (java7 build fix)
sed -i "s|public void configureComponentHolders(final ServiceReference|public void configureComponentHolders(final ServiceReference|" \
src/main/java/org/apache/felix/scr/impl/config/ConfigurationSupport.java
%mvn_file :%{bundle} %{project}/%{bundle}
%build
# no test deps availables e.g org.ops4j.pax.url:pax-url-wrap:1.4.0.RC1
%mvn_build -f -- -Dproject.build.sourceEncoding=UTF-8
%install
%mvn_install
%files -f .mfiles
%doc changelog.txt
%license LICENSE NOTICE
%files javadoc -f .mfiles-javadoc
%license LICENSE NOTICE
%changelog
* Wed Jul 08 2015 jkang@redhat.com - 1.6.2-3
- Added LICENSE and NOTICE files
* Wed Jun 17 2015 Jie Kang - 1.6.2-2
- Changed to vcs source as tarball no longer available
* Sun Oct 06 2013 gil cattaneo 1.6.2-1
- initial rpm