xz-java/xz-java.spec
2026-04-17 10:06:51 +00:00

66 lines
2 KiB
RPMSpec

%bcond_with bootstrap
Name: xz-java
Version: 1.12
Release: %autorelease
Summary: Java implementation of XZ data compression
License: LicenseRef-Fedora-Public-Domain
URL: https://tukaani.org/xz/java.html
BuildArch: noarch
ExclusiveArch: %{java_arches} noarch
Source0: https://tukaani.org/xz/xz-java-%{version}.zip
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
BuildRequires: javapackages-local-openjdk25
BuildRequires: ant-openjdk25
%endif
# TODO Remove in Fedora 46
Obsoletes: %{name}-javadoc < 1.9-25
%description
A complete implementation of XZ data compression in Java.
It features full support for the .xz file format specification version 1.0.4,
single-threaded streamed compression and decompression, single-threaded
decompression with limited random access support, raw streams (no .xz headers)
for advanced users, including LZMA2 with preset dictionary.
%prep
%autosetup -p1 -C
# Strip modern Ant namespace attributes for bootstrap compatibility.
# javapackages-bootstrap uses an older Ant that doesn't support ant:if/ant:unless.
# TODO Drop after javapackages-bootstrap > 1.27 is released
sed -i 's/xmlns:if="ant:if"//g' build.xml
sed -i 's/xmlns:unless="ant:unless"//g' build.xml
sed -i 's/\sif:true="[^"]*"//g' build.xml
sed -i 's/\sunless:true="[^"]*"//g' build.xml
sed -i 's/\sif:set="[^"]*"//g' build.xml
sed -i 's/\sunless:set="[^"]*"//g' build.xml
sed -i 's/\smodificationtime="[^"]*"//g' build.xml
sed -i 's/if:true="[^"]*"//g' build.xml
sed -i 's/unless:true="[^"]*"//g' build.xml
%mvn_file : %{name} xz
%build
# During documentation generation the upstream build.xml tries to download
# package-list from oracle.com. Create a dummy package-list to prevent that.
mkdir -p extdoc && touch extdoc/package-list
%ant -Dsourcever=8 -Dsourcever9=9 maven
%install
%mvn_artifact build/maven/xz-%{version}.pom build/jar/xz.jar
%mvn_install
%files -f .mfiles
%doc README.md THANKS.md
%license COPYING
%changelog
%autochangelog