%bcond_with instantclient # build Oracle oci8 extension module against oracle-instantclient package
%bcond_with system_gd # with system gd (we prefer internal since it enables few more features)
%bcond_with system_libzip # with system libzip (reported broken currently)
+%bcond_without 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 orgname php
-%if "%{pld_release}" == "ac_"
-%define php_suffix 53
+%if "%{pld_release}" == "ac"
%define _noautoreqdep libphp_common.*
-%else
-%define php_suffix %{nil}
+# if commandline --with was given. respect that
+%if 0%{!?_with_default_php:1}
+%undefine with_default_php
+%endif
%endif
-%define rel 2
+%define rel 5
+%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(ru.UTF-8): PHP Версии 5 - язык препроцессирования HTML-файлов, выполняемый на сервере
Summary(uk.UTF-8): PHP Версії 5 - мова препроцесування HTML-файлів, виконувана на сервері
Name: %{orgname}%{php_suffix}
-Version: 5.3.23
+Version: 5.3.27
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: ab7bd1dd3bbc8364cb9fcaa2d79fb502
+# Source0-md5: 25ae23a5b9615fe8d33de5b63e1bb788
Source2: %{orgname}-mod_%{orgname}.conf
Source3: %{orgname}-cgi-fcgi.ini
Source4: %{orgname}-apache.ini
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
%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}
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.
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
%if %{with suhosin}
%patch47 -p1
%endif
+%patch48 -p1
%patch49 -p1
%patch50 -p1
%patch51 -p1
: 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}.
# 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{,-%{version}}.so
-ln -s libphp5-%{version}.so $RPM_BUILD_ROOT%{_libdir}/apache1/libphp5.so
+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{,-%{version}}.so
-ln -s libphp5-%{version}.so $RPM_BUILD_ROOT%{_libdir}/apache/libphp5.so
+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
%endif
# install CLI
-# without suffix, install as php.cli
-%if "%{?php_suffix}" == ""
-%define phpfn %{name}.cli
-%else
-%define phpfn %{name}
+# 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
-libtool --mode=install install -p sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/%{phpfn}
-cp -p sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{phpfn}.1
-echo ".so %{phpfn}.1" >$RPM_BUILD_ROOT%{_mandir}/man1/php.1
-ln -sf %{phpfn} $RPM_BUILD_ROOT%{_bindir}/php
cp -p php.ini $RPM_BUILD_ROOT%{_sysconfdir}/php.ini
%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-%{version}.so
+%attr(755,root,root) %{_libdir}/apache1/libphp5-*.*.so
%endif
%if %{with apache2}
%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-%{version}.so
+%attr(755,root,root) %{_libdir}/apache/libphp5-*.*.so
%endif
%if %{with litespeed}
%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}/%{phpfn}
-%{_mandir}/man1/%{phpfn}.1*
+%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
+%endif
%files program
%defattr(644,root,root,755)
%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