Name: guice-recipes
Version: 3.0
Release: 1%{?dist}
Summary: Guice utilities
Group: Development/Libraries
License: ASL 2.0
URL: http://code.google.com/p/guice-recipes/
# svn export http://guice-recipes.googlecode.com/svn/tags/parent-3.0 guice-recipes-3.0
# tar czf guice-recipes-3.0-src-svn.tar.gz guice-recipes-3.0
Source0: %{name}-%{version}-src-svn.tar.gz
# java7 problem
Patch0: guice-recipes-3.0-Injectors.patch
BuildRequires: java-devel
BuildRequires: guice-parent
BuildRequires: geronimo-ejb
BuildRequires: geronimo-jpa
BuildRequires: google-guice
BuildRequires: guava
BuildRequires: junit
BuildRequires: springframework
BuildRequires: springframework-beans
BuildRequires: testng
# test dep
BuildRequires: cglib
BuildRequires: hamcrest12
BuildRequires: maven-local
BuildRequires: maven-plugin-bundle
BuildRequires: maven-surefire-provider-testng
Requires: google-guice
Requires: guava
Requires: java
BuildArch: noarch
# Tested on: http://koji.fedoraproject.org/koji/taskinfo?taskID=5431861
%description
Guice-recipes provides a number of utilities on top of the
Guice 3.x to help developers work with standard Annotations
for injection and life-cycles from JSR 250, Spring, EJB3 and
JPA as well as supporting Maven and improved Testing.
Guice-recipes is a fork of Guiceyfruit (https://code.google.com/p/guiceyfruit/)
to address unresolved issues.
%package ejb
Group: Development/Libraries
Summary: Guice-recipes :: EJB
Requires: %{name} = %{version}-%{release}
Requires: geronimo-ejb
%description ejb
Guice-recipes :: EJB.
%package jpa
Group: Development/Libraries
Summary: Guice-recipes :: JPA
Requires: %{name} = %{version}-%{release}
Requires: geronimo-jpa
%description jpa
Guice-recipes :: JPA.
%package junit
Group: Development/Libraries
Summary: Guice-recipes :: JUnit
Requires: %{name} = %{version}-%{release}
Requires: junit
%description junit
Guice-recipes :: JUnit.
%package spring
Group: Development/Libraries
Summary: Guice-recipes :: Spring
Requires: %{name} = %{version}-%{release}
Requires: guava
Requires: springframework
Requires: springframework-beans
%description spring
Guice-recipes :: Spring.
%package testng
Group: Development/Libraries
Summary: Guice-recipes :: TestNG
Requires: %{name} = %{version}-%{release}
Requires: testng
%description testng
Guice-recipes :: TestNG.
%package javadoc
Group: Documentation
Summary: Javadoc for %{name}
%description javadoc
This package contains javadoc for %{name}.
%prep
%setup -q
%patch0 -p0
# Unanted
%pom_disable_module %{name}
# Disable javadoc and source jars
%pom_remove_plugin :maven-source-plugin
%pom_remove_plugin :maven-javadoc-plugin
# Remove some unavailable deps:
# org.apache.servicemix.bundles:org.apache.servicemix.bundles.aopalliance
# org.easymock:easymock easymockclassextension 2.2
%pom_remove_dep org.apache.servicemix.bundles:
%pom_remove_dep org.easymock:
# Remove some warnings
sed -i 's|${groupId}|${project.groupId}|' $(find . -name "pom.xml")
sed -i 's|${artifactId}|${project.artifactId}|' $(find . -name "pom.xml")
sed -i 's|${version}|${project.version}|' $(find . -name "pom.xml")
%pom_xpath_inject "pom:build/pom:plugins/pom:plugin[pom:artifactId='maven-surefire-plugin']" "any"
sed -i 's/\r//' %{name}/src/main/release/*.txt
cp -p %{name}/src/main/release/LICENSE.txt .
cp -p %{name}/src/main/release/NOTICE.txt .
cp -p %{name}/src/main/release/README.txt .
# java.lang.NoClassDefFoundError: net/sf/cglib/proxy/CallbackFilter
for a in core \
ejb \
junit3 \
junit4 \
testng \
spring; do
%pom_add_dep net.sf.cglib:cglib::test %{name}-${a}
done
# no suitable method found for assertThat(javax.naming.Context,org.hamcrest.Matcher)
# [ERROR] method org.hamcrest.MatcherAssert.assertThat(java.lang.String,boolean) is not applicable
rm -r guice-recipes-core/src/test/java/org/guicerecipes/jsr250/ContextWithJsr250Test.java
# java.lang.AssertionError: ClassCounter.startCounter expected:<1> but was:<0>
rm -r guice-recipes-junit4/src/test/java/org/guicerecipes/testing/junit4/scopes/ScopeTest.java \
guice-recipes-junit4/src/test/java/org/guicerecipes/testing/junit4/scopes/UsingSingletonTest.java
%build
# use hamcrest 1.2. default require hamcrest 1.1
mvn-rpmbuild \
-Dproject.build.sourceEncoding=UTF-8 \
-Dmaven.local.depmap.file="%{_mavendepmapfragdir}/hamcrest12" \
package javadoc:aggregate
%install
mkdir -p %{buildroot}%{_mavenpomdir}
install -m 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-parent.pom
%add_maven_depmap JPP.%{name}-parent.pom
mkdir -p %{buildroot}%{_javadir}/%{name}
install -m 644 %{name}-core/target/%{name}-core-%{version}.jar \
%{buildroot}%{_javadir}/%{name}/%{name}-core.jar
install -pm 644 %{name}-core/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-core.pom
%add_maven_depmap JPP.%{name}-%{name}-core.pom %{name}/%{name}-core.jar
for a in ejb \
jpa \
testng; do
install -m 644 %{name}-${a}/target/%{name}-${a}-%{version}.jar \
%{buildroot}%{_javadir}/%{name}/%{name}-${a}.jar
install -pm 644 %{name}-${a}/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-${a}.pom
%add_maven_depmap JPP.%{name}-%{name}-${a}.pom %{name}/%{name}-${a}.jar -f ${a}
done
for a in junit3 \
junit4; do
install -m 644 %{name}-${a}/target/%{name}-${a}-%{version}.jar \
%{buildroot}%{_javadir}/%{name}/%{name}-${a}.jar
install -pm 644 %{name}-${a}/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-${a}.pom
%add_maven_depmap JPP.%{name}-%{name}-${a}.pom %{name}/%{name}-${a}.jar -f junit
done
for a in spring \
spring-converter; do
install -m 644 %{name}-${a}/target/%{name}-${a}-%{version}.jar \
%{buildroot}%{_javadir}/%{name}/%{name}-${a}.jar
install -pm 644 %{name}-${a}/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{name}-%{name}-${a}.pom
%add_maven_depmap JPP.%{name}-%{name}-${a}.pom %{name}/%{name}-${a}.jar -f spring
done
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -rp target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
%files
%dir %{_javadir}/%{name}
%{_javadir}/%{name}/%{name}-core.jar
%{_mavenpomdir}/JPP.%{name}-%{name}-core.pom
%{_mavenpomdir}/JPP.%{name}-parent.pom
%{_mavendepmapfragdir}/%{name}
%doc LICENSE.txt NOTICE.txt README.txt
%files ejb
%{_javadir}/%{name}/%{name}-ejb.jar
%{_mavenpomdir}/JPP.%{name}-%{name}-ejb.pom
%{_mavendepmapfragdir}/%{name}-ejb
%doc LICENSE.txt NOTICE.txt
%files jpa
%{_javadir}/%{name}/%{name}-jpa.jar
%{_mavenpomdir}/JPP.%{name}-%{name}-jpa.pom
%{_mavendepmapfragdir}/%{name}-jpa
%doc LICENSE.txt NOTICE.txt
%files junit
%{_javadir}/%{name}/%{name}-junit*.jar
%{_mavenpomdir}/JPP.%{name}-%{name}-junit*.pom
%{_mavendepmapfragdir}/%{name}-junit
%doc LICENSE.txt NOTICE.txt
%files spring
%{_javadir}/%{name}/%{name}-spring*.jar
%{_mavenpomdir}/JPP.%{name}-%{name}-spring*.pom
%{_mavendepmapfragdir}/%{name}-spring
%doc LICENSE.txt NOTICE.txt
%files testng
%{_javadir}/%{name}/%{name}-testng.jar
%{_mavenpomdir}/JPP.%{name}-%{name}-testng.pom
%{_mavendepmapfragdir}/%{name}-testng
%doc LICENSE.txt NOTICE.txt
%files javadoc
%{_javadocdir}/%{name}
%doc LICENSE.txt NOTICE.txt
%changelog
* Tue May 28 2013 gil cattaneo 3.0-1
- initial rpm