-# TODO:
-# - wait for alpha7 which will fix headers installation issue
#
# Conditional build:
%bcond_without tests # don't perform make check
Summary: LZMA Encoder/Decoder
Summary(pl.UTF-8): Koder/Dekoder LZMA
Name: lzma
-Version: 4.42.2
-Release: 0.%{snap}.2
+Version: 4.999.5
+Release: 0.%{snap}.3
Epoch: 1
License: LGPL v2.1+, helper scripts on GPL v2+
Group: Applications/Archiving
Source0: http://tukaani.org/lzma/%{name}-%{version}%{snap}.tar.gz
-# Source0-md5: 5cef8b41aecee8ce1c6fbc681701fe61
+# Source0-md5: db736e080858a7c34357960254dda280
+Patch0: %{name}-memlimit.patch
URL: http://tukaani.org/lzma/
BuildRequires: rpmbuild(macros) >= 1.402
+Conflicts: rpm < 4.4.9
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
%prep
%setup -q -n %{name}-%{version}%{snap}
+%patch0 -p1
%build
%configure
%{__make}
+%{?with_tests:%{__make} check}
+
%install
rm -rf $RPM_BUILD_ROOT
+install -d $RPM_BUILD_ROOT/{etc/env.d,%{_lib}}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT
-%find_lang %{name}
+mv -f $RPM_BUILD_ROOT%{_libdir}/liblzma.so.* $RPM_BUILD_ROOT/%{_lib}
+ln -sf /%{_lib}/liblzma.so.0.0.0 $RPM_BUILD_ROOT%{_libdir}/liblzma.so
-%{?with_tests:%{__make} check}
+echo '#LZMA_OPT="--threads=2"' > $RPM_BUILD_ROOT/etc/env.d/LZMA_OPT
+
+%find_lang %{name}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/lz*
+%config(noreplace,missingok) %verify(not md5 mtime size) /etc/env.d/LZMA_OPT
+%attr(755,root,root) %{_bindir}/*lz*
%{_mandir}/man1/lz*.1*
%files libs -f %{name}.lang
%defattr(644,root,root,755)
%doc AUTHORS COPYING README THANKS TODO
%doc doc/{bugs,faq,file-format,history,lzma-intro}.txt
-%attr(755,root,root) %{_libdir}/liblzma.so.*.*.*
-%attr(755,root,root) %ghost %{_libdir}/liblzma.so.0
+%attr(755,root,root) /%{_lib}/liblzma.so.*.*.*
+%attr(755,root,root) %ghost /%{_lib}/liblzma.so.0
%files devel
%defattr(644,root,root,755)