# # spec file for package zstd # # Copyright (c) 2016 SUSE LINUX 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 http://bugs.opensuse.org/ # Name: zstd %define major 1 %define libname lib%{name}%{major} Version: %{major}.1.0 Release: 0 Summary: Zstandard compression tools License: BSD-3-Clause and MIT Group: Productivity/Archiving/Compression Url: https://github.com/facebook/zstd Source0: https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz # PATCH-FIX-UPSTREAM -- https://github.com/pixelb/zstd/pull/1 Patch0: zstd-lib-no-rebuild.patch BuildRequires: gcc BuildRequires: pkgconfig BuildRoot: %{_tmppath}/%{name}-%{version}-build %description Zstd, short for Zstandard, is a lossless compression algorithm, targeting real-time compression scenarios at zlib-level compression ratio. Zstd can also offer stronger compression ratios at the cost of compression speed. Speed vs. compression trade-off is configurable by small increments. Decompression speed is preserved and remains roughly the same at all settings, a property shared by most LZ compression algorithms, such as zlib or lzma. %package -n %{libname} Summary: Zstd compression library Group: Productivity/Archiving/Compression %description -n %{libname} Zstd, short for Zstandard, is a lossless compression algorithm, targeting real-time compression scenarios at zlib-level compression ratio. This subpackage contains the implementation as a shared library. %package -n lib%{name}-devel Summary: Development files for the Zstd compression library Group: Development/Libraries/C and C++ Requires: %{libname} = %{version} Requires: glibc-devel %description -n lib%{name}-devel Zstd, short for Zstandard, is a lossless compression algorithm, targeting real-time compression scenarios at zlib-level compression ratio. Needed for compiling programs that link with the library. %prep %setup -q find -name .gitignore -delete %patch0 -p1 %build for dir in lib programs; do CFLAGS="%{optflags}" make %{?_smp_mflags} -C "$dir" done %check CFLAGS="%{optflags}" make %{?_smp_mflags} -C tests test-zstd %install %make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} rm %{buildroot}/%{_libdir}/libzstd.a %files %defattr(-,root,root,-) %doc NEWS README.md %{_bindir}/%{name} %{_bindir}/un%{name} %{_bindir}/%{name}cat %{_mandir}/man1/%{name}.1* %{_mandir}/man1/un%{name}.1* %{_mandir}/man1/%{name}cat.1* %doc LICENSE PATENTS %files -n %{libname} %defattr(-,root,root,-) %{_libdir}/libzstd.so.* %doc LICENSE PATENTS %files -n lib%{name}-devel %defattr(-,root,root,-) %{_includedir}/zbuff.h %{_includedir}/zdict.h %{_includedir}/zstd.h %{_libdir}/pkgconfig/libzstd.pc %{_libdir}/libzstd.so %post -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig %changelog