mirror of
https://abf.rosa.ru/djam/zstd.git
synced 2025-02-22 17:02:52 +00:00
118 lines
2.9 KiB
RPMSpec
118 lines
2.9 KiB
RPMSpec
%define oname zstd
|
|
%define major 1
|
|
%define libname %mklibname %{oname} %{major}
|
|
%define devname %mklibname %{oname} -d
|
|
# static libraries are used by qemu. Please don't disable them.
|
|
%define sdevname %mklibname %{name} -d -s
|
|
|
|
%bcond_with tests
|
|
|
|
Summary: Zstd compression library
|
|
Name: zstd
|
|
Version: 1.5.7
|
|
Release: 1
|
|
License: BSD and GPLv2+
|
|
Group: Archiving/Compression
|
|
URL: https://github.com/facebook/zstd
|
|
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
|
|
BuildRequires: gtest-devel
|
|
BuildRequires: pkgconfig(liblz4)
|
|
BuildRequires: pkgconfig(liblzma)
|
|
BuildRequires: pkgconfig(zlib)
|
|
BuildRequires: pkgconfig(openssl3.3)
|
|
BuildRequires: cmake
|
|
BuildRequires: ninja
|
|
|
|
%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
|
|
%{_bindir}/p%{name}
|
|
%{_bindir}/un%{name}
|
|
%{_mandir}/man1/*
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
%package -n %{libname}
|
|
Summary: Zstd shared library
|
|
Group: System/Libraries
|
|
|
|
%description -n %{libname}
|
|
Zstandard compression shared library.
|
|
|
|
%files -n %{libname}
|
|
%{_libdir}/libzstd.so.%{major}*
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
%package -n %{devname}
|
|
Summary: Header files for Zstd library
|
|
Group: Development/C
|
|
Requires: %{libname} = %{EVRD}
|
|
Provides: %{name}-devel = %{EVRD}
|
|
|
|
%description -n %{devname}
|
|
Header files for Zstd library.
|
|
|
|
%files -n %{devname}
|
|
%doc %{_docdir}/zstd
|
|
%{_includedir}/*.h
|
|
%{_libdir}/pkgconfig/libzstd.pc
|
|
%{_libdir}/libzstd.so
|
|
%{_libdir}/cmake/%{name}/*.cmake
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
%package -n %{sdevname}
|
|
Summary: Static libraries for zstd
|
|
Group: Development/C
|
|
Requires: %{devname} = %{version}-%{release}
|
|
Provides: %{name}-static-devel = %{EVRD}
|
|
|
|
%description -n %{sdevname}
|
|
Static library for zstd.
|
|
|
|
%files -n %{sdevname}
|
|
%{_libdir}/libzstd.a
|
|
|
|
#----------------------------------------------------------------------------
|
|
|
|
%prep
|
|
%setup -q
|
|
# 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
|
|
find -name .gitignore -delete
|
|
# Don't use obsolete standards
|
|
# https://github.com/facebook/zstd/issues/3163
|
|
sed -i -e 's,c99,gnu2a,g' build/cmake/CMakeModules/AddZstdCompilationFlags.cmake
|
|
|
|
%build
|
|
%set_build_flags
|
|
%ifarch %{riscv}
|
|
export LDFLAGS="%{ldflags} -latomic"
|
|
%endif
|
|
|
|
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
|
|
|
|
%install
|
|
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
|