xz/xz.spec
2020-11-27 16:27:01 +03:00

121 lines
3.3 KiB
RPMSpec

%define major 5
%define lname lzma
%define libname %mklibname %{lname} %{major}
%define devname %mklibname %{lname} -d
%define gitdate 20140129
Summary: XZ utils
Name: xz
Version: 5.2.5
Release: 2
License: Public Domain
Group: Archiving/Compression
Url: http://tukaani.org/xz/
Source0: http://tukaani.org/xz/%{name}-%{version}.tar.xz
Source1: xzme
Patch0: xz-5.2.0-text-tune.patch
Patch1: xz-5.1.3alpha-man-page-day.patch
# clearlinux
Patch2: speedup.patch
Patch3: default-threading.patch
Patch4: io-size.patch
# needed by check suite
BuildRequires: diffutils
%rename lzma
%rename lzma-utils
%description
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. 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.
- Very similar command line interface than what gzip and bzip2 have.
%files -f %{name}.lang
%doc %{_docdir}/%{name}
%{_bindir}/*
%{_mandir}/man1/*
%{_mandir}/*/man1
#----------------------------------------------------------------------------
%package -n %{libname}
Summary: Libraries for decoding XZ/LZMA compression
Group: System/Libraries
%description -n %{libname}
Libraries for decoding LZMA compression.
%files -n %{libname}
/%{_lib}/liblzma.so.%{major}*
#----------------------------------------------------------------------------
%package -n %{devname}
Summary: Devel libraries & headers for liblzma
Group: Development/C
Requires: %{libname} = %{EVRD}
Provides: %{lname}-devel = %{EVRD}
Provides: lib%{lname}-devel = %{EVRD}
Provides: %{name}-devel = %{EVRD}
%description -n %{devname}
Devel libraries & headers for liblzma.
%files -n %{devname}
%{_includedir}/%{lname}.h
%dir %{_includedir}/%{lname}
%{_includedir}/%{lname}/*.h
%{_libdir}/*.so
%{_libdir}/*.a
%{_libdir}/pkgconfig/lib%{lname}.pc
#----------------------------------------------------------------------------
%prep
%autosetup -p1
# 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
%build
export CONFIGURE_TOP=`pwd`
mkdir objs
pushd objs
CFLAGS="%{optflags} -O3 -funroll-loops" \
%configure --enable-static
%make
popd
%install
%makeinstall_std -C objs
install -d %{buildroot}/%{_lib}
mv %{buildroot}%{_libdir}/*.so.* %{buildroot}/%{_lib}/
rm -f %{buildroot}%{_libdir}/liblzma.so
ln -sr %{buildroot}/%{_lib}/liblzma.so.%{major} %{buildroot}%{_libdir}/liblzma.so
install -m755 %{SOURCE1} -D %{buildroot}%{_bindir}/xzme
%find_lang %{name}
%check
make check -C objs