zstd/zstd.spec

111 lines
2.7 KiB
RPMSpec
Raw Normal View History

2018-06-21 18:06:17 +10:00
%define oname zstd
%define major 1
%define libname %mklibname %{oname} %{major}
%define devname %mklibname %{oname} -d
2020-04-12 19:55:36 +00:00
# static libraries are used by qemu. Please don't disable them.
%define sdevname %mklibname %{name} -d -s
2018-06-21 10:14:25 +03:00
2018-06-21 18:06:17 +10:00
%bcond_with tests
2018-06-21 10:14:25 +03:00
2018-06-21 18:06:17 +10:00
Summary: Zstd compression library
Name: zstd
2020-06-22 10:30:19 +00:00
Version: 1.4.5
Release: 1
2018-06-21 18:06:17 +10:00
License: BSD and GPLv2+
Group: Archiving/Compression
Url: http://www.zstd.net/
Source0: https://github.com/facebook/zstd/archive/v%{version}/%{name}-%{version}.tar.gz
2020-04-12 19:55:36 +00:00
Patch0: zstd-1.3.4-multi-thread-default.patch
2018-06-21 18:06:17 +10:00
BuildRequires: gtest-devel
2020-04-12 19:55:36 +00:00
BuildRequires: pkgconfig(liblz4)
BuildRequires: pkgconfig(liblzma)
BuildRequires: pkgconfig(zlib)
BuildRequires: cmake
BuildRequires: ninja
2018-06-21 10:14:25 +03:00
%description
Zstd, short for Zstandard, is a fast lossless compression algorithm,
targeting real-time compression scenarios at zlib-level compression ratio.
%files
%{_bindir}/%{name}
%{_bindir}/%{name}cat
%{_bindir}/%{name}grep
%{_bindir}/%{name}less
%{_bindir}/%{name}mt
2018-06-21 10:14:25 +03:00
%{_bindir}/p%{name}
%{_bindir}/un%{name}
2020-04-12 19:55:36 +00:00
%{_mandir}/man1/*
2018-06-21 10:14:25 +03:00
#----------------------------------------------------------------------------
%package -n %{libname}
2018-06-21 18:06:17 +10:00
Summary: Zstd shared library
2018-06-21 10:14:25 +03:00
Group: System/Libraries
2018-06-21 18:06:17 +10:00
2018-06-21 10:14:25 +03:00
%description -n %{libname}
Zstandard compression shared library.
%files -n %{libname}
2018-06-21 18:06:17 +10:00
%{_libdir}/libzstd.so.%{major}*
2018-06-21 10:14:25 +03:00
#----------------------------------------------------------------------------
2018-06-21 18:06:17 +10:00
%package -n %{devname}
Summary: Header files for Zstd library
2018-06-21 10:14:25 +03:00
Group: Development/C
2018-06-21 18:06:17 +10:00
Requires: %{libname} = %{EVRD}
Provides: %{name}-devel = %{EVRD}
2018-06-21 10:14:25 +03:00
2018-06-21 18:06:17 +10:00
%description -n %{devname}
2018-06-21 10:14:25 +03:00
Header files for Zstd library.
2018-06-21 18:06:17 +10:00
%files -n %{devname}
2020-04-12 19:55:36 +00:00
%doc %{_docdir}/zstd
%{_includedir}/*.h
2018-06-21 10:14:25 +03:00
%{_libdir}/pkgconfig/libzstd.pc
%{_libdir}/libzstd.so
2020-06-22 10:30:19 +00:00
%{_libdir}/cmake/%{name}/*.cmake
2018-06-21 10:14:25 +03:00
#----------------------------------------------------------------------------
2020-04-12 19:55:36 +00:00
%package -n %{sdevname}
Summary: Static libraries for zstd
Group: Development/C
Requires: %{devname} = %{version}-%{release}
%description -n %{sdevname}
Static library for zstd.
%files -n %{sdevname}
%{_libdir}/libzstd.a
#----------------------------------------------------------------------------
2018-06-21 10:14:25 +03:00
%prep
2020-04-12 19:55:36 +00:00
%autosetup -p1
# Get rid of -L/usr/lib insanity
sed -i -e 's,-L\${libdir} ,,g' lib/*.pc.in
sed -i -e '/^Cflags:/d' lib/*.pc.in
2018-06-21 10:14:25 +03:00
find -name .gitignore -delete
%build
2020-04-12 19:55:36 +00:00
%set_build_flags
pushd build/cmake
%cmake -DZSTD_BUILD_CONTRIB:BOOL=ON \
-DZSTD_LEGACY_SUPPORT:BOOL=ON \
-DZSTD_LZ4_SUPPORT:BOOL=ON \
-DZSTD_LZMA_SUPPORT:BOOL=ON \
-DZSTD_PROGRAMS_LINK_SHARED:BOOL=ON \
-DZSTD_ZLIB_SUPPORT:BOOL=ON -G Ninja
%ninja_build
popd
2018-06-21 10:14:25 +03:00
%install
2020-04-12 19:55:36 +00:00
pushd build/cmake
%ninja_install -C build
install -m 755 build/contrib/pzstd/pzstd %{buildroot}%{_bindir}/
install -D -m644 build/programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1
popd