]> git.pld-linux.org Git - packages/php.git/blobdiff - php.spec
- provide versions for fileinfo,phar,zip,json extensions. obsolete pecl package if...
[packages/php.git] / php.spec
index f20d464c6b34552f4747fda7201998caf9517259..6dddd346dcd8e1a9398ef8bf1d1e5732540d7bba 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -32,6 +32,7 @@
 %bcond_with    oci8            # with Oracle oci8 extension module     (BR: proprietary libs)
 %bcond_with    instantclient   # build Oracle oci8 extension module against oracle-instantclient package
 %bcond_with    system_gd       # with system gd (we prefer internal since it enables few more features)
+%bcond_with    system_libzip   # with system libzip (reported broken currently)
 %bcond_without curl            # without CURL extension module
 %bcond_without filter          # without filter extension module
 %bcond_without imap            # without IMAP extension module
@@ -109,7 +110,7 @@ ERROR: You need to select at least one Apache SAPI to build shared modules.
 %undefine      with_filter
 %endif
 
-%define                rel     6
+%define                rel     10
 Summary:       PHP: Hypertext Preprocessor
 Summary(fr.UTF-8):     Le langage de script embarque-HTML PHP
 Summary(pl.UTF-8):     Język skryptowy PHP
@@ -210,7 +211,7 @@ BuildRequires:      elfutils-devel
 #BuildRequires:        fcgi-devel
 #BuildRequires:        flex
 %{?with_kerberos5:BuildRequires:       heimdal-devel}
-BuildRequires: libzip-devel >= 0.10-3
+%{?with_system_libzip:BuildRequires:   libzip-devel >= 0.10-3}
 BuildRequires: mysql-devel
 BuildRequires: pkgconfig
 BuildRequires: sed >= 4.0
@@ -290,6 +291,12 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define                zend_module_api         20090626
 %define                zend_extension_api      220090626
 
+# Extension versions
+%define                fileinfover 1.0.5-dev
+%define                pharver     2.0.1
+%define                zipver      1.9.1
+%define                jsonver     1.2.1
+
 %define                zend_zts                %{!?with_zts:0}%{?with_zts:1}
 %define                php_debug               %{!?debug:0}%{?debug:1}
 
@@ -710,9 +717,9 @@ Group:              Libraries
 URL:           http://www.php.net/manual/en/book.fileinfo.php
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
 Requires:      %{name}-pcre = %{epoch}:%{version}-%{release}
-Provides:      php(fileinfo)
+Provides:      php(fileinfo) = %{fileinfover}
 Obsoletes:     php-mime_magic
-Obsoletes:     php-pecl-fileinfo
+Obsoletes:     php-pecl-fileinfo < %{fileinfover}
 
 %description fileinfo
 This extension allows retrieval of information regarding vast majority
@@ -922,8 +929,8 @@ Summary(pl.UTF-8):  Rozszerzenie C PHP dla serializacji JSON
 Group:         Libraries
 URL:           http://www.php.net/manual/en/book.json.php
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
-Provides:      php(json)
-Obsoletes:     php-pecl-json
+Provides:      php(json) = %{jsonver}
+Obsoletes:     php-pecl-json < %{jsonver}
 
 %description json
 php-json is an extremely fast PHP C extension for JSON (JavaScript
@@ -1328,7 +1335,11 @@ Group:           Libraries
 URL:           http://www.php.net/manual/en/book.phar.php
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
 Requires:      %{name}-spl = %{epoch}:%{version}-%{release}
-Provides:      php(phar)
+# zlib is required by phar program, but as phar cli is optional should the dep be too
+Suggests:      %{name}-zlib
+Suggests:      php-program
+Provides:      php(phar) = %{pharver}
+Obsoletes:     php-pecl-phar < %{pharver}
 
 %description phar
 This is a dynamic shared object (DSO) for PHP that will add phar
@@ -1793,9 +1804,9 @@ 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
+%{?with_system_libzip:Requires:        libzip >= 0.10-3}
+Provides:      php(zip) = %{zipver}
+Obsoletes:     php-pecl-zip < %{zipver}
 
 %description zip
 Zip is an extension to create, modify and read zip files.
@@ -1890,13 +1901,11 @@ cp -p php.ini-production php.ini
 %patch62 -p1
 %patch63 -p1
 %patch64 -p1
-%patch65 -p1
+%{?with_system_libzip:%patch65 -p1}
 %{__rm} -r sapi/litespeed
 gzip -dc %{SOURCE15} | tar xf - -C sapi/
 
-%if "%{pld_release}" != "ac"
 sed -i -e '/PHP_ADD_LIBRARY_WITH_PATH/s#xmlrpc,#xmlrpc-epi,#' ext/xmlrpc/config.m4
-%endif
 
 # cleanup backups after patching
 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
@@ -1960,6 +1969,32 @@ if [ $API != %{zend_extension_api} ]; then
        exit 1
 fi
 
+# Check for some extension version
+ver=$(sed -n '/#define PHP_FILEINFO_VERSION /{s/.* "//;s/".*$//;p}' ext/fileinfo/php_fileinfo.h)
+if test "$ver" != "%{fileinfover}"; then
+       : Error: Upstream FILEINFO version is now ${ver}, expecting %{fileinfover}.
+       : Update the fileinfover macro and rebuild.
+       exit 1
+fi
+ver=$(sed -n '/#define PHP_PHAR_VERSION /{s/.* "//;s/".*$//;p}' ext/phar/php_phar.h)
+if test "$ver" != "%{pharver}"; then
+       : Error: Upstream PHAR version is now ${ver}, expecting %{pharver}.
+       : Update the pharver macro and rebuild.
+       exit 1
+fi
+ver=$(sed -n '/#define PHP_ZIP_VERSION_STRING /{s/.* "//;s/".*$//;p}' ext/zip/php_zip.h)
+if test "$ver" != "%{zipver}"; then
+       : Error: Upstream ZIP version is now ${ver}, expecting %{zipver}.
+       : Update the zipver macro and rebuild.
+       exit 1
+fi
+ver=$(sed -n '/#define PHP_JSON_VERSION /{s/.* "//;s/".*$//;p}' ext/json/php_json.h)
+if test "$ver" != "%{jsonver}"; then
+       : Error: Upstream JSON version is now ${ver}, expecting %{jsonver}.
+       : Update the jsonver macro and rebuild.
+       exit 1
+fi
+
 export EXTENSION_DIR="%{php_extensiondir}"
 # configure once (for faster debugging purposes)
 if [ ! -f _built-conf ]; then
@@ -2138,7 +2173,7 @@ for sapi in $sapis; do
        --with-xsl=shared \
        --with-zlib=shared \
        --with-zlib-dir=shared,/usr \
-       --with-libzip \
+       %{?with_system_libzip:--with-libzip} \
        --enable-zip=shared,/usr \
 
        # save for debug
This page took 0.048048 seconds and 4 git commands to generate.