%global namedreltag -b24
%global namedversion %{version}%{?namedreltag}
Name: glassfish-hk2
Version: 2.4.0
Release: 0.1.b24%{?dist}
Summary: Hundred Kilobytes Kernel
License: CDDL or GPLv2 with exceptions
URL: http://hk2.java.net/
# git clone -b hk2-parent-2.4.0-b24 git://java.net/hk2~git glassfish-hk2-2.4.0-b24
# find glassfish-hk2-2.4.0-b24 -name '*.jar' -type f -print -delete
# find glassfish-hk2-2.4.0-b24 -name '*.class' -print -delete
# tar cJf glassfish-hk2-2.4.0-b24.tar.xz glassfish-hk2-2.4.0-b24
Source0: glassfish-hk2-2.4.0-b24.tar.xz
# https://java.net/jira/browse/HK2-250
# wget -O glassfish-LICENSE.txt https://svn.java.net/svn/glassfish~svn/tags/legal-1.1/src/main/resources/META-INF/LICENSE.txt
# glassfish-hk2 package don't include the license file
Source1: glassfish-LICENSE.txt
Patch0: glassfish-hk2-2.3.0-hk2-utils-osgi_bundle.patch
Patch1: glassfish-hk2-2.4.0-b24-disable-asm-all-repackaged.patch
Patch2: glassfish-hk2-2.3.0-disable-external-aopalliance.patch
BuildRequires: maven-local
BuildRequires: mvn(aopalliance:aopalliance)
BuildRequires: mvn(args4j:args4j)
BuildRequires: mvn(com.google.inject:guice)
BuildRequires: mvn(com.sun.codemodel:codemodel)
BuildRequires: mvn(javax.el:javax.el-api)
BuildRequires: mvn(javax.enterprise:cdi-api)
BuildRequires: mvn(javax.inject:javax.inject)
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(net.java:jvnet-parent:pom:)
BuildRequires: mvn(org.apache.ant:ant)
BuildRequires: mvn(org.apache.ant:ant-launcher)
BuildRequires: mvn(org.apache.bcel:bcel)
BuildRequires: mvn(org.apache.felix:org.apache.felix.bundlerepository)
BuildRequires: mvn(org.apache.felix:org.osgi.core)
BuildRequires: mvn(org.apache.maven:maven-archiver)
BuildRequires: mvn(org.apache.maven:maven-artifact)
BuildRequires: mvn(org.apache.maven:maven-compat)
BuildRequires: mvn(org.apache.maven:maven-core)
BuildRequires: mvn(org.apache.maven:maven-plugin-api)
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-compiler-plugin)
BuildRequires: mvn(org.apache.maven.shared:maven-osgi)
BuildRequires: mvn(org.easymock:easymock)
BuildRequires: mvn(org.glassfish.hk2:osgi-resource-locator)
BuildRequires: mvn(org.hibernate:hibernate-validator)
BuildRequires: mvn(org.javassist:javassist)
BuildRequires: mvn(org.jvnet:tiger-types)
BuildRequires: mvn(org.mockito:mockito-core)
BuildRequires: mvn(org.osgi:org.osgi.compendium)
BuildRequires: mvn(org.osgi:org.osgi.core)
BuildRequires: mvn(org.ow2.asm:asm-all)
BuildRequires: mvn(org.springframework:spring-context)
BuildRequires: mvn(org.testng:testng)
Obsoletes: %{name}-apt
BuildArch: noarch
%description
HK2 for Hundred Kilobytes Kernel is an abstraction to
a module subsystem coupled with a simple yet powerful
component model to build server side software.
%package api
Summary: HK2 API module
%description api
Hundred Kilobytes Kernel API module.
%package class-model
Summary: Class Model for Hk2
%description class-model
Hundred Kilobytes Kernel Class Model.
%package configuration
Summary: HK2 configuration modules
%description configuration
Hundred Kilobytes Kernel configuration modules.
%package core
Summary: HK2 core module
%description core
Hundred Kilobytes Kernel core module.
%package dependency-verifier
Summary: HK2 Static Analyser for verifying module dependency
%description dependency-verifier
HK2 Static Analyser for verifying module dependency.
%package dependency-visualizer
Summary: HK2 Tool to visualize the dependencies
%description dependency-visualizer
Tool to visualize the dependencies generated by
HK2's dependency-verifier.
%package guice-bridge
Summary: HK2 Guice Bridge
%description guice-bridge
Hundred Kilobytes Kernel Guice Bridge.
%package hk2
Summary: HK2 module of HK2 itself
%description hk2
This is so that other modules can depend on HK2 as an HK2 module.
%package inhabitant-generator
Summary: HK2 Inhabitant Generator - maven plugin
%description inhabitant-generator
Hundred Kilobytes Kernel Inhabitant Generator - maven plugin.
%package jmx
Summary: HK2 JMX module
%description jmx
Hundred Kilobytes Kernel JMX module.
%package locator
Summary: HK2 ServiceLocator Default Implementation
%description locator
Hundred Kilobytes Kernel ServiceLocator Default Implementation.
%package maven
Summary: HK2 Module system maven support
%description maven
HK2 Maven plugin for developing.
%package maven-plugins
Summary: HK2 Maven Plugins
%description maven-plugins
This package provides:
* consolidated bundle Maven plugin,
* osgiversion-maven-plugin - Maven Plugin for
computing OSGi versions from Maven versions.
%package metadata-generator
Summary: HK2 Metadata Generator
%description metadata-generator
HK2 Metadata Generator Subsystem.
%package osgi
Summary: HK2 OSGi Adapter
%description osgi
HK2 Maven plugin for developing.
%package runlevel
Summary: HK2 Run Level Service
%description runlevel
Hundred Kilobytes Kernel Run Level Service.
%package spring-bridge
Summary: HK2 Spring Bridge
%description spring-bridge
Hundred Kilobytes Kernel Spring Bridge.
%package testing
Summary: Utilities for testing with HK2
%description testing
Hundred Kilobytes Kernel Utilities for testing.
%package locator-extras
Summary: HK2 Locator unit tests
%description locator-extras
Extra unit tests for the HK2 Locator implementation.
%package locator-no-proxies
Summary: HK2 Locator No Proxy Unit tests
%description locator-no-proxies
Tests the basic HK2 locator with no proxiable scopes.
%package locator-no-proxies2
Summary: HK2 Locator No Proxy Unit tests (2)
%description locator-no-proxies2
Tests the basic HK2 locator using AOP proxies.
%package runlevel-extras
Summary: HK2 RunLevel unit tests
%description runlevel-extras
Extra unit tests for the HK2 RunLevelService implementation.
%package testng
Summary: HK2 TestNG runner
%description testng
A utility for running HK2 under TestNG.
%package utils
Summary: HK2 Implementation Utilities
%description utils
Hundred Kilobytes Kernel Implementation Utilities.
%package javadoc
Summary: Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q -n glassfish-hk2-%{namedversion}
%patch0 -p0
%patch1 -p1
%patch2 -p1
%pom_remove_dep org.glassfish.hk2.external:aopalliance-repackaged hk2-extras
%pom_add_dep aopalliance:aopalliance:'${aopalliance.version}' hk2-extras
# org.apache.maven.wagon:wagon-webdav-jackrabbit:2.0
%pom_xpath_remove pom:build/pom:extensions
%pom_remove_plugin com.googlecode.maven-download-plugin:maven-download-plugin
%pom_remove_plugin :maven-site-plugin
%pom_remove_plugin :maven-eclipse-plugin
%pom_remove_plugin :maven-release-plugin
%pom_remove_plugin :findbugs-maven-plugin
%pom_disable_module external
%pom_remove_dep org.glassfish.hk2.external: bom
%pom_remove_dep org.glassfish.hk2:external bom
%pom_remove_dep org.glassfish.hk2:tiger-types-osgi bom
%pom_disable_module examples
# Use unavailable: org.ops4j.pax.exam, org.ops4j.pax.url
%pom_disable_module osgi-adapter-test osgi/adapter-tests
%pom_remove_dep :osgi-adapter-test bom
%pom_remove_dep org.ops4j.base:
%pom_remove_dep org.ops4j.pax.exam:
%pom_remove_dep org.ops4j.pax.tipi:
%pom_remove_dep org.ops4j.pax.url:
# disable tiger-types copy
%pom_remove_plugin :maven-dependency-plugin hk2-utils
%pom_xpath_remove "pom:plugin[pom:artifactId ='maven-surefire-plugin']/pom:configuration" hk2-api
%pom_xpath_remove "pom:plugin[pom:artifactId ='maven-surefire-plugin']/pom:configuration" hk2-locator
%pom_xpath_set "pom:dependency[pom:groupId ='org.osgi']/pom:artifactId" org.osgi.core hk2-maven
%pom_remove_dep org.apache.maven:maven-project hk2-maven
%pom_add_dep org.apache.maven:maven-core hk2-maven
%pom_add_dep org.apache.maven:maven-compat hk2-maven
%pom_remove_dep org.apache.maven:maven-project hk2-inhabitant-generator
%pom_add_dep org.apache.maven:maven-core::provided hk2-inhabitant-generator
%pom_remove_dep org.apache.maven:maven-project hk2-configuration/persistence/hk2-xml-dom/config-generator
%pom_add_dep org.apache.maven:maven-core hk2-configuration/persistence/hk2-xml-dom/config-generator
%pom_remove_dep :org.osgi.enterprise class-model
%pom_add_dep org.osgi:org.osgi.compendium:4.2.0:provided class-model
%pom_remove_plugin :maven-dependency-plugin osgi/adapter-tests/sdp-management-bundle
%pom_xpath_set "pom:dependency[pom:groupId ='com.sun']/pom:artifactId" tools hk2-testing/ant
%pom_xpath_remove "pom:dependency[pom:groupId ='com.sun']/pom:scope" hk2-testing/ant
%pom_xpath_remove "pom:dependency[pom:groupId ='com.sun']/pom:systemPath" hk2-testing/ant
%pom_xpath_remove "pom:profiles/pom:profile[pom:id ='mac']" hk2-testing/ant
# Unavailable test dep org.assertj:assertj-core:1.4.0 org.uncommons:reportng:jar:1.1.2
%pom_remove_dep org.assertj:assertj-core hk2-testing/hk2-testng
%pom_remove_dep org.uncommons:reportng hk2-testing/hk2-testng
rm -r hk2-testing/hk2-testng/src/test/java/*
%pom_remove_dep org.assertj:assertj-core hk2-testing/hk2-mockito
%pom_remove_dep org.uncommons:reportng hk2-testing/hk2-mockito
rm -r hk2-testing/hk2-mockito/src/test/java/*
%pom_remove_dep org.uncommons:reportng hk2-testing/hk2-runlevel-extras
rm -r hk2-testing/hk2-runlevel-extras/src/test/java/*
%pom_xpath_set "pom:plugin[pom:artifactId ='maven-jar-plugin']/pom:configuration/pom:archive/pom:manifest/pom:addClasspath" false dependency-verifier
mkdir -p hk2/target/classes
%pom_remove_plugin :maven-jar-plugin hk2
for d in hk2-configuration/persistence/hk2-xml-dom/hub-integration \
hk2-configuration/persistence/hk2-xml-dom/hk2-config;do
%pom_remove_dep org.glassfish.hk2.external:bean-validator $d
%pom_add_dep org.hibernate:hibernate-validator:'${hibernate-validator.version}' $d
done
for d in hk2-inhabitant-generator \
hk2-locator \
hk2-metadata-generator/main \
hk2-metadata-generator/test1 \
hk2-testing/hk2-junitrunner \
hk2-testing/hk2-locator-extras \
hk2-testing/hk2-locator-no-proxies \
hk2-testing/hk2-locator-no-proxies2 \
hk2-testing/hk2-mockito \
hk2-testing/hk2-runlevel-extras \
hk2-testing/hk2-testng \
hk2-testing/interceptor-events \
osgi/adapter-tests/no-hk2-bundle;do
%pom_xpath_set "pom:dependency[pom:artifactId = 'javax.inject']/pom:groupId" javax.inject $d
done
# RHBZ#1223468
%pom_xpath_inject "pom:dependency[pom:artifactId = 'cdi-api']" "
<exclusions>
<exclusion>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
</exclusion>
</exclusions>" class-model
%pom_xpath_set "pom:dependency[pom:artifactId ='ant']/pom:groupId" org.apache.ant hk2-inhabitant-generator
cp -p %{SOURCE1} LICENSE.txt
sed -i 's/\r//' LICENSE.txt
%mvn_package ":hk2" hk2
%mvn_package ":hk2-api" api
%mvn_package ":hk2-bom" %{name}
%mvn_package ":hk2-parent" %{name}
%mvn_package ":class-model" class-model
%mvn_package ":core" core
%mvn_package ":hk2-configuration" configuration
%mvn_package ":hk2-configuration-integration" configuration
%mvn_package ":hk2-configuration-hub" configuration
%mvn_package ":hk2-configuration-persistence" configuration
%mvn_package ":hk2-xml-parent" configuration
%mvn_package ":hk2-xml" configuration
%mvn_package ":hk2-xml-test" configuration
%mvn_package ":hk2-xml-dom" configuration
%mvn_package ":config-generator" configuration
%mvn_package ":config-types" configuration
%mvn_package ":hk2-config" configuration
%mvn_package ":hk2-config-hub-integration" configuration
%mvn_package ":hk2-property-file" configuration
%mvn_package ":hk2-dependency-verifier" dependency-verifier
%mvn_package ":hk2-dependency-visualizer" dependency-visualizer
%mvn_package ":hk2-inhabitant-generator" inhabitant-generator
%mvn_package ":hk2-jmx" jmx
%mvn_package ":hk2-locator" locator
%mvn_package ":hk2-locator-extras" locator-extras
%mvn_package ":hk2-locator-no-proxies" locator-no-proxies
%mvn_package ":hk2-locator-no-proxies2" locator-no-proxies2
%mvn_package ":hk2-maven" maven
%mvn_package ":consolidatedbundle-maven-plugin" maven-plugins
%mvn_package ":osgiversion-maven-plugin" maven-plugins
%mvn_package ":hk2-metadata-generator-parent" metadata-generator
%mvn_package ":hk2-metadata-generator" metadata-generator
%mvn_package ":hk2-metadata-generator-test1" metadata-generator
%mvn_package ":hk2-runlevel" runlevel
%mvn_package ":hk2-runlevel-extras" runlevel-extras
%mvn_package ":hk2-utils" utils
%mvn_package ":guice-bridge" guice-bridge
%mvn_package ":spring-bridge" spring-bridge
%mvn_package ":hk2-testing" testing
%mvn_package ":hk2-junitrunner" testing
%mvn_package ":hk2-ant-test" testing
%mvn_package ":hk2-collections-tests" testing
%mvn_package ":hk2-mockito" testing
%mvn_package ":interceptor-events" testing
%mvn_package ":hk2-testng" testng
%mvn_package ":osgi" osgi
%mvn_package ":osgi-adapter" osgi
%mvn_package ":osgi-adapter-tests-parent" osgi
%mvn_package ":contract-bundle" osgi
%mvn_package ":faux-sdp-bundle" osgi
%mvn_package ":no-hk2-bundle" osgi
%mvn_package ":sdp-management-bundle" osgi
%mvn_package ":test-module-startup" osgi
%build
# some tests fails for various cause
%mvn_build -- -Dmaven.test.failure.ignore=true
%install
%mvn_install
%files -f .mfiles-%{name}
%dir %{_javadir}/%{name}
%doc README.md
%license LICENSE.txt
%files api -f .mfiles-api
%license LICENSE.txt
%files class-model -f .mfiles-class-model
%license LICENSE.txt
%files configuration -f .mfiles-configuration
%license LICENSE.txt
%files core -f .mfiles-core
%license LICENSE.txt
%files dependency-verifier -f .mfiles-dependency-verifier
%license LICENSE.txt
%files dependency-visualizer -f .mfiles-dependency-visualizer
%doc dependency-visualizer/README
%license LICENSE.txt
%files guice-bridge -f .mfiles-guice-bridge
%license LICENSE.txt
%files hk2 -f .mfiles-hk2
%license LICENSE.txt
%files inhabitant-generator -f .mfiles-inhabitant-generator
%license LICENSE.txt
%files jmx -f .mfiles-jmx
%license LICENSE.txt
%files locator -f .mfiles-locator
%license LICENSE.txt
%files maven -f .mfiles-maven
%license LICENSE.txt
%files maven-plugins -f .mfiles-maven-plugins
%license LICENSE.txt
%files metadata-generator -f .mfiles-metadata-generator
%license LICENSE.txt
%files osgi -f .mfiles-osgi
%license LICENSE.txt
%files runlevel -f .mfiles-runlevel
%license LICENSE.txt
%files spring-bridge -f .mfiles-spring-bridge
%license LICENSE.txt
%files testing -f .mfiles-testing
%license LICENSE.txt
%files locator-extras -f .mfiles-locator-extras
%doc hk2-testing/hk2-locator-extras/README.txt
%license LICENSE.txt
%files locator-no-proxies -f .mfiles-locator-no-proxies
%doc hk2-testing/hk2-locator-no-proxies/README.txt
%license LICENSE.txt
%files locator-no-proxies2 -f .mfiles-locator-no-proxies2
%doc hk2-testing/hk2-locator-no-proxies2/README.txt
%license LICENSE.txt
%files runlevel-extras -f .mfiles-runlevel-extras
%doc hk2-testing/hk2-runlevel-extras/README.txt
%license LICENSE.txt
%files testng -f .mfiles-testng
%doc hk2-testing/hk2-testng/README.md
%license LICENSE.txt
%files utils -f .mfiles-utils
%license LICENSE.txt
%files javadoc -f .mfiles-javadoc
%license LICENSE.txt
%changelog
* Sat May 23 2015 gil cattaneo <puntogil@libero.it> 2.4.0-0.1.b24
- update to 2.4.0-b24
* Mon May 04 2015 gil cattaneo <puntogil@libero.it> 2.3.0-1
- update to 2.3.0
* Fri Feb 27 2015 Michal Srb <msrb@redhat.com> - 2.1.93-9
- Use mvn()-like BRs
* Tue Feb 03 2015 gil cattaneo <puntogil@libero.it> 2.1.93-8
- introduce license macro
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.93-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Fri May 09 2014 Michal Srb <msrb@redhat.com> - 2.1.93-6
- Remove BR: apt-maven-plugin
* Fri Mar 28 2014 Michael Simacek <msimacek@redhat.com> - 2.1.93-5
- Use Requires: java-headless rebuild (#1067528)
* Thu Nov 14 2013 gil cattaneo <puntogil@libero.it> 2.1.93-4
- use objectweb-asm3
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.93-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Wed Jul 10 2013 gil cattaneo <puntogil@libero.it> 2.1.93-2
- switch to XMvn
- minor changes to adapt to current guideline
* Tue May 14 2013 gil cattaneo <puntogil@libero.it> 2.1.93-1
- update to 2.1.93
* Fri Apr 26 2013 gil cattaneo <puntogil@libero.it> 2.1.92-1
- update to 2.1.92
* Sat Oct 13 2012 gil cattaneo <puntogil@libero.it> 2.1.37-1
- update to 2.1.37
* Sat Oct 06 2012 gil cattaneo <puntogil@libero.it> 2.1.35-1
- update to 2.1.35
* Sat Aug 25 2012 gil cattaneo <puntogil@libero.it> 2.1.34-1
- initial rpm