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,
%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
%{_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