822b73
%if 0%{?rhel} && 0%{?rhel} <= 6
822b73
# gcc-4.4 is currently too old to compile pzstd
822b73
%bcond_with pzstd
822b73
%else
822b73
%ifarch %{ix86} x86_64
822b73
%bcond_without pzstd
822b73
%else
822b73
# aarch64 and armv7hl at least currently segfault
822b73
# in ThreadPool test for the pzstd util
822b73
%bcond_with pzstd
822b73
%endif
822b73
%endif
822b73
822b73
Name:           zstd
0bfc88
Version:        1.4.4
0bfc88
Release:        1%{?dist}
822b73
Summary:        Zstd compression library
822b73
822b73
License:        BSD and GPLv2
822b73
URL:            https://github.com/facebook/zstd
822b73
Source0:        https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
822b73
822b73
Patch1:         pzstd.1.patch
822b73
822b73
BuildRequires:  gcc gtest-devel
822b73
%if %{with pzstd}
822b73
BuildRequires:  gcc-c++
822b73
%endif
822b73
822b73
%description
822b73
Zstd, short for Zstandard, is a fast lossless compression algorithm,
822b73
targeting real-time compression scenarios at zlib-level compression ratio.
822b73
822b73
%package -n lib%{name}
822b73
Summary:        Zstd shared library
822b73
822b73
%description -n lib%{name}
822b73
Zstandard compression shared library.
822b73
822b73
%package -n lib%{name}-devel
822b73
Summary:        Header files for Zstd library
822b73
Requires:       lib%{name}%{?_isa} = %{version}-%{release}
822b73
822b73
%description -n lib%{name}-devel
822b73
Header files for Zstd library.
822b73
822b73
822b73
%prep
822b73
%setup -q
822b73
find -name .gitignore -delete
822b73
%if %{with pzstd}
822b73
%patch1 -p1
822b73
%endif
822b73
822b73
%build
822b73
export CFLAGS="$RPM_OPT_FLAGS"
822b73
export LDFLAGS="$RPM_LD_FLAGS"
822b73
for dir in lib programs; do
822b73
  %make_build -C "$dir"
822b73
done
822b73
%if %{with pzstd}
822b73
export CXXFLAGS="$RPM_OPT_FLAGS -std=c++11"
822b73
%make_build -C contrib/pzstd
822b73
%endif
822b73
822b73
%check
822b73
export CFLAGS="$RPM_OPT_FLAGS"
822b73
export LDFLAGS="$RPM_LD_FLAGS"
822b73
make -C tests test-zstd
822b73
%if %{with pzstd}
822b73
export CXXFLAGS="$RPM_OPT_FLAGS -std=c++11"
822b73
make -C contrib/pzstd test
822b73
%endif
822b73
822b73
%install
822b73
%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir}
822b73
# Don't install the static lib
822b73
rm %{buildroot}%{_libdir}/libzstd.a
822b73
%if %{with pzstd}
822b73
install -D -m755 contrib/pzstd/pzstd %{buildroot}%{_bindir}/pzstd
822b73
install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1
822b73
%endif
822b73
822b73
%files
822b73
%doc CHANGELOG README.md
822b73
%{_bindir}/%{name}
822b73
%if %{with pzstd}
822b73
%{_bindir}/p%{name}
822b73
%{_mandir}/man1/p%{name}.1*
822b73
%endif
822b73
%{_bindir}/%{name}mt
822b73
%{_bindir}/un%{name}
822b73
%{_bindir}/%{name}cat
822b73
%{_bindir}/%{name}grep
822b73
%{_bindir}/%{name}less
822b73
%{_mandir}/man1/%{name}.1*
822b73
%{_mandir}/man1/un%{name}.1*
822b73
%{_mandir}/man1/%{name}cat.1*
822b73
%{_mandir}/man1/%{name}grep.1*
822b73
%{_mandir}/man1/%{name}less.1*
822b73
%license COPYING LICENSE
822b73
822b73
%files -n lib%{name}
822b73
%{_libdir}/libzstd.so.*
822b73
%license COPYING LICENSE
822b73
822b73
%files -n lib%{name}-devel
822b73
%{_includedir}/zbuff.h
822b73
%{_includedir}/zdict.h
822b73
%{_includedir}/zstd.h
822b73
%{_includedir}/zstd_errors.h
822b73
%{_libdir}/pkgconfig/libzstd.pc
822b73
%{_libdir}/libzstd.so
822b73
822b73
%ldconfig_scriptlets -n lib%{name}
822b73
822b73
%changelog
0bfc88
* Thu Jun 4 2020 Jakub Martisko <jamartis@redhat.com> - 1.4.4-1
0bfc88
- Rebase to 1.4.4
0bfc88
Resolvese: 1807452
0bfc88
822b73
* Tue Oct 15 2019 Jakub Martisko <jamartis@redhat.com> - 1.4.2-2
822b73
- Add some basic gating tests
822b73
822b73
* Tue Oct 15 2019 Jakub Martisko <jamartis@redhat.com> - 1.4.2-1
822b73
- Initial rhel commit
822b73
822b73
* Wed Jul 31 2019 Pádraig Brady <P@draigBrady.com> - 1.4.2-1
822b73
- Latest upstream
822b73
822b73
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.0-2
822b73
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
822b73
822b73
* Mon Apr 29 2019 Pádraig Brady <P@draigBrady.com> - 1.4.0-1
822b73
- Latest upstream
822b73
822b73
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.8-2
822b73
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
822b73
822b73
* Mon Dec 31 2018 Pádraig Brady <P@draigBrady.com> - 1.3.8-1
822b73
- Latest upstream
822b73
822b73
* Mon Oct 08 2018 Pádraig Brady <P@draigBrady.com> - 1.3.6-1
822b73
- Latest upstream
822b73
822b73
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.5-2
822b73
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
822b73
822b73
* Mon Jul 02 2018 Pádraig Brady <P@draigBrady.com> - 1.3.5.1
822b73
- Latest upstream
822b73
822b73
* Wed Mar 28 2018 Pádraig Brady <P@draigBrady.com> - 1.3.4-1
822b73
- Latest upstream
822b73
822b73
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.3-3
822b73
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
822b73
822b73
* Fri Feb 02 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 1.3.3-2
822b73
- Switch to %%ldconfig_scriptlets
822b73
822b73
* Thu Dec 21 2017 Pádraig Brady <P@draigBrady.com> - 1.3.3-1
822b73
- Latest upstream
822b73
822b73
* Fri Nov 10 2017 Pádraig Brady <P@draigBrady.com> - 1.3.2-1
822b73
- Latest upstream
822b73
822b73
* Mon Aug 21 2017 Pádraig Brady <P@draigBrady.com> - 1.3.1-1
822b73
- Latest upstream
822b73
822b73
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-3
822b73
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
822b73
822b73
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.0-2
822b73
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
822b73
822b73
* Sun Jul 16 2017 Pádraig Brady <P@draigBrady.com> - 1.3.0-1
822b73
- Latest upstream
822b73
822b73
* Mon May 08 2017 Pádraig Brady <P@draigBrady.com> - 1.2.0-1
822b73
- Latest upstream
822b73
822b73
* Mon Mar 06 2017 Pádraig Brady <P@draigBrady.com> - 1.1.3-1
822b73
- Latest upstream
822b73
822b73
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.1-2
822b73
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
822b73
822b73
* Wed Nov 02 2016 Pádraig Brady <pbrady@redhat.com> - 1.1.1-1
822b73
- Latest upstream
822b73
822b73
* Thu Oct 6  2016 Pádraig Brady <pbrady@fb.com> 1.1.0-2
822b73
- Add pzstd(1)
822b73
822b73
* Thu Sep 29 2016 Pádraig Brady <pbrady@fb.com> 1.1.0-1
822b73
- New upstream release
822b73
- Remove examples and static lib
822b73
822b73
* Mon Sep 12 2016 Pádraig Brady <pbrady@fb.com> 1.0.0-2
822b73
- Adjust various upstream links
822b73
- Parameterize various items in spec file
822b73
822b73
* Mon Sep 5 2016 Pádraig Brady <pbrady@fb.com> 1.0.0-1
822b73
- Initial release