diff --git a/libzip-1.9.2.tar.xz b/libzip-1.9.2.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..44a4f4b35c277ea7fec9647360bae2edc452f526 Binary files /dev/null and b/libzip-1.9.2.tar.xz differ diff --git a/libzip.spec b/libzip.spec new file mode 100644 index 0000000000000000000000000000000000000000..77bfb5027e2478e9b7902fc50750d6d6bc83f88f --- /dev/null +++ b/libzip.spec @@ -0,0 +1,139 @@ +%define anolis_release 1 +%bcond_without tests + +Name: libzip +Version: 1.9.2 +Release: %{anolis_release}%{dist} +Summary: C library for reading, creating, and modifying zip archives + +License: BSD +URL: https://libzip.org/ +Source0: https://libzip.org/download/libzip-%{version}.tar.xz + +BuildRequires: gcc +BuildRequires: zlib-devel +BuildRequires: bzip2-devel +BuildRequires: openssl-devel +BuildRequires: xz-devel +BuildRequires: libzstd-devel +BuildRequires: cmake >= 3.0.2 +# Needed to run the test suite +# find regress/ -type f | /usr/lib/rpm/perl.req +# find regress/ -type f | /usr/lib/rpm/perl.prov +BuildRequires: perl-interpreter +BuildRequires: perl(Cwd) +BuildRequires: perl(File::Copy) +BuildRequires: perl(File::Path) +BuildRequires: perl(Getopt::Long) +BuildRequires: perl(IPC::Open3) +BuildRequires: perl(Storable) +BuildRequires: perl(Symbol) +BuildRequires: perl(UNIVERSAL) +BuildRequires: perl(strict) +BuildRequires: perl(warnings) + +%description +libzip is a C library for reading, creating, and modifying zip archives. Files +can be added from data buffers, files, or compressed data copied directly from +other zip archives. Changes made without closing the archive can be reverted. +The API is documented by man pages. + +%package devel +Summary: Development files for %{name} +Requires: %{name} = %{version}-%{release} + +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + +%package tools +Summary: Command line tools from %{name} +Requires: %{name} = %{version}-%{release} + +%description tools +The %{name}-tools package provides command line tools split off %{name}: +- zipcmp +- zipmerge +- ziptool + +%package doc +Summary: Documentation files for %{name} +Requires: %{name} = %{EVR} +BuildArch: noarch + +%description doc +The %{name}-doc package contains documentation files for %{name}. + +%prep +%autosetup -p1 + +# unwanted in package documentation +rm INSTALL.md + +# drop skipped test which make test suite fails (cmake issue ?) +sed -e '/clone-fs-/d' \ + -i regress/CMakeLists.txt + +%build +%cmake \ + -DENABLE_COMMONCRYPTO:BOOL=OFF \ + -DENABLE_GNUTLS:BOOL=OFF \ + -DENABLE_MBEDTLS:BOOL=OFF \ + -DENABLE_OPENSSL:BOOL=ON \ + -DENABLE_WINDOWS_CRYPTO:BOOL=OFF \ + -DENABLE_BZIP2:BOOL=ON \ + -DENABLE_LZMA:BOOL=ON \ + -DENABLE_ZSTD:BOOL=ON \ + -DBUILD_TOOLS:BOOL=ON \ + -DBUILD_REGRESS:BOOL=ON \ + -DBUILD_EXAMPLES:BOOL=OFF \ + -DBUILD_DOC:BOOL=ON + +%cmake_build + +%install +%cmake_install + +%check +%if %{with tests} +%ctest +%else +: Test suite disabled +%endif + +%generate_compatibility_deps + +%files +%license LICENSE +%{_libdir}/libzip.so.5* + +%dir %{abidir} +%{abidir}/libzip.dump + +%files tools +%{_bindir}/zipcmp +%{_bindir}/zipmerge +%{_bindir}/ziptool +%{_mandir}/man1/zip* + +%{abidir}/zipcmp-option.list +%{abidir}/zipmerge-option.list +%{abidir}/ziptool-option.list + +%files devel +%doc AUTHORS THANKS *.md +%{_includedir}/zip.h +%{_includedir}/zipconf*.h +%{_libdir}/libzip.so +%{_libdir}/pkgconfig/libzip.pc +%{_libdir}/cmake/libzip +%{_mandir}/man3/libzip* +%{_mandir}/man3/zip* +%{_mandir}/man3/ZIP* + +%files doc +%doc AUTHORS README.md + +%changelog +* Mon Mar 27 2023 Zhongling He - 1.9.2-1 +- Init package from upstream