1 |
%define major 5 |
2 |
%define majorminor %{version} |
3 |
%define lname lzma |
4 |
%define libname %mklibname %{lname} %{major} |
5 |
%define libdev %mklibname -d %{lname} |
6 |
|
7 |
%bcond_without dietlibc |
8 |
|
9 |
Summary: XZ utils |
10 |
Name: xz |
11 |
Version: 5.0.4 |
12 |
Release: %mkrel 2 |
13 |
License: Public Domain |
14 |
Group: Archiving/Compression |
15 |
Source0: http://tukaani.org/xz/%{name}-%{version}.tar.xz |
16 |
Source1: xzme |
17 |
Patch0: xz-5.0.0-text-tune.patch |
18 |
Obsoletes: lzma <= %{version} lzma-utils <= %{version} |
19 |
Provides: lzma = %{version}-%{release} lzma-utils = %{version}-%{release} |
20 |
BuildRequires: zlib-devel diffutils |
21 |
%if %{with dietlibc} |
22 |
BuildRequires: dietlibc-devel |
23 |
%endif |
24 |
URL: http://tukaani.org/xz/ |
25 |
|
26 |
%description |
27 |
XZ provides very high compression ratio and fast decompression. The |
28 |
core of the XZ utils is Igor Pavlov's LZMA SDK containing the actual |
29 |
LZMA encoder/decoder. LZMA utils add a few scripts which provide |
30 |
gzip-like command line interface and a couple of other XZ related |
31 |
tools. Also provides: |
32 |
|
33 |
- Average compression ratio 30% better than that of gzip and 15% |
34 |
better than that of bzip2. |
35 |
|
36 |
- Decompression speed is only little slower than that of gzip, being |
37 |
two to five times faster than bzip2. |
38 |
|
39 |
- In fast mode, compresses faster than bzip2 with a comparable |
40 |
compression ratio. |
41 |
|
42 |
- Achieving the best compression ratios takes four to even twelve |
43 |
times longer than with bzip2. However. this doesn't affect |
44 |
decompressing speed. |
45 |
|
46 |
- Very similar command line interface than what gzip and bzip2 have. |
47 |
|
48 |
%package -n %{libname} |
49 |
Summary: Libraries for decoding XZ/LZMA compression |
50 |
Group: System/Libraries |
51 |
Requires(pre): filesystem >= 2.1.9-18 |
52 |
|
53 |
%description -n %{libname} |
54 |
Libraries for decoding LZMA compression. |
55 |
|
56 |
%package -n %{libdev} |
57 |
Summary: Devel libraries & headers for liblzma |
58 |
Group: Development/C |
59 |
Requires(pre): filesystem >= 2.1.9-18 |
60 |
Requires: %{libname} = %{version} |
61 |
Provides: %{lname}-devel = %{version}-%{release} |
62 |
Provides: lib%{lname}-devel = %{version}-%{release} |
63 |
|
64 |
%description -n %{libdev} |
65 |
Devel libraries & headers for liblzma. |
66 |
|
67 |
%prep |
68 |
%setup -q |
69 |
%patch0 -p1 -b .text~ |
70 |
|
71 |
%build |
72 |
mkdir diet |
73 |
pushd diet |
74 |
%if %{with dietlibc} |
75 |
CC="diet gcc" ../configure --enable-static --disable-shared |
76 |
make V=1 LD="diet ld" CC="diet cc -std=c99" |
77 |
%endif |
78 |
popd |
79 |
|
80 |
CFLAGS="%{optflags} -O3 -funroll-loops" \ |
81 |
%configure2_5x |
82 |
%make |
83 |
|
84 |
%install |
85 |
rm -rf %{buildroot} |
86 |
%makeinstall_std |
87 |
install -m755 %{SOURCE1} -D %{buildroot}%{_bindir}/xzme |
88 |
|
89 |
%if %{with dietlibc} |
90 |
install -m644 diet/src/liblzma/.libs/liblzma.a -D %{buildroot}%{_prefix}/lib/dietlibc/lib-%{_arch}/liblzma.a |
91 |
%endif |
92 |
|
93 |
rm -f %{buildroot}%{_libdir}/*.la |
94 |
%find_lang %{name} |
95 |
|
96 |
%check |
97 |
make check |
98 |
|
99 |
%clean |
100 |
rm -rf %{buildroot} |
101 |
|
102 |
%files -f %{name}.lang |
103 |
%defattr(-,root,root) |
104 |
%doc README THANKS |
105 |
%{_bindir}/* |
106 |
%{_mandir}/man1/* |
107 |
|
108 |
%files -n %{libname} |
109 |
%defattr(-,root,root) |
110 |
%{_libdir}/liblzma.so.%{majorminor} |
111 |
%{_libdir}/liblzma.so.%{major} |
112 |
|
113 |
%files -n %{libdev} |
114 |
%defattr(644,root,root,755) |
115 |
%defattr(-,root,root) |
116 |
%{_includedir}/%{lname}.h |
117 |
%dir %{_includedir}/%{lname} |
118 |
%{_includedir}/%{lname}/*.h |
119 |
%{_libdir}/*.so |
120 |
%{_libdir}/*.a |
121 |
%{_libdir}/pkgconfig/lib%{lname}.pc |
122 |
%if %{with dietlibc} |
123 |
%{_prefix}/lib/dietlibc/lib-%{_arch}/liblzma.a |
124 |
%endif |