]> git.pld-linux.org Git - packages/php.git/commitdiff
- use system libzip in zip extension auto/th/php-5_3_8-5
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 26 Sep 2011 21:33:08 +0000 (21:33 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    php.spec -> 1.954
    system-libzip.patch -> 1.1

php.spec
system-libzip.patch [new file with mode: 0644]

index 23c4f87013337bcbd81f200233ffdae042e629b7..cfd6e0593f54791f57c7eaa79ffe930c61a39912 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -109,7 +109,7 @@ ERROR: You need to select at least one Apache SAPI to build shared modules.
 %undefine      with_filter
 %endif
 
-%define                rel     4
+%define                rel     5
 Summary:       PHP: Hypertext Preprocessor
 Summary(fr.UTF-8):     Le langage de script embarque-HTML PHP
 Summary(pl.UTF-8):     Język skryptowy PHP
@@ -194,6 +194,8 @@ Patch61:    %{name}-krb5-ac.patch
 Patch62:       mcrypt-libs.patch
 Patch63:       %{name}-mysql-nowarning.patch
 Patch64:       %{name}-m4.patch
+# http://spot.fedorapeople.org/php-5.3.6-libzip.patch
+Patch65:       system-libzip.patch
 URL:           http://www.php.net/
 %{?with_interbase:%{!?with_interbase_inst:BuildRequires:       Firebird-devel >= 1.0.2.908-2}}
 %{?with_pspell:BuildRequires:  aspell-devel >= 2:0.50.0}
@@ -208,6 +210,7 @@ BuildRequires:      elfutils-devel
 #BuildRequires:        fcgi-devel
 #BuildRequires:        flex
 %{?with_kerberos5:BuildRequires:       heimdal-devel}
+BuildRequires: libzip-devel >= 0.10-3
 BuildRequires: mysql-devel
 BuildRequires: pkgconfig
 BuildRequires: sed >= 4.0
@@ -1790,6 +1793,7 @@ Summary(pl.UTF-8):        Zarządzanie archiwami zip
 Group:         Libraries
 URL:           http://www.php.net/manual/en/book.zip.php
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
+Requires:      libzip >= 0.10-3
 Provides:      php(zip)
 Obsoletes:     php-pecl-zip
 
@@ -1886,6 +1890,7 @@ cp -p php.ini-production php.ini
 %patch62 -p1
 %patch63 -p1
 %patch64 -p1
+%patch65 -p1
 %{__rm} -r sapi/litespeed
 gzip -dc %{SOURCE15} | tar xf - -C sapi/
 
@@ -2133,6 +2138,7 @@ for sapi in $sapis; do
        --with-xsl=shared \
        --with-zlib=shared \
        --with-zlib-dir=shared,/usr \
+       --with-libzip \
        --enable-zip=shared,/usr \
 
        # save for debug
diff --git a/system-libzip.patch b/system-libzip.patch
new file mode 100644 (file)
index 0000000..9aad49d
--- /dev/null
@@ -0,0 +1,79 @@
+
+https://bugzilla.redhat.com/show_bug.cgi?id=551513
+https://bugs.php.net/bug.php?id=39388
+http://spot.fedorapeople.org/php-5.3.6-libzip.patch
+
+diff -up php-5.3.6/ext/zip/config.m4.libzip php-5.3.6/ext/zip/config.m4
+--- php-5.3.6/ext/zip/config.m4.libzip 2008-08-08 05:47:15.000000000 -0400
++++ php-5.3.6/ext/zip/config.m4        2011-07-20 15:21:05.759490602 -0400
+@@ -15,6 +15,9 @@ PHP_ARG_WITH(pcre-dir, pcre install pref
+ if test "$PHP_ZIP" != "no"; then
++  PHP_ARG_WITH(libzip, libzip,
++  [  --with-libzip[=DIR]     Use libzip], no, no)
++
+   if test "$PHP_ZLIB_DIR" != "no" && test "$PHP_ZLIB_DIR" != "yes"; then
+     if test -f "$PHP_ZLIB_DIR/include/zlib/zlib.h"; then
+       PHP_ZLIB_DIR="$PHP_ZLIB_DIR"
+@@ -71,7 +74,43 @@ yes
+   ])
+   CPPFLAGS=$old_CPPFLAGS
+-  PHP_ZIP_SOURCES="$PHP_ZIP_SOURCES lib/zip_add.c lib/zip_error.c lib/zip_fclose.c \
++  if test "$PHP_LIBZIP" != "no"; then
++    if test -r $PHP_LIBZIP/include/zip.h; then
++      LIBZIP_DIR=$PHP_LIBZIP
++    else
++      AC_MSG_CHECKING(for libzip in default path)
++      for i in /usr/local /usr; do
++        if test -r $i/include/zip.h; then
++          LIBZIP_DIR=$i
++          AC_MSG_RESULT(found in $i)
++          break
++        fi
++      done
++    fi
++
++    if test -z "$LIBZIP_DIR"; then
++      AC_MSG_RESULT(not found)
++      AC_MSG_ERROR(Please reinstall the libzip distribution)
++    fi
++
++    dnl Could not think of a simple way to check libzip for overwrite support
++    PHP_CHECK_LIBRARY(zip, zip_open,
++    [
++      PHP_ADD_INCLUDE($LIBZIP_DIR/include)
++      PHP_ADD_LIBRARY_WITH_PATH(zip, $LIBZIP_DIR/$PHP_LIBDIR, LIBZIP_SHARED_LIBADD)
++      AC_DEFINE(HAVE_LIBZIP,1,[ ])
++    ], [
++      AC_MSG_ERROR(could not find usable libzip)
++    ], [
++      -L$LIBZIP_DIR/$PHP_LIBDIR
++    ])
++
++    AC_DEFINE(HAVE_ZIP,1,[ ])
++    PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c, $ext_shared)
++    PHP_SUBST(LIBZIP_SHARED_LIBADD)
++    PHP_SUBST(ZIP_SHARED_LIBADD)
++  else
++    PHP_ZIP_SOURCES="$PHP_ZIP_SOURCES lib/zip_add.c lib/zip_error.c lib/zip_fclose.c \
+                          lib/zip_fread.c lib/zip_open.c lib/zip_source_filep.c  \
+                          lib/zip_strerror.c lib/zip_close.c lib/zip_error_get.c \
+                          lib/zip_file_error_get.c lib/zip_free.c lib/zip_rename.c \
+@@ -91,10 +130,11 @@ yes
+                          lib/zip_unchange_archive.c lib/zip_memdup.c lib/zip_stat_init.c lib/zip_add_dir.c \
+                          lib/zip_error_clear.c lib/zip_file_error_clear.c"
+-  AC_DEFINE(HAVE_ZIP,1,[ ])
+-  PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared)
+-  PHP_ADD_BUILD_DIR($ext_builddir/lib, 1)
+-  PHP_SUBST(ZIP_SHARED_LIBADD)
++    AC_DEFINE(HAVE_ZIP,1,[ ])
++    PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c $PHP_ZIP_SOURCES, $ext_shared)
++    PHP_ADD_BUILD_DIR($ext_builddir/lib, 1)
++    PHP_SUBST(ZIP_SHARED_LIBADD)
++  fi
+   dnl so we always include the known-good working hack.
+   PHP_ADD_MAKEFILE_FRAGMENT
This page took 0.047476 seconds and 4 git commands to generate.