qat-zstd-plugin/qat-zstd-plugin.spec
Vladislav Dronov a1a501b979 Update to qat-zstd-plugin 1.0.0 @ 1e8b930c
... (RHEL-72905)
- NUMA node aware mem allocations and other Code optimizations
- Bug Fixes and Static analysis Fixes (OpenScanhub and Latest Coverity)
- Support ZSTD v1.5.7 and README refactor
- Spec file updates for RPM Packaging

Resolves: RHEL-72905

Signed-off-by: Vladislav Dronov <vdronov@redhat.com>
2026-02-02 13:55:35 +01:00

95 lines
3.7 KiB
RPMSpec

# SPDX-License-Identifier: MIT
Name: qat-zstd-plugin
Version: 1.0.0
Release: %autorelease
Summary: Intel QuickAssist Technology ZSTD Plugin
License: BSD-3-Clause
URL: https://github.com/intel/QAT-ZSTD-Plugin
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
Patch0: test.patch
Patch1: rh-makefile.patch
BuildRequires: automake
BuildRequires: gcc
BuildRequires: libzstd-devel
BuildRequires: qatlib-devel
BuildRequires: numactl-devel
# Upstream only supports x86_64
ExclusiveArch: x86_64
%description
Intel QuickAssist Technology ZSTD is a plugin to Zstandard for accelerating
compression by QAT. ZSTD* is a fast lossless compression algorithm, targeting
real-time compression scenarios at zlib-level and better compression ratios.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and header files for
applications that use %{name}.
%package static
Summary: Static library for %{name}
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
%description static
The %{name}-static package contains the static %{name} library.
%prep
%autosetup -p1 -n QAT-ZSTD-Plugin-%{version}
# fedora/rhel path fixes
sed -i -e 's|/usr/local|%{_prefix}|g' src/Makefile
sed -i -e 's|$(PREFIX)/lib|%{_libdir}|g' src/Makefile
sed -i -e 's|$(PREFIX)/include|%{_includedir}|g' src/Makefile
%build
# c9s build system quickfix BEGIN
CFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
export CFLAGS
CXXFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection'
export CXXFLAGS
FFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
export FFLAGS
FCFLAGS='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -I/usr/lib64/gfortran/modules'
export FCFLAGS
LDFLAGS='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 '
export LDFLAGS
LT_SYS_LIBRARY_PATH=/usr/lib64:
export LT_SYS_LIBRARY_PATH
CC=gcc
export CC
CXX=g++
export CXX
# c9s build system quickfix END
%make_build LDFLAGS="$LDFLAGS -lzstd"
make test
%install
%make_install
%check
LD_LIBRARY_PATH=%{buildroot}%{_libdir} ./test/test README.md
%files
%license LICENSE
%{_libdir}/libqatseqprod.so.1
%{_libdir}/libqatseqprod.so.%{version}
%files devel
%{_includedir}/qatseqprod.h
%{_libdir}/libqatseqprod.so
%files static
%license LICENSE
%{_libdir}/libqatseqprod.a
%changelog
%autochangelog