From 7c50053e5bd30b0d4e29f9fb548956c70de67065 Mon Sep 17 00:00:00 2001 From: Jie Kang Date: Sep 28 2015 18:54:46 +0000 Subject: SCL-ize package --- diff --git a/felix-scr.spec b/felix-scr.spec index 08cca65..936f48b 100644 --- a/felix-scr.spec +++ b/felix-scr.spec @@ -1,8 +1,17 @@ +%{?scl:%scl_package felix-scr} +%{!?scl:%global pkg_name %{name}} + +%if 0%{?rhel} +# Use java common's requires/provides generator +%{?java_common_find_provides_and_requires} +%endif% + %global project felix %global bundle org.apache.felix.scr -Name: felix-scr + +Name: %{?scl_prefix}felix-scr Version: 1.6.2 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Apache Felix Declarative Services Runtime License: ASL 2.0 URL: http://felix.apache.org/documentation/subprojects/apache-felix-service-component-runtime.html @@ -12,17 +21,17 @@ URL: http://felix.apache.org/documentation/subprojects/apache-felix-se # 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) +BuildRequires: %{?scl_prefix_java_common}maven-local +BuildRequires: %{?scl_prefix_maven}mvn(net.sf.kxml:kxml2) +BuildRequires: %{?scl_prefix_maven}mvn(org.apache.felix:felix-parent:pom:) +BuildRequires: %{?scl_prefix_java_common}mvn(org.apache.felix:org.apache.felix.framework) +BuildRequires: %{?scl_prefix}mvn(org.apache.felix:org.apache.felix.gogo.runtime) +BuildRequires: %{?scl_prefix_maven}mvn(org.apache.felix:org.apache.felix.shell) +BuildRequires: %{?scl_prefix_maven}mvn(org.apache.felix:org.apache.felix.utils) +BuildRequires: %{?scl_prefix_maven}mvn(org.apache.felix:maven-bundle-plugin) +BuildRequires: %{?scl_prefix_maven}mvn(org.apache.maven.plugins:maven-failsafe-plugin) +BuildRequires: %{?scl_prefix_maven}mvn(org.osgi:org.osgi.compendium) +BuildRequires: %{?scl_prefix_maven}mvn(org.osgi:org.osgi.core) BuildArch: noarch @@ -36,6 +45,7 @@ Summary: Javadoc for %{name} This package contains javadoc for %{name}. %prep +%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"} %setup -q -n %{bundle}-%{version} cp src/main/appended-resources/META-INF/LICENSE ./ @@ -70,28 +80,46 @@ cp src/main/appended-resources/META-INF/NOTICE ./ %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} +%{?scl:EOF} %build - +%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"} # 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 +%{?scl:EOF} %install +%{?scl:scl enable %{scl_maven} %{scl} - << "EOF"} %mvn_install +%{?scl:EOF} %files -f .mfiles %doc changelog.txt -%license LICENSE NOTICE + +%if 0%{?rhel} <= 6 + %doc LICENSE NOTICE +%else + %license LICENSE NOTICE +%endif %files javadoc -f .mfiles-javadoc -%license LICENSE NOTICE +%if 0%{?rhel} <= 6 + %doc LICENSE NOTICE +%else + %license LICENSE NOTICE +%endif + %changelog +* Thu Sep 10 2015 jkang@redhat.com - 1.6.2-4 +- SCL-ize package + * Wed Jul 08 2015 jkang@redhat.com - 1.6.2-3 - Added LICENSE and NOTICE files