diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4975342 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/libzip-0.10.1.tar.bz2 diff --git a/.libzip.metadata b/.libzip.metadata new file mode 100644 index 0000000..d101b31 --- /dev/null +++ b/.libzip.metadata @@ -0,0 +1 @@ +04be811a1919e1063a1f5210671181b7b5416d45 SOURCES/libzip-0.10.1.tar.bz2 diff --git a/SOURCES/libzip-0.10-php.patch b/SOURCES/libzip-0.10-php.patch new file mode 100644 index 0000000..e3dea35 --- /dev/null +++ b/SOURCES/libzip-0.10-php.patch @@ -0,0 +1,87 @@ +diff -up libzip-0.10/lib/zip_close.c.php libzip-0.10/lib/zip_close.c +--- libzip-0.10/lib/zip_close.c.php 2011-02-20 09:01:03.000000000 -0500 ++++ libzip-0.10/lib/zip_close.c 2012-01-25 18:37:04.188136374 -0500 +@@ -602,13 +602,15 @@ _zip_create_temp_output(struct zip *za, + char *temp; + int tfd; + FILE *tfp; ++ ++ int len = strlen(za->zn) + 8; + +- if ((temp=(char *)malloc(strlen(za->zn)+8)) == NULL) { ++ 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) { + _zip_error_set(&za->error, ZIP_ER_TMPOPEN, errno); +diff -up libzip-0.10/lib/zip_fclose.c.php libzip-0.10/lib/zip_fclose.c +--- libzip-0.10/lib/zip_fclose.c.php 2010-03-08 07:27:48.000000000 -0500 ++++ libzip-0.10/lib/zip_fclose.c 2012-01-25 18:36:22.389542215 -0500 +@@ -47,12 +47,14 @@ zip_fclose(struct zip_file *zf) + 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; +diff -up libzip-0.10/lib/zip.h.php libzip-0.10/lib/zip.h +--- libzip-0.10/lib/zip.h.php 2011-03-04 12:17:43.000000000 -0500 ++++ libzip-0.10/lib/zip.h 2012-01-25 18:36:22.389542215 -0500 +@@ -59,7 +59,7 @@ extern "C" { + #define ZIP_CREATE 1 + #define ZIP_EXCL 2 + #define ZIP_CHECKCONS 4 +- ++#define ZIP_OVERWRITE 8 + + /* flags for zip_name_locate, zip_fopen, zip_stat, ... */ + +diff -up libzip-0.10/lib/zip_open.c.php libzip-0.10/lib/zip_open.c +--- libzip-0.10/lib/zip_open.c.php 2011-03-16 07:18:44.000000000 -0400 ++++ libzip-0.10/lib/zip_open.c 2012-01-25 18:36:22.389542215 -0500 +@@ -61,10 +61,16 @@ ZIP_EXTERN struct zip * + zip_open(const char *fn, int flags, int *zep) + { + FILE *fp; ++ ++ if (flags & ZIP_OVERWRITE) { ++ return _zip_allocate_new(fn, zep); ++ } + + switch (_zip_file_exists(fn, flags, zep)) { + case -1: +- return NULL; ++ if (!(flags & ZIP_OVERWRITE)) { ++ return NULL; ++ } + case 0: + return _zip_allocate_new(fn, zep); + default: +@@ -482,7 +488,7 @@ _zip_file_exists(const char *fn, int fla + } + + if (stat(fn, &st) != 0) { +- if (flags & ZIP_CREATE) ++ if (flags & ZIP_CREATE || flags & ZIP_OVERWRITE) + return 0; + else { + set_error(zep, NULL, ZIP_ER_OPEN); diff --git a/SOURCES/zipconf.h b/SOURCES/zipconf.h new file mode 100644 index 0000000..4de5c8d --- /dev/null +++ b/SOURCES/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 diff --git a/SPECS/libzip.spec b/SPECS/libzip.spec new file mode 100644 index 0000000..0c60a3e --- /dev/null +++ b/SPECS/libzip.spec @@ -0,0 +1,170 @@ + +%define multilib_archs x86_64 %{ix86} ppc64 ppc s390x s390 sparc64 sparcv9 + +Name: libzip +Version: 0.10.1 +Release: 8%{?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 + +#BuildRequires: automake libtool +BuildRequires: zlib-devel + +# to handle multiarch headers, ex from mysql-devel package +Source1: zipconf.h + +# fonctionnal changes from php bundled library +Patch0: libzip-0.10-php.patch + + +%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}%{?_isa} = %{version}-%{release} +%description devel +The %{name}-devel package contains libraries and header files for +developing applications that use %{name}. + + +%prep +%setup -q + +%patch0 -p1 -b .forphp + +# Avoid lib64 rpaths (FIXME: recheck this on newer releases) +%if "%{_libdir}" != "/usr/lib" +sed -i -e 's|"/lib /usr/lib|"/%{_lib} %{_libdir}|' configure +#autoreconf -f -i +%endif + + +%build +%configure \ + --disable-static + +make %{?_smp_mflags} + + +%install + +make install DESTDIR=%{buildroot} INSTALL='install -p' + +## unpackaged files +rm -fv %{buildroot}%{_libdir}/lib*.la + +## FIXME: someday fix consumers of libzip to properly handle +## header @ %%{_libdir}/libzip/include/zipconf.h -- rex +%ifarch %{multilib_archs} +ln -s ../%{_lib}/libzip/include/zipconf.h \ + %{buildroot}%{_includedir}/zipconf-%{__isa_bits}.h +install -D -m644 -p %{SOURCE1} %{buildroot}%{_includedir}/zipconf.h +%else +ln -s ../%{_lib}/libzip/include/zipconf.h \ + %{buildroot}%{_includedir}/zipconf.h +%endif + + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%doc AUTHORS NEWS README THANKS TODO +%{_bindir}/zipcmp +%{_bindir}/zipmerge +%{_bindir}/ziptorrent +%{_libdir}/libzip.so.2* +%{_mandir}/man1/*zip* + +%files devel +%{_includedir}/zip.h +%{_includedir}/zipconf*.h +%dir %{_libdir}/libzip +%{_libdir}/libzip/include +%{_libdir}/libzip.so +%{_libdir}/pkgconfig/libzip.pc +%{_mandir}/man3/*zip* + + +%changelog +* Fri Jan 24 2014 Daniel Mach - 0.10.1-8 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 0.10.1-7 +- Mass rebuild 2013-12-27 + +* Thu Feb 14 2013 Fedora Release Engineering - 0.10.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Mon Oct 15 2012 Remi Collet - 0.10.1-5 +- fix typo in multiarch (#866171) + +* Wed Sep 05 2012 Rex Dieter 0.10.1-4 +- Warning about conflicting contexts for /usr/lib64/libzip/include/zipconf.h versus /usr/include/zipconf-64.h (#853954) + +* Thu Jul 19 2012 Fedora Release Engineering - 0.10.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Tue Jul 10 2012 Rex Dieter 0.10.1-2 +- spec cleanup, better multilib fix + +* Wed Mar 21 2012 Remi Collet - 0.10.1-1 +- update to 0.10.1 (security fix only) +- fixes for CVE-2012-1162 and CVE-2012-1163 + +* Sun Mar 04 2012 Remi Collet - 0.10-2 +- try to fix ARM issue (#799684) + +* Sat Feb 04 2012 Remi Collet - 0.10-1 +- update to 0.10 +- apply patch with changes from php bundled lib (thanks spot) +- handle multiarch headers (ex from MySQL) + +* Fri Jan 13 2012 Fedora Release Engineering - 0.9.3-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Feb 08 2011 Fedora Release Engineering - 0.9.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Thu Feb 04 2010 Kalev Lember - 0.9.3-2 +- Cleaned up pkgconfig deps which are now automatically handled by RPM. + +* Thu Feb 04 2010 Kalev Lember - 0.9.3-1 +- Updated to libzip 0.9.3 + +* Tue Aug 11 2009 Ville Skyttä - 0.9-4 +- Use bzipped upstream tarball. + +* Sat Jul 25 2009 Fedora Release Engineering - 0.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Feb 25 2009 Fedora Release Engineering - 0.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Fri Dec 12 2008 Rex Dieter 0.9-1 +- libzip-0.9 + +* Sat Feb 09 2008 Sebastian Vahl 0.8-5 +- rebuild for new gcc-4.3 + +* Fri Jan 11 2008 Rex Dieter 0.8-4 +- use better workaround for removing rpaths + +* Wed Nov 20 2007 Sebastian Vahl 0.8-3 +- require pkgconfig in devel subpkg +- move api description to devel subpkg +- keep timestamps in %%install +- avoid lib64 rpaths + +* Thu Nov 15 2007 Sebastian Vahl 0.8-2 +- Change License to BSD + +* Thu Nov 15 2007 Sebastian Vahl 0.8-1 +- Initial version for Fedora