diff --git a/zstd.spec b/zstd.spec index 29748a87c795526d48f911034533a867a9151eec..e88e79e7a1995dee56f37d9ac1c29bcceacd0aaf 100644 --- a/zstd.spec +++ b/zstd.spec @@ -1,4 +1,4 @@ -%define anolis_release 2 +%define anolis_release 3 %bcond_without asm %bcond_without lz4 @@ -22,7 +22,7 @@ Source0: https://github.com/facebook/zstd/releases/download/v%{version}/% Patch1: pzstd.1.patch Patch2: enable-CET.patch -BuildRequires: make +BuildRequires: make cmake BuildRequires: gcc gtest-devel %if %{with lz4} BuildRequires: lz4-devel @@ -90,9 +90,30 @@ export CXXFLAGS="$RPM_OPT_FLAGS" %make_build -C contrib/pzstd %{!?with_asm:ZSTD_NO_ASM=1} %endif +cd build/cmake +mkdir builddir +cd builddir +cmake .. +make + +%install +%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} +%if %{with pzstd} +install -D -m755 contrib/pzstd/pzstd %{buildroot}%{_bindir}/pzstd +install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 +%endif + +pushd build/cmake/builddir +mkdir cmake_install_dir +make install DESTDIR=./cmake_install_dir +mkdir -p %{buildroot}/%{_libdir}/cmake/zstd +cp -r cmake_install_dir/usr/local/lib64/cmake/zstd/*.cmake %{buildroot}/%{_libdir}/cmake/zstd/ +popd + +%generate_compatibility_deps + %check execstack lib/libzstd.so.1 - export CFLAGS="$RPM_OPT_FLAGS" export LDFLAGS="$RPM_LD_FLAGS" make -C tests test-zstd @@ -101,16 +122,9 @@ export CXXFLAGS="$RPM_OPT_FLAGS" make -C contrib/pzstd test %endif -%install -%make_install PREFIX=%{_prefix} LIBDIR=%{_libdir} -%if %{with pzstd} -install -D -m755 contrib/pzstd/pzstd %{buildroot}%{_bindir}/pzstd -install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 -%endif - -%generate_compatibility_deps %files +%license COPYING LICENSE %{_bindir}/%{name} %if %{with pzstd} %{_bindir}/p%{name} @@ -128,16 +142,15 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %{_mandir}/man1/%{name}cat.1* %{_mandir}/man1/%{name}grep.1* %{_mandir}/man1/%{name}less.1* -%license COPYING LICENSE %files doc %doc CHANGELOG README.md %files -n lib%{name} +%license COPYING LICENSE %dir %{abidir} %{_libdir}/libzstd.so.* %{abidir}/libzstd.dump -%license COPYING LICENSE %files -n lib%{name}-devel %{_includedir}/zdict.h @@ -145,6 +158,7 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %{_includedir}/zstd_errors.h %{_libdir}/pkgconfig/libzstd.pc %{_libdir}/libzstd.so +%{_libdir}/cmake/zstd/ %files -n lib%{name}-static %{_libdir}/libzstd.a @@ -152,6 +166,9 @@ install -D -m644 programs/%{name}.1 %{buildroot}%{_mandir}/man1/p%{name}.1 %ldconfig_scriptlets -n lib%{name} %changelog +* Fri Nov 11 2022 happy_orange - 1.5.2-3 +- add cmake files in devel package + * Wed Oct 19 2022 mgb01105731 - 1.5.2-2 - optimise spec file & add doc package