File pixz.spec of Package pixz

# spec file for package pixz
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via

%if 0%{?centos_version} || 0%{?rhel_version}
%define	use_static_libs 1
%define patch_missing_endianess_functions 1
%define use_static_libs 0
%define patch_missing_endianess_functions 0

Name:           pixz
Version:        1.0.2
Release:        0
Summary:        Parallel, indexing version of XZ
License:        BSD-2-Clause
Group:          Productivity/Archiving/Compression
Patch1:         pixz-underlinking.patch
Patch2:         pixz-use-static.patch
Patch3:         pixz-endianess-functions.patch
%if 0%{?use_static_libs}
BuildRequires:  libarchive-static-devel >= 2.8
BuildRequires:  xz-static-devel >= 4.999.9-beta-212
BuildRequires:  libarchive-devel
BuildRequires:  xz-devel

BuildRoot:      %{_tmppath}/%{name}-%{version}-build

The existing XZ Utils ( ) provide great compression in the .xz file format, 
but they have two significant problems:

* They are single-threaded, while most users nowadays have multi-core computers.
* The .xz files they produce are just one big block of compressed data, 
  rather than a collection of smaller blocks. This makes random access to the original data impossible.

%setup -q
%patch1 -p1
%if 0%{?use_static_libs}
%patch2 -p1
%if 0%{?patch_missing_endianess_functions}
%patch3 -p1

make %{?_smp_mflags} CFLAGS="%{optflags}"

mkdir -p %{buildroot}/%{_bindir}
mkdir -p %{buildroot}/%{_mandir}/man1/

install -m 0755 pixz %{buildroot}/%{_bindir}/pixz
install -m 0644 pixz.1 %{buildroot}/%{_mandir}/man1/pixz.1