37d2b9
# Not needed for f21+ and probably RHEL8+
37d2b9
%{!?_licensedir:%global license %%doc}
37d2b9
37d2b9
Summary:	LZMA compression utilities
37d2b9
Name:		xz
37d2b9
Version:	5.2.5
a2381c
Release:	8%{?dist}
37d2b9
37d2b9
# Scripts xz{grep,diff,less,more} and symlinks (copied from gzip) are
37d2b9
# GPLv2+, binaries are Public Domain (linked against LGPL getopt_long but its
37d2b9
# OK), documentation is Public Domain.
37d2b9
License:	GPLv2+ and Public Domain
37d2b9
# official upstream release
37d2b9
Source0:	https://tukaani.org/%{name}/%{name}-%{version}.tar.xz
37d2b9
37d2b9
Source100:	colorxzgrep.sh
37d2b9
Source101:	colorxzgrep.csh
37d2b9
37d2b9
Patch1:   xz-5.2.5-enable_CET.patch
a2381c
Patch2:   xz-5.2.5-cve-2022-1271.patch
37d2b9
37d2b9
URL:		https://tukaani.org/%{name}/
37d2b9
Requires:	%{name}-libs%{?_isa} = %{version}-%{release}
37d2b9
37d2b9
# For /usr/libexec/grepconf.sh (RHBZ#1189120).
37d2b9
# Unfortunately F21 has a newer version of grep which doesn't
37d2b9
# have grepconf, but we're only concerned with F22 here.
37d2b9
Requires:	grep >= 2.20-5
37d2b9
37d2b9
BuildRequires:  make
37d2b9
BuildRequires:	gcc
37d2b9
BuildRequires:	perl-interpreter
37d2b9
37d2b9
37d2b9
%description
37d2b9
XZ Utils are an attempt to make LZMA compression easy to use on free (as in
37d2b9
freedom) operating systems. This is achieved by providing tools and libraries
37d2b9
which are similar to use than the equivalents of the most popular existing
37d2b9
compression algorithms.
37d2b9
37d2b9
LZMA is a general purpose compression algorithm designed by Igor Pavlov as
37d2b9
part of 7-Zip. It provides high compression ratio while keeping the
37d2b9
decompression speed fast.
37d2b9
37d2b9
37d2b9
%package 	libs
37d2b9
Summary:	Libraries for decoding LZMA compression
37d2b9
License:	Public Domain
37d2b9
Obsoletes:	%{name}-compat-libs < %{version}-%{release}
37d2b9
37d2b9
%description 	libs
37d2b9
Libraries for decoding files compressed with LZMA or XZ utils.
37d2b9
37d2b9
37d2b9
%package 	static
37d2b9
Summary:	Statically linked library for decoding LZMA compression
37d2b9
License:	Public Domain
37d2b9
37d2b9
%description 	static
37d2b9
Statically linked library for decoding files compressed with LZMA or
37d2b9
XZ utils.  Most users should *not* install this.
37d2b9
37d2b9
37d2b9
%package 	devel
37d2b9
Summary:	Devel libraries & headers for liblzma
37d2b9
License:	Public Domain
37d2b9
Requires:	%{name}-libs%{?_isa} = %{version}-%{release}
37d2b9
37d2b9
%description	devel
37d2b9
Devel libraries and headers for liblzma.
37d2b9
37d2b9
37d2b9
%package 	lzma-compat
37d2b9
Summary:	Older LZMA format compatibility binaries
37d2b9
# Just a set of symlinks to 'xz' + two Public Domain binaries.
37d2b9
License:	Public Domain
37d2b9
Requires:	%{name}%{?_isa} = %{version}-%{release}
37d2b9
Obsoletes:	lzma < %{version}
37d2b9
Provides:	lzma = %{version}
37d2b9
37d2b9
%description	lzma-compat
37d2b9
The lzma-compat package contains compatibility links for older
37d2b9
commands that deal with the older LZMA format.
37d2b9
37d2b9
37d2b9
%prep
37d2b9
%autosetup -p1
37d2b9
37d2b9
37d2b9
%build
37d2b9
export CFLAGS="%optflags"
37d2b9
37d2b9
%ifarch %{power64}
37d2b9
  CFLAGS="$CFLAGS -O3"
37d2b9
%endif
37d2b9
37d2b9
%ifarch %ix86
37d2b9
  # rhbz#1630650, annocheck reports the following message because liblzma uses
37d2b9
  # crc*_x86.S asm code on i686:
37d2b9
  CFLAGS="$CFLAGS -Wa,--generate-missing-build-notes=yes"
37d2b9
%endif
37d2b9
37d2b9
%configure
37d2b9
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
37d2b9
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
37d2b9
%make_build
37d2b9
37d2b9
37d2b9
%install
37d2b9
%make_install
37d2b9
rm -f %{buildroot}%{_libdir}/*.la
37d2b9
37d2b9
# xzgrep colorization
37d2b9
%global profiledir %{_sysconfdir}/profile.d
37d2b9
mkdir -p %{buildroot}%{profiledir}
37d2b9
install -p -m 644 %{SOURCE100} %{buildroot}%{profiledir}
37d2b9
install -p -m 644 %{SOURCE101} %{buildroot}%{profiledir}
37d2b9
37d2b9
%find_lang %name
37d2b9
37d2b9
37d2b9
%check
37d2b9
LD_LIBRARY_PATH=$PWD/src/liblzma/.libs make check
37d2b9
37d2b9
%ldconfig_scriptlets libs
37d2b9
37d2b9
37d2b9
%files -f %{name}.lang
37d2b9
%license COPYING*
37d2b9
%doc %{_pkgdocdir}
37d2b9
%exclude %_pkgdocdir/examples*
37d2b9
%{_bindir}/*xz*
37d2b9
%{_mandir}/man1/*xz*
37d2b9
%{_mandir}/de/man1/*xz*
37d2b9
%{profiledir}/*
37d2b9
37d2b9
37d2b9
%files libs
37d2b9
%license COPYING
37d2b9
%{_libdir}/lib*.so.5*
37d2b9
37d2b9
37d2b9
%files static
37d2b9
%license COPYING
37d2b9
%{_libdir}/liblzma.a
37d2b9
37d2b9
37d2b9
%files devel
37d2b9
%dir %{_includedir}/lzma
37d2b9
%{_includedir}/lzma/*.h
37d2b9
%{_includedir}/lzma.h
37d2b9
%{_libdir}/*.so
37d2b9
%{_libdir}/pkgconfig/liblzma.pc
37d2b9
%doc %_pkgdocdir/examples*
37d2b9
37d2b9
37d2b9
%files lzma-compat
37d2b9
%{_bindir}/*lz*
37d2b9
%{_mandir}/man1/*lz*
37d2b9
%{_mandir}/de/man1/*lz*
37d2b9
37d2b9
37d2b9
%changelog
a2381c
* Tue May 31 2022 Matej Mužila <mmuzila@redhat.com> - 5.2.5-8
a2381c
- Fix arbitrary file write vulnerability
a2381c
  Resolves: CVE-2022-1271
a2381c
37d2b9
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 5.2.5-7
37d2b9
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
37d2b9
  Related: rhbz#1991688
37d2b9
37d2b9
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 5.2.5-6
37d2b9
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
37d2b9
37d2b9
* Thu Jan 28 2021 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.5-5
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
37d2b9
37d2b9
* Mon Jan 04 2021 Ondrej Dubaj <odubaj@redhat.com> - 5.2.5-4
37d2b9
- Enabled CET for i686 (#1910368)
37d2b9
37d2b9
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.5-3
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
37d2b9
37d2b9
* Mon Jun  8 2020 Richard W.M. Jones <rjones@redhat.com> - 5.2.5-2
37d2b9
- Fix location of German man pages (RHBZ#1844813).
37d2b9
37d2b9
* Mon Mar 30 2020 Ondrej Dubaj <odubaj@redhat.com> - 5.2.5-1
37d2b9
- Rebase to version 5.2.5 (#1818418)
37d2b9
37d2b9
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.4-8
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
37d2b9
37d2b9
* Wed Aug 21 2019 Petr Kubat <pkubat@redhat.com> - 5.2.4-7
37d2b9
- Use relative path for COPYING files so that rpm moves them to correct place
37d2b9
  Related: rhbz#1741074
37d2b9
37d2b9
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.4-6
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
37d2b9
37d2b9
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.4-5
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
37d2b9
37d2b9
* Thu Nov 22 2018 Pavel Raiskup <praiskup@redhat.com> - 5.2.4-4
37d2b9
- fix annocheck failures on i686 (rhbz#1630650)
37d2b9
37d2b9
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.4-3
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
37d2b9
37d2b9
* Wed May 09 2018 Pavel Raiskup <praiskup@redhat.com> - 5.2.4-2
37d2b9
- drop ppc64p7 hack, per fedora devel list discussion:
37d2b9
  https://lists.fedoraproject.org/archives/list/
37d2b9
  devel@lists.fedoraproject.org/thread/2OWD2QRDFBEC6HTPVQ7FMJENH32BWT54/
37d2b9
- don't explicitly set _FILE_OFFSET_BITS, package uses AC_SYS_LARGEFILE
37d2b9
37d2b9
* Tue May 08 2018 Pavel Raiskup <praiskup@redhat.com> - 5.2.4-1
37d2b9
- rebase to 5.2.4 (rhbz#1574039), per release notes:
37d2b9
  https://www.mail-archive.com/xz-devel@tukaani.org/msg00295.html
37d2b9
37d2b9
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.3-7
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
37d2b9
37d2b9
* Fri Feb 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 5.2.3-6
37d2b9
- Switch to %%ldconfig_scriptlets
37d2b9
37d2b9
* Wed Sep 13 2017 Vasiliy N. Glazov <vascom2@gmail.com> - 5.2.3.-5
37d2b9
- Cleanup spec
37d2b9
37d2b9
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.3-4
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
37d2b9
37d2b9
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.3-3
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
37d2b9
37d2b9
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.3-2
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
37d2b9
37d2b9
* Mon Jan 02 2017 Pavel Raiskup <praiskup@redhat.com> - 5.2.3-1
37d2b9
- rebase to stable 5.2.3 per release notes:
37d2b9
  http://www.mail-archive.com/xz-devel@tukaani.org/msg00285.html
37d2b9
37d2b9
* Mon Nov 28 2016 Lubomir Rintel <lkundrak@v3.sk> - 5.2.2-3
37d2b9
- Fix FTBFS by requiring Perl
37d2b9
37d2b9
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.2-2
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
37d2b9
37d2b9
* Tue Sep 29 2015 Pavel Raiskup <praiskup@redhat.com> - 5.2.2-1
37d2b9
- rebase to stable 5.2.2 per release notes:
37d2b9
  http://www.mail-archive.com/xz-devel@tukaani.org/msg00244.html
37d2b9
37d2b9
* Thu Jul 09 2015 Pavel Raiskup <praiskup@redhat.com> - 5.2.1-3
37d2b9
- remove xz-compat-libs as it is not necessary (#1179193)
37d2b9
37d2b9
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.2.1-2
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
37d2b9
37d2b9
* Fri Feb 27 2015 Pavel Raiskup <praiskup@redhat.com> - 5.2.1-1
37d2b9
- bugfix rebase to 5.2.1, per release notes
37d2b9
  http://www.mail-archive.com/xz-devel@tukaani.org/msg00226.html
37d2b9
37d2b9
* Wed Feb 04 2015 Richard W.M. Jones <rjones@redhat.com> - 5.2.0-2
37d2b9
- Depend on grep that contains grepconf.sh (#1189120)
37d2b9
37d2b9
* Tue Dec 23 2014 Pavel Raiskup <praiskup@redhat.com> - 5.2.0-1
37d2b9
- rebase per upstream release notes (#1023718)
37d2b9
  http://www.mail-archive.com/xz-devel@tukaani.org/msg00216.html
37d2b9
- fedora-review fixes, documentation/license fixes in spec
37d2b9
37d2b9
* Tue Aug 26 2014 Pavel Raiskup <praiskup@redhat.com> - 5.1.2-15alpha
37d2b9
- xz*grep's output is colored iff grep's is (#1034846)
37d2b9
37d2b9
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.2-14alpha
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
37d2b9
37d2b9
* Wed Aug  6 2014 Tom Callaway <spot@fedoraproject.org> - 5.1.2-13alpha
37d2b9
- fix license handling
37d2b9
37d2b9
* Fri Jun 13 2014 Pavel Raiskup <praiskup@redhat.com> - 5.1.2-12alpha
37d2b9
- xzgrep: return 0 when at least one file matches (#1109122)
37d2b9
37d2b9
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.2-11alpha
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
37d2b9
37d2b9
* Sat May 31 2014 Peter Robinson <pbrobinson@fedoraproject.org> 5.1.2-10alpha
37d2b9
- Drop ChangeLog, it's big and the excitement is summarised in NEWS
37d2b9
37d2b9
* Fri May 16 2014 Richard W.M. Jones <rjones@redhat.com> - 5.1.2-9alpha
37d2b9
- Add a -static subpackage (see RHBZ#547011).
37d2b9
37d2b9
* Wed Apr 02 2014 Pavel Raiskup <praiskup@redhat.com> - 5.1.2-8alpha
37d2b9
- add _isa requirements where appropriate
37d2b9
- better check the version of less binary (#1015924)
37d2b9
37d2b9
* Fri Jan 10 2014 Pavel Raiskup <praiskup@redhat.com> - 5.1.2-7alpha
37d2b9
- build with -O3 on ppc64 (private #1051078)
37d2b9
37d2b9
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.2-6alpha
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
37d2b9
37d2b9
* Tue Apr 09 2013 Pavel Raiskup <praiskup@redhat.com> - 5.1.2-5alpha
37d2b9
- fix manual page inconsistencies with help output (private #948533)
37d2b9
- enable/fix the 'xzgrep -h' (private #850898)
37d2b9
37d2b9
* Thu Feb 21 2013 Karsten Hopp <karsten@redhat.com> 5.1.2-4alpha
37d2b9
- add support for ppc64p7 arch (Power7 optimized)
37d2b9
37d2b9
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.2-3alpha
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
37d2b9
37d2b9
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.2-2alpha
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
37d2b9
37d2b9
* Thu Jul 05 2012 Jindrich Novy <jnovy@redhat.com> 5.1.2alpha-1
37d2b9
- update to 5.1.2alpha
37d2b9
37d2b9
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.1-2alpha
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
37d2b9
37d2b9
* Sun Oct 16 2011 Jindrich Novy <jnovy@redhat.com> 5.1.1alpha-1
37d2b9
- update to 5.1.1alpha
37d2b9
37d2b9
* Mon Jun 20 2011 Jindrich Novy <jnovy@redhat.com> 5.0.3-2
37d2b9
- better to have upstream tarballs in different formats than XZ
37d2b9
  to allow bootstrapping (#714765)
37d2b9
37d2b9
* Mon May 23 2011 Jindrich Novy <jnovy@redhat.com> 5.0.3-1
37d2b9
- update to 5.0.3
37d2b9
37d2b9
* Mon Apr 04 2011 Jindrich Novy <jnovy@redhat.com> 5.0.2-1
37d2b9
- update to 5.0.2
37d2b9
37d2b9
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.1-2
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
37d2b9
37d2b9
* Sat Jan 29 2011 Jindrich Novy <jnovy@redhat.com> 5.0.1-1
37d2b9
- update to 5.0.1
37d2b9
37d2b9
* Tue Oct 26 2010 Jindrich Novy <jnovy@redhat.com> 5.0.0-4
37d2b9
- call ldconfig for compat-libs and fix description
37d2b9
37d2b9
* Mon Oct 25 2010 Jindrich Novy <jnovy@redhat.com> 5.0.0-3
37d2b9
- introduce compat-libs subpackage with older soname to
37d2b9
  resolve problems with soname bump and for packages requiring
37d2b9
  older xz-4.999.9beta
37d2b9
37d2b9
* Mon Oct 25 2010 Jindrich Novy <jnovy@redhat.com> 5.0.0-2
37d2b9
- rebuild
37d2b9
37d2b9
* Mon Oct 25 2010 Jindrich Novy <jnovy@redhat.com> 5.0.0-1
37d2b9
- update to the new upstream release
37d2b9
37d2b9
* Sat Oct 16 2010 Jindrich Novy <jnovy@redhat.com> 4.999.9-0.3.beta.212.gacbc
37d2b9
- update to latest git snapshot
37d2b9
37d2b9
* Thu Apr 01 2010 Jindrich Novy <jnovy@redhat.com> 4.999.9-0.2.20100401.beta
37d2b9
- sync with upstream (#578925)
37d2b9
37d2b9
* Thu Feb 18 2010 Jindrich Novy <jnovy@redhat.com> 4.999.9-0.2.20091007.beta
37d2b9
- move xz man pages to main package, leave lzma ones where they belong (#566484)
37d2b9
37d2b9
* Wed Oct 07 2009 Jindrich Novy <jnovy@redhat.com> 4.999.9-0.1.20091007.beta
37d2b9
- sync with upstream again
37d2b9
37d2b9
* Fri Oct 02 2009 Jindrich Novy <jnovy@redhat.com> 4.999.9-0.1.20091002.beta
37d2b9
- sync with upstream to generate the same archives on machines with different
37d2b9
  endianess
37d2b9
37d2b9
* Fri Aug 28 2009 Jindrich Novy <jnovy@redhat.com> 4.999.9-0.1.beta
37d2b9
- update to 4.999.9beta
37d2b9
37d2b9
* Mon Aug 17 2009 Jindrich Novy <jnovy@redhat.com> 4.999.8-0.10.beta.20090817git
37d2b9
- sync with upstream because of #517806
37d2b9
37d2b9
* Tue Aug 04 2009 Jindrich Novy <jnovy@redhat.com> 4.999.8-0.9.beta.20090804git
37d2b9
- update to the latest GIT snapshot
37d2b9
37d2b9
* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.999.8-0.8.beta
37d2b9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
37d2b9
37d2b9
* Fri Jul 17 2009 Bill Nottingham <notting@redhat.com> 4.999.8-0.7.beta
37d2b9
- tweak summary
37d2b9
- add %%check section (<tibbs@math.uh.edu>)
37d2b9
 
37d2b9
* Thu Jul 09 2009 Bill Nottingham <notting@redhat.com> 4.999.8-0.6.beta
37d2b9
- fix release versioning to match guidelines
37d2b9
- fix up lzma-compat summary/description
37d2b9
- tweak licensing
37d2b9
37d2b9
* Mon Jun 22 2009 Jindrich Novy <jnovy@redhat.com> 4.999.8beta-0.5
37d2b9
- introduce lzma-compat subpackage
37d2b9
37d2b9
* Fri Jun 19 2009 Jindrich Novy <jnovy@redhat.com> 4.999.8beta-0.4
37d2b9
- try to not to conflict with lzma
37d2b9
37d2b9
* Thu Jun 18 2009 Jindrich Novy <jnovy@redhat.com> 4.999.8beta-0.3
37d2b9
- obsolete but don't provide lzma, they are largely incompatible
37d2b9
- put beta to Release
37d2b9
37d2b9
* Wed Jun 17 2009 Jindrich Novy <jnovy@redhat.com> 4.999.8beta-0.2
37d2b9
- obsolete old lzma
37d2b9
- add Requires: pkgconfig
37d2b9
37d2b9
* Tue Jun 16 2009 Jindrich Novy <jnovy@redhat.com> 4.999.8beta-0.1
37d2b9
- package XZ Utils, based on LZMA Utils packaged by Per Patrice Bouchand