Adjust cmake build 23/265423/2 accepted/tizen_7.0_base accepted/tizen_7.0_base_hotfix accepted/tizen_7.0_base_tool accepted/tizen_7.0_base_tool_hotfix sandbox/backup/zstd_1.4.5_20230110 tizen_7.0_base tizen_7.0_base_hotfix accepted/tizen/7.0/base/20230714.003154 accepted/tizen/7.0/base/hotfix/20230714.004003 accepted/tizen/7.0/base/tool/20221028.120725 accepted/tizen/7.0/base/tool/hotfix/20221115.084801 accepted/tizen/base/tool/20211115.010806 submit/tizen_7.0_base/20221028.201301 submit/tizen_7.0_base_hotfix/20221115.161701 submit/tizen_base/20211111.001758 tizen_7.0_m2_release
authorDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 19 Oct 2021 06:17:24 +0000 (15:17 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Tue, 19 Oct 2021 06:18:40 +0000 (15:18 +0900)
- support zstd cmake build
- include zstd archive file

Change-Id: Ie38be39efb548d112903f816dd9f827499dd28ce

packaging/zstd.spec

index f71befb..078139a 100644 (file)
@@ -27,6 +27,7 @@ Group:          Productivity/Archiving/Compression
 Url:            https://github.com/facebook/zstd
 Source0:        https://github.com/facebook/zstd/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 BuildRequires:  pkgconfig
+BuildRequires:  cmake
 
 %description
 Zstd, short for Zstandard, is a lossless compression algorithm,
@@ -64,24 +65,26 @@ Needed for compiling programs that link with the library.
 %setup -q
 
 %build
-for dir in lib programs; do
-  CFLAGS="%{optflags}" make %{?_smp_mflags} -C "$dir"
-done
-
-%post -n %{libname} -p /sbin/ldconfig
-%postun -n %{libname} -p /sbin/ldconfig
+pushd build/cmake
+%{cmake} ./
+%{__make}
+popd
 
 %install
-make install DESTDIR=$RPM_BUILD_ROOT \
-                       INSTALL="%{__install} -p" \
-                       PREFIX=%{_prefix} \
-                       LIBDIR=%{_libdir}
-rm -f %{buildroot}%{_libdir}/libzstd.a
+pushd build/cmake
+%{__make} DESTDIR=%{?buildroot:%{buildroot}} \
+        INSTALL_ROOT=%{?buildroot:%{buildroot}} \
+        install
+popd
+
 %remove_docs
 
 # %check
 # CFLAGS="%{optflags}" make %{?_smp_mflags} -C tests test-zstd
 
+%post -n %{libname} -p /sbin/ldconfig
+%postun -n %{libname} -p /sbin/ldconfig
+
 %files
 %license COPYING LICENSE
 %{_bindir}/zstd
@@ -101,6 +104,9 @@ rm -f %{buildroot}%{_libdir}/libzstd.a
 %{_includedir}/zdict.h
 %{_includedir}/zstd.h
 %{_includedir}/zstd_errors.h
+%{_includedir}/cover.h
 %{_libdir}/pkgconfig/libzstd.pc
 %{_libdir}/libzstd.so
+%{_libdir}/libzstd.a
+%{_libdir}/cmake/%{name}/*.cmake