#
# Conditional build:
%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
+%bcond_with oci # with Oracle oci8 extension module (BR: proprietary libs)
+%bcond_without 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_with default_php # use this PHP as default PHP in distro
%bcond_without curl # without CURL extension module
%bcond_without filter # without filter extension module
%bcond_without enchant # without Enchant extension module
%undefine with_filter
%endif
-%define rel 2
+%if "%{pld_release}" == "ac"
+%define _noautoreqdep libphp_common.*
+# if commandline --with was given. respect that
+%if 0%{!?_with_default_php:1}
+%undefine with_default_php
+%endif
+%endif
+
+%define rel 1
+%define orgname php
+%define ver_suffix 53
+%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
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: php
-Version: 5.3.15
+Name: %{orgname}%{php_suffix}
+Version: 5.3.29
Release: %{rel}%{?with_type_hints:.th}%{?with_oci8:.oci}
Epoch: 4
License: PHP
Group: Libraries
-Source0: http://www.php.net/distributions/%{name}-%{version}.tar.bz2
-# Source0-md5: 5cfcfd0fa4c4da7576f397073e7993cc
-Source2: %{name}-mod_%{name}.conf
-Source3: %{name}-cgi-fcgi.ini
-Source4: %{name}-apache.ini
-Source5: %{name}-cli.ini
+Source0: http://www.php.net/distributions/%{orgname}-%{version}.tar.bz2
+# Source0-md5: 9469e240cbe6ac865aeaec89b253dd30
+Source2: %{orgname}-mod_%{orgname}.conf
+Source3: %{orgname}-cgi-fcgi.ini
+Source4: %{orgname}-apache.ini
+Source5: %{orgname}-cli.ini
# Taken from: http://browsers.garykeith.com/downloads.asp
-Source9: %{name}_browscap.ini
-Source10: %{name}-fpm.init
-Source11: %{name}-fpm.logrotate
-Source12: %{name}-branch.sh
+Source9: %{orgname}_browscap.ini
+Source10: %{orgname}-fpm.init
+Source11: %{orgname}-fpm.logrotate
+Source12: %{orgname}-branch.sh
Source13: dep-tests.sh
Source14: skip-tests.sh
-Source15: http://litespeedtech.com/packages/lsapi/%{name}-litespeed-%{litespeed_version}.tgz
+Source15: http://litespeedtech.com/packages/lsapi/%{orgname}-litespeed-%{litespeed_version}.tgz
# Source15-md5: 9d58485d5fd6b5f5fefcec41b9ce283e
-Patch0: %{name}-shared.patch
-Patch1: %{name}-pldlogo.patch
-Patch2: %{name}-mail.patch
-Patch3: %{name}-link-libs.patch
-Patch4: %{name}-libpq_fs_h_path.patch
-Patch5: %{name}-filter-shared.patch
-Patch6: %{name}-build_modules.patch
-Patch7: %{name}-sapi-ini-file.patch
-Patch8: %{name}-config-file-scan-dir.patch
-Patch9: %{name}-sh.patch
-Patch10: %{name}-ini.patch
+Patch0: %{orgname}-shared.patch
+Patch1: %{orgname}-pldlogo.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
%if %{with type_hints}
Patch12: http://ilia.ws/patch/type_hint_53_v2.txt
%endif
-Patch14: %{name}-no_pear_install.patch
-Patch15: %{name}-zlib.patch
-Patch17: %{name}-readline.patch
-Patch18: %{name}-nohttpd.patch
-Patch19: %{name}-gd_imagerotate_enable.patch
-Patch20: %{name}-uint32_t.patch
-Patch21: %{name}-dba-link.patch
-Patch22: %{name}-both-apxs.patch
-Patch23: %{name}-builddir.patch
-Patch24: %{name}-zlib-for-getimagesize.patch
-Patch25: %{name}-stupidapache_version.patch
-Patch26: %{name}-pear.patch
-Patch27: %{name}-config-dir.patch
-Patch29: %{name}-fcgi-graceful.patch
-Patch31: %{name}-fcgi-error_log-no-newlines.patch
-Patch34: %{name}-libtool.patch
-Patch35: %{name}-tds.patch
-Patch36: %{name}-mysql-charsetphpini.patch
-Patch37: %{name}-mysqli-charsetphpini.patch
-Patch38: %{name}-pdo_mysql-charsetphpini.patch
-Patch39: %{name}-use-prog_sendmail.patch
-Patch41: %{name}-fpm-config.patch
-Patch42: %{name}-fpm-shared.patch
-Patch43: %{name}-silent-session-cleanup.patch
-Patch44: %{name}-include_path.patch
-Patch45: %{name}-imap-annotations.patch
-Patch46: %{name}-imap-myrights.patch
+Patch14: %{orgname}-no_pear_install.patch
+Patch15: %{orgname}-zlib.patch
+Patch17: %{orgname}-readline.patch
+Patch18: %{orgname}-nohttpd.patch
+Patch19: %{orgname}-gd_imagerotate_enable.patch
+Patch20: %{orgname}-uint32_t.patch
+Patch21: %{orgname}-dba-link.patch
+Patch22: %{orgname}-both-apxs.patch
+Patch23: %{orgname}-builddir.patch
+Patch24: %{orgname}-zlib-for-getimagesize.patch
+Patch25: %{orgname}-stupidapache_version.patch
+Patch26: %{orgname}-pear.patch
+Patch27: %{orgname}-config-dir.patch
+Patch29: %{orgname}-fcgi-graceful.patch
+Patch31: %{orgname}-fcgi-error_log-no-newlines.patch
+Patch34: %{orgname}-libtool.patch
+Patch35: %{orgname}-tds.patch
+Patch36: %{orgname}-mysql-charsetphpini.patch
+Patch37: %{orgname}-mysqli-charsetphpini.patch
+Patch38: %{orgname}-pdo_mysql-charsetphpini.patch
+Patch39: %{orgname}-use-prog_sendmail.patch
+Patch41: %{orgname}-fpm-config.patch
+Patch42: %{orgname}-fpm-shared.patch
+Patch43: %{orgname}-silent-session-cleanup.patch
+Patch44: %{orgname}-include_path.patch
+Patch45: %{orgname}-imap-annotations.patch
+Patch46: %{orgname}-imap-myrights.patch
Patch47: suhosin.patch
-Patch49: %{name}-m4-divert.patch
+Patch48: php-bug-60598.patch
+Patch49: %{orgname}-m4-divert.patch
Patch50: extension-shared-optional-dep.patch
Patch51: spl-shared.patch
Patch52: pcre-shared.patch
Patch53: fix-test-run.patch
-Patch59: %{name}-systzdata.patch
-Patch60: %{name}-oracle-instantclient.patch
+Patch59: %{orgname}-systzdata.patch
+Patch60: %{orgname}-oracle-instantclient.patch
Patch62: mcrypt-libs.patch
-Patch63: %{name}-mysql-nowarning.patch
-Patch64: %{name}-m4.patch
+Patch63: %{orgname}-mysql-nowarning.patch
+Patch64: %{orgname}-m4.patch
# http://spot.fedorapeople.org/php-5.3.6-libzip.patch
Patch65: system-libzip.patch
+Patch66: %{orgname}-db.patch
+Patch67: php-litespeed.patch
+Patch68: mysql-lib-ver-mismatch.patch
+Patch69: fpm-conf-split.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}
BuildRequires: elfutils-devel
%{?with_enchant:BuildRequires: enchant-devel >= 1.1.3}
#BuildRequires: fcgi-devel
-#BuildRequires: flex
+BuildRequires: file
%{?with_kerberos5:BuildRequires: heimdal-devel}
%{?with_system_libzip:BuildRequires: libzip-devel >= 0.10-3}
BuildRequires: mysql-devel
%{?with_gcov:BuildRequires: lcov}
%{?with_snmp:%{?with_tests:BuildRequires: mibs-net-snmp}}
%{?with_snmp:BuildRequires: net-snmp-devel >= 5.0.7}
-%{?with_instantclient:BuildRequires: oracle-instantclient-devel}
+%{?with_oci:%{?with_instantclient:BuildRequires: oracle-instantclient-devel}}
BuildRequires: pam-devel
%{?with_pcre:BuildRequires: pcre-devel >= 8.10}
BuildRequires: pkgconfig
%endif
%if %{with fpm}
#BuildRequires: judy-devel
-BuildRequires: libevent-devel >= 1.4.7-3
%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-%define php_sysconfdir /etc/php
-%define php_extensiondir %{_libdir}/php
+%define php_sysconfdir /etc/%{name}
+%define php_extensiondir %{_libdir}/%{name}
%define _sysconfdir %{php_sysconfdir}
# must be in sync with source. extra check ensuring that it is so is done in %%build
%define jsonver 1.2.1
%define pharver 2.0.1
%define sqlitever 2.0-dev
+%define sqlite3ver 0.7-dev
%define zipver 1.11.0
%define zend_zts %{!?with_zts:0}%{?with_zts:1}
%undefine with_ccache
%endif
-%if %{with oci8}
+%if %{with oci}
# ORACLE_HOME is required for oci8 ext to build
%define _preserve_env %_preserve_env_base ORACLE_HOME
%endif
роботи з базами даних є доволі простим. Найбільш популярне
використання PHP - заміна для CGI скриптів.
-%package -n apache1-mod_php
+%package -n apache1-mod_%{name}
Summary: PHP DSO module for Apache 1.3.x
Summary(pl.UTF-8): Moduł DSO (Dynamic Shared Object) PHP dla Apache 1.3.x
Group: Development/Languages/PHP
-Requires(triggerpostun): sed >= 4.0
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: apache1(EAPI) >= 1.3.33-2
Requires: apache1-mod_mime
Provides: webserver(php) = %{version}
Obsoletes: apache-mod_php < 1:4.1.1
+Obsoletes: apache1-mod_php < 4:5.3.28-7
Obsoletes: phpfi
-%description -n apache1-mod_php
+%description -n apache1-mod_%{name}
PHP as DSO module for Apache 1.3.x.
-%description -n apache1-mod_php -l pl.UTF-8
+%description -n apache1-mod_%{name} -l pl.UTF-8
PHP jako moduł DSO (Dynamic Shared Object) dla Apache 1.3.x.
-%package -n apache-mod_php
+%package -n apache-mod_%{name}
Summary: PHP DSO module for Apache 2.x
Summary(pl.UTF-8): Moduł DSO (Dynamic Shared Object) PHP dla Apache 2.x
Group: Development/Languages/PHP
Requires: apache(modules-api) = %{apache_modules_api}
Requires: apache-mod_mime
Provides: webserver(php) = %{version}
+Obsoletes: apache-mod_php < 4:5.3.28-7
Obsoletes: phpfi
-%description -n apache-mod_php
+%description -n apache-mod_%{name}
PHP as DSO module for Apache 2.x.
-%description -n apache-mod_php -l pl.UTF-8
+%description -n apache-mod_%{name} -l pl.UTF-8
PHP jako moduł DSO (Dynamic Shared Object) dla Apache 2.x.
%package litespeed
Summary(pl.UTF-8): PHP dla serwera HTTP litespeed
Group: Development/Languages/PHP
Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Provides: php(litespeed)
Provides: webserver(php) = %{version}
+Obsoletes: php-litespeed < 4:5.3.28-7
%description litespeed
PHP for litespeed HTTP server.
Provides: %{name}-fcgi = %{epoch}:%{version}-%{release}
Provides: php(cgi)
Provides: php(fcgi)
-Provides: webserver(php)
+Provides: webserver(php) = %{version}
+Obsoletes: php-cgi < 4:5.3.28-7
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.
Summary(pl.UTF-8): PHP jako interpreter działający z linii poleceń
Group: Development/Languages/PHP
Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Obsoletes: php-cli < 4:5.3.28-7
%description cli
PHP as CLI interpreter.
Summary(pl.UTF-8): Biblioteka PHP do osadzania w aplikacjach
Group: Libraries
Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Obsoletes: php-embedded < 4:5.3.28-7
%description embedded
The php-embedded package contains a library which can be embedded into
applications to provide PHP scripting language support.
%description embedded -l pl.UTF-8
-Ten pakiet zawiera bibliotekę, którą można osadzać w aplikacjach w
+Ten pakiet zawiera bibliotekę, którą można osadzać w aplikacjach w
celu obsługi PHP jako języka skryptowego.
%package program
Group: Development/Languages/PHP
Requires: %{name}-cli = %{epoch}:%{version}-%{release}
Obsoletes: /usr/bin/php
+Obsoletes: php-program < 4:5.3.28-7
%description program
Package providing /usr/bin/php symlink to PHP CLI.
Requires(pre): /bin/id
Requires(pre): /usr/sbin/useradd
Requires: %{name}-common = %{epoch}:%{version}-%{release}
-Requires: libevent >= 1.4.7-3
Requires: rc-scripts
+Provides: php(fpm)
Provides: user(http)
Provides: webserver(php) = %{version}
+Obsoletes: php-fpm < 4:5.3.28-7
%description fpm
PHP FastCGI Process Manager.
Requires(post): sed >= 4.0
# because of dlclose() bugs in glibc <= 2.3.4 causing SEGVs on exit
Requires: glibc >= 6:2.3.5
-Requires: php-dirs
+Requires: php-dirs >= 1.4
Requires: rpm-whiteout >= 1.28
Requires: tzdata
+%if "%{pld_release}" == "ac"
+# postpone tree rebuild in ac
+Provides: php5(debug) = %{php_debug}
+Provides: php5(thread-safety) = %{zend_zts}
+%endif
Provides: %{name}(debug) = %{php_debug}
Provides: %{name}(modules_api) = %{php_api_version}
Provides: %{name}(thread-safety) = %{zend_zts}
Provides: %{name}(zend_extension_api) = %{zend_extension_api}
Provides: %{name}(zend_module_api) = %{zend_module_api}
+Provides: %{name}-core
Provides: %{name}-date
Provides: %{name}-ereg
Provides: %{name}-reflection
Provides: %{name}-standard
+Provides: php(core) = %{version}
Provides: php(date)
Provides: php(ereg)
-Provides: php(hash)
Provides: php(libxml)
Provides: php(reflection)
Provides: php(standard)
%{!?with_mysqlnd:Obsoletes: php-mysqlnd}
%{?with_pcre:%requires_ge_to pcre pcre-devel}
+Obsoletes: php-common < 4:5.3.28-7
Obsoletes: php-pecl-domxml
Conflicts: php4-common < 3:4.4.4-8
Conflicts: rpm < 4.4.2-0.2
%else
Requires: libtool
%endif
-%{?with_pcre:Requires: pcre-devel >= 8.10}
%{?with_embed:Requires: %{name}-embedded = %{epoch}:%{version}-%{release}}
+%{?with_pcre:Requires: pcre-devel >= 8.10}
Requires: shtool
+Obsoletes: php-devel
Obsoletes: php-pear-devel
Obsoletes: php4-devel
+Obsoletes: php52-devel
+Obsoletes: php54-devel
+Obsoletes: php55-devel
%description devel
The php-devel package lets you compile dynamic extensions to PHP.
URL: http://www.php.net/manual/en/book.bc.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(bcmath)
+Obsoletes: php-bcmath < 4:5.3.28-7
%description bcmath
This is a dynamic shared object (DSO) for PHP that will add bc style
Provides: php(bz2) = %{bz2ver}
Provides: php(bzip2)
Provides: php-bzip2 = %{epoch}:%{version}-%{release}
+Obsoletes: php-bz2 < 4:5.3.28-7
Obsoletes: php-bzip2 < 4:5.2.14-3
Obsoletes: php-pecl-bz2 < %{bz2ver}
URL: http://www.php.net/manual/en/book.calendar.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(calendar)
+Obsoletes: php-calendar < 4:5.3.28-7
%description calendar
This is a dynamic shared object (DSO) for PHP that will add calendar
URL: http://www.php.net/manual/en/book.ctype.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(ctype)
+Obsoletes: php-ctype < 4:5.3.28-7
%description ctype
This is a dynamic shared object (DSO) for PHP that will add ctype
URL: http://www.php.net/manual/en/book.curl.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(curl)
+Obsoletes: php-curl < 4:5.3.28-7
%description curl
This is a dynamic shared object (DSO) for PHP that will add curl
URL: http://www.php.net/manual/en/book.dba.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(dba)
+Obsoletes: php-dba < 4:5.3.28-7
%description dba
This is a dynamic shared object (DSO) for PHP that will add flat-file
# it has some compatibility functions
Provides: %{name}-domxml = %{epoch}:%{version}-%{release}
Provides: php(domxml)
+Obsoletes: php-dom < 4:5.3.28-7
Obsoletes: php-domxml <= 3:4.3.8-1
%description dom
URL: http://www.php.net/manual/en/book.exif.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(enchant) = %{enchantver}
+Obsoletes: php-enchant < 4:5.3.28-7
Obsoletes: php-pecl-enchant < %{enchantver}
%description enchant
URL: http://www.php.net/manual/en/book.exif.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(exif)
+Obsoletes: php-exif < 4:5.3.28-7
%description exif
This is a dynamic shared object (DSO) for PHP that will add EXIF tags
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-pcre = %{epoch}:%{version}-%{release}
Provides: php(fileinfo) = %{fileinfover}
+Obsoletes: php-fileinfo < 4:5.3.28-7
Obsoletes: php-mime_magic
Obsoletes: php-pecl-fileinfo < %{fileinfover}
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-pcre = %{epoch}:%{version}-%{release}
Provides: php(filter)
+Obsoletes: php-filter < 4:5.3.28-7
Obsoletes: php-pecl-filter
%description filter
URL: http://www.php.net/manual/en/book.ftp.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(ftp)
+Obsoletes: php-ftp < 4:5.3.28-7
%description ftp
This is a dynamic shared object (DSO) for PHP that will add FTP
Requires: gd(imagerotate) = 5.2.0
%endif
Provides: php(gd)
+Obsoletes: php-gd < 4:5.3.28-7
%description gd
This is a dynamic shared object (DSO) for PHP that will add GD
URL: http://www.php.net/manual/en/book.gettext.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(gettext)
+Obsoletes: php-gettext < 4:5.3.28-7
%description gettext
This is a dynamic shared object (DSO) for PHP that will add gettext
URL: http://www.php.net/manual/en/book.gmp.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(gmp)
+Obsoletes: php-gmp < 4:5.3.28-7
%description gmp
This is a dynamic shared object (DSO) for PHP that will add arbitrary
Provides: php-mhash = %{epoch}:%{version}-%{release}
Obsoletes: php-mhash < 4:5.3.0
%endif
+Obsoletes: php-hash < 4:5.3.28-7
Obsoletes: php-pecl-hash < %{hashver}
%description hash
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: iconv
Provides: php(iconv)
+Obsoletes: php-iconv < 4:5.3.28-7
%description iconv
This is a dynamic shared object (DSO) for PHP that will add iconv
Requires: %{name}-pcre = %{epoch}:%{version}-%{release}
Requires: imap-lib >= 1:2007e-2
Provides: php(imap)
+Obsoletes: php-imap < 4:5.3.28-7
%description imap
This is a dynamic shared object (DSO) for PHP that will add IMAP
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(interbase)
%{?with_interbase_inst:Autoreq: false}
+Obsoletes: php-interbase < 4:5.3.28-7
%description interbase
This is a dynamic shared object (DSO) for PHP that will add InterBase
URL: http://www.php.net/intl
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(intl) = %{intlver}
+Obsoletes: php-intl < 4:5.3.28-7
Obsoletes: php-pecl-intl < %{intlver}
%description intl
URL: http://www.php.net/manual/en/book.json.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(json) = %{jsonver}
+Obsoletes: php-json < 4:5.3.28-7
Obsoletes: php-pecl-json < %{jsonver}
%description json
URL: http://www.php.net/manual/en/book.ldap.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(ldap)
+Obsoletes: php-ldap < 4:5.3.28-7
%description ldap
This is a dynamic shared object (DSO) for PHP that will add LDAP
URL: http://www.php.net/manual/en/book.mbstring.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(mbstring)
+Obsoletes: php-mbstring < 4:5.3.28-7
%description mbstring
This is a dynamic shared object (DSO) for PHP that will add multibyte
URL: http://www.php.net/manual/en/book.mcrypt.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(mcrypt)
+Obsoletes: php-mcrypt < 4:5.3.28-7
%description mcrypt
This is a dynamic shared object (DSO) for PHP that will add mcrypt
URL: http://www.php.net/manual/en/book.mssql.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(mssql)
+Obsoletes: php-mssql < 4:5.3.28-7
%description mssql
This is a dynamic shared object (DSO) for PHP that will add MS SQL
Requires: %{name}-common = %{epoch}:%{version}-%{release}
%{?with_mysqlnd:Requires: %{name}-mysqlnd = %{epoch}:%{version}-%{release}}
Provides: php(mysql)
+Obsoletes: php-mysql < 4:5.3.28-7
%description mysql
This is a dynamic shared object (DSO) for PHP that will add MySQL
%{?with_mysqlnd:Requires: %{name}-mysqlnd = %{epoch}:%{version}-%{release}}
Requires: %{name}-spl = %{epoch}:%{version}-%{release}
Provides: php(mysqli)
+Obsoletes: php-mysqli < 4:5.3.28-7
%description mysqli
This is a dynamic shared object (DSO) for PHP that will add MySQLi
URL: http://www.php.net/manual/en/book.mysqlnd.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(mysqlnd)
+Obsoletes: php-mysqlnd < 4:5.3.28-7
%description mysqlnd
MySQL Native Driver is a replacement for the MySQL Client Library
URL: http://www.php.net/manual/en/book.oci8.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(oci8)
+Obsoletes: php-oci8 < 4:5.3.28-7
AutoReq: false
%description oci8
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: unixODBC >= 2.1.1-3
Provides: php(odbc)
+Obsoletes: php-odbc < 4:5.3.28-7
%description odbc
This is a dynamic shared object (DSO) for PHP that will add ODBC
URL: http://www.php.net/manual/en/book.openssl.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(openssl)
+Obsoletes: php-openssl < 4:5.3.28-7
%description openssl
This is a dynamic shared object (DSO) for PHP that will add OpenSSL
URL: http://www.php.net/manual/en/book.pcntl.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(pcntl)
+Obsoletes: php-pcntl < 4:5.3.28-7
%description pcntl
This is a dynamic shared object (DSO) for PHP that will add process
Group: Libraries
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(pcre)
+Obsoletes: php-pcre < 4:5.3.28-7
%description pcre
This is a dynamic shared object (DSO) for PHP that will add Perl
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-spl = %{epoch}:%{version}-%{release}
Provides: php(pdo)
+Obsoletes: php-pdo < 4:5.3.28-7
Obsoletes: php-pecl-PDO
%description pdo
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-pdo = %{epoch}:%{version}-%{release}
Provides: php(dblib)
+Obsoletes: php-pdo-dblib < 4:5.3.28-7
%description pdo-dblib
This is a dynamic shared object (DSO) for PHP that will add PDO
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-pdo = %{epoch}:%{version}-%{release}
Provides: php(pdo-firebird)
+Obsoletes: php-pdo-firebird < 4:5.3.28-7
Obsoletes: php-pecl-PDO_FIREBIRD
%description pdo-firebird
%{?with_mysqlnd:Requires: %{name}-mysqlnd = %{epoch}:%{version}-%{release}}
Requires: %{name}-pdo = %{epoch}:%{version}-%{release}
Provides: php(pdo-mysql)
+Obsoletes: php-pdo-mysql < 4:5.3.28-7
Obsoletes: php-pecl-PDO_MYSQL
%description pdo-mysql
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-pdo = %{epoch}:%{version}-%{release}
Provides: php(pdo-oci)
+Obsoletes: php-pdo-oci < 4:5.3.28-7
Obsoletes: php-pecl-PDO_OCI
%description pdo-oci
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-pdo = %{epoch}:%{version}-%{release}
Provides: php(pdo-odbc)
+Obsoletes: php-pdo-odbc < 4:5.3.28-7
Obsoletes: php-pecl-PDO_ODBC
%description pdo-odbc
Requires: %{name}-pdo = %{epoch}:%{version}-%{release}
Provides: php(pdo-pgsql)
Provides: php-pecl-PDO_PGSQL
+Obsoletes: php-pdo-pgsql < 4:5.3.28-7
Obsoletes: php-pecl-PDO_PGSQL < 4:5.2.1-2
%description pdo-pgsql
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-pdo = %{epoch}:%{version}-%{release}
Provides: php(pdo-sqlite)
+Obsoletes: php-pdo-sqlite < 4:5.3.28-7
Obsoletes: php-pecl-PDO_SQLITE
%description pdo-sqlite
URL: http://www.php.net/manual/en/book.pgsql.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(pgsql)
+Obsoletes: php-pgsql < 4:5.3.28-7
%description pgsql
This is a dynamic shared object (DSO) for PHP that will add PostgreSQL
URL: http://www.php.net/manual/en/book.phar.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-spl = %{epoch}:%{version}-%{release}
+Suggests: %{name}-cli
# 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}
+Obsoletes: php-phar < 4:5.3.28-7
+Conflicts: php-ioncube < 4.0.9
%description phar
This is a dynamic shared object (DSO) for PHP that will add phar
URL: http://www.php.net/manual/en/book.posix.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(posix)
+Obsoletes: php-posix < 4:5.3.28-7
%description posix
This is a dynamic shared object (DSO) for PHP that will add POSIX
URL: http://www.php.net/manual/en/book.pspell.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(pspell)
+Obsoletes: php-pspell < 4:5.3.28-7
%description pspell
This is a dynamic shared object (DSO) for PHP that will add pspell
URL: http://www.php.net/manual/en/book.readline.php
Requires: %{name}-cli = %{epoch}:%{version}-%{release}
Provides: php(readline)
+Obsoletes: php-readline < 4:5.3.28-7
%description readline
This PHP module adds support for readline functions (only for cli and
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: recode >= 3.5d-3
Provides: php(recode)
+Obsoletes: php-recode < 4:5.3.28-7
%description recode
This is a dynamic shared object (DSO) for PHP that will add recode
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-spl = %{epoch}:%{version}-%{release}
Suggests: %{name}-hash = %{epoch}:%{version}-%{release}
+Suggests: tmpwatch
Provides: php(session)
+Obsoletes: php-session < 4:5.3.28-7
%description session
This is a dynamic shared object (DSO) for PHP that will add session
URL: http://www.php.net/manual/en/book.shmop.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(shmop)
+Obsoletes: php-shmop < 4:5.3.28-7
%description shmop
This is a dynamic shared object (DSO) for PHP that will add Shared
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-spl = %{epoch}:%{version}-%{release}
Provides: php(simplexml)
+Obsoletes: php-simplexml < 4:5.3.28-7
%description simplexml
This is a dynamic shared object (DSO) for PHP that will add Simple XML
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-sockets = %{epoch}:%{version}-%{release}
Provides: php(snmp)
+Obsoletes: php-snmp < 4:5.3.28-7
%description snmp
This is a dynamic shared object (DSO) for PHP that will add SNMP
URL: http://www.php.net/manual/en/book.soap.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(soap)
+Obsoletes: php-soap < 4:5.3.28-7
%description soap
This is a dynamic shared object (DSO) for PHP that will add SOAP/WSDL
URL: http://www.php.net/manual/en/book.sockets.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(sockets)
+Obsoletes: php-sockets < 4:5.3.28-7
%description sockets
This is a dynamic shared object (DSO) for PHP that will add sockets
Requires: %{name}-pcre = %{epoch}:%{version}-%{release}
Requires: %{name}-simplexml = %{epoch}:%{version}-%{release}
Provides: php(spl)
+Obsoletes: php-spl < 4:5.3.28-7
%description spl
This is a dynamic shared object (DSO) for PHP that will add Standard
Requires: %{name}-spl = %{epoch}:%{version}-%{release}
Provides: php(sqlite) = %{sqlitever}
Obsoletes: php-pecl-SQLite < %{sqlitever}
+Obsoletes: php-sqlite < 4:5.3.28-7
%description sqlite
SQLite is a C library that implements an embeddable SQL database
Group: Libraries
URL: http://php.net/manual/en/book.sqlite3.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
-Provides: php(sqlite3)
+Provides: php(sqlite3) = %{sqlite3ver}
+Obsoletes: php-sqlite3 < 4:5.3.28-7
%description sqlite3
SQLite is a C library that implements an embeddable SQL database
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(sybase-ct)
Obsoletes: php-sybase
+Obsoletes: php-sybase-ct < 4:5.3.28-7
%description sybase-ct
This is a dynamic shared object (DSO) for PHP that will add Sybase and
URL: http://www.php.net/manual/en/book.sem.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(sysvmsg)
+Obsoletes: php-sysvmsg < 4:5.3.28-7
%description sysvmsg
This is a dynamic shared object (DSO) for PHP that will add SysV
URL: http://www.php.net/manual/en/book.sem.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(sysvsem)
+Obsoletes: php-sysvsem < 4:5.3.28-7
%description sysvsem
This is a dynamic shared object (DSO) for PHP that will add SysV
URL: http://www.php.net/manual/en/book.shmop.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(sysvshm)
+Obsoletes: php-sysvshm < 4:5.3.28-7
%description sysvshm
This is a dynamic shared object (DSO) for PHP that will add SysV
Summary(pl.UTF-8): Zawiera pliki testów jednostkowych dla PHP i rozszerzeń
Group: Libraries
URL: http://qa.php.net/
-Requires: %{name}-cli
+Requires: %{name}-cli = %{epoch}:%{version}-%{release}
%description tests
This package contains unit tests for PHP and its extensions.
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: tidy
Provides: php(tidy)
+Obsoletes: php-tidy < 4:5.3.28-7
%description tidy
This is a dynamic shared object (DSO) for PHP that will add Tidy
URL: http://www.php.net/manual/en/book.tokenizer.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(tokenizer)
+Obsoletes: php-tokenizer < 4:5.3.28-7
%description tokenizer
This is a dynamic shared object (DSO) for PHP that will add tokenizer
#Requires: %{name}-session = %{epoch}:%{version}-%{release}
Requires: %{name}-xml = %{epoch}:%{version}-%{release}
Provides: php(wddx)
+Obsoletes: php-wddx < 4:5.3.28-7
%description wddx
This is a dynamic shared object (DSO) for PHP that will add wddx
URL: http://www.php.net/manual/en/book.xml.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(xml)
+Obsoletes: php-xml < 4:5.3.28-7
%description xml
This is a dynamic shared object (DSO) for PHP that will add XML
Group: Libraries
URL: http://www.php.net/manual/en/book.xmlreader.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
-Suggests: %{name}-dom = %{epoch}:%{version}-%{release}
+Requires: %{name}-dom = %{epoch}:%{version}-%{release}
Provides: php(xmlreader)
+Obsoletes: php-xmlreader < 4:5.3.28-7
%description xmlreader
This is a dynamic shared object (DSO) for PHP that will add XML Reader
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-xml = %{epoch}:%{version}-%{release}
Provides: php(xmlrpc)
+Obsoletes: php-xmlrpc < 4:5.3.28-7
%description xmlrpc
This is a dynamic shared object (DSO) for PHP that will add XMLRPC
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(xmlwriter)
Obsoletes: php-pecl-xmlwriter
+Obsoletes: php-xmlwriter < 4:5.3.28-7
%description xmlwriter
This extension wraps the libxml xmlWriter API. Represents a writer
Requires: libxslt >= 1.0.18
# actually not true, functionality is similar, but API differs
Provides: php(xsl)
+Obsoletes: php-xsl < 4:5.3.28-7
Obsoletes: php-xslt <= 3:4.3.8-1
%description xsl
%{?with_system_libzip:Requires: libzip >= 0.10-3}
Provides: php(zip) = %{zipver}
Obsoletes: php-pecl-zip < %{zipver}
+Obsoletes: php-zip < 4:5.3.28-7
%description zip
Zip is an extension to create, modify and read zip files.
URL: http://www.php.net/manual/en/book.zlib.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(zlib)
+Obsoletes: php-zlib < 4:5.3.28-7
%description zlib
This is a dynamic shared object (DSO) for PHP that will add zlib
Moduł PHP umożliwiający używanie kompresji zlib.
%prep
-%setup -q
-# prep for suhosin patch
-%{__sed} -i -e 's,\r$,,' Zend/Zend.dsp Zend/ZendTS.dsp
+%setup -q -n %{orgname}-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%if %{with suhosin}
%patch47 -p1
%endif
+%patch48 -p1
%patch49 -p1
%patch50 -p1
%patch51 -p1
%patch63 -p1
%patch64 -p1
%{?with_system_libzip:%patch65 -p1}
+%patch66 -p1
%{__rm} -r sapi/litespeed
gzip -dc %{SOURCE15} | tar xf - -C sapi/
+%patch67 -p1
+%patch68 -p1
+%patch69 -p1
sed -i -e '/PHP_ADD_LIBRARY_WITH_PATH/s#xmlrpc,#xmlrpc-epi,#' ext/xmlrpc/config.m4
: Update the pharver macro and rebuild.
exit 1
fi
+ver=$(sed -n '/#define PHP_SQLITE3_VERSION/{s/.* "//;s/".*$//;p}' ext/sqlite3/php_sqlite3.h)
+if test "$ver" != "%{sqlite3ver}"; then
+ : Error: Upstream Sqlite3 version is now ${ver}, expecting %{sqlite3ver}.
+ : Update the sqlite3ver 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}.
if [ ! -f _built-conf ]; then
# now remove Makefile copies
rm -f Makefile.{cgi-fcgi,fpm,cli,apxs1,apxs2,litespeed}
+ # force regeneration
+ touch Zend/zend_language_parser.y
%{__libtoolize}
%{__aclocal}
cp -f /usr/share/automake/config.* .
%{?with_mhash:--with-mhash=yes} \
--with-mysql-sock=/var/lib/mysql/mysql.sock \
--with-pdo-mysql=shared%{?with_mysqlnd:,mysqlnd} \
- %{?with_oci8:--with-pdo-oci=shared%{?with_instantclient:,instantclient,%{_libdir}}} \
+ %{?with_oci:--with-pdo-oci=shared%{?with_instantclient:,instantclient,%{_libdir}}} \
%{?with_odbc:--with-pdo-odbc=shared,unixODBC,/usr} \
%{?with_pgsql:--with-pdo-pgsql=shared} \
%{?with_pdo_sqlite:--with-pdo-sqlite=shared,/usr} \
%{?with_mysqlnd:--with-mysqlnd=shared} \
--with-mysql=shared%{?with_mysqlnd:,mysqlnd} \
%{?with_mysqli:--with-mysqli=shared%{?with_mysqlnd:,mysqlnd}} \
- %{?with_oci8:--with-oci8=shared%{?with_instantclient:,instantclient,%{_libdir}}} \
+ %{?with_oci:--with-oci8=shared%{?with_instantclient:,instantclient,%{_libdir}}} \
%{?with_openssl:--with-openssl=shared} \
%{?with_kerberos5:--with-kerberos} \
%{__with_without pcre pcre-regex /usr} \
%if %{with cgi}
cp -pf php_config.h.cgi-fcgi main/php_config.h
%{__make} -f Makefile.cgi-fcgi
-[ "$(echo '<?=php_sapi_name();' | ./sapi/cgi/php-cgi -qn)" = cgi-fcgi ] || exit 1
+[ "$(echo '<?=php_sapi_name();' | ./sapi/cgi/php-cgi -qn)" = "cgi-fcgi" ]
%endif
# PHP FPM
# CLI
cp -pf php_config.h.cli main/php_config.h
%{__make} -f Makefile.cli
-[ "$(echo '<?=php_sapi_name();' | ./sapi/cli/php -qn)" = cli ] || exit 1
+[ "$(echo '<?=php_sapi_name();' | ./sapi/cli/php -qn)" = "cli" ]
# check for stupid xml parse breakage where < and > just get lost in parse result
./sapi/cli/php -n -dextension_dir=modules -dextension=xml.so -r '$p = xml_parser_create(); xml_parse_into_struct($p, "<x><</x>", $vals, $index); exit((int )empty($vals[0]["value"]));'
exit 1
%endif
-%if %{with tests}
-# Run tests, using the CLI SAPI
-cp -pf php_config.h.cli main/php_config.h
-cp -pf Makefile.cli Makefile
-
cat <<'EOF' > run-tests.sh
#!/bin/sh
export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
RUN_TESTS_SETTINGS="-q $*"
EOF
chmod +x run-tests.sh
+
+%if %{with tests}
+# Run tests, using the CLI SAPI
+cp -pf php_config.h.cli main/php_config.h
+cp -pf Makefile.cli Makefile
+
./run-tests.sh -w failed.log -s test.log
# collect failed tests into cleanup script used in prep.
cp -pf php_config.h.cli main/php_config.h
cp -pf Makefile.cli Makefile
%{__make} install \
+ phpbuilddir=%{_libdir}/%{name}/build \
INSTALL_ROOT=$RPM_BUILD_ROOT
# make link relative
ln -sfn phar.phar $RPM_BUILD_ROOT%{_bindir}/phar
+# version suffix
+v=$(echo %{version} | cut -d. -f1-2)
+
# install Apache1 DSO module
%if %{with apache1}
libtool --mode=install install -p sapi/apache/libphp5.la $RPM_BUILD_ROOT%{_libdir}/apache1
+mv $RPM_BUILD_ROOT%{_libdir}/apache1/libphp5{,-$v}.so
+ln -s libphp5-$v.so $RPM_BUILD_ROOT%{_libdir}/apache1/libphp5.so
%endif
# install Apache2 DSO module
%if %{with apache2}
libtool --mode=install install -p sapi/apache2handler/libphp5.la $RPM_BUILD_ROOT%{_libdir}/apache
+mv $RPM_BUILD_ROOT%{_libdir}/apache/libphp5{,-$v}.so
+ln -s libphp5-$v.so $RPM_BUILD_ROOT%{_libdir}/apache/libphp5.so
%endif
# install litespeed sapi
%if %{with litespeed}
-libtool --mode=install install -p sapi/litespeed/php $RPM_BUILD_ROOT%{_sbindir}/php.litespeed
+libtool --mode=install install -p sapi/litespeed/php $RPM_BUILD_ROOT%{_sbindir}/%{name}.litespeed
%endif
libtool --mode=install install -p libphp_common.la $RPM_BUILD_ROOT%{_libdir}
# install CGI/FCGI
%if %{with cgi}
# install-cgi
-libtool --mode=install install -p sapi/cgi/php-cgi $RPM_BUILD_ROOT%{_bindir}/php.cgi
-ln -sf php.cgi $RPM_BUILD_ROOT%{_bindir}/php.fcgi
+libtool --mode=install install -p sapi/cgi/php-cgi $RPM_BUILD_ROOT%{_bindir}/%{name}.cgi
+ln -sf %{name}.cgi $RPM_BUILD_ROOT%{_bindir}/%{name}.fcgi
cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/php-cgi-fcgi.ini
%endif
# install FCGI PM
%if %{with fpm}
-%{__make} -f Makefile.fpm install-fpm \
- INSTALL_ROOT=$RPM_BUILD_ROOT
-# Makefile.fpm incorrectly installs libtool script instead of final binary so overwrite
-libtool --mode=install install -p sapi/fpm/php-fpm $RPM_BUILD_ROOT%{_sbindir}
-
-install -d $RPM_BUILD_ROOT{/etc/rc.d/init.d,%{_sysconfdir}/fpm.d}
-install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/php-fpm
+install -d $RPM_BUILD_ROOT{%{_sysconfdir}/fpm.d,%{_sbindir},%{_datadir}/fpm}
+libtool --mode=install install -p sapi/fpm/php-fpm $RPM_BUILD_ROOT%{_sbindir}/%{name}-fpm
+cp -p sapi/fpm/php-fpm.8 $RPM_BUILD_ROOT%{_mandir}/man8/%{name}-fpm.8
+cp -p sapi/fpm/php-fpm.conf $RPM_BUILD_ROOT%{_sysconfdir}
+cp -p sapi/fpm/php-fpm.conf-d $RPM_BUILD_ROOT%{_sysconfdir}/fpm.d/www.conf
+cp -p sapi/fpm/status.html $RPM_BUILD_ROOT%{_datadir}/fpm
+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/php-fpm
+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}#
+ s#/etc/php#%{_sysconfdir}#
+ s#@processname@#%{name}-fpm#g
+' $RPM_BUILD_ROOT{/etc/{rc.d/init.d/%{name}-fpm,logrotate.d/%{name}-fpm},%{_sysconfdir}/php-fpm.conf,%{_sysconfdir}/fpm.d/www.conf}
%endif
# install Embedded API
%endif
# install CLI
-libtool --mode=install install -p sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/php.cli
-cp -p sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1/php.1
-echo ".so php.1" >$RPM_BUILD_ROOT%{_mandir}/man1/php.cli.1
-ln -sf php.cli $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
+echo ".so php%{ver_suffix}.1" >$RPM_BUILD_ROOT%{_mandir}/man1/php.1
+ln -sf php%{ver_suffix} $RPM_BUILD_ROOT%{_bindir}/php
-sed -e 's#%{_prefix}/lib/php#%{_libdir}/php#g' php.ini > $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
+# .cli extension is installed only if default php.spec in distro for legacy purposes
+%if "%{?php_suffix}" == "" && "%{pld_release}" != "ac"
+ln -s php%{ver_suffix} $RPM_BUILD_ROOT%{_bindir}/php.cli
+%endif
+
+cp -p php.ini $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
cp -p %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/php-cli.ini
cp -p %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/browscap.ini
%{__rm} -f $RPM_BUILD_ROOT%{_libdir}/apache/libphp5.la
%endif
+# ensure that paths are correct for current php version and arch
+grep -El '/etc/php/|/usr/lib/php/' $RPM_BUILD_ROOT%{_sysconfdir}/*.ini | xargs -r \
+%{__sed} -i -e '
+ s#/usr/lib/php#%{php_extensiondir}#
+ s#/etc/php#%{_sysconfdir}#
+'
+
install -d $RPM_BUILD_ROOT%{_sysconfdir}/conf.d
cp -p conf.d/*.ini $RPM_BUILD_ROOT%{_sysconfdir}/conf.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
+ ln -snf /usr/share/automake/config.{guess,sub} $RPM_BUILD_ROOT%{_libdir}/%{name}/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
+ ln -snf %{_aclocaldir}/${i} $RPM_BUILD_ROOT%{_libdir}/%{name}/build
done
- ln -snf %{_datadir}/libtool/config/ltmain.sh $RPM_BUILD_ROOT%{_libdir}/php/build
+ ln -snf %{_datadir}/libtool/config/ltmain.sh $RPM_BUILD_ROOT%{_libdir}/%{name}/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
+ ln -snf %{_aclocaldir}/libtool.m4 $RPM_BUILD_ROOT%{_libdir}/%{name}/build
+ ln -snf %{_datadir}/libtool/ltmain.sh $RPM_BUILD_ROOT%{_libdir}/%{name}/build
%endif
-ln -snf %{_bindir}/shtool $RPM_BUILD_ROOT%{_libdir}/php/build
+ln -snf %{_bindir}/shtool $RPM_BUILD_ROOT%{_libdir}/%{name}/build
+sed -i -e '/^phpdir/ s,/php/build,/%{name}/build,' $RPM_BUILD_ROOT%{_bindir}/phpize
# for php-pecl-mailparse
install -d $RPM_BUILD_ROOT%{_includedir}/php/ext/mbstring
sed -i -e "/dependency_libs/ s,/[^ ]*/libs/libphp_common.la,%{_libdir}/libphp_common.la," $RPM_BUILD_ROOT%{_libdir}/libphp5.la
%endif
# better solution?
-sed -i -e 's|libphp_common.la|$(libdir)/libphp_common.la|' $RPM_BUILD_ROOT%{_libdir}/php/build/acinclude.m4
+sed -i -e 's|libphp_common.la|$(libdir)/libphp_common.la|' $RPM_BUILD_ROOT%{_libdir}/%{name}/build/acinclude.m4
%clean
rm -rf $RPM_BUILD_ROOT
-%post -n apache1-mod_php
+%post -n apache1-mod_%{name}
if [ "$1" = "1" ]; then
%service -q apache restart
fi
-%postun -n apache1-mod_php
+%postun -n apache1-mod_%{name}
if [ "$1" = "0" ]; then
%service -q apache restart
fi
-%post -n apache-mod_php
+%post -n apache-mod_%{name}
if [ "$1" = "1" ]; then
%service -q httpd restart
fi
-%postun -n apache-mod_php
+%postun -n apache-mod_%{name}
if [ "$1" = "0" ]; then
%service -q httpd restart
fi
%useradd -u 51 -r -s /bin/false -c "HTTP User" -g http http
%post fpm
-/sbin/chkconfig --add php-fpm
-%service php-fpm restart
+/sbin/chkconfig --add %{name}-fpm
+%service %{name}-fpm restart
%preun fpm
if [ "$1" = 0 ]; then
- %service php-fpm stop
- /sbin/chkconfig --del php-fpm
+ %service %{name}-fpm stop
+ /sbin/chkconfig --del %{name}-fpm
fi
%postun fpm
[ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart
[ ! -f /etc/httpd/conf.d/??_mod_php.conf ] || %service -q httpd restart
-%if %{with apache1}
-%triggerpostun -n apache1-mod_php -- php < 4:5.0.4-9.11
-sed -i -e '
- /^AddType application\/x-httpd-php \.php/s,^,#,
- /^\(Add\|Load\)Module.*php5\.\(so\|c\)/d
-' /etc/apache/apache.conf
-%service -q apache restart
-%endif
-
-%if %{with apache2}
-%triggerpostun -n apache-mod_php -- php < 4:5.0.4-7.1
-# for fixed php-SAPI.ini, the poor php-apache.ini was never read for apache2
-if [ -f %{_sysconfdir}/php-apache.ini.rpmsave ]; then
- cp -f %{_sysconfdir}/php-apache2handler.ini{,.rpmnew}
- mv -f %{_sysconfdir}/php-apache.ini.rpmsave %{_sysconfdir}/php-apache2handler.ini
-fi
-%endif
+%triggerpostun common -- php-common < 4:5.3.28-7
+# migrate configs /etc/php/conf.d -> /etc/phpXY/conf.d/
+# do config migration in php-common trigger, as the trigger is ran after all packages are upgraded
+# this way we can stick to one trigger, instead of attaching one for each (sub)package!
+for f in /etc/php/*.ini.rpmsave /etc/php/*.d/*.ini.rpmsave; do
+ test -f "$f" || continue
+ bn=${f#/etc/php/}
+ dn=${bn%/*}
+ fn=${bn#*/}
+ test "$dn" = "$fn" && dn=
+ fn=${fn%.rpmsave}
+ nf=%{_sysconfdir}/$dn/$fn
+ test -f "$nf" || continue
+ cp -vf $nf{,.rpmnew}
+ mv -vf $f $nf
+ %{__sed} -i -e '
+ s#%{_libdir}/php#%{_libdir}/%{name}#
+ s#/etc/php#%{_sysconfdir}#
+ ' $nf
+done
# common macros called at extension post/postun scriptlet
%define extension_scripts() \
%extension_scripts zlib
%if %{with apache1}
-%files -n apache1-mod_php
+%files -n apache1-mod_%{name}
%defattr(644,root,root,755)
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/apache/conf.d/*_mod_php.conf
%dir %{_sysconfdir}/apache.d
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-apache.ini
%attr(755,root,root) %{_libdir}/apache1/libphp5.so
+%attr(755,root,root) %{_libdir}/apache1/libphp5-*.*.so
%endif
%if %{with apache2}
-%files -n apache-mod_php
+%files -n apache-mod_%{name}
%defattr(644,root,root,755)
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/httpd/conf.d/*_mod_php.conf
%dir %{_sysconfdir}/apache2handler.d
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-apache2handler.ini
%attr(755,root,root) %{_libdir}/apache/libphp5.so
+%attr(755,root,root) %{_libdir}/apache/libphp5-*.*.so
%endif
%if %{with litespeed}
%files litespeed
%defattr(644,root,root,755)
-%attr(755,root,root) %{_sbindir}/php.litespeed
+%attr(755,root,root) %{_sbindir}/%{name}.litespeed
%endif
%if %{with cgi}
%defattr(644,root,root,755)
%dir %{_sysconfdir}/cgi-fcgi.d
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-cgi-fcgi.ini
-%attr(755,root,root) %{_bindir}/php.cgi
-%attr(755,root,root) %{_bindir}/php.fcgi
+%attr(755,root,root) %{_bindir}/%{name}.cgi
+%attr(755,root,root) %{_bindir}/%{name}.fcgi
%endif
%if %{with embed}
%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}/php%{ver_suffix}
+%{_mandir}/man1/php%{ver_suffix}.1*
+
+# legacy. do we really need it?
+%if "%{?php_suffix}" == "" && "%{pld_release}" != "ac"
%attr(755,root,root) %{_bindir}/php.cli
-%{_mandir}/man1/php.cli.1*
+%endif
%files program
%defattr(644,root,root,755)
%doc sapi/fpm/{CREDITS,LICENSE}
%dir %{_sysconfdir}/fpm.d
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-fpm.conf
-%attr(755,root,root) %{_sbindir}/php-fpm
-%{_mandir}/man8/php-fpm.8*
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/php-fpm
-%attr(754,root,root) /etc/rc.d/init.d/php-fpm
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpm.d/www.conf
+%attr(755,root,root) %{_sbindir}/%{name}-fpm
+%{_mandir}/man8/%{name}-fpm.8*
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/logrotate.d/%{name}-fpm
+%attr(754,root,root) /etc/rc.d/init.d/%{name}-fpm
%dir %{_datadir}/fpm
%{_datadir}/fpm/status.html
%endif
%attr(755,root,root) %{_libdir}/libphp_common.so
%{_libdir}/libphp_common.la
%{_includedir}/php
-%{_libdir}/php/build
+%{_libdir}/%{name}/build
%{_mandir}/man1/php-config.1*
%{_mandir}/man1/phpize.1*
%if %{with embed}
%files dba
%defattr(644,root,root,755)
+%doc ext/dba/{CREDITS,README}
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/dba.ini
%attr(755,root,root) %{php_extensiondir}/dba.so
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/dom.ini
%attr(755,root,root) %{php_extensiondir}/dom.so
+%if %{with enchant}
%files enchant
%defattr(644,root,root,755)
%doc ext/enchant/{CREDITS,docs/examples}
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/enchant.ini
%attr(755,root,root) %{php_extensiondir}/enchant.so
+%endif
%files exif
%defattr(644,root,root,755)
%attr(755,root,root) %{php_extensiondir}/mysqlnd.so
%endif
-%if %{with oci8}
+%if %{with oci}
%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
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/pdo_mysql.ini
%attr(755,root,root) %{php_extensiondir}/pdo_mysql.so
-%if %{with oci8}
+%if %{with oci}
%files pdo-oci
%defattr(644,root,root,755)
%doc ext/pdo_oci/CREDITS