Bootstrap Maven as non-modular packages

Resolves: rhbz#1951482
This commit is contained in:
Mikolaj Izdebski 2021-06-08 20:17:56 +02:00
parent 1ee46dd2de
commit 915115672f
2 changed files with 89 additions and 128 deletions

View File

@ -1,57 +1,40 @@
%bcond_with jpa # Workaround for rhbz#1969370: __bootstrap macro is not defined in
%bcond_with spring # CentOS Stream, See https://bugzilla.redhat.com/1969370
%global __bootstrap ~bootstrap
%global short_name guice %bcond_without bootstrap
Name: google-%{short_name} Name: google-guice
Version: 4.2.3 Version: 4.2.3
Release: 5%{?dist} Release: 6%{?dist}
Summary: Lightweight dependency injection framework for Java 5 and above Summary: Lightweight dependency injection framework for Java 5 and above
License: ASL 2.0 License: ASL 2.0
URL: https://github.com/google/%{short_name} URL: https://github.com/google/guice
BuildArch: noarch BuildArch: noarch
# ./create-tarball.sh %%{version} # ./create-tarball.sh %%{version}
Source0: %{name}-%{version}.tar.xz Source0: %{name}-%{version}.tar.xz
Source1: create-tarball.sh Source1: create-tarball.sh
BuildRequires: maven-local BuildRequires: maven-local-openjdk8
BuildRequires: mvn(aopalliance:aopalliance) %if %{with bootstrap}
BuildRequires: mvn(cglib:cglib) BuildRequires: javapackages-bootstrap
%else
BuildRequires: mvn(com.google.code.findbugs:jsr305) BuildRequires: mvn(com.google.code.findbugs:jsr305)
BuildRequires: mvn(com.google.guava:guava) BuildRequires: %{?module_prefix}mvn(com.google.guava:guava)
BuildRequires: mvn(javax.inject:javax.inject) BuildRequires: %{?module_prefix}mvn(javax.inject:javax.inject)
BuildRequires: mvn(javax.servlet:servlet-api) BuildRequires: mvn(javax.servlet:servlet-api)
# xmvn-builddep misses apache-jar-resource-bundle
BuildRequires: mvn(org.apache:apache-jar-resource-bundle)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-remote-resources-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-remote-resources-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin) BuildRequires: mvn(org.apache.maven.plugins:maven-source-plugin)
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin) BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
BuildRequires: mvn(org.ow2.asm:asm)
BuildRequires: mvn(org.sonatype.plugins:munge-maven-plugin) BuildRequires: mvn(org.sonatype.plugins:munge-maven-plugin)
%if %{with jpa}
BuildRequires: mvn(org.hibernate.javax.persistence:hibernate-jpa-2.0-api)
%endif %endif
%if %{with spring} # xmvn-builddep misses this:
BuildRequires: mvn(org.springframework:spring-beans) %if %{without bootstrap}
BuildRequires: mvn(org.apache:apache-jar-resource-bundle)
%endif %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
Obsoletes: guice-testlib < 4.1-17
%description %description
Put simply, Guice alleviates the need for factories and the use of new 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 in your Java code. Think of Guice's @Inject as the new new. You will
@ -71,116 +54,80 @@ with at least three use cases. When in doubt, we leave it out. We
build general functionality which enables you to extend Guice rather build general functionality which enables you to extend Guice rather
than adding every feature to the core framework. than adding every feature to the core framework.
%package -n guice-parent
%package -n %{short_name}-parent
Summary: Guice parent POM Summary: Guice parent POM
%description -n %{short_name}-parent %description -n guice-parent
Guice is a lightweight dependency injection framework for Java 5 Guice is a lightweight dependency injection framework for Java 5
and above. This package provides parent POM for Guice modules. and above. This package provides parent POM for Guice modules.
%package -n guice-assistedinject
%package -n %{short_name}-assistedinject
Summary: AssistedInject extension module for Guice Summary: AssistedInject extension module for Guice
%description -n %{short_name}-assistedinject %description -n guice-assistedinject
Guice is a lightweight dependency injection framework for Java 5 Guice is a lightweight dependency injection framework for Java 5
and above. This package provides AssistedInject module for Guice. and above. This package provides AssistedInject module for Guice.
%package -n guice-extensions
%package -n %{short_name}-extensions
Summary: Extensions for Guice Summary: Extensions for Guice
%description -n %{short_name}-extensions %description -n guice-extensions
Guice is a lightweight dependency injection framework for Java 5 Guice is a lightweight dependency injection framework for Java 5
and above. This package provides extensions POM for Guice. and above. This package provides extensions POM for Guice.
%package -n guice-grapher
%package -n %{short_name}-grapher
Summary: Grapher extension module for Guice Summary: Grapher extension module for Guice
%description -n %{short_name}-grapher %description -n guice-grapher
Guice is a lightweight dependency injection framework for Java 5 Guice is a lightweight dependency injection framework for Java 5
and above. This package provides Grapher module for Guice. and above. This package provides Grapher module for Guice.
%package -n guice-jmx
%package -n %{short_name}-jmx
Summary: JMX extension module for Guice Summary: JMX extension module for Guice
%description -n %{short_name}-jmx %description -n guice-jmx
Guice is a lightweight dependency injection framework for Java 5 Guice is a lightweight dependency injection framework for Java 5
and above. This package provides JMX module for Guice. and above. This package provides JMX module for Guice.
%package -n guice-jndi
%package -n %{short_name}-jndi
Summary: JNDI extension module for Guice Summary: JNDI extension module for Guice
%description -n %{short_name}-jndi %description -n guice-jndi
Guice is a lightweight dependency injection framework for Java 5 Guice is a lightweight dependency injection framework for Java 5
and above. This package provides JNDI module for Guice. and above. This package provides JNDI module for Guice.
%package -n guice-multibindings
%package -n %{short_name}-multibindings
Summary: MultiBindings extension module for Guice Summary: MultiBindings extension module for Guice
%description -n %{short_name}-multibindings %description -n guice-multibindings
Guice is a lightweight dependency injection framework for Java 5 Guice is a lightweight dependency injection framework for Java 5
and above. This package provides MultiBindings module for Guice. and above. This package provides MultiBindings module for Guice.
%package -n guice-servlet
%if %{with jpa}
%package -n %{short_name}-persist
Summary: Persist extension module for Guice
%description -n %{short_name}-persist
Guice is a lightweight dependency injection framework for Java 5
and above. This package provides Persist module for Guice.
%endif
%package -n %{short_name}-servlet
Summary: Servlet extension module for Guice Summary: Servlet extension module for Guice
%description -n %{short_name}-servlet %description -n guice-servlet
Guice is a lightweight dependency injection framework for Java 5 Guice is a lightweight dependency injection framework for Java 5
and above. This package provides Servlet module for Guice. and above. This package provides Servlet module for Guice.
%package -n guice-throwingproviders
%if %{with spring}
%package -n %{short_name}-spring
Summary: Spring extension module for Guice
%description -n %{short_name}-spring
Guice is a lightweight dependency injection framework for Java 5
and above. This package provides Spring module for Guice.
%endif
%package -n %{short_name}-throwingproviders
Summary: ThrowingProviders extension module for Guice Summary: ThrowingProviders extension module for Guice
%description -n %{short_name}-throwingproviders %description -n guice-throwingproviders
Guice is a lightweight dependency injection framework for Java 5 Guice is a lightweight dependency injection framework for Java 5
and above. This package provides ThrowingProviders module for Guice. and above. This package provides ThrowingProviders module for Guice.
%package -n guice-bom
%package -n %{short_name}-bom
Summary: Bill of Materials for Guice Summary: Bill of Materials for Guice
%description -n %{short_name}-bom %description -n guice-bom
Guice is a lightweight dependency injection framework for Java 5 Guice is a lightweight dependency injection framework for Java 5
and above. This package provides Bill of Materials module for Guice. and above. This package provides Bill of Materials module for Guice.
%{?javadoc_package}
%package javadoc
Summary: API documentation for Guice
%description javadoc
This package provides %{summary}.
%prep %prep
%setup -q -n %{name}-%{version} %setup -q
# We don't have struts2 in Fedora yet. # We don't have struts2 in Fedora yet.
%pom_disable_module struts2 extensions %pom_disable_module struts2 extensions
@ -208,17 +155,13 @@ This package provides %{summary}.
# remove test dependency to make sure we don't produce requires # remove test dependency to make sure we don't produce requires
# see #1007498 # see #1007498
%pom_remove_dep :guava-testlib extensions %pom_remove_dep :guava-testlib extensions
%pom_xpath_remove "pom:dependency[pom:classifier[text()='tests']]" extensions %pom_xpath_remove "pom:dependency[pom:classifier='tests']" extensions
%pom_remove_parent %pom_remove_parent
%pom_set_parent com.google.inject:guice-parent:%{version} jdk8-tests %pom_set_parent com.google.inject:guice-parent:%{version} jdk8-tests
%if %{without jpa}
%pom_disable_module persist extensions %pom_disable_module persist extensions
%endif
%if %{without spring}
%pom_disable_module spring extensions %pom_disable_module spring extensions
%endif
%pom_disable_module jdk8-tests %pom_disable_module jdk8-tests
@ -228,58 +171,64 @@ This package provides %{summary}.
%pom_disable_module testlib extensions %pom_disable_module testlib extensions
%pom_remove_dep :aopalliance core
%pom_remove_dep :asm core
%pom_remove_dep :cglib core
%pom_xpath_remove "pom:plugin[pom:artifactId='maven-jar-plugin']/pom:configuration"
%pom_xpath_remove "pom:plugin[pom:artifactId='maven-jar-plugin']/pom:executions"
%pom_xpath_set "pom:plugin[pom:artifactId='munge-maven-plugin']/pom:executions/pom:execution/pom:phase" generate-sources core
%pom_xpath_set "pom:plugin[pom:artifactId='munge-maven-plugin']/pom:executions/pom:execution/pom:goals/pom:goal" munge core
%pom_xpath_inject "pom:dependency[pom:artifactId='guice']" "<scope>provided</scope>" extensions
%build %build
%mvn_alias "com.google.inject.extensions:" "org.sonatype.sisu.inject:" %mvn_alias "com.google.inject.extensions:" "org.sonatype.sisu.inject:"
%mvn_package :::no_aop: guice %mvn_package :::no_aop: guice
%mvn_package :guice:jar:{}: __noinstall
%mvn_file ":guice-{*}" %{short_name}/guice-@1 %mvn_file ":guice-{*}" guice/guice-@1
%mvn_file ":guice" %{short_name}/%{name} %{name} %mvn_file ":guice" guice/%{name} %{name}
%mvn_alias ":guice" "org.sonatype.sisu:sisu-guice" %mvn_alias ":guice" "org.sonatype.sisu:sisu-guice"
# Skip tests because of missing dependency guice-testlib # Skip tests because of missing dependency guice-testlib
%mvn_build -f -s %mvn_build -f -s
%install %install
%mvn_install %mvn_install
%files -n %{?module_prefix}%{name} -f .mfiles-guice
%files -f .mfiles-guice %files -n guice-parent -f .mfiles-guice-parent
%dir %{_javadir}/%{short_name} %license COPYING
%files -n %{short_name}-parent -f .mfiles-guice-parent %files -n guice-assistedinject -f .mfiles-guice-assistedinject
%doc COPYING %files -n guice-extensions -f .mfiles-extensions-parent
%files -n guice-grapher -f .mfiles-guice-grapher
%files -n %{short_name}-assistedinject -f .mfiles-guice-assistedinject %files -n guice-jmx -f .mfiles-guice-jmx
%files -n %{short_name}-extensions -f .mfiles-extensions-parent %files -n guice-jndi -f .mfiles-guice-jndi
%files -n %{short_name}-grapher -f .mfiles-guice-grapher %files -n guice-multibindings -f .mfiles-guice-multibindings
%files -n %{short_name}-jmx -f .mfiles-guice-jmx %files -n guice-servlet -f .mfiles-guice-servlet
%files -n %{short_name}-jndi -f .mfiles-guice-jndi %files -n guice-throwingproviders -f .mfiles-guice-throwingproviders
%files -n %{short_name}-multibindings -f .mfiles-guice-multibindings
%if %{with jpa}
%files -n %{short_name}-persist -f .mfiles-guice-persist
%endif
%files -n %{short_name}-servlet -f .mfiles-guice-servlet
%if %{with spring}
%files -n %{short_name}-spring -f .mfiles-guice-spring
%endif
%files -n %{short_name}-throwingproviders -f .mfiles-guice-throwingproviders
%files -n %{short_name}-bom -f .mfiles-guice-bom
%files javadoc -f .mfiles-javadoc
%doc COPYING
%files -n guice-bom -f .mfiles-guice-bom
%changelog %changelog
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 4.2.3-5 * Tue Jun 08 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.3-6
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 - Bootstrap Maven for CentOS Stream 9
* Mon May 17 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.3-5
- Bump release
* Mon May 17 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.3-2
- Bootstrap build
- Non-bootstrap build
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.3-4 * Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.3-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Sep 18 2020 Marian Koncek <mkoncek@redhat.com> - 4.2.3-1
- Update to upstream version 4.2.3
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.3-3 * Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.3-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
@ -292,6 +241,12 @@ This package provides %{summary}.
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.2-2 * Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sat Jan 25 2020 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.2-4
- Build with OpenJDK 8
* Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.2-3
- Mass rebuild for javapackages-tools 201902
* Mon Jul 29 2019 Fabio Valentini <decathorpe@gmail.com> - 4.2.2-1 * Mon Jul 29 2019 Fabio Valentini <decathorpe@gmail.com> - 4.2.2-1
- Update to version 4.2.2. - Update to version 4.2.2.
- Obsolete guice-testlib. - Obsolete guice-testlib.
@ -302,6 +257,13 @@ This package provides %{summary}.
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-15 * Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.2-2
- Mass rebuild for javapackages-tools 201901
* Fri Apr 05 2019 Marian Koncek <mkoncek@redhat.com> - 4.2.2-1
- Update to upstream version 4.2.2
- Fixes: RHBZ #1563661
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-14 * Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 4.1-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
@ -513,4 +475,3 @@ This package provides %{summary}.
* Thu Oct 7 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 2.0-1.1219svn * Thu Oct 7 2010 Stanislav Ochotnicky <sochotnicky@redhat.com> - 2.0-1.1219svn
- Initial version of the package - Initial version of the package

View File

@ -1 +1 @@
SHA512 (google-guice-4.2.3.tar.xz) = c2afb1a3a3f1c68b1a9d31b20bcf8a72ecc69210c7e4e34e7bd473e8c07d308e401b73ae5f584b114e15a32aacb8ac2a80631f54c092401926f97578fbca193f SHA512 (google-guice-4.2.3.tar.xz) = 289eb5c68e28526bfc75b5a9fcbef2c3b722afd49b2268cd62d86fe327d6c748fa3241ccf8ae8a34843817f4a78ec0335b6cefd3834a747b66d5232f18477484