[php/f17] - update to 5.4.9 - switch back to upstream generated scanner/parser - use _httpd_contentdir macro a

Remi Collet remi at fedoraproject.org
Thu Nov 22 09:50:26 UTC 2012


commit 757d8e15c97db68f454ee0a6017dc4d523b35ec2
Author: Remi Collet <remi at fedoraproject.org>
Date:   Thu Nov 22 10:49:40 2012 +0100

    - update to 5.4.9
    - switch back to upstream generated scanner/parser
    - use _httpd_contentdir macro and fix php.gif path
    - improve system libzip patch to use pkg-config
    - use _httpd_moddir macro
    - apply ldap_r patch on fedora >= 18 only

 .gitignore                    |    1 +
 php-5.4.5-system-libzip.patch |   33 +++++++++++++++++++---------
 php.spec                      |   46 ++++++++++++++++++++++++-----------------
 sources                       |    2 +-
 4 files changed, 51 insertions(+), 31 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e0f8f3a..67d4000 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,3 +6,4 @@ php-5.3*.bz2
 /php-5.4.6.tar.bz2
 /php-5.4.7.tar.bz2
 /php-5.4.8.tar.bz2
+/php-5.4.9.tar.bz2
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 c6f6654..6f5a6ce 100644
--- a/php.spec
+++ b/php.spec
@@ -1,4 +1,3 @@
-%global contentdir  /var/www
 # API/ABI check
 %global apiver      20100412
 %global zendver     20100525
@@ -35,6 +34,8 @@
 %{!?_httpd_confdir:    %{expand: %%global _httpd_confdir    %%{_sysconfdir}/httpd/conf.d}}
 # /etc/httpd/conf.d with httpd < 2.4 and defined as /etc/httpd/conf.modules.d with httpd >= 2.4
 %{!?_httpd_modconfdir: %{expand: %%global _httpd_modconfdir %%{_sysconfdir}/httpd/conf.d}}
+%{!?_httpd_moddir:     %{expand: %%global _httpd_moddir %%{_libdir}/httpd/modules}}
+%{!?_httpd_contentdir: %{expand: %%global _httpd_contentdir /var/www}}
 
 %if 0%{?fedora} < 17 && 0%{?rhel} < 7
 %global with_zip     0
@@ -54,8 +55,8 @@
 
 Summary: PHP scripting language for creating dynamic web sites
 Name: php
-Version: 5.4.8
-Release: 6%{?dist}
+Version: 5.4.9
+Release: 1%{?dist}
 # All files licensed under PHP version 3.01, except
 # Zend is licensed under Zend
 # TSRM is licensed under BSD
@@ -114,7 +115,6 @@ BuildRequires: zlib-devel, smtpdaemon, libedit-devel
 BuildRequires: pcre-devel >= 6.6
 BuildRequires: bzip2, perl, libtool >= 1.4.3, gcc-c++
 BuildRequires: libtool-ltdl-devel
-BuildRequires: bison
 %if %{with_libzip}
 BuildRequires: libzip-devel >= 0.10
 %endif
@@ -133,13 +133,10 @@ Requires(pre): httpd
 
 
 # Don't provides extensions, which are not shared library, as .so
-# RPM 4.8
 %{?filter_provides_in: %filter_provides_in %{_libdir}/php/modules/.*\.so$}
 %{?filter_provides_in: %filter_provides_in %{_libdir}/php-zts/modules/.*\.so$}
+%{?filter_provides_in: %filter_provides_in %{_httpd_moddir}/.*\.so$}
 %{?filter_setup}
-# RPM 4.9
-%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}%{_libdir}/php/modules/.*\\.so$
-%global __provides_exclude_from %{__provides_exclude_from}|%{_libdir}/php-zts/modules/.*\\.so$
 
 
 %description
@@ -675,7 +672,9 @@ support for using the enchant library to PHP.
 %if %{with_libzip}
 %patch44 -p1 -b .systzip
 %endif
+%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
 %patch45 -p1 -b .ldap_r
+%endif
 
 # Prevent %%doc confusion over LICENSE files
 cp Zend/LICENSE Zend/ZEND_LICENSE
@@ -805,8 +804,9 @@ PEAR_INSTALLDIR=%{_datadir}/pear; export PEAR_INSTALLDIR
 
 # Shell function to configure and build a PHP tree.
 build() {
-# bison-1.875-2 seems to produce a broken parser; workaround.
-# mkdir Zend && cp ../Zend/zend_{language,ini}_{parser,scanner}.[ch] Zend
+# Old/recent bison version seems to produce a broken parser;
+# upstream uses GNU Bison 2.3. Workaround:
+mkdir Zend && cp ../Zend/zend_{language,ini}_{parser,scanner}.[ch] Zend
 ln -sf ../configure
 %configure \
 	--cache-file=../config.cache \
@@ -1107,18 +1107,18 @@ make -C build-apache install-modules \
 # Install the default configuration file and icons
 install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/
 install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
-install -m 755 -d $RPM_BUILD_ROOT%{contentdir}/icons
-install -m 644 php.gif $RPM_BUILD_ROOT%{contentdir}/icons/php.gif
+install -m 755 -d $RPM_BUILD_ROOT%{_httpd_contentdir}/icons
+install -m 644 php.gif $RPM_BUILD_ROOT%{_httpd_contentdir}/icons/php.gif
 
 # For third-party packaging:
 install -m 755 -d $RPM_BUILD_ROOT%{_datadir}/php
 
 # install the DSO
-install -m 755 -d $RPM_BUILD_ROOT%{_libdir}/httpd/modules
-install -m 755 build-apache/libs/libphp5.so $RPM_BUILD_ROOT%{_libdir}/httpd/modules
+install -m 755 -d $RPM_BUILD_ROOT%{_httpd_moddir}
+install -m 755 build-apache/libs/libphp5.so $RPM_BUILD_ROOT%{_httpd_moddir}
 
 # install the ZTS DSO
-install -m 755 build-zts/libs/libphp5.so $RPM_BUILD_ROOT%{_libdir}/httpd/modules/libphp5-zts.so
+install -m 755 build-zts/libs/libphp5.so $RPM_BUILD_ROOT%{_httpd_moddir}/libphp5-zts.so
 
 # Apache config fragment
 %if "%{_httpd_modconfdir}" == "%{_httpd_confdir}"
@@ -1247,7 +1247,7 @@ getent group  apache >/dev/null || \
   groupadd -g 48 -r apache
 getent passwd apache >/dev/null || \
   useradd -r -u 48 -g apache -s /sbin/nologin \
-    -d %{contentdir} -c "Apache" apache
+    -d %{_httpd_contentdir} -c "Apache" apache
 exit 0
 
 %post fpm
@@ -1302,14 +1302,14 @@ fi
 %postun embedded -p /sbin/ldconfig
 
 %files
-%{_libdir}/httpd/modules/libphp5.so
-%{_libdir}/httpd/modules/libphp5-zts.so
+%{_httpd_moddir}/libphp5.so
+%{_httpd_moddir}/libphp5-zts.so
 %attr(0770,root,apache) %dir %{_localstatedir}/lib/php/session
 %config(noreplace) %{_httpd_confdir}/php.conf
 %if "%{_httpd_modconfdir}" != "%{_httpd_confdir}"
 %config(noreplace) %{_httpd_modconfdir}/10-php.conf
 %endif
-%{contentdir}/icons/php.gif
+%{_httpd_contentdir}/icons/php.gif
 
 %files common -f files.common
 %doc CODING_STANDARDS CREDITS EXTENSIONS LICENSE NEWS README*
@@ -1407,6 +1407,14 @@ fi
 
 
 %changelog
+* Thu Nov 22 2012 Remi Collet <rcollet at redhat.com> 5.4.9-1
+- update to 5.4.9
+- switch back to upstream generated scanner/parser
+- use _httpd_contentdir macro and fix php.gif path
+- improve system libzip patch to use pkg-config
+- use _httpd_moddir macro
+- apply ldap_r patch on fedora >= 18 only
+
 * Fri Nov  9 2012 Remi Collet <rcollet at redhat.com> 5.4.8-6
 - clarify Licenses
 - missing provides xmlreader and xmlwriter
diff --git a/sources b/sources
index 54445d2..7e3983c 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-bb8c816a9299be8995255ef70c63b800  php-5.4.8.tar.bz2
+076a9f84d861d3f664a2878d5773ba78  php-5.4.9.tar.bz2


More information about the scm-commits mailing list