xz/xz.spec

164 lines
3.9 KiB
RPMSpec
Raw 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 uclibc
%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
2014-05-29 16:44:16 +11:00
Version: 5.1.3
Release: 0.alpha.3.%{gitdate}.2
2013-12-10 18:29:38 +11:00
License: Public Domain
2012-02-01 14:22:54 +04:00
Group: Archiving/Compression
2013-12-10 18:29:38 +11:00
Url: http://tukaani.org/xz/
2014-05-29 16:44:16 +11:00
Source0: http://tukaani.org/xz/%{name}-%{version}alpha.tar.xz
2012-02-01 14:22:54 +04:00
Source1: xzme
2014-05-29 16:44:16 +11:00
Patch0: xz-5.1.3alpha-text-tune.patch
Patch1: xz-5.1.3alpha-man-page-day.patch
2012-02-01 14:22:54 +04:00
# needed by check suite
BuildRequires: diffutils
%if %{with uclibc}
BuildRequires: uClibc-devel
%endif
%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/*
#----------------------------------------------------------------------------
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
%if %{with uclibc}
%{uclibc_root}%{_libdir}/liblzma.a
%endif
%{_libdir}/pkgconfig/lib%{lname}.pc
#----------------------------------------------------------------------------
2012-02-01 14:22:54 +04:00
%prep
2014-05-29 16:44:16 +11:00
%setup -qn %{name}-%{version}alpha
2012-02-01 14:22:54 +04:00
%patch0 -p1 -b .text~
2014-05-29 16:44:16 +11:00
%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
%if %{with uclibc}
mkdir objsuclibc
pushd objsuclibc
CFLAGS="%{uclibc_cflags}" LDFLAGS="%{?ldflags}" CC="%{uclibc_cc}" \
%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}/
ln -sf ../../%{_lib}/liblzma.so.%{version} %{buildroot}%{_libdir}/liblzma.so
%if %{with uclibc}
install -D objsuclibc/src/liblzma/.libs/liblzma.a -D %{buildroot}%{uclibc_root}%{_libdir}/liblzma.a
%endif
%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