]> git.pld-linux.org Git - packages/xz.git/blobdiff - xz.spec
Revert back to 5.4.6 as 5.6.x are BACKDOORED! https://www.openwall.com/lists/oss...
[packages/xz.git] / xz.spec
diff --git a/xz.spec b/xz.spec
index 9665b232a2d950cd33ae862d54fb7dd93fda0265..8094d11af072c300704b8956038087613314bf1e 100644 (file)
--- a/xz.spec
+++ b/xz.spec
@@ -1,17 +1,41 @@
+#
+# Conditional build:
+%bcond_without tests           # don't perform make check
+%bcond_without asm             # ix86 asm optimizations
+%bcond_without static_libs     # static library
+
+%ifnarch %{ix86}
+# Speed-optimized CRC64 using slicing-by-four algorithm. This uses only i386
+# instructions, but it is optimized for i686 and later (including e.g. Pentium
+# II/III/IV, Athlon XP, and Core 2).
+%undefine      with_asm
+%endif
+
+%if "%{pld_release}" == "ac"
+%undefine      with_asm
+%endif
+
 Summary:       LZMA Encoder/Decoder
-Summary(pl):   Koder/Dekoder LZMA
-Name:          lzma
-Version:       4.43
-Release:       1
-License:       CPL/LGPL
+Summary(pl.UTF-8):     Koder/Dekoder LZMA
+Name:          xz
+Version:       5.4.6
+Release:       2
+Epoch:         2
+License:       LGPL v2.1+, helper scripts on GPL v2+
 Group:         Applications/Archiving
-Source0:       http://dl.sourceforge.net/sevenzip/%{name}443.tar.bz2
-# Source0-md5: c4e1b467184c7cffd4371c74df2baf0f
-Patch0:                %{name}-quiet.patch
-Patch1:                %{name}427_zlib.patch
-URL:           http://www.7-zip.org/sdk.html
-BuildRequires: gcc >= 5:3.4.0
-BuildRequires: libstdc++-devel
+Source0:       https://github.com/tukaani-project/xz/releases/download/v%{version}/%{name}-%{version}.tar.bz2
+# Source0-md5: 098549e685e27620f2fe2883b02c35f2
+Patch0:                %{name}-parallel.patch
+Patch1:                %{name}-memlimit.patch
+URL:           https://tukaani.org/xz/
+%{?with_asm:BuildRequires:     gcc >= 5:3.4}
+BuildRequires: rpm >= 4.4.9-56
+BuildRequires: rpmbuild(macros) >= 1.527
+Requires:      %{name}-libs = %{epoch}:%{version}-%{release}
+Suggests:      mktemp
+Provides:      lzma = %{epoch}:%{version}-%{release}
+Obsoletes:     lzma < 1:4.999.6
+Conflicts:     rpm < 4.4.9
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -32,90 +56,157 @@ LZMA features:
 - Small code size for decompressing: 2-8 KB (depending from speed
   optimizations)
 
-%description -l pl
-LZMA jest domy¶lnym i ogólnym algorytmem kompresji formatu 7z
-stosowanego przez 7-Zip. LZMA zapewnia wysoki stopieñ kompresji i
-bardzo szybk± dekompresjê, wiêc nadaje siê do zastosowañ osadzonych.
-Przyk³adowo, mo¿e byæ u¿yty do kompresji ROM-u (firmware'u).
+%description -l pl.UTF-8
+LZMA jest domyślnym i ogólnym algorytmem kompresji formatu 7z
+stosowanego przez 7-Zip. LZMA zapewnia wysoki stopień kompresji i
+bardzo szybką dekompresję, więc nadaje się do zastosowań osadzonych.
+Przykładowo, może być użyty do kompresji ROM-u (firmware'u).
 
 Cechy LZMA:
 
-- Szybko¶æ kompresowania: 500 KB/s na 1 GHz procesorze,
-- Szybko¶æ dekompresowania:
+- Szybkość kompresowania: 500 KB/s na 1 GHz procesorze,
+- Szybkość dekompresowania:
   - 8-12 MB/s na 1 GHz Pentium 3 lub Athlonie,
   - 500-1000 KB/s na 100 MHz procesorach ARM, MIPS, PowerPC lub innych
     prostych RISC-ach,
-- Ma³a ilo¶æ pamiêci potrzebna do dekompresowania: 8-32 KB + rozmiar
-  s³ownika,
-- Ma³y rozmiar kodu dekompresuj±cego: 2-8 KB (w zale¿no¶ci od opcji
+- Mała ilość pamięci potrzebna do dekompresowania: 8-32 KB + rozmiar
+  słownika,
+- Mały rozmiar kodu dekompresującego: 2-8 KB (w zależności od opcji
   optymalizacji).
 
+%package libs
+Summary:       LZMA shared library
+Summary(pl.UTF-8):     Biblioteka współdzielona LZMA
+Group:         Libraries
+Provides:      lzma-libs = %{epoch}:%{version}-%{release}
+Obsoletes:     lzma-libs < 1:4.999.6
+
+%description libs
+LZMA shared library.
+
+%description libs -l pl.UTF-8
+Biblioteka współdzielona LZMA.
+
 %package devel
-Summary:       LZMA library
-Summary(pl):   Biblioteka LZMA
+Summary:       Header file for LZMA library
+Summary(pl.UTF-8):     Plik nagłówkowy biblioteki LZMA
 Group:         Development/Libraries
+Requires:      %{name}-libs%{?_isa} = %{epoch}:%{version}-%{release}
+Provides:      lzma-devel = %{epoch}:%{version}-%{release}
+Obsoletes:     lzma-devel < 1:4.999.6
 
 %description devel
-LZMA Library.
+Header file for LZMA library.
 
-%description devel -l pl
-Biblioteka LZMA.
+%description devel -l pl.UTF-8
+Plik nagłówkowy biblioteki LZMA.
+
+%package static
+Summary:       LZMA static library
+Summary(pl.UTF-8):     Biblioteka statyczna LZMA
+Group:         Development/Libraries
+Requires:      %{name}-devel = %{epoch}:%{version}-%{release}
+Provides:      lzma-static = %{epoch}:%{version}-%{release}
+Obsoletes:     lzma-static < 1:4.999.6
+
+%description static
+LZMA static library.
+
+%description static -l pl.UTF-8
+Biblioteka statyczna LZMA.
 
 %prep
-%setup -q -c
+%setup -q
 %patch0 -p1
 %patch1 -p1
 
 %build
-cd C/7zip/Compress/LZMA_Alone
-%{__make} -f makefile.gcc \
-       CXX="%{__cxx}" \
-       CXX_C="%{__cc}" \
-       CFLAGS="%{rpmcflags} -fprofile-generate -c -I ../../.." \
-       LDFLAGS="%{rpmldflags} -fprofile-generate" \
-       LIB="-lm -lgcov"
-
-cat ../LZMA/* > test1
-cat lzma *.o > test2
-tar cf test3 ../../../../*
-./lzma e test1 test4
-./lzma e test2 test5
-./lzma e test3 test6
-./lzma d test4 test7
-./lzma d test5 test8
-./lzma d test6 test9
-cmp test1 test7
-cmp test2 test8
-cmp test3 test9
-
-%{__make} -f makefile.gcc clean
-
-%{__make} -f makefile.gcc \
-       CXX="%{__cxx}" \
-       CXX_C="%{__cc}" \
-       CFLAGS="%{rpmcflags} -fprofile-use -c -I ../../.." \
-       LDFLAGS="%{rpmldflags}"
-
-cd ../LZMA_Lib
-%{__make} -f makefile \
-       CXX="%{__cxx}" \
-       CFLAGS="%{rpmcflags} -c"
+%configure \
+       %{!?with_asm:--disable-assembler} \
+       %{__enable_disable static_libs static}
+%{__make}
+
+%{?with_tests:%{__make} check}
 
 %install
 rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}}
+install -d $RPM_BUILD_ROOT{/etc/env.d,/%{_lib}}
 
-install C/7zip/Compress/LZMA_Alone/lzma $RPM_BUILD_ROOT%{_bindir}
-install C/7zip/Compress/LZMA_Lib/liblzma.a $RPM_BUILD_ROOT%{_libdir}
+%{__make} install \
+       DESTDIR=$RPM_BUILD_ROOT
+
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}/%{name}
+
+install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+cp -a doc/examples*  $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
+
+mv -f $RPM_BUILD_ROOT%{_libdir}/liblzma.so.* $RPM_BUILD_ROOT/%{_lib}
+ln -sf /%{_lib}/$(basename $RPM_BUILD_ROOT/%{_lib}/liblzma.so.*.*.*) $RPM_BUILD_ROOT%{_libdir}/liblzma.so
+
+echo '#XZ_OPT="--threads=2"' > $RPM_BUILD_ROOT/etc/env.d/XZ_OPT
+
+%find_lang %{name}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%files
+%post  libs -p /sbin/ldconfig
+%postun        libs -p /sbin/ldconfig
+
+%files -f %{name}.lang
 %defattr(644,root,root,755)
-%doc history.txt lzma.txt
-%attr(755,root,root) %{_bindir}/*
+%config(noreplace,missingok) %verify(not md5 mtime size) /etc/env.d/XZ_OPT
+%attr(755,root,root) %{_bindir}/lz*
+%attr(755,root,root) %{_bindir}/unlzma
+%attr(755,root,root) %{_bindir}/unxz
+%attr(755,root,root) %{_bindir}/xz*
+%{_mandir}/man1/lz*.1*
+%{_mandir}/man1/unlzma.1*
+%{_mandir}/man1/unxz.1*
+%{_mandir}/man1/xz*.1*
+%lang(de) %{_mandir}/de/man1/lz*.1*
+%lang(de) %{_mandir}/de/man1/unlzma.1*
+%lang(de) %{_mandir}/de/man1/unxz.1*
+%lang(de) %{_mandir}/de/man1/xz*.1*
+%lang(fr) %{_mandir}/fr/man1/lz*.1*
+%lang(fr) %{_mandir}/fr/man1/unlzma.1*
+%lang(fr) %{_mandir}/fr/man1/unxz.1*
+%lang(fr) %{_mandir}/fr/man1/xz*.1*
+%lang(ko) %{_mandir}/ko/man1/lz*.1*
+%lang(ko) %{_mandir}/ko/man1/unlzma.1*
+%lang(ko) %{_mandir}/ko/man1/unxz.1*
+%lang(ko) %{_mandir}/ko/man1/xz*.1*
+%lang(pt_BR) %{_mandir}/pt_BR/man1/lz*.1*
+%lang(pt_BR) %{_mandir}/pt_BR/man1/unlzma.1*
+%lang(pt_BR) %{_mandir}/pt_BR/man1/unxz.1*
+%lang(pt_BR) %{_mandir}/pt_BR/man1/xz*.1*
+%lang(ro) %{_mandir}/ro/man1/lz*.1*
+%lang(ro) %{_mandir}/ro/man1/unlzma.1*
+%lang(ro) %{_mandir}/ro/man1/unxz.1*
+%lang(ro) %{_mandir}/ro/man1/xz*.1*
+%lang(uk) %{_mandir}/uk/man1/lz*.1*
+%lang(uk) %{_mandir}/uk/man1/unlzma.1*
+%lang(uk) %{_mandir}/uk/man1/unxz.1*
+%lang(uk) %{_mandir}/uk/man1/xz*.1*
+
+%files libs
+%defattr(644,root,root,755)
+%doc AUTHORS COPYING README THANKS
+%doc doc/*.txt
+%attr(755,root,root) /%{_lib}/liblzma.so.*.*.*
+%attr(755,root,root) %ghost /%{_lib}/liblzma.so.5
 
 %files devel
 %defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/liblzma.so
+%{_libdir}/liblzma.la
+%{_includedir}/lzma.h
+%{_includedir}/lzma
+%{_pkgconfigdir}/liblzma.pc
+%{_examplesdir}/%{name}-%{version}
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
 %{_libdir}/liblzma.a
+%endif
This page took 0.055975 seconds and 4 git commands to generate.