]> TLD Linux GIT Repositories - packages/php.git/blobdiff - php.spec
- updated to 5.5.17
[packages/php.git] / php.spec
index 334ec7922b2c4d3a02e2b51f7a34cad757dd668c..fa07c4eab72ebe27a895738543b132ab5821d391 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -1,3 +1,6 @@
+# TODO 5.5:
+# - enable --with-fpm-systemd, but ensure it checks for sd_booted()
+# - build with system libgd 2.1, see 73c5128
 # TODO 5.4:
 # - do not remove PatchX: definitions until merged to HEAD, needed for tracking their state
 # - check php-sapi-ini-file.patch for safe mode removal
@@ -39,6 +42,8 @@
 # Reflection
 #
 # Conditional build:
+
+%bcond_with    default_php     # use this PHP as default PHP in distro
 %bcond_with    interbase_inst  # use InterBase install., not Firebird  (BR: proprietary libs)
 %bcond_with    oci8            # with Oracle oci8 extension module     (BR: proprietary libs)
 %bcond_with    instantclient   # build Oracle oci8 extension module against oracle-instantclient package
@@ -60,6 +65,7 @@
 %bcond_with    mysqlnd         # with mysqlnd support in mysql related extensions
 %bcond_without mysqli          # without mysqli support (Requires mysql > 4.1)
 %bcond_without odbc            # without ODBC extension module
+%bcond_without opcache         # without Enable Zend OPcache extension support
 %bcond_without openssl         # without OpenSSL support and OpenSSL extension (module)
 %bcond_without pcre            # without PCRE extension module
 %bcond_without pdo_sqlite      # without PDO SQLite extension module
@@ -123,10 +129,10 @@ ERROR: You need to select at least one Apache SAPI to build shared modules.
 %undefine      with_filter
 %endif
 
-%define                orgname php
-%define                php_suffix 54
-
 %define                rel     1
+%define                orgname php
+%define                ver_suffix 55
+%define                php_suffix %{!?with_default_php:%{ver_suffix}}
 Summary:       PHP: Hypertext Preprocessor
 Summary(fr.UTF-8):     Le langage de script embarque-HTML PHP
 Summary(pl.UTF-8):     Język skryptowy PHP
@@ -134,13 +140,13 @@ Summary(pt_BR.UTF-8):     A linguagem de script PHP
 Summary(ru.UTF-8):     PHP Версии 5 - язык препроцессирования HTML-файлов, выполняемый на сервере
 Summary(uk.UTF-8):     PHP Версії 5 - мова препроцесування HTML-файлів, виконувана на сервері
 Name:          %{orgname}%{php_suffix}
-Version:       5.4.14
+Version:       5.5.17
 Release:       %{rel}%{?with_type_hints:.th}%{?with_oci8:.oci}
 Epoch:         4
 License:       PHP
 Group:         Libraries
 Source0:       http://www.php.net/distributions/%{orgname}-%{version}.tar.bz2
-# Source0-md5: cfdc044be2c582991a1fe0967898fa38
+# Source0-md5: b36c1eb5c40b872517b35d65bd840316
 Source2:       %{orgname}-mod_%{orgname}.conf
 Source3:       %{orgname}-cgi-fcgi.ini
 Source4:       %{orgname}-apache.ini
@@ -153,14 +159,13 @@ Source12: %{orgname}-branch.sh
 Source13:      dep-tests.sh
 Source14:      skip-tests.sh
 Patch0:                %{orgname}-shared.patch
-Patch1:                %{orgname}-pldlogo.patch
+Patch1:                %{orgname}-tld.patch
 Patch2:                %{orgname}-mail.patch
 Patch3:                %{orgname}-link-libs.patch
 Patch4:                %{orgname}-libpq_fs_h_path.patch
 Patch5:                %{orgname}-filter-shared.patch
 Patch6:                %{orgname}-build_modules.patch
 Patch7:                %{orgname}-sapi-ini-file.patch
-Patch8:                %{orgname}-config-file-scan-dir.patch
 Patch9:                %{orgname}-sh.patch
 Patch10:       %{orgname}-ini.patch
 Patch11:       embed.patch
@@ -235,13 +240,12 @@ BuildRequires:    freetds-devel >= 0.82
 %endif
 BuildRequires: freetype-devel >= 2.0
 %if %{with system_gd}
-BuildRequires: gd-devel >= 2.0.28-4
-BuildRequires: gd-devel(imagerotate) = 5.2.0
+BuildRequires: gd-devel >= 2.1
 %endif
 BuildRequires: gdbm-devel
 BuildRequires: gmp-devel
 %{?with_imap:BuildRequires:    imap-devel >= 1:2007e-2}
-%{?with_intl:BuildRequires:    libicu-devel}
+%{?with_intl:BuildRequires:    libicu-devel >= 4.4}
 BuildRequires: libjpeg-devel
 BuildRequires: libltdl-devel >= 1.4
 BuildRequires: libmcrypt-devel >= 2.4.4
@@ -249,11 +253,7 @@ BuildRequires:     libpng-devel >= 1.0.8
 #BuildRequires:        libtiff-devel
 %{?with_webp:BuildRequires:    libvpx-devel}
 BuildRequires: tokyocabinet-devel
-%if "%{pld_release}" != "ac"
 BuildRequires: libtool >= 2:2.2
-%else
-BuildRequires: libtool >= 1.4.3
-%endif
 #BuildRequires:        libwrap-devel
 BuildRequires: libxml2-devel >= 1:2.7.6-4
 BuildRequires: libxslt-devel >= 1.1.0
@@ -276,6 +276,8 @@ BuildRequires:      readline-devel
 BuildRequires: rpm >= 4.4.9-56
 BuildRequires: rpm-build >= 4.4.0
 BuildRequires: rpmbuild(macros) >= 1.566
+BuildRequires: tar >= 1:1.22
+BuildRequires: xz
 %if %{with sqlite3} || %{with pdo_sqlite}
 BuildRequires: sqlite3-devel >= 3.3.9
 %endif
@@ -302,9 +304,9 @@ BuildRoot:  %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define                _sysconfdir                     %{php_sysconfdir}
 
 # must be in sync with source. extra check ensuring that it is so is done in %%build
-%define                php_api_version         20100412
-%define                zend_module_api         20100525
-%define                zend_extension_api      220100525
+%define                php_api_version         20121113
+%define                zend_module_api         20121212
+%define                zend_extension_api      220121212
 
 # Extension versions
 %define                bz2ver          1.0
@@ -313,8 +315,9 @@ BuildRoot:  %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define                hashver         1.0
 %define                intlver         1.1.0
 %define                jsonver         1.2.1
-%define                pharver         2.0.1
-%define                sqlite3ver      0.7
+%define                opcachever      7.0.4-dev
+%define                pharver         2.0.2
+%define                sqlite3ver      0.7-dev
 %define                zipver          1.11.0
 
 %define                zend_zts                %{!?with_zts:0}%{?with_zts:1}
@@ -439,9 +442,7 @@ Provides:   php(cgi)
 Provides:      php(fcgi)
 Provides:      webserver(php) = %{version}
 Obsoletes:     php-fcgi < 4:5.3.0
-%if "%{pld_release}" != "ac"
 Conflicts:     logrotate < 3.8.0
-%endif
 
 %description cgi
 PHP as CGI or FastCGI program.
@@ -454,6 +455,7 @@ Summary:    PHP as CLI interpreter
 Summary(pl.UTF-8):     PHP jako interpreter działający z linii poleceń
 Group:         Development/Languages/PHP
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
+Provides:      php-program
 
 %description cli
 PHP as CLI interpreter.
@@ -475,19 +477,6 @@ applications to provide PHP scripting language support.
 Ten pakiet zawiera bibliotekę, którą można osadzać w aplikacjach w
 celu obsługi PHP jako języka skryptowego.
 
-%package program
-Summary:       /usr/bin/php symlink
-Summary(pl.UTF-8):     Dowiązanie symboliczne /usr/bin/php
-Group:         Development/Languages/PHP
-Requires:      %{name}-cli = %{epoch}:%{version}-%{release}
-Obsoletes:     /usr/bin/php
-
-%description program
-Package providing /usr/bin/php symlink to PHP CLI.
-
-%description program -l pl.UTF-8
-Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI.
-
 %package fpm
 Summary:       PHP FastCGI Process Manager
 Summary(pl.UTF-8):     PHP FastCGI Process Manager - zarządca procesów FastCGI
@@ -567,17 +556,15 @@ Group:            Development/Languages/PHP
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
 Requires:      autoconf >= 2.13
 Requires:      automake
-%if "%{pld_release}" != "ac"
 Requires:      libtool >= 2:2.2
-%else
-Requires:      libtool
-%endif
 %{?with_pcre:Requires: pcre-devel >= 8.10}
 Requires:      shtool
 Obsoletes:     php-devel
 Obsoletes:     php-pear-devel
 Obsoletes:     php4-devel
 Obsoletes:     php52-devel
+Obsoletes:     php53-devel
+Obsoletes:     php54-devel
 
 %description devel
 The php-devel package lets you compile dynamic extensions to PHP.
@@ -1181,6 +1168,21 @@ Moduł PHP ze wsparciem dla ODBC.
 %description odbc -l pt_BR.UTF-8
 Um módulo para aplicações PHP que usam ODBC.
 
+%package opcache
+Summary:       Zend Optimizer+ - PHP code optimizer
+Group:         Libraries
+URL:           https://wiki.php.net/rfc/optimizerplus
+Requires:      %{name}-common = %{epoch}:%{version}-%{release}
+Provides:      php(opcache) = %{opcachever}
+
+%description opcache
+The Zend OPcache provides faster PHP execution through opcode caching
+and optimization. It improves PHP performance by storing precompiled
+script bytecode in the shared memory. This eliminates the stages of
+reading code from the disk and compiling it on future access. In
+addition, it applies a few bytecode optimization patterns that make
+code execution faster.
+
 %package openssl
 Summary:       OpenSSL extension module for PHP
 Summary(pl.UTF-8):     Moduł OpenSSL dla PHP
@@ -1873,7 +1875,6 @@ Moduł PHP umożliwiający używanie kompresji zlib.
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
-%patch8 -p1
 %patch7 -p1
 %patch9 -p1
 cp -p php.ini-production php.ini
@@ -1897,9 +1898,7 @@ cp -p php.ini-production php.ini
 %patch27 -p1
 %patch29 -p1
 %patch31 -p1
-%if "%{pld_release}" != "ac"
 %patch34 -p1
-%endif
 %patch35 -p1
 %patch36 -p1
 %patch37 -p1
@@ -2055,6 +2054,12 @@ if test "$ver" != "%{jsonver}"; then
        : Update the jsonver macro and rebuild.
        exit 1
 fi
+ver=$(sed -n '/#define PHP_ZENDOPCACHE_VERSION /{s/.* "//;s/".*$//;p}' ext/opcache/ZendAccelerator.h)
+if test "$ver" != "%{opcachever}"; then
+       : Error: Upstream Zend Opcachge version is now ${ver}, expecting %{opcachever}.
+       : Update the opcachever macro and rebuild.
+       exit 1
+fi
 ver=$(sed -rne 's,.*<version>(.+)</version>,\1,p' ext/bz2/package.xml)
 if test "$ver" != "%{bz2ver}"; then
        : Error: Upstream BZIP2 version is now ${ver}, expecting %{bz2ver}.
@@ -2232,6 +2237,7 @@ for sapi in $sapis; do
        --with-mysql=shared,%{!?with_mysqlnd:/usr}%{?with_mysqlnd:mysqlnd} \
        %{?with_mysqli:--with-mysqli=shared,%{!?with_mysqlnd:/usr/bin/mysql_config}%{?with_mysqlnd:mysqlnd}} \
        %{?with_oci8:--with-oci8=shared%{?with_instantclient:,instantclient,%{_libdir}}} \
+       %{?with_opcache:--enable-opcache=shared} \
        %{?with_openssl:--with-openssl=shared} \
        %{?with_kerberos5:--with-kerberos} \
        --with-tcadb=/usr \
@@ -2315,6 +2321,9 @@ install -d conf.d
 generate_inifiles() {
        for so in modules/*.so; do
                mod=$(basename $so .so)
+               ext=extension
+               # opcache.so is zend extension
+               nm $so | grep -q zend_extension_entry && ext=zend_extension
                conf="$mod.ini"
                # xml needs to be loaded before wddx
                [ "$mod" = "wddx" ] && conf="xml_$mod.ini"
@@ -2328,8 +2337,8 @@ generate_inifiles() {
                [ "$mod" = "mysqlnd" ] && conf="MySQLND.ini"
                echo "+ $conf"
                cat > conf.d/$conf <<-EOF
-                       ; Enable $mod extension module
-                       extension=$mod.so
+                       ; Enable $mod $ext module
+                       $ext=$mod.so
                EOF
        done
 }
@@ -2437,9 +2446,6 @@ install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
 install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fpm
 install -d $RPM_BUILD_ROOT/etc/logrotate.d
 cp -p %{SOURCE11} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-fpm
-%if "%{pld_release}" == "ac"
-%{__sed} -i -e '/su/d' $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-fpm
-%endif
 
 %{__sed} -i -e '
        s#/usr/lib/php#%{php_extensiondir}#
@@ -2457,10 +2463,18 @@ cp -p sapi/embed/php_embed.h $RPM_BUILD_ROOT%{_includedir}/php/sapi/embed
 %endif
 
 # install CLI
-libtool --mode=install install -p sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/%{name}
-cp -p sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1
-echo ".so %{name}.1" >$RPM_BUILD_ROOT%{_mandir}/man1/php.1
-ln -sf %{name} $RPM_BUILD_ROOT%{_bindir}/php
+# versioned suffix is always installed
+libtool --mode=install install -p sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/php%{ver_suffix}
+cp -p sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1/php%{ver_suffix}.1
+
+%if %{with default_php}
+# man for php
+echo ".so php%{ver_suffix}.1" >$RPM_BUILD_ROOT%{_mandir}/man1/php.1
+# link as /usr/bin/php
+ln -sf php%{ver_suffix} $RPM_BUILD_ROOT%{_bindir}/php
+# php.cli link for backward compatibility
+ln -sf php $RPM_BUILD_ROOT%{_bindir}/php.cli
+%endif
 
 cp -p php.ini $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
 
@@ -2496,16 +2510,11 @@ install -d $RPM_BUILD_ROOT%{_sysconfdir}/{cgi-fcgi,cli,apache,apache2handler}.d
 mv $RPM_BUILD_ROOT%{_sysconfdir}/{conf.d/readline.ini,cli.d}
 
 # use system automake and {lib,sh}tool
-%if "%{pld_release}" != "ac"
-       ln -snf /usr/share/automake/config.{guess,sub} $RPM_BUILD_ROOT%{_libdir}/php/build
-       for i in libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4; do
-               ln -snf %{_aclocaldir}/${i} $RPM_BUILD_ROOT%{_libdir}/php/build
-       done
-       ln -snf %{_datadir}/libtool/config/ltmain.sh $RPM_BUILD_ROOT%{_libdir}/php/build
-%else
-       ln -snf %{_aclocaldir}/libtool.m4 $RPM_BUILD_ROOT%{_libdir}/php/build
-       ln -snf %{_datadir}/libtool/ltmain.sh $RPM_BUILD_ROOT%{_libdir}/php/build
-%endif
+ln -snf /usr/share/automake/config.{guess,sub} $RPM_BUILD_ROOT%{_libdir}/php/build
+for i in libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4; do
+       ln -snf %{_aclocaldir}/${i} $RPM_BUILD_ROOT%{_libdir}/php/build
+done
+ln -snf %{_datadir}/libtool/config/ltmain.sh $RPM_BUILD_ROOT%{_libdir}/php/build
 ln -snf %{_bindir}/shtool $RPM_BUILD_ROOT%{_libdir}/php/build
 
 # for php-pecl-mailparse
@@ -2638,6 +2647,7 @@ fi
 %extension_scripts mysqlnd
 %extension_scripts oci8
 %extension_scripts odbc
+%extension_scripts opcache
 %extension_scripts openssl
 %extension_scripts pcre
 %extension_scripts pdo
@@ -2722,13 +2732,13 @@ fi
 %defattr(644,root,root,755)
 %dir %{_sysconfdir}/cli.d
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-cli.ini
-%attr(755,root,root) %{_bindir}/%{name}
-%{_mandir}/man1/%{name}.1*
-
-%files program
-%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/php%{ver_suffix}
+%{_mandir}/man1/php%{ver_suffix}.1*
+%if %{with default_php}
 %attr(755,root,root) %{_bindir}/php
+%attr(755,root,root) %{_bindir}/php.cli
 %{_mandir}/man1/php.1*
+%endif
 
 %if %{with fpm}
 %files fpm
@@ -2961,7 +2971,7 @@ fi
 %if %{with oci8}
 %files oci8
 %defattr(644,root,root,755)
-%doc ext/ico8/{CREDITS,README}
+%doc ext/oci8/{CREDITS,README}
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/oci8.ini
 %attr(755,root,root) %{php_extensiondir}/oci8.so
 %endif
@@ -2974,6 +2984,14 @@ fi
 %attr(755,root,root) %{php_extensiondir}/odbc.so
 %endif
 
+%if %{with opcache}
+%files opcache
+%defattr(644,root,root,755)
+%doc ext/opcache/README
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/opcache.ini
+%attr(755,root,root) %{php_extensiondir}/opcache.so
+%endif
+
 %if %{with openssl}
 %files openssl
 %defattr(644,root,root,755)