# TODO
+# - lost patches:
+# +Patch11: %{name}-acam.patch
+# +Patch13: %{name}-tsrmlsfetchgcc2.patch
+# +Patch16: %{name}-sybase-fix.patch
+# +Patch26: %{name}-pear.patch
+# +Patch28: %{name}-bug-42952.patch
+# +Patch30: %{name}-apr-apu.patch
+# +Patch31: %{name}-fcgi-error_log-no-newlines.patch
+# +Patch32: %{name}-curl-limit-speed.patch
+# +Patch33: %{name}-mime_magic.patch
+# +Patch34: %{name}-libtool.patch
+# +Patch36: %{name}-mysql-charsetphpini.patch
+# +Patch37: %{name}-mysqli-charsetphpini.patch
+# +Patch38: %{name}-pdo_mysql-charsetphpini.patch
+# +Patch44: %{name}-include_path.patch
+# +Patch45: %{name}-imap-annotations.patch
+# +Patch46: %{name}-imap-myrights.patch
+# - php CLI has safe mode enabled off the box
# - deal with modules removed from php and not moved to PECL, still not obsoleted anywhere
# - removed from php 5.0 (currently in php4):
# db, hyperwave, java, mcal, overload, qtdom
# - removed from php 5.2:
# filepro, hw
# - removed from php 5.3:
-# dbase, mhash, mime_magic, ming, ncurses, sybase
+# dbase, mime_magic, ming, ncurses, sybase
# - make additional headers and checking added by mail patch configurable
-# - modularize session, standard (output from pure php -m)?
+# - modularize standard (output from pure php -m)?
# - lib64 patch obsolete by $PHP_LIBDIR ?
-# - move mysqlnd out of libphp-common.so?
+# - move mysqlnd out of libphp-common.so, or link again with mysql-devel?
# - WARNING: Phar: sha256/sha512 signature support disabled if ext/hash is
# built shared, also PHAR_HAVE_OPENSSL is false if openssl is built shared.
# make it runtime dep and add Suggests (or php warning messages)
#+ereg
# libxml
#+mysqlnd
-# pcre
# Reflection
-# session
#
# Conditional build:
%bcond_with fdf # with FDF (PDF forms) module (BR: proprietary lib)
%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 system_gd # with system gd (we prefer internal since it enables few more features)
+%bcond_with litespeed # build litespeed module
%bcond_without curl # without CURL extension module
%bcond_without filter # without filter extension module
%bcond_without imap # without IMAP extension module
%bcond_without mysqli # without mysqli support (Requires mysql > 4.1)
%bcond_without odbc # without ODBC extension module
%bcond_without openssl # without OpenSSL support and OpenSSL extension (module)
+%bcond_without pcre # without PCRE extension module
%bcond_without pgsql # without PostgreSQL extension module
%bcond_without phar # without phar extension module
%bcond_without pspell # without pspell extension module
%bcond_without xmlrpc # without XML-RPC extension module
%bcond_without apache1 # disable building apache 1.3.x module
%bcond_without apache2 # disable building apache 2.x module
-%bcond_without zts # disable experimental-zts
-%bcond_with tests # default off; test process very often hangs on buildersl; perform "make test"
+%bcond_without zts # disable Zend Thread Safety
+%bcond_without fpm # fpm patches from http://www.php-fpm.org/
+%bcond_without suhosin # with suhosin patch
+%bcond_with tests # default off; test process very often hangs on builders; perform "make test"
%bcond_with type_hints # experimental support for strict typing/casting
%define apxs1 /usr/sbin/apxs1
%undefine with_interbase
%endif
+%ifnarch %{ix86} %{x8664}
+# unsupported, see sapi/cgi/fpm/fpm_atomic.h
+%undefine with_fpm
+%endif
+
%if %{without apache1} && %{without apache2}
ERROR: You need to select at least one Apache SAPI to build shared modules.
%endif
-%define rel 0.3
+# filter depends on pcre
+%if %{without pcre}
+%undefine with_filter
+%endif
+
+%define rel 1.12
Summary: PHP: Hypertext Preprocessor
Summary(fr.UTF-8): Le langage de script embarque-HTML PHP
Summary(pl.UTF-8): Język skryptowy PHP
Summary(ru.UTF-8): PHP Версии 5 - язык препроцессирования HTML-файлов, выполняемый на сервере
Summary(uk.UTF-8): PHP Версії 5 - мова препроцесування HTML-файлів, виконувана на сервері
Name: php
-Version: 5.3.0
+Version: 5.3.1
Release: %{rel}%{?with_type_hints:th}
Epoch: 4
License: PHP
Group: Libraries
Source0: http://www.php.net/distributions/%{name}-%{version}.tar.bz2
-# Source0-md5: 846760cd655c98dfd86d6d97c3d964b0
+# Source0-md5: 63e97ad450f0f7259e785100b634c797
Source2: %{name}-mod_%{name}.conf
Source3: %{name}-cgi-fcgi.ini
Source4: %{name}-apache.ini
Source5: %{name}-cli.ini
# Taken from: http://browsers.garykeith.com/downloads.asp
Source9: %{name}_browscap.ini
+Source10: %{name}-fpm.init
+Source11: %{name}-fpm.logrotate
Patch0: %{name}-shared.patch
Patch1: %{name}-pldlogo.patch
Patch2: %{name}-mail.patch
Patch4: %{name}-libpq_fs_h_path.patch
Patch5: %{name}-filter-shared.patch
Patch6: %{name}-build_modules.patch
-Patch7: %{name}-config-file-scan-dir.patch
-Patch8: %{name}-sapi-ini-file.patch
+Patch7: %{name}-sapi-ini-file.patch
+Patch8: %{name}-config-file-scan-dir.patch
Patch9: %{name}-sh.patch
Patch10: %{name}-ini.patch
+# untill 5.3.2 when this gets released
+Patch11: %{name}-bug-50458.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
Patch19: %{name}-gd_imagerotate_enable.patch
Patch20: %{name}-uint32_t.patch
Patch21: %{name}-dba-link.patch
-Patch23: %{name}-both-apxs.patch
-Patch24: %{name}-builddir.patch
-Patch25: %{name}-zlib-for-getimagesize.patch
-Patch29: %{name}-config-dir.patch
-Patch31: %{name}-fcgi-graceful.patch
-Patch38: %{name}-tds.patch
-Patch43: %{name}-use-prog_sendmail.patch
-%if %{with type_hints}
-Patch50: http://ilia.ws/patch/type_hint_53_v2.txt
-%endif
+Patch22: %{name}-both-apxs.patch
+Patch23: %{name}-builddir.patch
+Patch24: %{name}-zlib-for-getimagesize.patch
+Patch25: %{name}-stupidapache_version.patch
+Patch27: %{name}-config-dir.patch
+Patch29: %{name}-fcgi-graceful.patch
+Patch35: %{name}-tds.patch
+Patch39: %{name}-use-prog_sendmail.patch
+Patch40: %{name}-fpm.patch
+Patch41: %{name}-fpm-config.patch
+Patch42: %{name}-fpm-shared.patch
+Patch43: %{name}-silent-session-cleanup.patch
+Patch47: suhosin.patch
+Patch49: %{name}-m4-divert.patch
+Patch50: extension-shared-optional-dep.patch
+Patch51: spl-shared.patch
+Patch52: pcre-shared.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: cyrus-sasl-devel
BuildRequires: db-devel >= 4.0
BuildRequires: elfutils-devel
-%if %{with xmlrpc}
-BuildRequires: expat-devel
-%endif
+BuildRequires: fcgi-devel
%{?with_fdf:BuildRequires: fdftk-devel}
BuildRequires: flex
-Requires: fcgi-devel
+BuildRequires: pkgconfig
%if %{with mssql} || %{with sybase_ct}
BuildRequires: freetds-devel >= 0.82
%endif
BuildRequires: gdbm-devel
BuildRequires: gmp-devel
%{?with_imap:BuildRequires: imap-devel >= 1:2001-0.BETA.200107022325.2}
+BuildRequires: libicu-devel
BuildRequires: libjpeg-devel
BuildRequires: libltdl-devel >= 1.4
BuildRequires: libmcrypt-devel >= 2.4.4
BuildRequires: libpng-devel >= 1.0.8
-# otherwise check for "xxx-pld-linux-g++ static flag -static" fails
-BuildRequires: libstdc++-static
BuildRequires: libtiff-devel
%if "%{pld_release}" != "ac"
BuildRequires: libtool >= 2:2.2
%endif
%{?with_snmp:BuildRequires: net-snmp-devel >= 5.0.7}
BuildRequires: pam-devel
-BuildRequires: pcre-devel >= 6.6
+%{?with_pcre:BuildRequires: pcre-devel >= 6.6}
%{?with_pgsql:BuildRequires: postgresql-backend-devel >= 7.2}
%{?with_pgsql:BuildRequires: postgresql-devel}
BuildRequires: readline-devel
%{?with_recode:BuildRequires: recode-devel >= 3.5d-3}
BuildRequires: rpm >= 4.4.9-56
BuildRequires: rpm-build >= 4.4.0
-BuildRequires: rpmbuild(macros) >= 1.238
+BuildRequires: rpmbuild(macros) >= 1.519
%{?with_sqlite:BuildRequires: sqlite-devel}
%{?with_sqlite3:BuildRequires: sqlite3-devel >= 3.3.9}
BuildRequires: t1lib-devel
BuildRequires: apr-devel >= 1:1.0.0
BuildRequires: apr-util-devel >= 1:1.0.0
%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
%description -n apache-mod_php -l pl.UTF-8
php jako moduł DSO (Dynamic Shared Object) dla apache 2.x.
+%package litespeed
+Summary: PHP for litespeed http server
+Summary(pl.UTF-8): PHP dla serwera http litespeed
+Group: Development/Languages/PHP
+Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Requires: litespeed
+Provides: webserver(php) = %{version}
+
+%description litespeed
+PHP for litespeed http server.
+
+%description litespeed -l pl.UTF-8
+PHP dla serwera http litespeed.
+
%package cgi
-Summary: php as CGI/FastCGI program
-Summary(pl.UTF-8): php jako program CGI/FastCGI
+Summary: PHP as CGI/FastCGI program
+Summary(pl.UTF-8): PHP jako program CGI/FastCGI
Group: Development/Languages/PHP
Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Provides: %{name}-fcgi = %{epoch}:%{version}-%{release}
Provides: php(cgi)
Provides: php(fcgi)
Provides: webserver(php)
-Provides: %{name}-fcgi = %{epoch}:%{version}-%{release}
Obsoletes: php-fcgi < 4:5.3.0
%description cgi
-php as CGI or FastCGI program.
+PHP as CGI or FastCGI program.
%description cgi -l pl.UTF-8
-php jako program CGI lub FastCGI.
+PHP jako program CGI lub FastCGI.
%package cli
-Summary: php as CLI interpreter
-Summary(pl.UTF-8): php jako interpreter działający z linii poleceń
+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}
%description cli
-php as CLI interpreter.
+PHP as CLI interpreter.
%description cli -l pl.UTF-8
-php jako interpreter działający z linii poleceń.
+PHP jako interpreter działający z linii poleceń.
%package program
Summary: /usr/bin/php symlink
%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
+Group: Development/Languages/PHP
+URL: http://www.php-fpm.org/
+Requires(post,preun): /sbin/chkconfig
+Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Requires: libevent >= 1.4.7-3
+Requires: rc-scripts
+Provides: webserver(php) = %{version}
+
+%description fpm
+PHP FastCGI Process Manager.
+
%package common
-Summary: Common files needed by both Apache modules and CGI/CLI SAPI-s.
+Summary: Common files needed by both Apache modules and CGI/CLI SAPI-s
Summary(pl.UTF-8): Wspólne pliki dla modułu apache'a i programu CGI
Summary(ru.UTF-8): Разделяемые библиотеки для php
Summary(uk.UTF-8): Бібліотеки спільного використання для php
Provides: php(libxml)
Provides: php(modules_api) = %{php_api_version}
Provides: php(overload)
-Provides: php(pcre)
Provides: php(reflection)
-Provides: php(session)
-Provides: php(spl)
Provides: php(standard)
Provides: php(zend_extension_api) = %{zend_extension_api}
Provides: php(zend_module_api) = %{zend_module_api}
Provides: php5(debug) = %{php_debug}
Provides: php5(thread-safety) = %{zend_zts}
-Obsoletes: php-mhash
-Obsoletes: php-pcre < 4:5.2.0
Obsoletes: php-pecl-domxml
-Obsoletes: php-session < 3:4.2.1-2
Conflicts: php4-common < 3:4.4.4-8
Conflicts: rpm < 4.4.2-0.2
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: autoconf
Requires: automake
+%if "%{pld_release}" != "ac"
+Requires: libtool >= 2:2.2
+%else
Requires: libtool
-Requires: pcre-devel >= 6.6
+%endif
+%{?with_pcre:Requires: pcre-devel >= 6.6}
Requires: shtool
Obsoletes: php-pear-devel
Obsoletes: php4-devel
URL: http://www.php.net/manual/en/book.gmp.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Provides: php(hash)
+Provides: php(mhash)
+Obsoletes: php-mhash
Obsoletes: php-pecl-hash
%description hash
Provides: php(intl)
%description intl
-Internationalization extension (further is referred as Intl) is a wrapper
-for ICU library, enabling PHP programmers to perform UCA-conformant
-collation and date/time/number/currency formatting in their scripts.
+Internationalization extension (further is referred as Intl) is a
+wrapper for ICU library, enabling PHP programmers to perform
+UCA-conformant collation and date/time/number/currency formatting in
+their scripts.
%description intl -l pl.UTF-8
-Rozszerzenie do internacjonalizacji (dalej nazywane Intl) jest wrapperem
-biblioteki ICU, pozwalającym programistom PHP na wykonywanie w skryptach
-porównań zdgodnych z UCA oraz formatowań daty/czasu/walut.
+Rozszerzenie do internacjonalizacji (dalej nazywane Intl) jest
+wrapperem biblioteki ICU, pozwalającym programistom PHP na wykonywanie
+w skryptach porównań zdgodnych z UCA oraz formatowań daty/czasu/walut.
%package json
Summary: PHP C extension for JSON serialization
Group: Libraries
URL: http://www.php.net/manual/en/book.mysqli.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Requires: %{name}-spl = %{epoch}:%{version}-%{release}
Provides: php(mysqli)
%description mysqli
Moduł PHP umożliwiający tworzenie nowych procesów i kontrolę nad nimi.
Obsługuje funkcje takie jak fork(), waitpid(), signal() i podobne.
+%package pcre
+Summary: PCRE extension module for PHP
+Summary(pl.UTF-8): Moduł PCRE dla PHP
+Group: Libraries
+Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Provides: php(pcre)
+
+%description pcre
+This is a dynamic shared object (DSO) for PHP that will add Perl
+Compatible Regular Expression support.
+
+%description pcre -l pl.UTF-8
+Moduł PHP umożliwiający korzystanie z perlowych wyrażeń regularnych
+(Perl Compatible Regular Expressions)
+
%package pdo
Summary: PHP Data Objects (PDO)
Summary(pl.UTF-8): Obsługa PHP Data Objects (PDO)
Group: Libraries
URL: http://www.php.net/manual/en/book.pdo.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Requires: %{name}-spl = %{epoch}:%{version}-%{release}
Provides: php(pdo)
Obsoletes: php-pecl-PDO
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)
%description phar
Moduł PHP dodający możliwość konwersji kodowania plików (poprzez
bibliotekę recode).
+%package session
+Summary: session extension module for PHP
+Summary(pl.UTF-8): Moduł session dla PHP
+Group: Libraries
+Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Suggests: %{name}-hash = %{epoch}:%{version}-%{release}
+Provides: php(session)
+
+%description session
+This is a dynamic shared object (DSO) for PHP that will add session
+support.
+
+%description session -l pl.UTF-8
+Moduł PHP dodający obsługę sesji.
+
%package shmop
Summary: Shared Memory Operations extension module for PHP
Summary(pl.UTF-8): Moduł shmop dla PHP
%description sockets -l pl.UTF-8
Moduł PHP dodający obsługę gniazdek.
+%package spl
+Summary: Standard PHP Library module for PHP
+Summary(pl.UTF-8): Moduł SPL dla PHP
+Group: Libraries
+URL: http://php.net/manual/en/book.spl.php
+Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Requires: %{name}-pcre = %{epoch}:%{version}-%{release}
+Requires: %{name}-simplexml = %{epoch}:%{version}-%{release}
+Provides: php(spl)
+
+%description spl
+This is a dynamic shared object (DSO) for PHP that will add Standard
+PHP Library support.
+
+%description spl -l pl.UTF-8
+Moduł PHP dodający obsługę gniazdek.
+
%package sqlite
Summary: SQLite extension module for PHP
Summary(pl.UTF-8): Moduł SQLite dla PHP
Group: Libraries
URL: http://www.php.net/manual/en/book.sqlite.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
-# sqlite ext extends spl and pdo
-Requires: %{name}-pdo = %{epoch}:%{version}-%{release}
+Suggests: %{name}-pdo = %{epoch}:%{version}-%{release}
+Suggests: %{name}-spl = %{epoch}:%{version}-%{release}
Provides: php(sqlite)
%description sqlite
Group: Libraries
URL: http://www.php.net/manual/en/book.wddx.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
-#Requires: %{name}-session = %{epoch}:%{version}-%{release}
+Requires: %{name}-session = %{epoch}:%{version}-%{release}
Requires: %{name}-xml = %{epoch}:%{version}-%{release}
Provides: php(wddx)
Group: Libraries
URL: http://www.php.net/manual/en/book.xmlreader.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
-Requires: %{name}-dom = %{epoch}:%{version}-%{release}
+Suggests: %{name}-dom = %{epoch}:%{version}-%{release}
Provides: php(xmlreader)
%description xmlreader
%prep
%setup -q
-
-%if %{with type_hints}
-%patch50 -p0
-%endif
-
+# prep for suhosin patch
+%{__sed} -i -e 's,\r$,,' Zend/Zend.dsp Zend/ZendTS.dsp
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
-%patch7 -p1
%patch8 -p1
+%patch7 -p1
%patch9 -p1
-
cp php.ini-production php.ini
%patch10 -p1
-
+%if %{with type_hints}
+%patch12 -p0
+%endif
%patch14 -p1
%patch15 -p1
%patch17 -p1
%endif
%patch20 -p1
%patch21 -p1
-
+%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
-
+%patch27 -p1
%patch29 -p1
-%patch31 -p1
-%patch38 -p1
-
+%patch35 -p1
+%patch39 -p1
+%if %{with fpm}
+%patch40 -p1
+%patch41 -p1
+%patch42 -p1
+%endif
%patch43 -p1
+%if %{with suhosin}
+%patch47 -p1
+%endif
+%patch49 -p1
+%patch50 -p1
+%patch51 -p1
+%patch52 -p1
+
+%patch11 -p4
+
+# cleanup backups after patching
+find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
# conflict seems to be resolved by recode patches
rm -f ext/recode/config9.m4
#rm -rf ext/soap/interop
rm -rf ext/xmlrpc/libxmlrpc
+cp -af Zend/LICENSE{,.Zend}
+
+# breaks build
+sed -i -e 's#-fvisibility=hidden##g' configure*
+
%build
API=$(awk '/#define PHP_API_VERSION/{print $3}' main/php.h)
if [ $API != %{php_api_version} ]; then
fi
export EXTENSION_DIR="%{php_extensiondir}"
-if [ ! -f _built-conf ]; then # configure once (for faster debugging purposes)
- rm -f Makefile.{cgi-fcgi,cli,apxs{1,2}} # now remove Makefile copies
+# configure once (for faster debugging purposes)
+if [ ! -f _built-conf ]; then
+ # now remove Makefile copies
+ rm -f Makefile.{cgi-fcgi,fpm,cli,apxs{1,2}}
%{__libtoolize}
%{__aclocal}
cp -f /usr/share/automake/config.* .
sapis="
cgi-fcgi cli
+%if %{with fpm}
+fpm
+%endif
%if %{with apache1}
apxs1
%endif
%if %{with apache2}
apxs2
%endif
+%if %{with litespeed}
+litespeed
+%endif
"
for sapi in $sapis; do
: SAPI $sapi
- [ -f Makefile.$sapi ] && continue # skip if already configured (for faster debugging purposes)
+ # skip if already configured (for faster debugging purposes)
+ [ -f Makefile.$sapi ] && continue
sapi_args=''
case $sapi in
cgi-fcgi)
- sapi_args=''
+ sapi_args='--disable-cli'
;;
cli)
sapi_args='--disable-cgi'
;;
+ fpm)
+ sapi_args='--disable-cli --with-fpm'
+ ;;
apxs1)
ver=$(rpm -q --qf '%{V}' apache1-devel)
- sapi_args="--with-apxs=%{apxs1}"
+ sapi_args="--disable-cli --with-apxs=%{apxs1} --with-apache-version=$ver"
;;
apxs2)
ver=$(rpm -q --qf '%{V}' apache-devel)
- sapi_args="--with-apxs2=%{apxs2}"
+ sapi_args="--disable-cli --with-apxs2=%{apxs2} --with-apache-version=$ver"
+ ;;
+ litespeed)
+ sapi_args='--with-litespeed'
;;
esac
--enable-json=shared \
--enable-hash=shared \
--enable-xmlwriter=shared \
+%if %{with fpm}
+ --with-libevent=shared \
+ --with-fpm-conf=%{_sysconfdir}/fpm.conf \
+ --with-fpm-log=/var/log/fpm.log \
+ --with-fpm-pid=/var/run/php/fpm.pid \
+ --with-fpm-port=9000 \
+ --with-fpm-user=http \
+ --with-fpm-group=http \
+%endif
%if %{with mssql} || %{with sybase_ct}
--with-pdo-dblib=shared \
%endif
%{?with_odbc:--with-pdo-odbc=shared,unixODBC,/usr} \
%{?with_pgsql:--with-pdo-pgsql=shared} \
%{?with_sqlite:--with-pdo-sqlite=shared,/usr} \
+ --without-libexpat-dir \
--enable-mysqlnd-threading \
--enable-posix=shared \
- --enable-session \
--enable-shared \
+ --enable-session=shared \
--enable-shmop=shared \
--enable-simplexml=shared \
+ --enable-spl=shared \
--enable-sysvmsg=shared \
--enable-sysvsem=shared \
--enable-sysvshm=shared \
%{?with_oci8:--with-oci8=shared} \
%{?with_openssl:--with-openssl=shared} \
--with-kerberos \
- --with-pcre-regex=/usr \
+ %{!?with_pcre:--without-pcre-regex}%{?with_pcre:--with-pcre-regex=/usr} \
%{!?with_filter:--disable-filter}%{?with_filter:--enable-filter=shared} \
--with-pear=%{php_pear_dir} \
%{!?with_pgsql:--without-pgsql}%{?with_pgsql:--with-pgsql=shared,/usr} \
--with-zlib-dir=shared,/usr \
--enable-zip=shared,/usr \
+ # save for debug
cp -f Makefile Makefile.$sapi
cp -f main/php_config.h php_config.h.$sapi
cp -f config.log config.log.$sapi
done
-# must make this first, so modules can link against it.
+# as we build each SAPI in own make, adjust php-config.in forehead
+sapis=$(awk '/^PHP_SAPI = /{print $3}' Makefile.* | sort -u | xargs)
+sed -i -e "s,@PHP_INSTALLED_SAPIS@,$sapis," "scripts/php-config.in"
+
+# must make libphp_common first, so modules can link against it.
%{__make} libphp_common.la
%{__make} build-modules
%{__make} libtool-sapi LIBTOOL_SAPI=sapi/apache2handler/libphp5.la -f Makefile.apxs2
%endif
-# CGI
+%if %{with litespeed}
+%{__make} -f Makefile.litespeed
+%endif
+
+# CGI/FCGI
cp -af php_config.h.cgi-fcgi main/php_config.h
-rm -rf sapi/cgi/.libs sapi/cgi/*.lo
-%{__make} sapi/cgi/php-cgi -f Makefile.cgi-fcgi
+%{__make} -f Makefile.cgi-fcgi
[ "$(echo '<?=php_sapi_name();' | ./sapi/cgi/php-cgi -qn)" = cgi-fcgi ] || exit 1
# CLI
cp -af php_config.h.cli main/php_config.h
-%{__make} sapi/cli/php -f Makefile.cli
+%{__make} -f Makefile.cli
[ "$(echo '<?=php_sapi_name();' | ./sapi/cli/php -qn)" = cli ] || exit 1
+%if %{with fpm}
+cp -af php_config.h.fpm main/php_config.h
+%{__make} -f Makefile.fpm
+ ./sapi/fpm/php-fpm -qn -m > /dev/null
+%endif
+
%if %{with tests}
# Run tests, using the CLI SAPI
export NO_INTERACTION=1 REPORT_EXIT_STATUS=1 MALLOC_CHECK_=2
libtool --silent --mode=install install sapi/apache2handler/libphp5.la $RPM_BUILD_ROOT%{_libdir}/apache
%endif
+# install litespeed sapi
+%if %{with litespeed}
+libtool --silent --mode=install install sapi/litespeed/php $RPM_BUILD_ROOT%{_bindir}/php.litespeed
+%endif
+
libtool --silent --mode=install install libphp_common.la $RPM_BUILD_ROOT%{_libdir}
# fix install paths, avoid evil rpaths
sed -i -e "s|^libdir=.*|libdir='%{_libdir}'|" $RPM_BUILD_ROOT%{_libdir}/libphp_common.la
# better solution?
sed -i -e 's|libphp_common.la|$(libdir)/libphp_common.la|' $RPM_BUILD_ROOT%{_libdir}/php/build/acinclude.m4
-# install CGI
+# install CGI/FCGI
libtool --silent --mode=install install sapi/cgi/php-cgi $RPM_BUILD_ROOT%{_bindir}/php.cgi
ln -sf php.cgi $RPM_BUILD_ROOT%{_bindir}/php.fcgi
+# install FCGI PM
+%if %{with fpm}
+libtool --silent --mode=install install sapi/fpm/php-fpm $RPM_BUILD_ROOT%{_bindir}/php.fpm
+cp -a sapi/fpm/php-fpm.1 $RPM_BUILD_ROOT%{_mandir}/man1/php-fpm.1
+cp -a sapi/fpm/php_fpm.conf $RPM_BUILD_ROOT%{_sysconfdir}/fpm.conf
+install -d $RPM_BUILD_ROOT/etc/rc.d/init.d
+install -p %{SOURCE10} $RPM_BUILD_ROOT/etc/rc.d/init.d/php-fpm
+install -d $RPM_BUILD_ROOT/etc/logrotate.d
+cp -a %{SOURCE11} $RPM_BUILD_ROOT/etc/logrotate.d/php-fpm
+%endif
+
# install CLI
libtool --silent --mode=install install sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/php.cli
install 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
sed -e 's#%{_prefix}/lib/php#%{_libdir}/php#g' php.ini > $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
install -d $RPM_BUILD_ROOT%{_sysconfdir}
-install %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/php-cli.ini
-install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/php-cgi-fcgi.ini
-install %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/browscap.ini
+cp -a %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/php-cli.ini
+cp -a %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/php-cgi-fcgi.ini
+cp -a %{SOURCE9} $RPM_BUILD_ROOT%{_sysconfdir}/browscap.ini
%if %{with apache1}
-install %{SOURCE3} $RPM_BUILD_ROOT/etc/apache/conf.d/70_mod_php.conf
-install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/php-apache.ini
+cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/apache/conf.d/70_mod_php.conf
+cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/php-apache.ini
rm -f $RPM_BUILD_ROOT%{_libdir}/apache1/libphp5.la
%endif
%if %{with apache2}
-install %{SOURCE3} $RPM_BUILD_ROOT/etc/httpd/conf.d/70_mod_php.conf
-install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/php-apache2handler.ini
+cp -a %{SOURCE2} $RPM_BUILD_ROOT/etc/httpd/conf.d/70_mod_php.conf
+cp -a %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/php-apache2handler.ini
rm -f $RPM_BUILD_ROOT%{_libdir}/apache/libphp5.la
%endif
-cp -f Zend/LICENSE{,.Zend}
-
# Generate stub .ini files for each subpackage
install -d $RPM_BUILD_ROOT%{_sysconfdir}/conf.d
generate_inifiles() {
conf="%{_sysconfdir}/conf.d/$mod.ini"
# xml needs to be loaded before wddx
[ "$mod" = "wddx" ] && conf="%{_sysconfdir}/conf.d/xml_$mod.ini"
+ # pre needs to be loaded before SPL
+ [ "$mod" = "pcre" ] && conf="%{_sysconfdir}/conf.d/PCRE.ini"
+ # spl needs to be loaded before mysqli
+ [ "$mod" = "spl" ] && conf="%{_sysconfdir}/conf.d/SPL.ini"
echo "+ $conf"
cat > $RPM_BUILD_ROOT$conf <<-EOF
; Enable $mod extension module
# tests
install -d $RPM_BUILD_ROOT%{php_data_dir}/tests/php
-install run-tests.php $RPM_BUILD_ROOT%{php_data_dir}/tests/php/run-tests.php
+install -p run-tests.php $RPM_BUILD_ROOT%{php_data_dir}/tests/php/run-tests.php
cp -a tests/* $RPM_BUILD_ROOT%{php_data_dir}/tests/php
%clean
%service -q httpd restart
fi
+%post fpm
+/sbin/chkconfig --add php-fpm
+%service php-fpm restart
+
+%preun fpm
+if [ "$1" = 0 ]; then
+ %service php-fpm stop
+ /sbin/chkconfig --del php-fpm
+fi
+
%post common -p /sbin/ldconfig
%postun common -p /sbin/ldconfig
%extension_scripts oci8
%extension_scripts odbc
%extension_scripts openssl
+%extension_scripts pcre
%extension_scripts pdo-dblib
%extension_scripts pdo-firebird
%extension_scripts pdo-mysql
%extension_scripts posix
%extension_scripts pspell
%extension_scripts recode
+%extension_scripts session
%extension_scripts shmop
%extension_scripts snmp
%extension_scripts soap
%extension_scripts sockets
+%extension_scripts spl
%extension_scripts sqlite
%extension_scripts sqlite3
%extension_scripts sybase-ct
%triggerun interbase -- %{name}-interbase < 4:5.0.4-9.1
%{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*interbase\.so/d' %{_sysconfdir}/php.ini
-%triggerun intl -- %{name}-intl < 4:5.0.4-9.1
-%{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*intl\.so/d' %{_sysconfdir}/php.ini
-
%triggerun ldap -- %{name}-ldap < 4:5.0.4-9.1
%{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*ldap\.so/d' %{_sysconfdir}/php.ini
%{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*pcntl\.so/d' %{_sysconfdir}/php-cli.ini
fi
+%triggerun pcre -- %{name}-pcre < 4:5.0.4-9.1
+%{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*pcre\.so/d' %{_sysconfdir}/php.ini
+
%triggerun pgsql -- %{name}-pgsql < 4:5.0.4-9.1
%{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*pgsql\.so/d' %{_sysconfdir}/php.ini
-%triggerun phar -- %{name}-phar < 4:5.0.4-9.1
-%{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*phar\.so/d' %{_sysconfdir}/php.ini
-
%triggerun posix -- %{name}-posix < 4:5.0.4-9.1
%{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*posix\.so/d' %{_sysconfdir}/php.ini
%triggerun recode -- %{name}-recode < 4:5.0.4-9.1
%{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*recode\.so/d' %{_sysconfdir}/php.ini
+%triggerun session -- %{name}-session < 4:5.0.4-9.1
+%{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*session\.so/d' %{_sysconfdir}/php.ini
+
%triggerun shmop -- %{name}-shmop < 4:5.0.4-9.1
%{__sed} -i -e '/^extension[[:space:]]*=[[:space:]]*shmop\.so/d' %{_sysconfdir}/php.ini
%attr(755,root,root) %{_libdir}/apache/libphp5.so
%endif
+%if %{with litespeed}
+%files litespeed
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/php.litespeed
+%endif
+
%files cgi
%defattr(644,root,root,755)
%dir %{_sysconfdir}/cgi-fcgi.d
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/php
+%if %{with fpm}
+%files fpm
+%defattr(644,root,root,755)
+%doc %lang(ru) sapi/fpm/readme-ru.markdown
+%doc sapi/fpm/nginx-site-conf.sample
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpm.conf
+%attr(755,root,root) %{_bindir}/php.fpm
+%{_mandir}/man1/php-fpm.1*
+%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
+%endif
+
%files common
%defattr(644,root,root,755)
%doc php.ini-*
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cli.d/pcntl.ini
%attr(755,root,root) %{php_extensiondir}/pcntl.so
+%if %{with pcre}
+%files pcre
+%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/PCRE.ini
+%attr(755,root,root) %{php_extensiondir}/pcre.so
+%endif
+
%files pdo
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/pdo.ini
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/simplexml.ini
%attr(755,root,root) %{php_extensiondir}/simplexml.so
+%files session
+%defattr(644,root,root,755)
+%doc ext/session/mod_files.sh
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/session.ini
+%attr(755,root,root) %{php_extensiondir}/session.so
+
%files shmop
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/shmop.ini
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/sockets.ini
%attr(755,root,root) %{php_extensiondir}/sockets.so
+%files spl
+%defattr(644,root,root,755)
+%doc ext/spl/{CREDITS,README,TODO}
+%doc ext/spl/examples
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/SPL.ini
+%attr(755,root,root) %{php_extensiondir}/spl.so
+
%if %{with sqlite}
%files sqlite
%defattr(644,root,root,755)