| 1 | %bcond_without tests
|
|---|
| 2 |
|
|---|
| 3 | Name: libzip
|
|---|
| 4 | Version: 1.7.3
|
|---|
| 5 | Release: 1%{?dist}
|
|---|
| 6 | Summary: C library for reading, creating, and modifying zip archives
|
|---|
| 7 |
|
|---|
| 8 | License: BSD
|
|---|
| 9 | URL: https://libzip.org/
|
|---|
| 10 | %if !0%{?os2_version}
|
|---|
| 11 | Source0: https://libzip.org/download/libzip-%{version}.tar.xz
|
|---|
| 12 | %else
|
|---|
| 13 | %scm_source github https://github.com/TeLLie/libzip-os2 master
|
|---|
| 14 | %endif
|
|---|
| 15 |
|
|---|
| 16 | BuildRequires: gcc
|
|---|
| 17 | BuildRequires: zlib-devel
|
|---|
| 18 | BuildRequires: bzip2-devel
|
|---|
| 19 | BuildRequires: openssl-devel
|
|---|
| 20 | BuildRequires: xz-devel
|
|---|
| 21 | BuildRequires: cmake >= 3.0.2
|
|---|
| 22 | # Needed to run the test suite
|
|---|
| 23 | # find regress/ -type f | /usr/lib/rpm/perl.req
|
|---|
| 24 | # find regress/ -type f | /usr/lib/rpm/perl.prov
|
|---|
| 25 | %if !0%{?os2_version}
|
|---|
| 26 | BuildRequires: perl-interpreter
|
|---|
| 27 | %endif
|
|---|
| 28 | BuildRequires: perl(Cwd)
|
|---|
| 29 | BuildRequires: perl(File::Copy)
|
|---|
| 30 | BuildRequires: perl(File::Path)
|
|---|
| 31 | BuildRequires: perl(Getopt::Long)
|
|---|
| 32 | BuildRequires: perl(IPC::Open3)
|
|---|
| 33 | BuildRequires: perl(Storable)
|
|---|
| 34 | BuildRequires: perl(Symbol)
|
|---|
| 35 | BuildRequires: perl(UNIVERSAL)
|
|---|
| 36 | BuildRequires: perl(strict)
|
|---|
| 37 | BuildRequires: perl(warnings)
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 | %description
|
|---|
| 41 | libzip is a C library for reading, creating, and modifying zip archives. Files
|
|---|
| 42 | can be added from data buffers, files, or compressed data copied directly from
|
|---|
| 43 | other zip archives. Changes made without closing the archive can be reverted.
|
|---|
| 44 | The API is documented by man pages.
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 | %package devel
|
|---|
| 48 | Summary: Development files for %{name}
|
|---|
| 49 | Requires: %{name}%{?_isa} = %{version}-%{release}
|
|---|
| 50 |
|
|---|
| 51 | %description devel
|
|---|
| 52 | The %{name}-devel package contains libraries and header files for
|
|---|
| 53 | developing applications that use %{name}.
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 | %package tools
|
|---|
| 57 | Summary: Command line tools from %{name}
|
|---|
| 58 | Requires: %{name}%{?_isa} = %{version}-%{release}
|
|---|
| 59 |
|
|---|
| 60 | %description tools
|
|---|
| 61 | The %{name}-tools package provides command line tools split off %{name}:
|
|---|
| 62 | - zipcmp
|
|---|
| 63 | - zipmerge
|
|---|
| 64 | - ziptool
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 | %prep
|
|---|
| 68 | %if !0%{?os2_version}
|
|---|
| 69 | %autosetup -p1
|
|---|
| 70 | %else
|
|---|
| 71 | %scm_setup
|
|---|
| 72 | %endif
|
|---|
| 73 |
|
|---|
| 74 | # unwanted in package documentation
|
|---|
| 75 | rm INSTALL.md
|
|---|
| 76 |
|
|---|
| 77 | # drop skipped test which make test suite fails (cmake issue ?)
|
|---|
| 78 | sed -e '/clone-fs-/d' \
|
|---|
| 79 | -i regress/CMakeLists.txt
|
|---|
| 80 |
|
|---|
| 81 | %build
|
|---|
| 82 | mkdir builder
|
|---|
| 83 | cd builder
|
|---|
| 84 |
|
|---|
| 85 | export LDFLAGS="-Zhigh-mem -Zomf -Zargs-wild -Zargs-resp"
|
|---|
| 86 | export LIBS="-lcx"
|
|---|
| 87 |
|
|---|
| 88 | %cmake .. \
|
|---|
| 89 | -DENABLE_COMMONCRYPTO:BOOL=ON \
|
|---|
| 90 | -DENABLE_GNUTLS:BOOL=OFF \
|
|---|
| 91 | -DENABLE_MBEDTLS:BOOL=OFF \
|
|---|
| 92 | -DENABLE_OPENSSL:BOOL=ON \
|
|---|
| 93 | -DENABLE_WINDOWS_CRYPTO:BOOL=OFF \
|
|---|
| 94 | -DENABLE_BZIP2:BOOL=ON \
|
|---|
| 95 | -DENABLE_LZMA:BOOL=ON \
|
|---|
| 96 | -DBUILD_TOOLS:BOOL=ON \
|
|---|
| 97 | -DBUILD_REGRESS:BOOL=ON \
|
|---|
| 98 | -DBUILD_EXAMPLES:BOOL=OFF \
|
|---|
| 99 | -DBUILD_DOC:BOOL=ON
|
|---|
| 100 |
|
|---|
| 101 | %if !0%{?os2_version}
|
|---|
| 102 | %cmake_build
|
|---|
| 103 | %else
|
|---|
| 104 | make %{?_smp_mflags}
|
|---|
| 105 | %endif
|
|---|
| 106 |
|
|---|
| 107 | %install
|
|---|
| 108 | %if !0%{?os2_version}
|
|---|
| 109 | %cmake_install
|
|---|
| 110 | %else
|
|---|
| 111 | %make_install -C builder
|
|---|
| 112 | mkdir -p %{buildroot}%{_mandir}/man1
|
|---|
| 113 | mkdir -p %{buildroot}%{_mandir}/man3
|
|---|
| 114 | cp -p builder/man/zip*.1 %{buildroot}%{_mandir}/man1/
|
|---|
| 115 | cp -p builder/man/zip*.3 %{buildroot}%{_mandir}/man3/
|
|---|
| 116 | %endif
|
|---|
| 117 |
|
|---|
| 118 |
|
|---|
| 119 | %check
|
|---|
| 120 | %if %{with tests} && !0%{?os2_version}
|
|---|
| 121 | %ctest
|
|---|
| 122 | %else
|
|---|
| 123 | : Test suite disabled
|
|---|
| 124 | %endif
|
|---|
| 125 |
|
|---|
| 126 | %if !0%{?os2_version}
|
|---|
| 127 | %ldconfig_scriptlets
|
|---|
| 128 | %endif
|
|---|
| 129 |
|
|---|
| 130 | %files
|
|---|
| 131 | %license LICENSE
|
|---|
| 132 | %if !0%{?os2_version}
|
|---|
| 133 | %{_libdir}/libzip.so.5*
|
|---|
| 134 | %else
|
|---|
| 135 | %{_libdir}/*.dll
|
|---|
| 136 | %endif
|
|---|
| 137 |
|
|---|
| 138 | %files tools
|
|---|
| 139 | %if !0%{?os2_version}
|
|---|
| 140 | %{_bindir}/zipcmp
|
|---|
| 141 | %{_bindir}/zipmerge
|
|---|
| 142 | %{_bindir}/ziptool
|
|---|
| 143 | %else
|
|---|
| 144 | %{_bindir}/zipcmp.exe
|
|---|
| 145 | %{_bindir}/zipmerge.exe
|
|---|
| 146 | %{_bindir}/ziptool.exe
|
|---|
| 147 | %endif
|
|---|
| 148 | %{_mandir}/man1/zip*.1*
|
|---|
| 149 |
|
|---|
| 150 | %files devel
|
|---|
| 151 | %doc AUTHORS THANKS *.md
|
|---|
| 152 | %doc %{_docdir}/%{name}/libzip/*.html
|
|---|
| 153 | %{_includedir}/zip.h
|
|---|
| 154 | %{_includedir}/zipconf*.h
|
|---|
| 155 | %if !0%{?os2_version}
|
|---|
| 156 | %{_libdir}/libzip.so
|
|---|
| 157 | %else
|
|---|
| 158 | %{_libdir}/*.a
|
|---|
| 159 | %endif
|
|---|
| 160 | %{_libdir}/pkgconfig/libzip.pc
|
|---|
| 161 | %{_libdir}/cmake/libzip
|
|---|
| 162 | %if !0%{?os2_version}
|
|---|
| 163 | %{_mandir}/man3/libzip*
|
|---|
| 164 | %{_mandir}/man3/zip*
|
|---|
| 165 | %{_mandir}/man3/ZIP*
|
|---|
| 166 | %else
|
|---|
| 167 | %{_mandir}/man3/*.3*
|
|---|
| 168 | %endif
|
|---|
| 169 |
|
|---|
| 170 | %changelog
|
|---|
| 171 | * Sat Dec 19 2020 Elbert Pol <elbert.pol@gmail.com> - 1.7.3-1
|
|---|
| 172 | - First rpm for OS2
|
|---|
| 173 | - Add o_binary for OS2
|
|---|