%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
-%else
-%define php_suffix %{nil}
+%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 2
+%define rel 3
+%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.20
+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: 00241b9e89e93adf3baac32c56211e4e
+# 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
Patch65: system-libzip.patch
Patch66: %{orgname}-db.patch
Patch67: php-litespeed.patch
-Patch68: file-magic.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}
%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}
Provides: php(fcgi)
Provides: webserver(php) = %{version}
Obsoletes: php-fcgi < 4:5.3.0
+%if "%{pld_release}" != "ac"
+Conflicts: logrotate < 3.8.0
+%endif
%description cgi
PHP as CGI or FastCGI program.
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 >= 1.3
+Requires: php-dirs >= 1.4
Requires: rpm-whiteout >= 1.28
Requires: tzdata
%if "%{pld_release}" == "ac"
%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
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
%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
%if %{with suhosin}
%patch47 -p1
%endif
+%patch48 -p1
%patch49 -p1
%patch50 -p1
%patch51 -p1
%{__rm} -r sapi/litespeed
gzip -dc %{SOURCE15} | tar xf - -C sapi/
%patch67 -p1
-%patch68 -p1
sed -i -e '/PHP_ADD_LIBRARY_WITH_PATH/s#xmlrpc,#xmlrpc-epi,#' ext/xmlrpc/config.m4
-# somewhy php devs have embedded magic database into php extension. yuck!
-# rebuild data file for now
-mv ext/fileinfo/data_file.c{,.php-src}
-
# cleanup backups after patching
find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
: 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{,-$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
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}#
%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
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-*.*.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-*.*.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}/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)
%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