From ec56d6a700656a68af9ca4650423b42a036cee99 Mon Sep 17 00:00:00 2001
From: Sandro Mani <manisandro(a)gmail.com>
Date: Dec 31 2017 19:09:03 +0000
Subject: Update to 1.4.0
---
diff --git a/.gitignore b/.gitignore
index 712c057..a29eb86 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@ libzip-0.9.tar.gz
/libzip-1.2.0.tar.xz
/libzip-1.3.0.tar.xz
/libzip-1.3.2.tar.xz
+/libzip-1.4.0.tar.xz
diff --git a/libzip_cmake.patch b/libzip_cmake.patch
new file mode 100644
index 0000000..3242936
--- /dev/null
+++ b/libzip_cmake.patch
@@ -0,0 +1,31 @@
+diff -rupN libzip-1.4.0/lib/CMakeLists.txt libzip-1.4.0-new/lib/CMakeLists.txt
+--- libzip-1.4.0/lib/CMakeLists.txt 2017-12-29 13:37:22.000000000 +0100
++++ libzip-1.4.0-new/lib/CMakeLists.txt 2017-12-31 19:43:28.235775853 +0100
+@@ -201,6 +201,10 @@ ENDIF(NOT HAVE_MKSTEMP)
+
+ ADD_LIBRARY(zip ${LIBZIP_SOURCES} ${LIBZIP_EXTRA_FILES} ${LIBZIP_OPSYS_FILES})
+ SET_TARGET_PROPERTIES(zip PROPERTIES VERSION 5.0 SOVERSION 5)
++IF(MINGW)
++ GET_TARGET_PROPERTY(ZIP_SOVERSION zip SOVERSION)
++ SET_TARGET_PROPERTIES(zip PROPERTIES SUFFIX
"-${ZIP_SOVERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}")
++ENDIF(MINGW)
+ TARGET_LINK_LIBRARIES(zip ${ZLIB_LIBRARY} ${OPTIONAL_LIBRARY})
+ INSTALL(TARGETS zip
+ RUNTIME DESTINATION bin
+diff -rupN libzip-1.4.0/regress/CMakeLists.txt libzip-1.4.0-new/regress/CMakeLists.txt
+--- libzip-1.4.0/regress/CMakeLists.txt 2017-12-29 13:37:22.000000000 +0100
++++ libzip-1.4.0-new/regress/CMakeLists.txt 2017-12-31 19:44:19.822772999 +0100
+@@ -32,9 +32,10 @@ ADD_EXECUTABLE(ziptool_regress ziptool_r
+ TARGET_LINK_LIBRARIES(ziptool_regress zip)
+
+ ADD_LIBRARY(malloc MODULE malloc.c)
+-TARGET_LINK_LIBRARIES(malloc ${CMAKE_DL_LIBS})
+-ADD_LIBRARY(nonrandomopen MODULE nonrandomopen.c)
+-TARGET_LINK_LIBRARIES(nonrandomopen ${CMAKE_DL_LIBS})
++TARGET_LINK_LIBRARIES(malloc dl)
++ADD_LIBRARY(nonrandomopen STATIC nonrandomopen.c)
++TARGET_LINK_LIBRARIES(nonrandomopen dl)
++TARGET_LINK_LIBRARIES(nonrandomopentest nonrandomopen)
+
+ FOREACH(PROGRAM ${GETOPT_USERS})
+ ADD_EXECUTABLE(${PROGRAM} ${PROGRAM}.c ${SRC_EXTRA_FILES})
diff --git a/mingw-libzip.spec b/mingw-libzip.spec
index ee4d3ed..d630fe6 100644
--- a/mingw-libzip.spec
+++ b/mingw-libzip.spec
@@ -3,7 +3,7 @@
%global pkgname libzip
Name: mingw-%{pkgname}
-Version: 1.3.2
+Version: 1.4.0
Release: 1%{?dist}
Summary: C library for reading, creating, and modifying zip archives
@@ -13,20 +13,29 @@ URL:
http://www.nih.at/libzip/index.html
Source0:
http://www.nih.at/libzip/%{pkgname}-%{version}.tar.xz
# Don't use compatibility macro for open on MinGW, the regular open can be used
Patch0: libzip_open.patch
+# CMake fixes:
+# - Add soversion suffix, as was the case previously with autotools build
+# - Workaround CMAKE_DL_LIBS not defined on MINGW
(
https://gitlab.kitware.com/cmake/cmake/issues/17600)
+# - Fix nonrandomopentest non linked to nonrandomopen
+Patch1: libzip_cmake.patch
+BuildRequires: cmake
BuildRequires: perl
+BuildRequires: libzip-tools
BuildRequires: mingw32-filesystem >= 95
BuildRequires: mingw32-gcc
BuildRequires: mingw32-binutils
-BuildRequires: mingw32-zlib >= 1.1.2
BuildRequires: mingw32-bzip2
+BuildRequires: mingw32-dlfcn
+BuildRequires: mingw32-zlib >= 1.1.2
BuildRequires: mingw64-filesystem >= 95
BuildRequires: mingw64-gcc
BuildRequires: mingw64-binutils
-BuildRequires: mingw64-zlib >= 1.1.2
BuildRequires: mingw64-bzip2
+BuildRequires: mingw64-dlfcn
+BuildRequires: mingw64-zlib >= 1.1.2
%description
@@ -64,13 +73,12 @@ The API is documented by man pages.
%build
-%mingw_configure --disable-static
+%mingw_cmake
%mingw_make %{?_smp_mflags}
%install
%mingw_make install DESTDIR=%{buildroot}
-find %{buildroot} -name '*.la' -delete
# Remove files we don't need
rm -r %{buildroot}%{mingw32_datadir}/*
@@ -101,6 +109,9 @@ rm -r %{buildroot}%{mingw64_datadir}/*
%changelog
+* Sun Dec 31 2017 Sandro Mani <manisandro(a)gmail.com> - 1.4.0-1
+- Update to 1.4.0
+
* Tue Nov 21 2017 Sandro Mani <manisandro(a)gmail.com> - 1.3.2-1
- Update to 1.3.2
diff --git a/sources b/sources
index 28dc1ae..ba7ea10 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (libzip-1.3.2.tar.xz) =
d7b678c4a39f7bc33f90febac1b42230eac4d414e835dab7d3458a81f047482cee9ee65b6374bdf8abbf5a33c23725e8771da51300ba92ddc6728b570caec255
+SHA512 (libzip-1.4.0.tar.xz) =
125e4de8b02781023f9bed450747b9c36942cbf41de7a863402786d1c7b848e19b425f4b0c26ab3857c6bbfd8571bcd9cb1434df355c59148db54f1b951f5c56
https://src.fedoraproject.org/rpms/mingw-libzip/c/ec56d6a700656a68af9ca46...