# TODO 5.6:
-# - phpdbg: link with libphp_common
# - enable --with-fpm-systemd, but ensure it checks for sd_booted()
# - build with system libgd 2.1, see 73c5128
# TODO 5.4:
# - wddx: restore session support (not compiled in due DL extension check)
# - make additional headers and checking added by mail patch configurable
# - modularize standard (output from pure php -m)?
-# - 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)
# - some mods should be shared:
#$ php -m
# [PHP Modules]
%undefine with_filter
%endif
-%define rel 2
+%define rel 1
%define orgname php
%define ver_suffix 56
%define php_suffix %{!?with_default_php:%{ver_suffix}}
Summary(ru.UTF-8): PHP Версии 5 - язык препроцессирования HTML-файлов, выполняемый на сервере
Summary(uk.UTF-8): PHP Версії 5 - мова препроцесування HTML-файлів, виконувана на сервері
Name: %{orgname}%{php_suffix}
-Version: 5.6.12
+Version: 5.6.27
Release: %{rel}
Epoch: 4
# All files licensed under PHP version 3.01, except
License: PHP 3.01 and Zend and BSD
Group: Libraries
Source0: http://www.php.net/distributions/%{orgname}-%{version}.tar.xz
-# Source0-md5: f2cc602602eb2b121779f2c4b8bacaba
+# Source0-md5: 9ce6efc96d5ab81ef808f8ed6b1f242d
Source2: %{orgname}-mod_%{orgname}.conf
Source3: %{orgname}-cgi-fcgi.ini
Source4: %{orgname}-apache.ini
Patch1: %{orgname}-pldlogo.patch
Patch2: %{orgname}-mail.patch
Patch3: %{orgname}-link-libs.patch
+Patch4: php-bug-71475.patch
Patch5: %{orgname}-filter-shared.patch
Patch6: %{orgname}-build_modules.patch
Patch7: %{orgname}-sapi-ini-file.patch
Patch65: system-libzip.patch
Patch66: php-db.patch
Patch67: mysql-lib-ver-mismatch.patch
-# https://bugs.php.net/bug.php?id=68344
-Patch68: php-mysql-ssl-context.patch
+
Patch69: fpm-conf-split.patch
Patch70: mysqlnd-ssl.patch
+Patch72: phar-hash-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: libltdl-devel >= 1.4
BuildRequires: libmcrypt-devel >= 2.4.4
BuildRequires: libpng-devel >= 1.0.8
+%{?with_intl:BuildRequires: libstdc++-devel}
%{?with_webp:BuildRequires: libvpx-devel}
BuildRequires: tokyocabinet-devel
%if "%{pld_release}" != "ac"
Requires(pre): /bin/id
Requires(pre): /usr/sbin/useradd
Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Requires: alternatives
+Requires: php-dirs >= 1.4-2
Requires: rc-scripts
Provides: php(fcgi)
Provides: php(fpm)
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Requires: %{name}-pdo = %{epoch}:%{version}-%{release}
Provides: php(pdo-pgsql)
-Provides: php-pecl-PDO_PGSQL
+Provides: php-pecl-PDO_PGSQL = 4:5.3.28-7
Obsoletes: php-pdo-pgsql < 4:5.3.28-7
Obsoletes: php-pecl-PDO_PGSQL < 4:5.2.1-2
Um módulo para aplicações PHP que usam bancos de dados postgresql.
%package phar
-Summary: phar database module for PHP
+Summary: Phar archive module for PHP
Summary(pl.UTF-8): Moduł phar dla PHP
Group: Libraries
URL: http://www.php.net/manual/en/book.phar.php
Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Requires: %{name}-hash = %{epoch}:%{version}-%{release}
Requires: %{name}-spl = %{epoch}:%{version}-%{release}
+Requires: alternatives
Suggests: %{name}-cli
# zlib is required by phar program, but as phar cli is optional should the dep be too
Suggests: %{name}-zlib
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%{?with_system_libzip:%patch65 -p1}
%patch66 -p1
%patch67 -p1
-%patch68 -p1
+
%patch70 -p1
+%patch72 -p1
-sed -i -e '/PHP_ADD_LIBRARY_WITH_PATH/s#xmlrpc,#xmlrpc-epi,#' ext/xmlrpc/config.m4
+%{__sed} -i -e '/PHP_ADD_LIBRARY_WITH_PATH/s#xmlrpc,#xmlrpc-epi,#' ext/xmlrpc/config.m4
# cleanup backups after patching
find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
esac
%configure \
+ EXTRA_LDFLAGS="%{rpmldflags}" \
$sapi_args \
%if "%{!?configure_cache:0}%{?configure_cache}" == "0"
--cache-file=config.cache \
phpbuilddir=%{_libdir}/%{name}/build \
INSTALL_ROOT=$RPM_BUILD_ROOT
-# make link relative
-ln -sfn phar.phar $RPM_BUILD_ROOT%{_bindir}/phar
+# version the .phar files
+mv $RPM_BUILD_ROOT%{_bindir}/phar{,%{ver_suffix}}.phar
+mv $RPM_BUILD_ROOT%{_mandir}/man1/phar{,%{ver_suffix}}.1
+# touch for ghost
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/phar
+touch $RPM_BUILD_ROOT%{_bindir}/phar
+touch $RPM_BUILD_ROOT%{_mandir}/man1/phar.1
# version suffix
v=$(echo %{version} | cut -d. -f1-2)
%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
+ln -s libphp5-$v.so $RPM_BUILD_ROOT%{_libdir}/apache1/mod_php.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
+ln -s libphp5-$v.so $RPM_BUILD_ROOT%{_libdir}/apache/mod_php.so
%endif
# install litespeed sapi
%if %{with phpdbg}
%{__make} -f Makefile.phpdbg install-phpdbg \
+ INSTALL="libtool --mode=install install -p" \
INSTALL_ROOT=$RPM_BUILD_ROOT
+
+# version the phpdbg files
+mv $RPM_BUILD_ROOT%{_bindir}/phpdbg{,%{ver_suffix}}
+mv $RPM_BUILD_ROOT%{_mandir}/man1/phpdbg{,%{ver_suffix}}.1
%endif
%if %{with milter}
%{__sed} -i -e '/su/d' $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-fpm
%endif
+# touch for ghost for alternatives
+touch $RPM_BUILD_ROOT%{_sbindir}/php-fpm
+
%{__sed} -i -e '
s#/usr/lib/php#%{php_extensiondir}#
s#/etc/php#%{_sysconfdir}#
%post fpm
/sbin/chkconfig --add %{name}-fpm
%service %{name}-fpm restart
+update-alternatives --install %{_sbindir}/php-fpm php-fpm %{_sbindir}/php%{ver_suffix}-fpm %{ver_suffix} || :
%preun fpm
if [ "$1" = "0" ]; then
%service %{name}-fpm stop
/sbin/chkconfig --del %{name}-fpm
+ update-alternatives --remove php-fpm %{_sbindir}/php-fpm || :
fi
%postun fpm
%post embedded -p /sbin/ldconfig
%postun embedded -p /sbin/ldconfig
-%post common
+%posttrans common
# PHP 5.3 requires timezone being setup, try setup it from tzdata
if ! grep -q '^date.timezone[[:space:]]*=' %{_sysconfdir}/php.ini && [ -f /etc/sysconfig/timezone ]; then
TIMEZONE=
fi
fi
-%posttrans common
# minimizing apache restarts logics. we restart webserver:
#
# 1. at the end of transaction. (posttrans, feature from rpm 4.4.2)
%{__sed} -i -e 's#^browscap = /usr/share/browscap/php_browscap.ini#;&#' %{_sysconfdir}/php.ini
fi
+%triggerpostun -n apache1-mod_%{name} -- apache1-mod_%{name} < 4:5.6.14-2
+sed -i -e 's#modules/libphp5.so#modules/mod_php.so#g' /etc/apache/conf.d/*_mod_php.conf
+
+%triggerpostun -n apache-mod_%{name} -- apache-mod_%{name} < 4:5.6.14-2
+sed -i -e 's#modules/libphp[57].so#modules/mod_php.so#g' /etc/httpd/conf.d/*_mod_php.conf
+
# common macros called at extension post/postun scriptlet
-%define extension_scripts() \
-%post %1 \
+%define ext_post \
if [ "$1" = "1" ]; then \
%php_webserver_restart \
fi \
-\
-%postun %1 \
+%{nil}
+
+%define ext_postun \
if [ "$1" = "0" ]; then \
%php_webserver_restart \
-fi
+fi \
+%{nil}
+
+%define extension_scripts() \
+%post %1 \
+%ext_post \
+\
+%postun %1 \
+%ext_postun \
%{nil}
# extension scripts defines
%extension_scripts pdo-pgsql
%extension_scripts pdo-sqlite
%extension_scripts pgsql
-%extension_scripts phar
%extension_scripts pcntl
%extension_scripts posix
%extension_scripts pspell
%extension_scripts zip
%extension_scripts zlib
+%post phar
+%ext_post
+update-alternatives \
+ --install %{_bindir}/phar phar %{_bindir}/phar%{ver_suffix}.phar %{ver_suffix} \
+ --slave %{_mandir}/man1/phar.1 phar.1 %{_mandir}/man1/phar%{ver_suffix}.1* || :
+
+%postun phar
+%ext_postun
+if [ $1 -eq 0 ]; then
+ update-alternatives --remove phar %{_bindir}/phar || :
+fi
+
%if %{with apache1}
%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/mod_php.so
%attr(755,root,root) %{_libdir}/apache1/libphp5-*.*.so
%endif
%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/mod_php.so
%attr(755,root,root) %{_libdir}/apache/libphp5-*.*.so
%endif
%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
+%ghost %{_sbindir}/php-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
%if %{with phpdbg}
%files phpdbg
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/phpdbg
-%{_mandir}/man1/phpdbg.1*
+%attr(755,root,root) %{_bindir}/phpdbg%{ver_suffix}
+%{_mandir}/man1/phpdbg%{ver_suffix}.1*
%endif
%if %{with milter}
%dir %{_sysconfdir}
%dir %{_sysconfdir}/conf.d
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php.ini
+%if %{with apache1} || %{with apache2}
%attr(755,root,root) %{_libdir}/libphp_common-*.so
+%endif
%dir %{php_extensiondir}
%doc ext/session/mod_files.sh
%doc CODING_STANDARDS README.{EXT_SKEL,PARAMETER_PARSING_API,SELF-CONTAINED-EXTENSIONS,STREAMS,SUBMITTING_PATCH,TESTING,TESTING2,UNIX-BUILD-SYSTEM,input_filter}
%attr(755,root,root) %{_bindir}/phpize
%attr(755,root,root) %{_bindir}/php-config
+%if %{with apache1} || %{with apache2}
%attr(755,root,root) %{_libdir}/libphp_common.so
+%else
+%attr(755,root,root) %{_libdir}/libphp_common.a
+%endif
%{_libdir}/libphp_common.la
%{_includedir}/php
%{_libdir}/%{name}/build
%doc ext/phar/{CREDITS,TODO}
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/phar.ini
%attr(755,root,root) %{php_extensiondir}/phar.so
-%attr(755,root,root) %{_bindir}/phar
-%attr(755,root,root) %{_bindir}/phar.phar
-%{_mandir}/man1/phar.1*
+%attr(755,root,root) %{_bindir}/phar%{ver_suffix}.phar
%{_mandir}/man1/phar.phar.1
+%{_mandir}/man1/phar%{ver_suffix}.1*
+%ghost %{_bindir}/phar
+%ghost %{_mandir}/man1/phar.1
%endif
%if %{with posix}