Sophie

Sophie

distrib > Mageia > 6 > armv7hl > media > core-updates-src > by-pkgid > 7d44548f3a3b104ef9ab5d866ee0ee86 > files > 3

zstd-1.3.2-1.mga6.src.rpm

%define realname        zstd
%define libmajor        1
%define libname         %mklibname %{realname} %{libmajor}
%define libname_devel   %mklibname %{realname} -d

# aarch64 and armv7hl at least currently segfault
# in ThreadPool test for the pzstd util
%ifarch %{ix86} x86_64
%global with_pzstd 1
%endif

Name:           zstd
Version:        1.3.2
Release:        %mkrel 1
Summary:        Zstd compression library
Group:		Archiving/Compression
License:        BSD and GPLv2
URL:            https://github.com/facebook/zstd
Source0:        https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz

Patch1:         pzstd.1.patch

BuildRequires:  gcc gtest-devel

%description
Zstd, short for Zstandard, is a fast lossless compression algorithm,
targeting real-time compression scenarios at zlib-level compression ratio.

%package -n %{libname}
Summary:        Zstd shared library
Group:		System/Libraries
%description -n %{libname}
Zstandard compression shared library.

%package -n %{libname_devel}
Summary:        Header files for Zstd library
Group:		Development/C
Requires:       %{libname} = %{version}-%{release}

%description -n %{libname_devel}
Header files for Zstd library.


%prep
%setup -q
find -name .gitignore -delete
%if 0%{?with_pzstd}
%patch1 -p1
%endif

%build
%{?__global_ldflags:LDFLAGS="${LDFLAGS:-%__global_ldflags}" ; export LDFLAGS ;}
for dir in lib programs; do
  CFLAGS="%{optflags}" %make_build -C "$dir"
done
%if 0%{?with_pzstd}
CFLAGS="%{optflags}" CXXFLAGS="%{optflags} -std=c++11" %make_build -C 'contrib/pzstd'
%endif

%check
%{?__global_ldflags:LDFLAGS="${LDFLAGS:-%__global_ldflags}" ; export LDFLAGS ;}
CFLAGS="%{optflags}" make -C tests test-zstd
%if 0%{?with_pzstd}
CFLAGS="%{optflags}" CXXFLAGS="%{optflags} -std=c++11" make -C contrib/pzstd test
%endif

%install
%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir}
# Remove undocumented wrappers of minimal use
rm %{buildroot}/%{_bindir}/%{name}less
rm %{buildroot}/%{_bindir}/%{name}grep
# Don't install the static lib
rm %{buildroot}/%{_libdir}/libzstd.a
%if 0%{?with_pzstd}
install -D -m755 contrib/pzstd/pzstd %{buildroot}/usr/bin/pzstd
install -D -m644 programs/%{name}.1 %{buildroot}/%{_mandir}/man1/p%{name}.1
%endif

%files
%doc NEWS README.md
%{_bindir}/%{name}
%if 0%{?with_pzstd}
%{_bindir}/p%{name}
%{_mandir}/man1/p%{name}.1*
%endif
%{_bindir}/%{name}mt
%{_bindir}/un%{name}
%{_bindir}/%{name}cat
%{_mandir}/man1/%{name}.1*
%{_mandir}/man1/un%{name}.1*
%{_mandir}/man1/%{name}cat.1*
%license LICENSE

%files -n %{libname}
%{_libdir}/libzstd.so.*
%license LICENSE

%files -n %{libname_devel}
%{_includedir}/zbuff.h
%{_includedir}/zdict.h
%{_includedir}/zstd.h
%{_includedir}/zstd_errors.h
%{_libdir}/pkgconfig/libzstd.pc
%{_libdir}/libzstd.so



%changelog
* Tue Nov 21 2017 tmb <tmb> 1.3.2-1.mga7
+ Revision: 1178202
- fix group
- adapt for Mageia
- import from fedora