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 05d2617ae0
commit c6f6eab967
2 changed files with 28 additions and 24 deletions

View File

@ -1,8 +1,12 @@
%bcond_with avalon
# Workaround for rhbz#1969370: __bootstrap macro is not defined in
# CentOS Stream, See https://bugzilla.redhat.com/1969370
%global __bootstrap ~bootstrap
%bcond_without bootstrap
Name: apache-commons-logging
Version: 1.2
Release: 26%{?dist}
Release: 27%{?dist}
Summary: Apache Commons Logging
License: ASL 2.0
URL: http://commons.apache.org/logging
@ -15,18 +19,16 @@ Patch0: 0001-Generate-different-Bundle-SymbolicName-for-different.patch
Patch1: 0002-Port-to-maven-jar-plugin-3.0.0.patch
BuildRequires: maven-local
%if %{with avalon}
BuildRequires: mvn(avalon-framework:avalon-framework-api)
BuildRequires: mvn(avalon-framework:avalon-framework-impl)
BuildRequires: mvn(logkit:logkit)
%endif
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
BuildRequires: mvn(javax.servlet:servlet-api)
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.logging.log4j:log4j-1.2-api)
BuildRequires: mvn(org.apache.commons:commons-parent:pom:)
BuildRequires: mvn(org.apache.maven.plugins:maven-failsafe-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-dependency-plugin)
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
%endif
%description
The commons-logging package provides a simple, component oriented
@ -44,23 +46,15 @@ logging implementation.
%prep
%autosetup -p1 -n commons-logging-%{version}-src
%if %{with avalon}
# Sent upstream https://issues.apache.org/jira/browse/LOGGING-143
%pom_remove_dep :avalon-framework
%pom_add_dep avalon-framework:avalon-framework-api:4.3:provided
%pom_add_dep avalon-framework:avalon-framework-impl:4.3:test
%pom_xpath_inject "pom:dependency[pom:artifactId='logkit']" '<scope>provided</scope>'
%else
%pom_remove_dep -r :avalon-framework
%pom_remove_dep -r :logkit
rm -r src/test/java/org/apache/commons/logging/{avalon,logkit}
%pom_remove_dep -r :log4j
rm src/main/java/org/apache/commons/logging/impl/AvalonLogger.java
rm src/main/java/org/apache/commons/logging/impl/Log4JLogger.java
rm src/main/java/org/apache/commons/logging/impl/LogKitLogger.java
%endif
rm -r src/test/java/org/apache/commons/logging/{avalon,log4j,logkit}
rm src/test/java/org/apache/commons/logging/pathable/{Parent,Child}FirstTestCase.java
# Switch to log4j 2.x API
%pom_change_dep log4j:log4j org.apache.logging.log4j:log4j-1.2-api
# Avoid hard-coded versions in OSGi metadata
%pom_xpath_set "pom:properties/pom:commons.osgi.import" '*;resolution:=optional'
@ -78,7 +72,7 @@ sed -i 's/\r//' RELEASE-NOTES.txt LICENSE.txt NOTICE.txt
rm -rf src/test/java/org/apache/commons/logging/log4j/log4j12
%build
%mvn_build -- -Dcommons.osgi.symbolicName=org.apache.commons.logging -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8
%mvn_build -- -Dmaven.compiler.source=1.6 -Dmaven.compiler.target=1.6 -Dcommons.osgi.symbolicName=org.apache.commons.logging
# The build produces more artifacts from one pom
%mvn_artifact %{SOURCE2} target/commons-logging-%{version}-api.jar
@ -92,8 +86,12 @@ rm -rf src/test/java/org/apache/commons/logging/log4j/log4j12
%doc PROPOSAL.html RELEASE-NOTES.txt
%changelog
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 1.2-26
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jun 08 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.2-27
- Bootstrap Maven for CentOS Stream 9
* Mon May 17 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.2-26
- Bootstrap build
- Non-bootstrap build
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
@ -116,9 +114,15 @@ rm -rf src/test/java/org/apache/commons/logging/log4j/log4j12
* Sat Nov 09 2019 Fabio Valentini <decathorpe@gmail.com> - 1.2-19
- Disable avalon support by default.
* Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.2-15
- Mass rebuild for javapackages-tools 201902
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.2-14
- Mass rebuild for javapackages-tools 201901
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

View File

@ -1 +1 @@
ce977548f1cbf46918e93cd38ac35163 commons-logging-1.2-src.tar.gz
SHA512 (commons-logging-1.2-src.tar.gz) = 9f3761184950f2f13e85d8bc447709ab8be631dfd231b4f053f8147468db1bf71fb116ddba95e39f4afc4cf28c742e07d40c7a637f28004a60dc13935f9609f9