revert cmake change,

because we do not want to add it into Ring0 / Bootstrap.

OBS-URL: https://build.opensuse.org/package/show/Archiving/zstd?expand=0&rev=87
This commit is contained in:
Bernhard M. Wiedemann 2023-04-24 13:44:36 +00:00 committed by Git OBS Bridge
parent 4172bf1c18
commit 596f53d820
2 changed files with 13 additions and 30 deletions

View File

@ -1,9 +1,3 @@
-------------------------------------------------------------------
Sun Apr 16 12:03:54 UTC 2023 - Hillwood Yang <hillwood@opensuse.org>
- Build it by cmake
- Add missing cmake profiles
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Apr 13 11:15:39 UTC 2023 - Dirk Müller <dmueller@suse.com> Thu Apr 13 11:15:39 UTC 2023 - Dirk Müller <dmueller@suse.com>

View File

@ -29,7 +29,6 @@ Source1: https://github.com/facebook/zstd/releases/download/v%{version}/%
Source2: zstd.keyring Source2: zstd.keyring
Source99: baselibs.conf Source99: baselibs.conf
Patch1: pzstd.1.patch Patch1: pzstd.1.patch
BuildRequires: cmake
BuildRequires: gcc BuildRequires: gcc
# C++ is needed for pzstd only # C++ is needed for pzstd only
BuildRequires: gcc-c++ BuildRequires: gcc-c++
@ -103,37 +102,30 @@ an optimized deflate/zlib handling.
%prep %prep
%autosetup -p1 %autosetup -p1
sed -i '/build static library to build tests/d' build/cmake/CMakeLists.txt
sed -i 's/libzstd_static/libzstd_shared/g' build/cmake/tests/CMakeLists.txt
%build %build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects %global _lto_cflags %{_lto_cflags} -ffat-lto-objects
export CFLAGS="%{optflags}" export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags} -std=c++11" export CXXFLAGS="%{optflags} -std=c++11"
cd build/cmake # lib-mt is alias for multi-threaded library support
%cmake \ %make_build HAVE_ZLIB=1 prefix=%{_prefix} libdir=%{_libdir} -C lib lib-mt
-DCMAKE_BUILD_TYPE=None \ for dir in programs contrib/pzstd; do
-DCMAKE_INSTALL_PREFIX=%{_prefix} \ %make_build -C "$dir"
-DZSTD_ZLIB_SUPPORT=ON \ done
-DZSTD_LZMA_SUPPORT=OFF \
-DZSTD_LZ4_SUPPORT=OFF \
-DZSTD_BUILD_CONTRIB=ON \
-DZSTD_BUILD_STATIC=ON \
-DZSTD_BUILD_TESTS=ON \
-DZSTD_PROGRAMS_LINK_SHARED=ON
%cmake_build
%check %check
export CFLAGS="%{optflags}" export CFLAGS="%{optflags}"
export CXXFLAGS="%{optflags} -std=c++11" export CXXFLAGS="%{optflags} -std=c++11"
%make_build -C tests test-zstd %make_build -C tests test-zstd
#make_build -C contrib/pzstd test-pzstd
%install %install
cd build/cmake %make_install V=1 VERBOSE=1 prefix=%{_prefix} libdir=%{_libdir}
%cmake_install install -D -m755 contrib/pzstd/pzstd %{buildroot}%{_bindir}/pzstd
ln -sf %{_bindir}/zstd %{buildroot}%{_bindir}/gzip install -D -m644 programs/zstd.1 %{buildroot}%{_mandir}/man1/pzstd.1
ln -sf %{_bindir}/zstd %{buildroot}%{_bindir}/gunzip ln -s zstd %{buildroot}/%{_bindir}/gzip
ln -sf %{_bindir}/zstdcat %{buildroot}%{_bindir}/zcat ln -s zstd %{buildroot}/%{_bindir}/gunzip
ln -s zstdcat %{buildroot}/%{_bindir}/zcat
%post -n %{libname} -p /sbin/ldconfig %post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig
@ -141,8 +133,6 @@ ln -sf %{_bindir}/zstdcat %{buildroot}%{_bindir}/zcat
%files %files
%license COPYING LICENSE %license COPYING LICENSE
%doc README.md CHANGELOG %doc README.md CHANGELOG
%dir %{_datadir}/doc/%{name}
%{_datadir}/doc/%{name}/%{name}_manual.html
%{_bindir}/pzstd %{_bindir}/pzstd
%{_bindir}/unzstd %{_bindir}/unzstd
%{_bindir}/zstd %{_bindir}/zstd
@ -154,14 +144,13 @@ ln -sf %{_bindir}/zstdcat %{buildroot}%{_bindir}/zcat
%files -n %{libname} %files -n %{libname}
%license COPYING LICENSE %license COPYING LICENSE
%{_libdir}/libzstd.so.* %{_libdir}/libzstd.so.1*
%files -n lib%{name}-devel %files -n lib%{name}-devel
%license COPYING LICENSE %license COPYING LICENSE
%{_includedir}/*.h %{_includedir}/*.h
%{_libdir}/pkgconfig/libzstd.pc %{_libdir}/pkgconfig/libzstd.pc
%{_libdir}/libzstd.so %{_libdir}/libzstd.so
%{_libdir}/cmake/%{name}
%files -n lib%{name}-devel-static %files -n lib%{name}-devel-static
%{_libdir}/libzstd.a %{_libdir}/libzstd.a