public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Remi Collet <rcollet@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/php] private-php86: improve system libzip patch to use pkg-config
Date: Fri, 27 Nov 2026 07:25:35 GMT	[thread overview]
Message-ID: <179576433531.1.10190796223326225066.rpms-php-0b66d1f76add@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/php
Branch : private-php86
Commit : 0b66d1f76add03b04f1a148283eb87238c721930
Author : Remi Collet <rcollet@redhat.com>
Date   : 2012-11-14T14:34:16+01:00
Stats  : +26/-12 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/php/c/0b66d1f76add03b04f1a148283eb87238c721930?branch=private-php86

Log:
improve system libzip patch to use pkg-config

---
diff --git a/php-5.4.5-system-libzip.patch b/php-5.4.5-system-libzip.patch
index a347a2f..897fb87 100644
--- a/php-5.4.5-system-libzip.patch
+++ b/php-5.4.5-system-libzip.patch
@@ -1,7 +1,7 @@
 diff -up php-5.4.5RC1/ext/zip/config.m4.systzip php-5.4.5RC1/ext/zip/config.m4
 --- php-5.4.5RC1/ext/zip/config.m4.systzip	2012-07-04 07:43:14.000000000 +0200
 +++ php-5.4.5RC1/ext/zip/config.m4	2012-07-07 15:56:41.418171233 +0200
-@@ -13,65 +13,105 @@ fi
+@@ -13,65 +13,116 @@
  PHP_ARG_WITH(pcre-dir, pcre install prefix,
  [  --with-pcre-dir           ZIP: pcre install prefix], no, no)
  
@@ -18,22 +18,34 @@ diff -up php-5.4.5RC1/ext/zip/config.m4.systzip php-5.4.5RC1/ext/zip/config.m4
 -      PHP_ZLIB_INCDIR="$PHP_ZLIB_DIR/include"
 +if test "$PHP_ZIP" != "no"; then
 +  if test "$PHP_LIBZIP" != "no"; then
++
++    AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
++
 +    dnl system libzip, depends on libzip
++    AC_MSG_CHECKING(for libzip)
 +    if test -r $PHP_LIBZIP/include/zip.h; then
-+      LIBZIP_DIR=$PHP_LIBZIP
++      LIBZIP_CFLAGS="-I$PHP_LIBZIP/include"
++      LIBZIP_LIBDIR="$PHP_LIBZIP/$PHP_LIBDIR"
++      AC_MSG_RESULT(from option: found in $PHP_LIBZIP)
++
++    elif test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libzip; then
++      LIBZIP_CFLAGS=`$PKG_CONFIG libzip --cflags`
++      LIBZIP_LIBDIR=`$PKG_CONFIG libzip --variable=libdir`
++      AC_MSG_RESULT(from pkgconfig: found in $LIBZIP_LIBDIR)
++
      else
 -      AC_MSG_ERROR([Can not find zlib headers under "$PHP_ZLIB_DIR"])
-+      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)
++          LIBZIP_CFLAGS="-I$i/include"
++          LIBZIP_LIBDIR="$i/$PHP_LIBDIR"
++          AC_MSG_RESULT(in default path: found in $i)
 +          break
 +        fi
 +      done
 +    fi
 +
-+    if test -z "$LIBZIP_DIR"; then
++    if test -z "$LIBZIP_LIBDIR"; then
 +      AC_MSG_RESULT(not found)
 +      AC_MSG_ERROR(Please reinstall the libzip distribution)
      fi
@@ -41,17 +53,16 @@ diff -up php-5.4.5RC1/ext/zip/config.m4.systzip php-5.4.5RC1/ext/zip/config.m4
 +    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, ZIP_SHARED_LIBADD)
++      PHP_ADD_LIBRARY_WITH_PATH(zip, $LIBZIP_LIBDIR, ZIP_SHARED_LIBADD)
 +      AC_DEFINE(HAVE_LIBZIP,1,[ ])
 +    ], [
 +      AC_MSG_ERROR(could not find usable libzip)
 +    ], [
-+      -L$LIBZIP_DIR/$PHP_LIBDIR
++      -L$LIBZIP_LIBDIR
 +    ])
 +
 +    AC_DEFINE(HAVE_ZIP,1,[ ]) 
-+    PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c, $ext_shared)
++    PHP_NEW_EXTENSION(zip, php_zip.c zip_stream.c, $ext_shared,, $LIBZIP_CFLAGS)
 +    PHP_SUBST(ZIP_SHARED_LIBADD)
    else
 -    for i in /usr/local /usr; do
@@ -149,7 +160,7 @@ diff -up php-5.4.5RC1/ext/zip/config.m4.systzip php-5.4.5RC1/ext/zip/config.m4
                           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 \
-@@ -98,10 +138,11 @@ yes
+@@ -98,10 +149,11 @@
  						 lib/zip_source_open.c lib/zip_source_pkware.c lib/zip_source_pop.c \
  						 lib/zip_source_read.c lib/zip_source_stat.c"
  

diff --git a/php.spec b/php.spec
index 0975357..5e0639d 100644
--- a/php.spec
+++ b/php.spec
@@ -58,7 +58,7 @@
 Summary: PHP scripting language for creating dynamic web sites
 Name: php
 Version: 5.4.9
-Release: 0.2.%{rcver}%{?dist}
+Release: 0.3.%{rcver}%{?dist}
 # All files licensed under PHP version 3.01, except
 # Zend is licensed under Zend
 # TSRM is licensed under BSD
@@ -1409,6 +1409,9 @@ fi
 
 
 %changelog
+* Wed Nov 14 2012 Remi Collet <rcollet@redhat.com> 5.4.9-0.3.RC1
+- improve system libzip patch to use pkg-config
+
 * Wed Nov 14 2012 Remi Collet <rcollet@redhat.com> 5.4.9-0.2.RC1
 - use _httpd_moddir macro
 

                 reply	other threads:[~2026-11-27  7:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179576433531.1.10190796223326225066.rpms-php-0b66d1f76add@fedoraproject.org \
    --to=rcollet@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox