google-guice/google-guice.spec

372 lines
16 KiB
RPMSpec
Raw Normal View History

2012-11-09 14:20:23 +00:00
%if 0%{?fedora}
%bcond_without extensions
%endif
2010-10-13 15:25:09 +00:00
%global short_name guice
Name: google-%{short_name}
Version: 3.1.2
2012-11-16 12:57:37 +00:00
Release: 7%{?dist}
Summary: Lightweight dependency injection framework for Java 5 and above
Group: Development/Libraries
2010-10-13 15:25:09 +00:00
License: ASL 2.0
URL: https://github.com/sonatype/sisu-%{short_name}
2012-11-16 12:57:37 +00:00
# ./create-tarball.sh %{version}
Source: %{name}-%{version}.tar.xz
2010-10-13 15:25:09 +00:00
BuildArch: noarch
BuildRequires: java-devel
BuildRequires: jpackage-utils
BuildRequires: javapackages-tools >= 0.7.0
BuildRequires: maven
BuildRequires: maven-remote-resources-plugin
BuildRequires: apache-resource-bundles
BuildRequires: aopalliance
2010-10-13 15:25:09 +00:00
BuildRequires: atinject
BuildRequires: cglib
BuildRequires: guava
BuildRequires: slf4j
%if %{with extensions}
BuildRequires: hibernate-jpa-2.0-api
BuildRequires: springframework-beans
BuildRequires: tomcat-servlet-3.0-api
%endif
# Test dependencies:
%if 0
BuildRequires: maven-surefire-provider-testng
BuildRequires: aqute-bnd
BuildRequires: atinject-tck
BuildRequires: easymock2
BuildRequires: felix-framework
BuildRequires: hibernate3-entitymanager
BuildRequires: mvn(org.hsqldb:hsqldb-j5)
BuildRequires: testng
%endif
Requires: java
Requires: jpackage-utils
Requires: aopalliance
2011-05-24 09:34:02 +00:00
Requires: atinject
Requires: cglib
Requires: guava
Requires: slf4j
Requires: %{short_name}-parent = %{version}-%{release}
Provides: %{short_name} = %{version}-%{release}
2012-02-09 15:23:50 +00:00
2010-10-13 15:25:09 +00:00
%description
Put simply, Guice alleviates the need for factories and the use of new
in your Java code. Think of Guice's @Inject as the new new. You will
still need to write factories in some cases, but your code will not
depend directly on them. Your code will be easier to change, unit test
and reuse in other contexts.
Guice embraces Java's type safe nature, especially when it comes to
features introduced in Java 5 such as generics and annotations. You
might think of Guice as filling in missing features for core
Java. Ideally, the language itself would provide most of the same
features, but until such a language comes along, we have Guice.
Guice helps you design better APIs, and the Guice API itself sets a
good example. Guice is not a kitchen sink. We justify each feature
with at least three use cases. When in doubt, we leave it out. We
build general functionality which enables you to extend Guice rather
than adding every feature to the core framework.
2012-11-09 14:20:23 +00:00
%package -n %{short_name}-parent
Summary: Guice parent POM
Requires: jpackage-utils
%description -n %{short_name}-parent
Guice is a lightweight dependency injection framework for Java 5
and above. This package provides parent POM for Guice modules.
%if %{with extensions}
%package -n %{short_name}-assistedinject
Summary: AssistedInject extension module for Guice
Requires: java
Requires: jpackage-utils
Requires: %{short_name} = %{version}-%{release}
%description -n %{short_name}-assistedinject
Guice is a lightweight dependency injection framework for Java 5
and above. This package provides AssistedInject module for Guice.
%package -n %{short_name}-extensions
Summary: Extensions for Guice
Requires: jpackage-utils
Requires: %{short_name} = %{version}-%{release}
%description -n %{short_name}-extensions
Guice is a lightweight dependency injection framework for Java 5
and above. This package provides extensions POM for Guice.
%package -n %{short_name}-grapher
Summary: Grapher extension module for Guice
Requires: java
Requires: jpackage-utils
Requires: %{short_name} = %{version}-%{release}
Requires: %{short_name}-assistedinject = %{version}-%{release}
Requires: %{short_name}-multibindings = %{version}-%{release}
%description -n %{short_name}-grapher
Guice is a lightweight dependency injection framework for Java 5
and above. This package provides Grapher module for Guice.
%package -n %{short_name}-jmx
Summary: JMX extension module for Guice
Requires: java
Requires: jpackage-utils
Requires: %{short_name} = %{version}-%{release}
%description -n %{short_name}-jmx
Guice is a lightweight dependency injection framework for Java 5
and above. This package provides JMX module for Guice.
%package -n %{short_name}-jndi
Summary: JNDI extension module for Guice
Requires: java
Requires: jpackage-utils
Requires: %{short_name} = %{version}-%{release}
%description -n %{short_name}-jndi
Guice is a lightweight dependency injection framework for Java 5
and above. This package provides JNDI module for Guice.
%package -n %{short_name}-multibindings
Summary: MultiBindings extension module for Guice
Requires: java
Requires: jpackage-utils
Requires: %{short_name} = %{version}-%{release}
%description -n %{short_name}-multibindings
Guice is a lightweight dependency injection framework for Java 5
and above. This package provides MultiBindings module for Guice.
%package -n %{short_name}-persist
Summary: Persist extension module for Guice
Requires: java
Requires: jpackage-utils
Requires: hibernate-jpa-2.0-api
Requires: tomcat-servlet-3.0-api
Requires: %{short_name} = %{version}-%{release}
%description -n %{short_name}-persist
Guice is a lightweight dependency injection framework for Java 5
and above. This package provides Persist module for Guice.
%package -n %{short_name}-servlet
Summary: Servlet extension module for Guice
Requires: java
Requires: jpackage-utils
Requires: tomcat-servlet-3.0-api
Requires: %{short_name} = %{version}-%{release}
%description -n %{short_name}-servlet
Guice is a lightweight dependency injection framework for Java 5
and above. This package provides Servlet module for Guice.
%package -n %{short_name}-spring
Summary: Spring extension module for Guice
Requires: java
Requires: jpackage-utils
Requires: springframework-beans
Requires: %{short_name} = %{version}-%{release}
%description -n %{short_name}-spring
Guice is a lightweight dependency injection framework for Java 5
and above. This package provides Spring module for Guice.
%package -n %{short_name}-throwingproviders
Summary: ThrowingProviders extension module for Guice
Requires: java
Requires: jpackage-utils
Requires: %{short_name} = %{version}-%{release}
%description -n %{short_name}-throwingproviders
Guice is a lightweight dependency injection framework for Java 5
and above. This package provides ThrowingProviders module for Guice.
2012-11-09 14:20:23 +00:00
%endif # with extensions
%package javadoc
Summary: API documentation for Guice
2010-10-13 15:25:09 +00:00
Group: Documentation
Requires: jpackage-utils
Provides: %{short_name}-javadoc = %{version}-%{release}
2010-10-13 15:25:09 +00:00
%description javadoc
This package provides %{summary}.
2010-10-13 15:25:09 +00:00
%prep
2012-11-16 12:57:37 +00:00
%setup -q
2010-10-13 15:25:09 +00:00
# We don't have struts2 in Fedora yet.
%pom_disable_module struts2 extensions
2010-10-13 15:25:09 +00:00
# Remove additional build profiles, which we don't use anyways
# and which are only pulling additional dependencies.
%pom_xpath_remove pom:project/pom:profiles core
2010-10-13 15:25:09 +00:00
# Animal sniffer is only causing problems. Disable it for now.
%pom_remove_plugin :animal-sniffer-maven-plugin core
%pom_remove_plugin :animal-sniffer-maven-plugin extensions
2010-10-13 15:25:09 +00:00
# We don't have the custom doclet used by upstream. Remove
# maven-javadoc-plugin to generate javadocs with default style.
%pom_remove_plugin :maven-javadoc-plugin
2010-10-13 15:25:09 +00:00
# Don't try to build extension modules unless they are needed
%if %{without extensions}
%pom_disable_module extensions
%endif
%build
# Skip tests because of missing dependency (hsqldb-j5).
mvn-rpmbuild -e -Dmaven.test.skip=true verify javadoc:aggregate
2010-10-13 15:25:09 +00:00
%install
# directories
install -d -m 755 %{buildroot}%{_javadir}/%{short_name}
install -d -m 755 %{buildroot}%{_mavenpomdir}
install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
# JARs
2012-11-09 14:29:05 +00:00
install -p -m 644 core/target/sisu-%{short_name}-%{version}.jar %{buildroot}%{_javadir}/%{short_name}/%{name}.jar
# POMs
install -p -m 644 pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-parent.pom
install -p -m 644 core/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{short_name}-%{name}.pom
# depmaps
%add_maven_depmap JPP.%{short_name}-%{short_name}-parent.pom -f parent
%add_maven_depmap JPP.%{short_name}-%{name}.pom %{short_name}/%{name}.jar -a com.google.inject:guice
# javadoc
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}
# compat symlink
ln -sf %{short_name}/%{name}.jar %{buildroot}%{_javadir}
# Extensions
%if %{with extensions}
# JARs
install -p -m 644 extensions/assistedinject/target/%{short_name}-assistedinject-%{version}.jar %{buildroot}%{_javadir}/%{short_name}/%{short_name}-assistedinject.jar
install -p -m 644 extensions/grapher/target/%{short_name}-grapher-%{version}.jar %{buildroot}%{_javadir}/%{short_name}/%{short_name}-grapher.jar
install -p -m 644 extensions/jmx/target/%{short_name}-jmx-%{version}.jar %{buildroot}%{_javadir}/%{short_name}/%{short_name}-jmx.jar
install -p -m 644 extensions/jndi/target/%{short_name}-jndi-%{version}.jar %{buildroot}%{_javadir}/%{short_name}/%{short_name}-jndi.jar
install -p -m 644 extensions/multibindings/target/%{short_name}-multibindings-%{version}.jar %{buildroot}%{_javadir}/%{short_name}/%{short_name}-multibindings.jar
install -p -m 644 extensions/persist/target/%{short_name}-persist-%{version}.jar %{buildroot}%{_javadir}/%{short_name}/%{short_name}-persist.jar
install -p -m 644 extensions/servlet/target/%{short_name}-servlet-%{version}.jar %{buildroot}%{_javadir}/%{short_name}/%{short_name}-servlet.jar
install -p -m 644 extensions/spring/target/%{short_name}-spring-%{version}.jar %{buildroot}%{_javadir}/%{short_name}/%{short_name}-spring.jar
install -p -m 644 extensions/throwingproviders/target/%{short_name}-throwingproviders-%{version}.jar %{buildroot}%{_javadir}/%{short_name}/%{short_name}-throwingproviders.jar
# POMs
install -p -m 644 extensions/assistedinject/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-assistedinject.pom
install -p -m 644 extensions/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-extensions.pom
install -p -m 644 extensions/grapher/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-grapher.pom
install -p -m 644 extensions/jmx/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-jmx.pom
install -p -m 644 extensions/jndi/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-jndi.pom
install -p -m 644 extensions/multibindings/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-multibindings.pom
install -p -m 644 extensions/persist/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-persist.pom
install -p -m 644 extensions/servlet/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-servlet.pom
install -p -m 644 extensions/spring/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-spring.pom
install -p -m 644 extensions/throwingproviders/pom.xml %{buildroot}%{_mavenpomdir}/JPP.%{short_name}-%{short_name}-throwingproviders.pom
# depmaps
%add_maven_depmap JPP.%{short_name}-%{short_name}-assistedinject.pom %{short_name}/%{short_name}-assistedinject.jar -f assistedinject -a com.google.inject.extensions:guice-assistedinject
%add_maven_depmap JPP.%{short_name}-%{short_name}-extensions.pom -f extensions
%add_maven_depmap JPP.%{short_name}-%{short_name}-grapher.pom %{short_name}/%{short_name}-grapher.jar -f grapher -a com.google.inject.extensions:guice-grapher
%add_maven_depmap JPP.%{short_name}-%{short_name}-jmx.pom %{short_name}/%{short_name}-jmx.jar -f jmx -a com.google.inject.extensions:guice-jmx
%add_maven_depmap JPP.%{short_name}-%{short_name}-jndi.pom %{short_name}/%{short_name}-jndi.jar -f jndi -a com.google.inject.extensions:guice-jndi
%add_maven_depmap JPP.%{short_name}-%{short_name}-multibindings.pom %{short_name}/%{short_name}-multibindings.jar -f multibindings -a com.google.inject.extensions:guice-multibindings
%add_maven_depmap JPP.%{short_name}-%{short_name}-persist.pom %{short_name}/%{short_name}-persist.jar -f persist -a com.google.inject.extensions:guice-persist
%add_maven_depmap JPP.%{short_name}-%{short_name}-servlet.pom %{short_name}/%{short_name}-servlet.jar -f servlet -a com.google.inject.extensions:guice-servlet
%add_maven_depmap JPP.%{short_name}-%{short_name}-spring.pom %{short_name}/%{short_name}-spring.jar -f spring -a com.google.inject.extensions:guice-spring
%add_maven_depmap JPP.%{short_name}-%{short_name}-throwingproviders.pom %{short_name}/%{short_name}-throwingproviders.jar -f throwingproviders -a com.google.inject.extensions:guice-throwingproviders
2012-11-09 14:29:05 +00:00
%endif # with extensions
2010-10-13 15:25:09 +00:00
2012-11-01 12:35:22 +00:00
%files -f .mfiles
%doc README
%{_javadir}/%{name}.jar
2012-11-09 14:20:23 +00:00
%files -n %{short_name}-parent -f .mfiles-parent
%doc COPYING
2012-11-09 14:20:23 +00:00
%if %{with extensions}
%files -n %{short_name}-assistedinject -f .mfiles-assistedinject
2012-11-01 12:35:22 +00:00
%files -n %{short_name}-extensions -f .mfiles-extensions
%files -n %{short_name}-grapher -f .mfiles-grapher
%files -n %{short_name}-jmx -f .mfiles-jmx
%files -n %{short_name}-jndi -f .mfiles-jndi
%files -n %{short_name}-multibindings -f .mfiles-multibindings
%files -n %{short_name}-persist -f .mfiles-persist
%files -n %{short_name}-servlet -f .mfiles-servlet
%files -n %{short_name}-spring -f .mfiles-spring
%files -n %{short_name}-throwingproviders -f .mfiles-throwingproviders
2012-11-09 14:20:23 +00:00
%endif # with extensions
%files javadoc
%doc COPYING
%{_javadocdir}/%{name}
2010-10-13 15:25:09 +00:00
%changelog
2012-11-16 12:57:37 +00:00
* Fri Nov 16 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.2-7
- Repackage tarball
* Fri Nov 9 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.2-6
- Don't try to build extension modules unless they are needed
2012-11-09 14:29:05 +00:00
* Fri Nov 9 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.2-5
- Conditionalize %%install section too
2012-11-09 14:20:23 +00:00
* Fri Nov 9 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.2-4
- Conditionally disable extensions
2012-11-01 12:35:22 +00:00
* Thu Nov 1 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.2-3
- Update to new add_maven_depmap macro
* Wed Oct 31 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.1.2-2
- Use new generated maven filelist feature from javapackages-tools
* Fri Oct 5 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.2-1
- Complete rewrite of the spec file
- New upstream, to ease future maintenance
- Build with maven instead of ant
- Split into multiple subpackages
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0-0.7.rc2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
2012-02-09 15:23:50 +00:00
* Thu Feb 9 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-0.6.rc2
- Temporary fix for maven buildroots
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0-0.5.rc2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Wed Oct 12 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-0.4.rc2
- Build with aqute-bnd (#745176)
- Use new maven macros
- Few packaging tweaks
2011-05-24 09:34:02 +00:00
* Tue May 24 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-0.3.rc2
- Add cglib and atinject to R
* Thu May 12 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-0.2.rc2
- Remove test and missing deps from pom.xml
* Tue Mar 1 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-0.1.rc2
- Update to 3.0rc2
- Changes according to new guidelines (versionless jars & javadocs)
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-4.1219svn
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Thu Oct 14 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 2.0-3.1219svn
- Add java-devel >= 1:1.6.0 to BR
2010-10-13 15:25:09 +00:00
* Wed Oct 13 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 2.0-2.1219svn
- Moved munge repacking to prep
- Added -Dversion to change generated manifest version
- Removed http part of URL
* Thu Oct 7 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 2.0-1.1219svn
- Initial version of the package