xz/xz.spec

127 lines
3.4 KiB
RPMSpec
Raw Permalink Normal View History

2013-12-10 18:29:38 +11:00
%define major 5
%define lname lzma
2012-02-01 14:22:54 +04:00
%define libname %mklibname %{lname} %{major}
2014-05-29 16:44:16 +11:00
%define devname %mklibname %{lname} -d
2012-02-01 14:22:54 +04:00
2022-12-06 21:45:36 +01:00
%define gitdate 0
2014-05-29 16:44:16 +11:00
2013-12-10 18:29:38 +11:00
Summary: XZ utils
Name: xz
2022-12-06 21:45:36 +01:00
Version: 5.2.9
Release: 1
2013-12-10 18:29:38 +11:00
License: Public Domain
2012-02-01 14:22:54 +04:00
Group: Archiving/Compression
2022-12-06 21:45:36 +01:00
Url: https://tukaani.org/xz/
Source0: https://tukaani.org/xz/%{name}-%{version}.tar.xz
Source1: xzme
2016-06-23 20:28:05 +10:00
Patch0: xz-5.2.0-text-tune.patch
2022-12-06 21:45:36 +01:00
Patch1: xz-5.2.9-man-page-day.patch
2020-03-06 10:30:44 +00:00
# clearlinux
Patch2: speedup.patch
Patch3: default-threading.patch
Patch4: io-size.patch
2022-12-06 21:45:36 +01:00
# Needed by check suite
2012-02-01 14:22:54 +04:00
BuildRequires: diffutils
2022-12-06 21:45:36 +01:00
%rename lzma
%rename lzma-utils
2012-02-01 14:22:54 +04:00
%description
2022-12-06 21:45:36 +01:00
XZ provides very high compression ratio and fast decompression. The core of
the XZ utils is Igor Pavlov's LZMA SDK containing the actual LZMA
encoder/decoder. LZMA utils add a few scripts which provide gzip-like
command line interface and a couple of other XZ related tools. It also
provides:
- Average compression ratio 30% better than that of gzip and 15% better than
that of bzip2.
- Decompression speed is only little slower than that of gzip, being two to
five times faster than bzip2.
- In fast mode, compresses faster than bzip2 with a comparable compression
ratio.
- Achieving the best compression ratios takes four to even twelve times longer
than with bzip2. However. this doesn't affect decompressing speed.
2012-02-01 14:22:54 +04:00
- Very similar command line interface than what gzip and bzip2 have.
2013-12-10 18:29:38 +11:00
%files -f %{name}.lang
2020-03-06 10:30:44 +00:00
%doc %{_docdir}/%{name}
2013-12-10 18:29:38 +11:00
%{_bindir}/*
%{_mandir}/man1/*
2020-03-21 02:16:32 +00:00
%{_mandir}/*/man1
2013-12-10 18:29:38 +11:00
#----------------------------------------------------------------------------
2012-02-01 14:22:54 +04:00
%package -n %{libname}
Summary: Libraries for decoding XZ/LZMA compression
Group: System/Libraries
2022-12-06 21:45:36 +01:00
# Compat with Fedora/RH
Provides: xz-libs = %{EVRD}
2012-02-01 14:22:54 +04:00
%description -n %{libname}
2022-12-06 21:45:36 +01:00
Libraries for decoding XZ/LZMA compression.
2012-02-01 14:22:54 +04:00
2013-12-10 18:29:38 +11:00
%files -n %{libname}
2022-12-06 21:45:36 +01:00
%doc COPYING
2013-12-10 18:29:38 +11:00
/%{_lib}/liblzma.so.%{major}*
#----------------------------------------------------------------------------
%package -n %{devname}
2012-02-01 14:22:54 +04:00
Summary: Devel libraries & headers for liblzma
Group: Development/C
2013-12-10 18:29:38 +11:00
Requires: %{libname} = %{EVRD}
2022-12-06 21:45:36 +01:00
Provides: %{lname}-devel = %{EVRD}
Provides: lib%{lname}-devel = %{EVRD}
Provides: %{name}-devel = %{EVRD}
2012-02-01 14:22:54 +04:00
2013-12-10 18:29:38 +11:00
%description -n %{devname}
2012-02-01 14:22:54 +04:00
Devel libraries & headers for liblzma.
2013-12-10 18:29:38 +11:00
%files -n %{devname}
2022-12-06 21:45:36 +01:00
%doc COPYING
2013-12-10 18:29:38 +11:00
%{_includedir}/%{lname}.h
%dir %{_includedir}/%{lname}
%{_includedir}/%{lname}/*.h
%{_libdir}/*.so
%{_libdir}/*.a
%{_libdir}/pkgconfig/lib%{lname}.pc
#----------------------------------------------------------------------------
2012-02-01 14:22:54 +04:00
%prep
2020-03-06 10:30:44 +00:00
%autosetup -p1
2012-02-01 14:22:54 +04:00
# Patch3 turns on multithreading by default, but there are memory limits on 32 bit
# and xz(1) and liblzma do not control it by themselves
# https://bugzilla.redhat.com/show_bug.cgi?id=1196786
# https://github.com/rpm-software-management/rpm/commit/a60f36a55cff3331e8bef3a1ab95c87d313911bb
# It makes xz fail in various places, e.g. when building the Linux kernel
%if "%{__isa_bits}" != "64"
%patch3 -p1 -R
%endif
2012-02-01 14:22:54 +04:00
%build
2022-03-11 19:47:09 +00:00
%config_update
2012-02-01 14:22:54 +04:00
export CONFIGURE_TOP=`pwd`
mkdir objs
pushd objs
2022-12-06 21:45:36 +01:00
CFLAGS="%{optflags} -O3 -funroll-loops" \
%configure --enable-static
%make
2012-02-01 14:22:54 +04:00
popd
2022-12-06 21:45:36 +01:00
2012-02-01 14:22:54 +04:00
%install
2020-01-13 19:44:36 +03:00
%makeinstall_std -C objs
2012-02-01 14:22:54 +04:00
install -d %{buildroot}/%{_lib}
mv %{buildroot}%{_libdir}/*.so.* %{buildroot}/%{_lib}/
2014-05-29 17:53:29 +11:00
rm -f %{buildroot}%{_libdir}/liblzma.so
ln -sr %{buildroot}/%{_lib}/liblzma.so.%{major} %{buildroot}%{_libdir}/liblzma.so
2012-02-01 14:22:54 +04:00
install -m755 %{SOURCE1} -D %{buildroot}%{_bindir}/xzme
%find_lang %{name}
2022-12-06 21:45:36 +01:00
2012-02-01 14:22:54 +04:00
%check
make check -C objs