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 d0061f073c
commit 68cb66b816

View File

@ -1,28 +1,35 @@
%global base_name compress
%global short_name commons-%{base_name}
# Workaround for rhbz#1969370: __bootstrap macro is not defined in
# CentOS Stream, See https://bugzilla.redhat.com/1969370
%global __bootstrap ~bootstrap
Name: apache-%{short_name}
%bcond_without bootstrap
Name: apache-commons-compress
Version: 1.20
Release: 6%{?dist}
Release: 7%{?dist}
Summary: Java API for working with compressed files and archivers
License: ASL 2.0
URL: http://commons.apache.org/proper/commons-compress/
URL: https://commons.apache.org/proper/commons-compress/
BuildArch: noarch
Source0: http://archive.apache.org/dist/commons/compress/source/%{short_name}-%{version}-src.tar.gz
Source0: https://archive.apache.org/dist/commons/compress/source/commons-compress-%{version}-src.tar.gz
Patch0: 0001-Remove-Brotli-compressor.patch
Patch1: 0002-Remove-ZSTD-compressor.patch
Patch2: 0003-Avoid-use-of-internal-Mockito-API.patch
BuildRequires: maven-local
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.commons:commons-parent:pom:)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-antrun-plugin)
BuildRequires: mvn(org.mockito:mockito-core)
BuildRequires: mvn(org.osgi:osgi.core)
BuildRequires: mvn(org.osgi:org.osgi.core)
BuildRequires: mvn(org.tukaani:xz)
%endif
%description
The Apache Commons Compress library defines an API for working with
@ -37,7 +44,7 @@ Summary: API documentation for %{name}
This package provides %{summary}.
%prep
%setup -q -n %{short_name}-%{version}-src
%setup -q -n commons-compress-%{version}-src
# Unavailable Google Brotli library (org.brotli.dec)
%patch0 -p1
@ -60,19 +67,13 @@ rm src/test/java/org/apache/commons/compress/compressors/DetectCompressorTestCas
%pom_remove_dep :slf4j-api::test
rm src/test/java/org/apache/commons/compress/OsgiITest.java
# use osgi-core instead of felix-osgi-core
%pom_change_dep :org.osgi.core org.osgi:osgi.core
# Remove test that requires powermock
%pom_remove_dep org.powermock:
%pom_add_dep org.mockito:mockito-core::test
rm src/test/java/org/apache/commons/compress/compressors/z/ZCompressorInputStreamTest.java
# Generate Java 8 level bytecode when built on Java 11
%pom_xpath_replace "pom:maven.compiler.release" "<maven.compiler.release>8</maven.compiler.release>"
%build
%mvn_file : %{short_name} %{name}
%mvn_file : commons-compress %{name}
%mvn_alias : commons:
%mvn_build -- -Dcommons.osgi.symbolicName=org.apache.commons.compress
@ -86,8 +87,12 @@ rm src/test/java/org/apache/commons/compress/compressors/z/ZCompressorInputStrea
%doc LICENSE.txt NOTICE.txt
%changelog
* Thu Apr 15 2021 Mohan Boddu <mboddu@redhat.com> - 1.20-6
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Tue Jun 08 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.20-7
- Bootstrap Maven for CentOS Stream 9
* Mon May 17 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.20-6
- Bootstrap build
- Non-bootstrap build
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.20-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
@ -101,24 +106,39 @@ rm src/test/java/org/apache/commons/compress/compressors/z/ZCompressorInputStrea
* Fri Jul 10 2020 Jiri Vanek <jvanek@redhat.com> - 1.20-2
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
* Wed Mar 04 2020 Marian Koncek <mkoncek@redhat.com> - 1.20-1
- Update to upstream version 1.20
* Mon Mar 02 2020 Fabio Valentini <decathorpe@gmail.com> - 1.20-1
- Update to version 1.20.
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.19-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Tue Nov 05 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.19-2
- Mass rebuild for javapackages-tools 201902
* Fri Oct 04 2019 Fabio Valentini <decathorpe@gmail.com> - 1.19-1
- Update to version 1.19.
* Wed Sep 18 2019 Fabio Valentini <decathorpe@gmail.com> - 1.18-7
- Migrate from the obsolete felix-osgi-core to osgi-core.
* Mon Sep 02 2019 Marian Koncek <mkoncek@redhat.com> - 1.19-1
- Update to upstream version 1.19
* Wed Aug 14 2019 Fabio Valentini <decathorpe@gmail.com> - 1.18-6
- Remove build-dependency on powermock
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.18-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.18-6
- Mass rebuild for javapackages-tools 201901
* Fri May 24 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1.18-5
- Remove build-dependency on powermock
* Thu Feb 14 2019 Mat Booth <mat.booth@redhat.com> - 1.18-4
- Rebuild to regenerate OSGi metadata