%global compat_ver xz-4.999.9beta %global prerel alpha %if 0%{?fedora} >= 22 || 0%{?rhel} >= 8 %global has_grepconf 1 %else %global has_grepconf 0 %endif Summary: LZMA compression utilities Name: xz Version: 5.1.2 Release: 16.1.alpha.cf%{?dist} License: LGPLv2+ URL: http://tukaani.org/xz/ Source0: http://tukaani.org/xz/xz-%{version}%{?prerel}.tar.gz # source created as "make dist" in checked out GIT tree Source1: %{compat_ver}.20100401git.tar.bz2 Source100: colorxzgrep.sh Source101: colorxzgrep.csh Patch0: xz-5.1.2alpha-man-page-day.patch Patch1: xz-5.1.2alpha-xzgrep-and-h-option.patch Patch2: xz-5.1.2alpha-less-version-check.patch Patch3: xz-5.1.2alpha-xzgrep-exit.patch Patch4: xz-5.1.2alpha-xzgrep-exit-test.patch Requires: xz-libs%{?_isa} = %{version}-%{release} %description XZ Utils are an attempt to make LZMA compression easy to use on free (as in freedom) operating systems. This is achieved by providing tools and libraries which are similar to use than the equivalents of the most popular existing compression algorithms. LZMA is a general purpose compression algorithm designed by Igor Pavlov as part of 7-Zip. It provides high compression ratio while keeping the decompression speed fast. %package libs Summary: Libraries for decoding LZMA compression License: LGPLv2+ %description libs Libraries for decoding files compressed with LZMA or XZ utils. %package static Summary: Statically linked library for decoding LZMA compression License: LGPLv2+ %description static Statically linked library for decoding files compressed with LZMA or XZ utils. Most users should *not* install this. %package compat-libs Summary: Compatibility libraries for decoding LZMA compression License: LGPLv2+ %description compat-libs Compatibility libraries for decoding files compressed with LZMA or XZ utils. This particular package ships libraries from %{compat_ver} as of 1st of April 2010. %package devel Summary: Devel libraries & headers for liblzma License: LGPLv2+ Requires: xz-libs%{?_isa} = %{version}-%{release} %description devel Devel libraries and headers for liblzma. %package lzma-compat Summary: Older LZMA format compatibility binaries # lz{grep,diff,more} are GPLv2+. Other binaries are LGPLv2+ License: GPLv2+ and LGPLv2+ Requires: xz%{?_isa} = %{version}-%{release} Obsoletes: lzma < %{version} Provides: lzma = %{version} %description lzma-compat The lzma-compat package contains compatibility links for older commands that deal with the older LZMA format. %prep %setup -q -n %{name}-%{version}%{?prerel} -a1 # partly upstream/partly not (yet?) # ~> proposal: http://www.mail-archive.com/xz-devel@tukaani.org/msg00153.html # ~> #948533 %patch0 -p1 -b .man-page-day # fix 'xzgrep -h' to behave as expected # ~> upstream (5019413a0) # ~> #850898 %patch1 -p1 -b .xzgrep-and-h-option # fix less version checking # ~> upstream (db5c1817fa, 9e6dabcf22) # ~> #1015924 %patch2 -p1 -b .less-version-check # xzgrep: return 0 when at least one file matches (+ test) # ~> upstream (ceca37901783) # ~> #1109122 %patch3 -p1 -b .xzgrep-exit-status %patch4 -p1 -b .xzgrep-exit-status-test # add support for ppc64p7 arch (Power7 optimized) for i in `find . -name config.sub`; do perl -pi -e "s/ppc64-\*/ppc64-\* \| ppc64p7-\*/" $i done %build CFLAGS="%{optflags} -D_FILE_OFFSET_BITS=64" CXXFLAGS="%{optflags} -D_FILE_OFFSET_BITS=64" %ifarch %{power64} CFLAGS=`echo $CFLAGS | xargs -n 1 | sed 's|^-O2$|-O3|g' | xargs -n 100` CXXFLAGS=`echo $CXXFLAGS | xargs -n 1 | sed 's|^-O2$|-O3|g' | xargs -n 100` %endif export CFLAGS export CXXFLAGS %configure sed -i -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \ libtool make %{?_smp_mflags} cd %{compat_ver} %configure sed -i -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' \ libtool make %{?_smp_mflags} cd - %install make install DESTDIR=%{buildroot} INSTALL="install -p" # Install compat libraries cp -a %{compat_ver}/src/liblzma/.libs/liblzma.so.0* %{buildroot}%{_libdir}/ chmod g-w %{buildroot}%{_libdir}/liblzma.so.0* # Remove stuff we don't want packaged rm -f %{buildroot}%{_libdir}/*.la rm -rf %{buildroot}%{_docdir}/xz %find_lang xz %if %{has_grepconf} %global profiledir %{_sysconfdir}/profile.d mkdir -p %{buildroot}%{profiledir} install -p -m 644 %{SOURCE100} %{buildroot}%{profiledir} install -p -m 644 %{SOURCE101} %{buildroot}%{profiledir} %endif %check LD_LIBRARY_PATH=$PWD/src/liblzma/.libs make check %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig %post compat-libs -p /sbin/ldconfig %postun compat-libs -p /sbin/ldconfig %files %if 0%{?_licensedir:1} %license COPYING* %else %doc COPYING* %endif %doc AUTHORS NEWS README THANKS TODO %{_bindir}/unxz %{_bindir}/xz %{_bindir}/xzcat %{_bindir}/xzcmp %{_bindir}/xzdec %{_bindir}/xzdiff %{_bindir}/xzegrep %{_bindir}/xzfgrep %{_bindir}/xzgrep %{_bindir}/xzless %{_bindir}/xzmore %{_mandir}/man1/unxz.1* %{_mandir}/man1/xz.1* %{_mandir}/man1/xzcat.1* %{_mandir}/man1/xzcmp.1* %{_mandir}/man1/xzdec.1* %{_mandir}/man1/xzdiff.1* %{_mandir}/man1/xzegrep.1* %{_mandir}/man1/xzfgrep.1* %{_mandir}/man1/xzgrep.1* %{_mandir}/man1/xzless.1* %{_mandir}/man1/xzmore.1* %if %{has_grepconf} %{profiledir}/colorxzgrep.csh %{profiledir}/colorxzgrep.sh %endif %files -f xz.lang libs %if 0%{?_licensedir:1} %license COPYING* %else %doc COPYING* %endif %{_libdir}/liblzma.so.5* %files static %if 0%{?_licensedir:1} %license COPYING* %else %doc COPYING* %endif %{_libdir}/liblzma.a %files compat-libs %if 0%{?_licensedir:1} %license COPYING* %else %doc COPYING* %endif %{_libdir}/liblzma.so.0* %files devel %{_includedir}/lzma.h %{_includedir}/lzma/ %{_libdir}/liblzma.so %{_libdir}/pkgconfig/liblzma.pc %files lzma-compat %{_bindir}/lzcat %{_bindir}/lzcmp %{_bindir}/lzdiff %{_bindir}/lzegrep %{_bindir}/lzfgrep %{_bindir}/lzgrep %{_bindir}/lzless %{_bindir}/lzma %{_bindir}/lzmadec %{_bindir}/lzmainfo %{_bindir}/lzmore %{_bindir}/unlzma %{_mandir}/man1/lzcat.1* %{_mandir}/man1/lzcmp.1* %{_mandir}/man1/lzdiff.1* %{_mandir}/man1/lzegrep.1* %{_mandir}/man1/lzfgrep.1* %{_mandir}/man1/lzgrep.1* %{_mandir}/man1/lzless.1* %{_mandir}/man1/lzma.1* %{_mandir}/man1/lzmadec.1* %{_mandir}/man1/lzmainfo.1* %{_mandir}/man1/lzmore.1* %{_mandir}/man1/unlzma.1* %changelog * Fri Aug 29 2014 Paul Howarth 5.1.2-16.1.alpha.cf - only attempt colored xz*grep output on Fedora 22 onwards * Thu Aug 28 2014 Paul Howarth 5.1.2-16.alpha.cf - xz*grep's output is colored iff grep's is (#1034846) * Wed Aug 20 2014 Paul Howarth 5.1.2-15.alpha.cf - rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild * Thu Aug 7 2014 Paul Howarth 5.1.2-14.alpha.cf - use %%license where possible * Fri Jun 13 2014 Paul Howarth 5.1.2-13.alpha.cf - xzgrep: return 0 when at least one file matches (#1109122) * Sat Jun 7 2014 Paul Howarth 5.1.2-12.alpha.cf - drop ChangeLog; it's big and the excitement is summarised in NEWS * Fri May 16 2014 Paul Howarth 5.1.2-10.alpha.cf - add a -static sub-package (#547011) - modern rpm doesn't require buildroot cleaning * Wed Apr 2 2014 Paul Howarth 5.1.2-9.alpha.cf - better check the version of less binary (#1015924) - drop support for old distributions prior to F-16 because we're not building for them anyway * Fri Jan 10 2014 Paul Howarth 5.1.2-8.alpha.cf - build with -O3 on ppc64 (private #1051078) * Mon Aug 5 2013 Paul Howarth 5.1.2-7.alpha.cf - rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild * Tue Apr 9 2013 Paul Howarth 5.1.2-6.alpha.cf - fix manual page inconsistencies with help output (private #948533) - enable/fix the 'xzgrep -h' (private #850898) * Thu Feb 21 2013 Paul Howarth 5.1.2-5.alpha.cf - add support for ppc64p7 arch (Power7 optimized) * Tue Jul 24 2012 Paul Howarth 5.1.2-3.alpha.cf - rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Thu Jul 5 2012 Paul Howarth 5.1.2-2.alpha.cf - update to 5.1.2alpha (see NEWS for details) * Wed Jan 18 2012 Paul Howarth 5.1.1-3.alpha.cf - rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Mon Oct 17 2011 Paul Howarth 5.1.1-2.alpha.cf - update to 5.1.1alpha (#736318) - support for multithreaded compression was added using the simplest method, which splits the input data into blocks and compresses them independently (other methods will be added in the future) - added the options --single-stream and --block-size=SIZE to xz - xzdiff and xzgrep now support .lzo files if lzop is installed (the .tzo suffix is also recognized as a shorthand for .tar.lzo) - support for short 8.3 filenames under DOS was added to xz; it is experimental and may change before it gets into a stable release * Mon Jun 20 2011 Paul Howarth 5.0.3-2.0.cf - use bzipped tarball instead of gzipped one * Mon May 23 2011 Paul Howarth 5.0.3-1.0.cf - update to 5.0.3 - liblzma: a memory leak was fixed - liblzma: lzma_stream_buffer_encode() no longer creates an empty .xz Block if encoding an empty buffer; such an empty Block with LZMA2 data would trigger a bug in 5.0.1 and older - liblzma: validate function arguments better in a few functions; most importantly, specifying an unsupported integrity check to lzma_stream_buffer_encode() no longer creates a corrupt .xz file - liblzma: document that lzma_block_buffer_encode(), lzma_easy_buffer_encode(), lzma_stream_encoder(), and lzma_stream_buffer_encode() may return LZMA_UNSUPPORTED_CHECK - liblzma: the return values of the _memusage() functions are now documented better - fix command name detection in xzgrep; xzegrep and xzfgrep now correctly use egrep and fgrep instead of grep - French translation was added. * Mon Apr 4 2011 Paul Howarth 5.0.2-1.0.cf - update to 5.0.2 - LZMA2 decompressor now correctly accepts LZMA2 streams with no uncompressed data - "xz --suffix=.foo filename.foo" now refuses to compress the file due to it already having the suffix .foo - "xzgrep -l foo bar.xz" works now - Polish translation was added - nobody else likes macros for commands * Wed Feb 9 2011 Paul Howarth 5.0.1-2.0.cf - remove URL tag from liblzma.pc if we have have pkgconfig <= 0.15 - drop explicit dependency of devel package on pkgconfig if rpm can auto-detect the requirement * Sat Jan 29 2011 Paul Howarth 5.0.1-1.0.cf - update to 5.0.1 - xz --force now (de)compresses files that have setuid, setgid, or sticky bit set and files that have multiple hard links; the man page had it documented this way already but the code had a bug - gzip and bzip2 support in xzdiff was fixed - portability fixes - Minor fix to Czech translation * Mon Oct 25 2010 Paul Howarth 5.0.0-4.0.cf - update to the new upstream release, with liblzma.so.5 - introduce compat-libs subpackage with liblzma.so.0 for compatibility with distributions using older releases * Sun Oct 17 2010 Paul Howarth 4.999.9-0.6.beta.212.gacbc - update to latest git snapshot * Tue Jun 8 2010 Paul Howarth 4.999.9-0.5.beta.20100401git - rebuild for i686 in RHEL-6 beta * Thu Apr 1 2010 Paul Howarth 4.999.9-0.4.beta.20100401git - sync with upstream (#578925) - add message translations, in libs package * Fri Feb 19 2010 Paul Howarth 4.999.9-0.3.beta.20091007git - move xz man pages to main package, leave lzma ones where they belong (#566484) * Sat Dec 26 2009 Paul Howarth 4.999.9-0.2.beta.20091007git - import from Fedora * Wed Oct 07 2009 Jindrich Novy 4.999.9-0.1.20091007.beta - sync with upstream again * Fri Oct 02 2009 Jindrich Novy 4.999.9-0.1.20091002.beta - sync with upstream to generate the same archives on machines with different endianess * Fri Aug 28 2009 Jindrich Novy 4.999.9-0.1.beta - update to 4.999.9beta * Mon Aug 17 2009 Jindrich Novy 4.999.8-0.10.beta.20090817git - sync with upstream because of #517806 * Tue Aug 04 2009 Jindrich Novy 4.999.8-0.9.beta.20090804git - update to the latest GIT snapshot * Mon Jul 27 2009 Fedora Release Engineering - 4.999.8-0.8.beta - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Fri Jul 17 2009 Bill Nottingham 4.999.8-0.7.beta - tweak summary - add %%check section () * Thu Jul 09 2009 Bill Nottingham 4.999.8-0.6.beta - fix release versioning to match guidelines - fix up lzma-compat summary/description - tweak licensing * Mon Jun 22 2009 Jindrich Novy 4.999.8beta-0.5 - introduce lzma-compat subpackage * Fri Jun 19 2009 Jindrich Novy 4.999.8beta-0.4 - try to not to conflict with lzma * Thu Jun 18 2009 Jindrich Novy 4.999.8beta-0.3 - obsolete but don't provide lzma, they are largely incompatible - put beta to Release * Wed Jun 17 2009 Jindrich Novy 4.999.8beta-0.2 - obsolete old lzma - add Requires: pkgconfig * Tue Jun 16 2009 Jindrich Novy 4.999.8beta-0.1 - package XZ Utils, based on LZMA Utils packaged by Per Patrice Bouchand