f78da9
%bcond_without jpa
f78da9
%bcond_without spring
f78da9
f78da9
%global short_name guice
f78da9
f78da9
Name:           google-%{short_name}
f78da9
Version:        4.1
f78da9
Release:        11%{?dist}
f78da9
Summary:        Lightweight dependency injection framework for Java 5 and above
f78da9
License:        ASL 2.0
f78da9
URL:            https://github.com/google/%{short_name}
f78da9
BuildArch:      noarch
f78da9
f78da9
# ./create-tarball.sh %%{version}
f78da9
Source0:        %{name}-%{version}.tar.xz
f78da9
Source1:        create-tarball.sh
f78da9
f78da9
BuildRequires:  maven-local
f78da9
BuildRequires:  mvn(aopalliance:aopalliance)
f78da9
BuildRequires:  mvn(cglib:cglib)
f78da9
BuildRequires:  mvn(com.google.guava:guava:19.0)
f78da9
BuildRequires:  mvn(javax.inject:javax.inject)
f78da9
BuildRequires:  mvn(javax.servlet:servlet-api)
f78da9
BuildRequires:  mvn(org.apache.felix:maven-bundle-plugin)
f78da9
BuildRequires:  mvn(org.apache.maven.plugins:maven-remote-resources-plugin)
f78da9
BuildRequires:  mvn(org.apache.maven.plugins:maven-source-plugin)
f78da9
BuildRequires:  mvn(org.ow2.asm:asm)
f78da9
BuildRequires:  mvn(org.slf4j:slf4j-api)
f78da9
BuildRequires:  mvn(org.sonatype.plugins:munge-maven-plugin)
f78da9
# xmvn-builddep misses this:
f78da9
BuildRequires:  mvn(org.apache:apache-jar-resource-bundle)
f78da9
f78da9
%if %{with jpa}
f78da9
BuildRequires:  hibernate-jpa-2.0-api
f78da9
%endif
f78da9
%if %{with spring}
f78da9
BuildRequires:  springframework-beans
f78da9
%endif
f78da9
f78da9
# Test dependencies:
f78da9
%if 0
f78da9
BuildRequires:  maven-surefire-provider-testng
f78da9
BuildRequires:  aqute-bnd
f78da9
BuildRequires:  atinject-tck
f78da9
BuildRequires:  easymock2
f78da9
BuildRequires:  felix-framework
f78da9
BuildRequires:  hibernate3-entitymanager
f78da9
BuildRequires:  mvn(org.hsqldb:hsqldb-j5)
f78da9
BuildRequires:  testng
f78da9
%endif
f78da9
f78da9
%description
f78da9
Put simply, Guice alleviates the need for factories and the use of new
f78da9
in your Java code. Think of Guice's @Inject as the new new. You will
f78da9
still need to write factories in some cases, but your code will not
f78da9
depend directly on them. Your code will be easier to change, unit test
f78da9
and reuse in other contexts.
f78da9
f78da9
Guice embraces Java's type safe nature, especially when it comes to
f78da9
features introduced in Java 5 such as generics and annotations. You
f78da9
might think of Guice as filling in missing features for core
f78da9
Java. Ideally, the language itself would provide most of the same
f78da9
features, but until such a language comes along, we have Guice.
f78da9
f78da9
Guice helps you design better APIs, and the Guice API itself sets a
f78da9
good example. Guice is not a kitchen sink. We justify each feature
f78da9
with at least three use cases. When in doubt, we leave it out. We
f78da9
build general functionality which enables you to extend Guice rather
f78da9
than adding every feature to the core framework.
f78da9
f78da9
%package -n %{short_name}-parent
f78da9
Summary:        Guice parent POM
f78da9
f78da9
%description -n %{short_name}-parent
f78da9
Guice is a lightweight dependency injection framework for Java 5
f78da9
and above. This package provides parent POM for Guice modules.
f78da9
f78da9
%package -n %{short_name}-assistedinject
f78da9
Summary:        AssistedInject extension module for Guice
f78da9
f78da9
%description -n %{short_name}-assistedinject
f78da9
Guice is a lightweight dependency injection framework for Java 5
f78da9
and above. This package provides AssistedInject module for Guice.
f78da9
f78da9
%package -n %{short_name}-extensions
f78da9
Summary:        Extensions for Guice
f78da9
f78da9
%description -n %{short_name}-extensions
f78da9
Guice is a lightweight dependency injection framework for Java 5
f78da9
and above. This package provides extensions POM for Guice.
f78da9
f78da9
%package -n %{short_name}-grapher
f78da9
Summary:        Grapher extension module for Guice
f78da9
f78da9
%description -n %{short_name}-grapher
f78da9
Guice is a lightweight dependency injection framework for Java 5
f78da9
and above. This package provides Grapher module for Guice.
f78da9
f78da9
%package -n %{short_name}-jmx
f78da9
Summary:        JMX extension module for Guice
f78da9
f78da9
%description -n %{short_name}-jmx
f78da9
Guice is a lightweight dependency injection framework for Java 5
f78da9
and above. This package provides JMX module for Guice.
f78da9
f78da9
%package -n %{short_name}-jndi
f78da9
Summary:        JNDI extension module for Guice
f78da9
f78da9
%description -n %{short_name}-jndi
f78da9
Guice is a lightweight dependency injection framework for Java 5
f78da9
and above. This package provides JNDI module for Guice.
f78da9
f78da9
%package -n %{short_name}-multibindings
f78da9
Summary:        MultiBindings extension module for Guice
f78da9
f78da9
%description -n %{short_name}-multibindings
f78da9
Guice is a lightweight dependency injection framework for Java 5
f78da9
and above. This package provides MultiBindings module for Guice.
f78da9
f78da9
%if %{with jpa}
f78da9
%package -n %{short_name}-persist
f78da9
Summary:        Persist extension module for Guice
f78da9
f78da9
%description -n %{short_name}-persist
f78da9
Guice is a lightweight dependency injection framework for Java 5
f78da9
and above. This package provides Persist module for Guice.
f78da9
%endif
f78da9
f78da9
%package -n %{short_name}-servlet
f78da9
Summary:        Servlet extension module for Guice
f78da9
f78da9
%description -n %{short_name}-servlet
f78da9
Guice is a lightweight dependency injection framework for Java 5
f78da9
and above. This package provides Servlet module for Guice.
f78da9
f78da9
%if %{with spring}
f78da9
%package -n %{short_name}-spring
f78da9
Summary:        Spring extension module for Guice
f78da9
f78da9
%description -n %{short_name}-spring
f78da9
Guice is a lightweight dependency injection framework for Java 5
f78da9
and above. This package provides Spring module for Guice.
f78da9
%endif
f78da9
f78da9
%package -n %{short_name}-testlib
f78da9
Summary:        TestLib extension module for Guice
f78da9
f78da9
%description -n %{short_name}-testlib
f78da9
Guice is a lightweight dependency injection framework for Java 5
f78da9
and above. This package provides TestLib module for Guice.
f78da9
f78da9
%package -n %{short_name}-throwingproviders
f78da9
Summary:        ThrowingProviders extension module for Guice
f78da9
f78da9
%description -n %{short_name}-throwingproviders
f78da9
Guice is a lightweight dependency injection framework for Java 5
f78da9
and above. This package provides ThrowingProviders module for Guice.
f78da9
f78da9
%package -n %{short_name}-bom
f78da9
Summary:        Bill of Materials for Guice
f78da9
f78da9
%description -n %{short_name}-bom
f78da9
Guice is a lightweight dependency injection framework for Java 5
f78da9
and above. This package provides Bill of Materials module for Guice.
f78da9
f78da9
%package javadoc
f78da9
Summary:        API documentation for Guice
f78da9
f78da9
%description javadoc
f78da9
This package provides %{summary}.
f78da9
f78da9
f78da9
%prep
f78da9
%setup -q -n %{name}-%{version}
f78da9
f78da9
# We don't have struts2 in Fedora yet.
f78da9
%pom_disable_module struts2 extensions
f78da9
# Android-specific extension
f78da9
%pom_disable_module dagger-adapter extensions
f78da9
f78da9
# Remove additional build profiles, which we don't use anyways
f78da9
# and which are only pulling additional dependencies.
f78da9
%pom_xpath_remove "pom:profile[pom:id='guice.with.jarjar']" core
f78da9
f78da9
# Fix OSGi metadata due to not using jarjar
f78da9
%pom_xpath_set "pom:instructions/pom:Import-Package" \
f78da9
  "!com.google.inject.*,*" core
f78da9
f78da9
# Animal sniffer is only causing problems. Disable it for now.
f78da9
%pom_remove_plugin :animal-sniffer-maven-plugin core
f78da9
%pom_remove_plugin :animal-sniffer-maven-plugin extensions
f78da9
f78da9
%pom_remove_plugin :maven-gpg-plugin
f78da9
f78da9
# We don't have the custom doclet used by upstream. Remove
f78da9
# maven-javadoc-plugin to generate javadocs with default style.
f78da9
%pom_remove_plugin -r :maven-javadoc-plugin
f78da9
f78da9
# remove test dependency to make sure we don't produce requires
f78da9
# see #1007498
f78da9
%pom_remove_dep :guava-testlib extensions
f78da9
%pom_xpath_remove "pom:dependency[pom:classifier[text()='tests']]" extensions
f78da9
f78da9
%pom_remove_parent
f78da9
%pom_set_parent com.google.inject:guice-parent:%{version} jdk8-tests
f78da9
f78da9
%if %{without jpa}
f78da9
%pom_disable_module persist extensions
f78da9
%endif
f78da9
%if %{without spring}
f78da9
%pom_disable_module spring extensions
f78da9
%endif
f78da9
f78da9
%pom_disable_module jdk8-tests
f78da9
f78da9
%build
f78da9
%mvn_alias "com.google.inject.extensions:" "org.sonatype.sisu.inject:"
f78da9
f78da9
%mvn_package :::no_aop: guice
f78da9
f78da9
%mvn_file  ":guice-{*}"  %{short_name}/guice-@1
f78da9
%mvn_file  ":guice" %{short_name}/%{name} %{name}
f78da9
%mvn_alias ":guice" "org.sonatype.sisu:sisu-guice"
f78da9
# Skip tests because of missing dependency guice-testlib
f78da9
%mvn_build -f -s
f78da9
f78da9
%install
f78da9
%mvn_install
f78da9
f78da9
%files -f .mfiles-guice
f78da9
%dir %{_javadir}/%{short_name}
f78da9
f78da9
%files -n %{short_name}-parent -f .mfiles-guice-parent
f78da9
%doc COPYING
f78da9
f78da9
%files -n %{short_name}-assistedinject -f .mfiles-guice-assistedinject
f78da9
%files -n %{short_name}-extensions -f .mfiles-extensions-parent
f78da9
%files -n %{short_name}-grapher -f .mfiles-guice-grapher
f78da9
%files -n %{short_name}-jmx -f .mfiles-guice-jmx
f78da9
%files -n %{short_name}-jndi -f .mfiles-guice-jndi
f78da9
%files -n %{short_name}-multibindings -f .mfiles-guice-multibindings
f78da9
%if %{with jpa}
f78da9
%files -n %{short_name}-persist -f .mfiles-guice-persist
f78da9
%endif
f78da9
%files -n %{short_name}-servlet -f .mfiles-guice-servlet
f78da9
%if %{with spring}
f78da9
%files -n %{short_name}-spring -f .mfiles-guice-spring
f78da9
%endif
f78da9
%files -n %{short_name}-testlib -f .mfiles-guice-testlib
f78da9
%files -n %{short_name}-throwingproviders -f .mfiles-guice-throwingproviders
f78da9
f78da9
%files -n %{short_name}-bom -f .mfiles-guice-bom
f78da9
f78da9
%files javadoc -f .mfiles-javadoc
f78da9
%doc COPYING
f78da9
f78da9
f78da9
%changelog
f78da9
* Wed Apr 18 2018 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.1-11
f78da9
- Remove legacy Provides
f78da9
f78da9
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-10
f78da9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
f78da9
f78da9
* Mon Feb 05 2018 Michael Simacek <msimacek@redhat.com> - 4.1-9
f78da9
- Use guava20
f78da9
f78da9
* Mon Oct 02 2017 Mat Booth <mat.booth@redhat.com> - 4.1-8
f78da9
- Fix OSGi metadata to import cglib and asm, since we are not bundling them with
f78da9
  jarjar
f78da9
f78da9
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-7
f78da9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
f78da9
f78da9
* Fri Jun 23 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.1-6
f78da9
- Remove unused patches
f78da9
f78da9
* Fri Feb 24 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.1-5
f78da9
- Remove maven-javadoc-plugin from all POMs
f78da9
f78da9
* Thu Feb 23 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.1-4
f78da9
- Add missing BR on apache-resource-bundles
f78da9
f78da9
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-3
f78da9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
f78da9
f78da9
* Wed Feb  1 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.1-2
f78da9
- Introduce build-conditionals for jpa and spring
f78da9
f78da9
* Thu Aug  4 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.1-1
f78da9
- Update to upstream version 4.1
f78da9
f78da9
* Wed Jun 29 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0-6
f78da9
- Make aopalliance dependency optional
f78da9
f78da9
* Wed Jun 15 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0-5
f78da9
- Regenerate build-requires
f78da9
f78da9
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 4.0-4
f78da9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
f78da9
f78da9
* Tue Jan 12 2016 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0-3
f78da9
- Install BOM even when without extensions
f78da9
f78da9
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.0-2
f78da9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
f78da9
f78da9
* Thu May 14 2015 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0-1
f78da9
- Update to upstream version 4.0
f78da9
f78da9
* Mon Apr 27 2015 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.2.6-1
f78da9
- Update to upstream version 3.2.6
f78da9
f78da9
* Fri Mar 6 2015 Alexander Kurtakov <akurtako@redhat.com> 3.2.5-2
f78da9
- Drop gone tomcat-servlet-3.0-api BR, builds fine without it.
f78da9
f78da9
* Fri Jan 23 2015 Michael Simacek <msimacek@redhat.com> - 3.2.5-1
f78da9
- Update to upstream version 3.2.5
f78da9
f78da9
* Mon Sep 29 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.2.4-1
f78da9
- Update to upstream version 3.2.4
f78da9
f78da9
* Fri Jun  6 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.2.2-1
f78da9
- Update to upstream version 3.2.2
f78da9
f78da9
* Wed May 28 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.2.1-2
f78da9
- Rebuild to regenerate Maven auto-requires
f78da9
f78da9
* Wed Apr 16 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.2.1-1
f78da9
- Update to upstream version 3.2.1
f78da9
- Add testlib subpackage
f78da9
f78da9
* Tue Mar  4 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.10-3
f78da9
- Fix directory ownership
f78da9
f78da9
* Tue Mar 04 2014 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.1.10-3
f78da9
- Use Requires: java-headless rebuild (#1067528)
f78da9
f78da9
* Wed Feb 19 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.10-2
f78da9
- Fix unowned directory
f78da9
f78da9
* Tue Feb 18 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.10-1
f78da9
- Update to upstream version 3.1.10
f78da9
f78da9
* Mon Jan 20 2014 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.9-1
f78da9
- Update to upstream version 3.1.9
f78da9
f78da9
* Mon Nov 11 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.8-1
f78da9
- Update to upstream version 3.1.8
f78da9
f78da9
* Wed Oct 23 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.3-10
f78da9
- Rebuild to regenerate broken POMs
f78da9
- Related: rhbz#1021484
f78da9
f78da9
* Fri Oct 18 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.3-9
f78da9
- Don't force generation of pom.properties
f78da9
f78da9
* Wed Sep 25 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.3-8
f78da9
- Install no_aop artifact after javapackages update
f78da9
f78da9
* Thu Sep 12 2013 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.1.3-7
f78da9
- Remove dependency on tests from runtime
f78da9
- Related: rhbz#1007498
f78da9
f78da9
* Tue Sep 10 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.3-6
f78da9
- Install no_aop artifact
f78da9
- Resolves: rhbz#1006491
f78da9
f78da9
* Wed Sep  4 2013 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.3-5
f78da9
- Enable pom.properties
f78da9
- Resolves: rhbz#1004360
f78da9
f78da9
* Wed Aug 07 2013 Michal Srb <msrb@redhat.com> - 3.1.3-4
f78da9
- Add create-tarball.sh script to SRPM
f78da9
f78da9
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.1.3-3
f78da9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
f78da9
f78da9
* Wed Apr 24 2013 Michal Srb <msrb@redhat.com> - 3.1.3-2
f78da9
- Revert update to 3.1.4 (uses asm4)
f78da9
f78da9
* Thu Mar 14 2013 Michal Srb <msrb@redhat.com> - 3.1.3-1
f78da9
- Update to upstream version 3.1.3
f78da9
- Remove bundled JARs from tarball
f78da9
f78da9
* Wed Feb 06 2013 Java SIG <java-devel@lists.fedoraproject.org> - 3.1.2-11
f78da9
- Update for https://fedoraproject.org/wiki/Fedora_19_Maven_Rebuild
f78da9
- Replace maven BuildRequires with maven-local
f78da9
f78da9
* Thu Jan 31 2013 Michal Srb <msrb@redhat.com> - 3.1.2-10
f78da9
- Remove all requires
f78da9
- Correct usage of xmvn's macros
f78da9
f78da9
* Mon Jan 28 2013 Michal Srb <msrb@redhat.com> - 3.1.2-9
f78da9
- Build with xmvn
f78da9
f78da9
* Fri Nov 16 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.2-8
f78da9
- Remove README
f78da9
f78da9
* Fri Nov 16 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.2-7
f78da9
- Repackage tarball
f78da9
f78da9
* Fri Nov  9 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.2-6
f78da9
- Don't try to build extension modules unless they are needed
f78da9
f78da9
* Fri Nov  9 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.2-5
f78da9
- Conditionalize %%install section too
f78da9
f78da9
* Fri Nov  9 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.2-4
f78da9
- Conditionally disable extensions
f78da9
f78da9
* Thu Nov  1 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.2-3
f78da9
- Update to new add_maven_depmap macro
f78da9
f78da9
* Wed Oct 31 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.1.2-2
f78da9
- Use new generated maven filelist feature from javapackages-tools
f78da9
f78da9
* Fri Oct  5 2012 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.2-1
f78da9
- Complete rewrite of the spec file
f78da9
- New upstream, to ease future maintenance
f78da9
- Build with maven instead of ant
f78da9
- Split into multiple subpackages
f78da9
f78da9
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0-0.7.rc2
f78da9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
f78da9
f78da9
* Thu Feb  9 2012 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-0.6.rc2
f78da9
- Temporary fix for maven buildroots
f78da9
f78da9
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.0-0.5.rc2
f78da9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
f78da9
f78da9
* Wed Oct 12 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-0.4.rc2
f78da9
- Build with aqute-bnd (#745176)
f78da9
- Use new maven macros
f78da9
- Few packaging tweaks
f78da9
f78da9
* Tue May 24 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-0.3.rc2
f78da9
- Add cglib and atinject to R
f78da9
f78da9
* Thu May 12 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-0.2.rc2
f78da9
- Remove test and missing deps from pom.xml
f78da9
f78da9
* Tue Mar  1 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 3.0-0.1.rc2
f78da9
- Update to 3.0rc2
f78da9
- Changes according to new guidelines (versionless jars & javadocs)
f78da9
f78da9
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0-4.1219svn
f78da9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
f78da9
f78da9
* Thu Oct 14 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 2.0-3.1219svn
f78da9
- Add java-devel >= 1:1.6.0 to BR
f78da9
f78da9
* Wed Oct 13 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 2.0-2.1219svn
f78da9
- Moved munge repacking to prep
f78da9
- Added -Dversion to change generated manifest version
f78da9
- Removed http part of URL
f78da9
f78da9
* Thu Oct  7 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 2.0-1.1219svn
f78da9
- Initial version of the package