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