xz/xz.spec

142 lines
3.5 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
2013-12-10 18:29:38 +11:00
%bcond_with dietlibc
2012-02-01 14:22:54 +04:00
2014-05-29 16:44:16 +11:00
%define gitdate 20140129
2013-12-10 18:29:38 +11:00
Summary: XZ utils
Name: xz
2025-02-02 11:41:13 +00:00
Version: 5.2.13
Release: 1
2013-12-10 18:29:38 +11:00
License: Public Domain
2012-02-01 14:22:54 +04:00
Group: Archiving/Compression
2025-02-02 11:41:13 +00:00
URL: http://tukaani.org/xz/
#Source0: http://tukaani.org/xz/%{name}-%{version}.tar.xz
Source0: https://github.com/tukaani-project/xz/releases/download/v%{version}/%{name}-%{version}.tar.gz
2012-02-01 14:22:54 +04:00
Source1: xzme
2025-02-02 11:41:13 +00:00
Source1000: %{name}.rpmlintrc
2016-06-23 20:28:05 +10:00
Patch0: xz-5.2.0-text-tune.patch
2014-05-29 16:44:16 +11:00
Patch1: xz-5.1.3alpha-man-page-day.patch
2012-02-01 14:22:54 +04:00
# needed by check suite
2025-02-02 13:06:50 +00:00
BuildRequires: pkgconfig(openssl3.3)
2012-02-01 14:22:54 +04:00
BuildRequires: diffutils
%if %{with diet}
BuildRequires: dietlibc-devel
%endif
2013-12-10 18:29:38 +11:00
%rename lzma
%rename lzma-utils
2012-02-01 14:22:54 +04:00
%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.
2013-12-10 18:29:38 +11:00
%files -f %{name}.lang
%doc README THANKS
%{_bindir}/*
%{_mandir}/man1/*
2025-02-03 00:06:03 +03: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
%description -n %{libname}
Libraries for decoding LZMA compression.
2013-12-10 18:29:38 +11:00
%files -n %{libname}
/%{_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}
Provides: %{lname}-devel = %{EVRD}
Provides: lib%{lname}-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}
%{_includedir}/%{lname}.h
%dir %{_includedir}/%{lname}
%{_includedir}/%{lname}/*.h
%{_libdir}/*.so
%{_libdir}/*.a
%if %{with dietlibc}
%{_prefix}/lib/dietlibc/lib-%{_arch}/liblzma.a
%endif
%{_libdir}/pkgconfig/lib%{lname}.pc
#----------------------------------------------------------------------------
2012-02-01 14:22:54 +04:00
%prep
2016-06-23 20:28:05 +10:00
%setup -q
2025-02-02 12:44:44 +00:00
#patch0 -p1 -b .text~
#patch1 -p1 -b .day~
2012-02-01 14:22:54 +04:00
%build
export CONFIGURE_TOP=`pwd`
mkdir objs
pushd objs
CFLAGS="%{optflags} -O3 -funroll-loops" \
%configure2_5x
%make
popd
%if %{with dietlibc}
mkdir objsdietlibc
pushd objsdietlibc
CFLAGS="-Os" CC="diet gcc" \
%configure2_5x --disable-shared \
--enable-static \
--disable-xz \
--disable-xzdec \
--disable-lzmadec \
--disable-lzmainfo \
--disable-lzma-links \
--disable-scripts
%make
popd
%endif
%install
%makeinstall_std -C objs
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
%if %{with dietlibc}
install -D objsdietlibc/src/liblzma/.libs/liblzma.a -D %{buildroot}%{_prefix}/lib/dietlibc/lib-%{_arch}/liblzma.a
%endif
install -m755 %{SOURCE1} -D %{buildroot}%{_bindir}/xzme
%find_lang %{name}
%check
make check -C objs