]> git.pld-linux.org Git - packages/php.git/blobdiff - php.spec
package php-session Suggest tmpwatch for /var/run/php cleanip
[packages/php.git] / php.spec
index 2f42d9eacc748c93a5c51d8875c1f759023f472d..547bb3a402b8fd85a7fc6f972263f07efc9ffe27 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -32,6 +32,7 @@
 %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_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
@@ -110,14 +111,18 @@ ERROR: You need to select at least one Apache SAPI to build shared modules.
 %undefine      with_filter
 %endif
 
-%define                orgname php
 %if "%{pld_release}" == "ac"
-%define                php_suffix 53
-%else
-%define                php_suffix %{nil}
+%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     2
+%define                rel     4
+%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
@@ -125,13 +130,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.3.16
+Version:       5.3.28
 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: 99cfd78531643027f60c900e792d21be
+# Source0-md5: 56ff88934e068d142d6c0deefd1f396b
 Source2:       %{orgname}-mod_%{orgname}.conf
 Source3:       %{orgname}-cgi-fcgi.ini
 Source4:       %{orgname}-apache.ini
@@ -188,6 +193,7 @@ Patch44:    %{orgname}-include_path.patch
 Patch45:       %{orgname}-imap-annotations.patch
 Patch46:       %{orgname}-imap-myrights.patch
 Patch47:       suhosin.patch
+Patch48:       php-bug-60598.patch
 Patch49:       %{orgname}-m4-divert.patch
 Patch50:       extension-shared-optional-dep.patch
 Patch51:       spl-shared.patch
@@ -200,6 +206,10 @@ 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}
@@ -213,7 +223,7 @@ BuildRequires:      db-devel >= 4.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
@@ -303,6 +313,7 @@ BuildRoot:  %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %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}
@@ -425,8 +436,11 @@ Requires:  %{name}-common = %{epoch}:%{version}-%{release}
 Provides:      %{name}-fcgi = %{epoch}:%{version}-%{release}
 Provides:      php(cgi)
 Provides:      php(fcgi)
-Provides:      webserver(php)
+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.
@@ -502,9 +516,14 @@ Group:             Libraries
 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}
@@ -518,7 +537,6 @@ 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)
@@ -557,13 +575,14 @@ Requires: libtool >= 2:2.2
 %else
 Requires:      libtool
 %endif
-%{?with_embed:Requires:        %{orgname}-embedded = %{epoch}:%{version}-%{release}}
+%{?with_embed:Requires:        %{name}-embedded = %{epoch}:%{version}-%{release}}
 %{?with_pcre:Requires: pcre-devel >= 8.10}
 Requires:      shtool
 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.
@@ -1383,11 +1402,12 @@ Group:          Libraries
 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}
+Conflicts:     php-ioncube < 4.0.9
 
 %description phar
 This is a dynamic shared object (DSO) for PHP that will add phar
@@ -1467,6 +1487,7 @@ Group:            Libraries
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
 Requires:      %{name}-spl = %{epoch}:%{version}-%{release}
 Suggests:      %{name}-hash = %{epoch}:%{version}-%{release}
+Suggests:      tmpwatch
 Provides:      php(session)
 
 %description session
@@ -1607,7 +1628,7 @@ Summary(pl.UTF-8):        Moduł SQLite3 dla PHP
 Group:         Libraries
 URL:           http://php.net/manual/en/book.sqlite3.php
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
-Provides:      php(sqlite3)
+Provides:      php(sqlite3) = %{sqlite3ver}
 
 %description sqlite3
 SQLite is a C library that implements an embeddable SQL database
@@ -1881,8 +1902,6 @@ Moduł PHP umożliwiający używanie kompresji zlib.
 
 %prep
 %setup -q -n %{orgname}-%{version}
-# prep for suhosin patch
-%{__sed} -i -e 's,\r$,,' Zend/Zend.dsp Zend/ZendTS.dsp
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
@@ -1935,6 +1954,7 @@ cp -p php.ini-production php.ini
 %if %{with suhosin}
 %patch47 -p1
 %endif
+%patch48 -p1
 %patch49 -p1
 %patch50 -p1
 %patch51 -p1
@@ -1947,8 +1967,12 @@ cp -p php.ini-production php.ini
 %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
 
@@ -2027,6 +2051,12 @@ if test "$ver" != "%{pharver}"; then
        : 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}.
@@ -2075,6 +2105,8 @@ export EXTENSION_DIR="%{php_extensiondir}"
 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.* .
@@ -2383,19 +2415,27 @@ install -d $RPM_BUILD_ROOT{%{_libdir}/{php,apache{,1}},%{_sysconfdir}/{apache,cg
 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
@@ -2419,16 +2459,21 @@ 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/%{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 $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.conf
-install -d $RPM_BUILD_ROOT/etc/logrotate.d
-cp -p %{SOURCE11} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-fpm
+' $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
@@ -2440,12 +2485,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}/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
+
+# .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
 
-sed -e 's#%{_prefix}/lib/php#%{_libdir}/php#g' php.ini > $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
+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
@@ -2480,16 +2531,17 @@ 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
+       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
@@ -2507,7 +2559,7 @@ sed -i -e "s|^libdir=.*|libdir='%{_libdir}'|" $RPM_BUILD_ROOT%{_libdir}/libphp_c
 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
@@ -2668,6 +2720,7 @@ fi
 %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}
@@ -2677,6 +2730,7 @@ fi
 %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}
@@ -2704,8 +2758,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}/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)
@@ -2718,6 +2777,7 @@ fi
 %doc sapi/fpm/{CREDITS,LICENSE}
 %dir %{_sysconfdir}/fpm.d
 %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-fpm.conf
+%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
@@ -2746,7 +2806,7 @@ fi
 %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}
@@ -2788,6 +2848,7 @@ fi
 
 %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
 
@@ -2797,11 +2858,13 @@ fi
 %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)
This page took 0.094519 seconds and 4 git commands to generate.