%global bundle org.apache.aries.spifly Name: aries-spifly Version: 1.0.8 Release: 1%{?dist} Summary: Reference Implementation of the OSGi ServiceLoader Mediator specification License: ASL 2.0 URL: http://aries.apache.org/modules/spi-fly.html Source0: http://central.maven.org/maven2/org/apache/aries/spifly/spifly/%{version}/spifly-%{version}-source-release.zip BuildRequires: maven-local BuildRequires: mvn(junit:junit) BuildRequires: mvn(org.apache.aries:org.apache.aries.util) BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.easymock:easymock) #BuildRequires: mvn(org.osgi:org.osgi.compendium) BuildRequires: mvn(org.eclipse.osgi:org.eclipse.osgi) BuildRequires: mvn(org.ow2.asm:asm-debug-all) BuildArch: noarch %description The SPI Fly component is aimed at providing OSGi support for JRE SPI mechanisms, including the usage of java.util.ServiceLoader, META-INF/services and similar methods. SPI Fly is the Reference Implementation of the OSGi ServiceLoader Mediator specification, chapter 133 in the OSGi Enterprise Specification, available from version 5. %package core-internal Summary: Apache Aries SPI Fly Core (internal module) %description core-internal This bundle contains an extender that facilitates the use of JRE SPI providers (components typically plugged in to the JRE through META-INF/services resources). %package dynamic-bundle Summary: Apache Aries SPI Fly Dynamic Weaving Bundle %description dynamic-bundle This bundle contains an extender that facilitates the use of JRE SPI providers (components typically plugged in to the JRE through META-INF/services resources). %package javadoc Summary: Javadoc for %{name} %description javadoc This package contains javadoc for %{name}. %package static-bundle Summary: Apache Aries SPI Fly Static Weaving Bundle %description static-bundle This bundle contains support classes used at run-time by bundles woven using the static weaving done through the org.apache.aries.spifly.static component. %package static-tool Summary: Apache Aries SPI Fly Static Weaving Tool %description static-tool This tool does the weaving to support SPI ServiceLoader statically. %package weaver-internal Summary: Apache Aries SPI Fly Weaver (internal module) %description weaver-internal Apache Aries SPI Fly Weaver (internal module). %prep %setup -q -n spifly-%{version} # Cleanup find . -name "*.class" -delete find . -name "*.jar" -type f -delete #sed -i '24,29d' spi-fly-core/pom.xml spi-fly-dynamic-bundle/pom.xml spi-fly-static-bundle/pom.xml spi-fly-static-tool/pom.xml spi-fly-weaver/pom.xml pom.xml %pom_remove_parent spi-fly-core/pom.xml spi-fly-dynamic-bundle/pom.xml spi-fly-static-bundle/pom.xml spi-fly-static-tool/pom.xml spi-fly-weaver/pom.xml pom.xml # Fix OSGi manifests %pom_xpath_set "pom:project/pom:packaging" -r bundle spi-fly-core spi-fly-static-tool spi-fly-weaver # Do not bundle system libraries %pom_xpath_remove "pom:plugin[pom:artifactId = 'maven-bundle-plugin']/pom:configuration/pom:instructions/pom:Embed-Dependency" spi-fly-dynamic-bundle %pom_xpath_inject "pom:plugin[pom:artifactId = 'maven-bundle-plugin']/pom:configuration" "true" spi-fly-dynamic-bundle spi-fly-static-bundle %pom_xpath_inject "pom:plugin[pom:artifactId = 'maven-bundle-plugin']" "true" spi-fly-dynamic-bundle spi-fly-static-bundle %pom_remove_plugin :maven-assembly-plugin spi-fly-static-tool %pom_add_plugin org.apache.felix:maven-bundle-plugin spi-fly-core ' true true ${project.name} ${project.artifactId} Apache Aries ${project.version} The Apache Software Foundation bundle-manifest process-classes manifest ' %pom_add_plugin org.apache.felix:maven-bundle-plugin spi-fly-static-tool ' true true ${project.name} ${project.artifactId} Apache Aries ${project.version} The Apache Software Foundation org.apache.aries.spifly.statictool.Main bundle-manifest process-classes manifest ' %pom_add_plugin org.apache.felix:maven-bundle-plugin spi-fly-weaver ' true true ${project.name} ${project.artifactId} Apache Aries ${project.version} The Apache Software Foundation bundle-manifest process-classes manifest ' # Use OSGi 5.x specification %pom_change_dep -r org.osgi:org.osgi.core org.eclipse.osgi:org.eclipse.osgi:3.10.102.v20160416-2200 %pom_remove_dep -r org.osgi:org.osgi.compendium # NOT available plugin %pom_remove_plugin -r org.apache.aries.versioning:org.apache.aries.versioning.plugin spi-fly-dynamic-bundle spi-fly-static-bundle %build # Test suite fails for various reasons %mvn_build -s -f -- -Dproject.build.sourceEncoding=UTF-8 %install %mvn_install %files -f .mfiles-spifly %license LICENSE NOTICE %files core-internal -f .mfiles-%{bundle}.core-internal %license LICENSE NOTICE %files dynamic-bundle -f .mfiles-%{bundle}.dynamic.bundle %files javadoc -f .mfiles-javadoc %license LICENSE NOTICE %files static-bundle -f .mfiles-%{bundle}.static.bundle %files static-tool -f .mfiles-%{bundle}.static.tool %files weaver-internal -f .mfiles-%{bundle}.weaver-internal %changelog * Tue Feb 28 2017 gil cattaneo 1.0.8-1 - initial rpm