From 098af2ee44706eda1d49ace737e4979de35207ca Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 8 Aug 2013 11:51:27 +0200 Subject: libzip 0.11.1 WIP --- libzip-0.11-php.patch | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++ libzip.spec | 13 ++++++---- zipconf.h | 23 ++++++++++++++++++ 3 files changed, 98 insertions(+), 5 deletions(-) create mode 100644 libzip-0.11-php.patch create mode 100644 zipconf.h diff --git a/libzip-0.11-php.patch b/libzip-0.11-php.patch new file mode 100644 index 0000000..dd12de9 --- /dev/null +++ b/libzip-0.11-php.patch @@ -0,0 +1,67 @@ +diff -ru libzip-0.11.1.orig/lib/zip_close.c libzip-0.11.1/lib/zip_close.c +--- libzip-0.11.1.orig/lib/zip_close.c 2013-08-08 11:01:26.000000000 +0200 ++++ libzip-0.11.1/lib/zip_close.c 2013-08-08 11:03:07.000000000 +0200 +@@ -596,18 +596,22 @@ + FILE *tfp; + + if (za->tempdir) { +- if ((temp=(char *)malloc(strlen(za->tempdir)+13)) == NULL) { ++ int len = strlen(za->tempdir)+13; ++ ++ if ((temp=(char *)malloc(len)) == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + return NULL; + } +- sprintf(temp, "%s/.zip.XXXXXX", za->tempdir); ++ snprintf(temp, len, "%s/.zip.XXXXXX", za->tempdir); + } + else { +- if ((temp=(char *)malloc(strlen(za->zn)+8)) == NULL) { ++ int len = strlen(za->zn)+8; ++ ++ if ((temp=(char *)malloc(len)) == NULL) { + _zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + return NULL; + } +- sprintf(temp, "%s.XXXXXX", za->zn); ++ snprintf(temp, len, "%s.XXXXXX", za->zn); + } + + if ((tfd=mkstemp(temp)) == -1) { +diff -ru libzip-0.11.1.orig/lib/zip_fclose.c libzip-0.11.1/lib/zip_fclose.c +--- libzip-0.11.1.orig/lib/zip_fclose.c 2013-08-08 11:01:26.000000000 +0200 ++++ libzip-0.11.1/lib/zip_fclose.c 2013-08-08 11:06:46.000000000 +0200 +@@ -48,14 +48,15 @@ + if (zf->src) + zip_source_free(zf->src); + +- for (i=0; iza->nfile; i++) { +- if (zf->za->file[i] == zf) { +- zf->za->file[i] = zf->za->file[zf->za->nfile-1]; +- zf->za->nfile--; +- break; ++ if (zf->za) { ++ for (i=0; iza->nfile; i++) { ++ if (zf->za->file[i] == zf) { ++ zf->za->file[i] = zf->za->file[zf->za->nfile-1]; ++ zf->za->nfile--; ++ break; ++ } ++ } + } +- } +- + ret = 0; + if (zf->error.zip_err) + ret = zf->error.zip_err; +--- libzip-0.11.1.orig/lib/zip.h 2013-08-08 11:01:26.000000000 +0200 ++++ libzip-0.11.1/lib/zip.h 2013-08-08 11:19:57.000000000 +0200 +@@ -62,6 +62,8 @@ + #define ZIP_EXCL 2 + #define ZIP_CHECKCONS 4 + #define ZIP_TRUNCATE 8 ++/* PHP use this name, same behavior */ ++#define ZIP_OVERWRITE 8 + + + /* flags for zip_name_locate, zip_fopen, zip_stat, ... */ diff --git a/libzip.spec b/libzip.spec index ea5f0fa..c87ba8b 100644 --- a/libzip.spec +++ b/libzip.spec @@ -2,13 +2,13 @@ %define multilib_archs x86_64 %{ix86} ppc64 ppc s390x s390 sparc64 sparcv9 Name: libzip -Version: 0.10.1 -Release: 7%{?dist} +Version: 0.11.1 +Release: 1%{?dist} Summary: C library for reading, creating, and modifying zip archives License: BSD URL: http://www.nih.at/libzip/index.html -Source0: http://www.nih.at/libzip/libzip-%{version}.tar.bz2 +Source0: http://www.nih.at/libzip/libzip-%{version}.tar.xz #BuildRequires: automake libtool BuildRequires: zlib-devel @@ -17,7 +17,7 @@ BuildRequires: zlib-devel Source1: zipconf.h # fonctionnal changes from php bundled library -Patch0: libzip-0.10-php.patch +Patch0: libzip-0.11-php.patch %description @@ -94,6 +94,9 @@ ln -s ../%{_lib}/libzip/include/zipconf.h \ %changelog +* Thu Aug 08 2013 Remi Collet - 0.11.1-1 +- update to 0.11.1 + * Sat Aug 03 2013 Fedora Release Engineering - 0.10.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild @@ -154,7 +157,7 @@ ln -s ../%{_lib}/libzip/include/zipconf.h \ * Fri Jan 11 2008 Rex Dieter 0.8-4 - use better workaround for removing rpaths -* Wed Nov 20 2007 Sebastian Vahl 0.8-3 +* Tue Nov 20 2007 Sebastian Vahl 0.8-3 - require pkgconfig in devel subpkg - move api description to devel subpkg - keep timestamps in %%install diff --git a/zipconf.h b/zipconf.h new file mode 100644 index 0000000..4de5c8d --- /dev/null +++ b/zipconf.h @@ -0,0 +1,23 @@ +/* + * Kluge to support multilib installation of both 32 and 64-bit RPMS: + * we need to arrange that header files that appear in both RPMs are + * identical. Hence, this file is architecture-independent and calls + * in an arch-dependent file that will appear in just one RPM. + * + * To avoid breaking arches not explicitly supported by Fedora, we + * use this indirection file *only* on known multilib arches. + * DO NOT INCLUDE THE NEW FILE DIRECTLY -- ALWAYS INCLUDE THIS ONE INSTEAD. */ + +#ifndef ZIPCONF_MULTILIB_H +#define ZIPCONF_MULTILIB_H + +#include +#if __WORDSIZE == 32 +#include "zipconf-32.h" +#elif __WORDSIZE == 64 +#include "zipconf-64.h" +#else +#error "unexpected value for __WORDSIZE macro" +#endif + +#endif -- cgit