Blob Blame History Raw
%global commit b43c183fdad31be0500a5f2ae022a54a66cb1a3d
%global shortcommit %(c=%{commit}; echo ${c:0:7})

# valgrind is available only on selected arches
%ifarch %{ix86} x86_64 ppc ppc64 ppc64le s390x %{arm} aarch64
%global with_valgrind 1

Name:       csnappy 
Version:    0
Release:    1.20141010git%{shortcommit}%{?dist}
Summary:    Snappy compression library ported to C 
Group:      System Environment/Libraries
License:    BSD
# Adjust Makefile to install into proper paths,
# <>, accepted
Patch0:     %{name}-b43c183f-Install-file-into-DESTDIR-and-LIBDIR.patch
# Include all needed headers
# <>, accepted
Patch1:     %{name}-b43c183f-Include-stdint.h-for-uint32_t-types.patch
# Tests:
%if 0%{?with_valgrind}
BuildRequires:  valgrind

This is an ANSI C port of Google's Snappy library. Snappy is a compression
library designed for speed rather than compression ratios.

%package devel
Group:      Development/Libraries
Summary:    Development files for the %{name} library
Requires:   %{name}%{?_isa} = %{version}-%{release}
Requires:   glibc-headers%{?_isa}

%description devel
Header files for developing applications that use the %{name} library.

%setup -qn %{name}-%{commit}
%patch0 -p1
%patch1 -p1
# Extract BSD license and copyright notices, bug #1152057
! test -e LICENSE
for F in $(< Makefile sed -e '/ s/.*:// p' -e 'd'); do
    < $F sed -e '/Copyright/,/\*\//p' -e 'd'
done > LICENSE
test -s LICENSE

make %{?_smp_mflags} 'OPT_FLAGS=%{optflags}' 'LDFLAGS=%{?__global_ldflags}' \
    lib%{name}.so cl_tester

%if 0%{?with_valgrind}
make test

make install 'DESTDIR=%{buildroot}' 'LIBDIR=%{_libdir}'

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files devel

* Fri Jan 16 2015 Dan HorĂ¡k <dan[at]> - 0-1.20141010gitb43c183
- valgrind is available only on selected arches

* Mon Oct 13 2014 Petr Pisar <> - 0-0.20141010gitb43c183
- b43c183fdad31be0500a5f2ae022a54a66cb1a3d snapshot