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