# 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 oci # with Oracle oci8 extension module (BR: proprietary libs)
+%bcond_without 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: https://bugs.php.net/bug.php?id=60100)
%bcond_with gd_jis_conv # causes imagettfbbox(): any2eucjp(): invalid code in input string when internal gd used
%bcond_with zend_multibyte # enable zend multibyte, mbstring can't be shared then anymore
+%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 imap # without IMAP extension module
%undefine with_mm
%endif
-%ifnarch %{ix86} %{x8664} sparc sparcv9 alpha ppc
+%ifnarch %{ix86} %{x8664} x32 sparc sparcv9 alpha ppc
%undefine with_interbase
%endif
%if "%{pld_release}" == "th"
%endif
%endif
-%ifnarch %{ix86} %{x8664}
+%ifnarch %{ix86} %{x8664} x32
# unsupported, see sapi/cgi/fpm/fpm_atomic.h
%undefine with_fpm
%endif
%if "%{pld_release}" == "ac"
%define magic_mime /usr/share/file/magic.mime
+%define _noautoreqdep libphp_common.*
+# if commandline --with was given. respect that
+%if 0%{!?_with_default_php:1}
+%undefine with_default_php
+%endif
%else
%define magic_mime /usr/share/misc/magic.mime
%endif
+%define rel 12
%define orgname php
-%if "%{pld_release}" == "th"
-%define php_suffix 52
-%define _noautoreqdep libphp_common.*
-%else
-%define php_suffix %{nil}
-%endif
-
-%define rel 1
-%define backport_date 20130717
+%define ver_suffix 52
+%define php_suffix %{!?with_default_php:%{ver_suffix}}
+%define backport_date 20130717
Summary: PHP: Hypertext Preprocessor
Summary(fr.UTF-8): Le langage de script embarque-HTML PHP
Summary(pl.UTF-8): Język skryptowy PHP
Version: 5.2.17
Release: %{backport_date}.%{rel}
Epoch: 4
-License: PHP
+# All files licensed under PHP version 3.01, except
+# Zend is licensed under Zend
+# TSRM is licensed under BSD
+License: PHP 3.01 and Zend and BSD
Group: Libraries
Source0: http://www.php.net/distributions/%{orgname}-%{version}.tar.bz2
# Source0-md5: b27947f3045220faf16e4d9158cbfe13
Source4: %{orgname}-cgi.ini
Source5: %{orgname}-apache.ini
Source6: %{orgname}-cli.ini
-# Taken from: http://browsers.garykeith.com/downloads.asp
-Source8: %{orgname}_browscap.ini
# lynx -dump ftp://distfiles.gentoo.org/pub/gentoo/distfiles/|grep -o ftp://.*php-patchset.*tar.bz2
#Source9: ftp://distfiles.gentoo.org/pub/gentoo/distfiles/%{orgname}-patchset-%{version}-r1.tar.bz2
## Source9-md5: d67f23f5e69664e06fce89b064d5bbab
Patch69: bug-50563.patch
Patch70: php-crypt-null.patch
Patch71: php-apache24.patch
+Patch72: exif-crash-bug-36.patch
+Patch73: CVE-2013-6420.patch
+Patch74: CVE-2013-4073.patch
+Patch75: php-secbug-67498.patch
+Patch76: CVE-2015-0232.patch
+Patch77: x32.patch
# CENTALT patches
# Backport from 5.3.6
Patch311: php-5.3.6-bug-47435.patch
BuildRequires: libxml2-devel >= 1:2.7.6-4
BuildRequires: libxslt-devel >= 1.1.0
%{?with_mhash:BuildRequires: mhash-devel}
+%{?with_snmp:%{?with_tests:BuildRequires: mibs-net-snmp}}
%{?with_ming:BuildRequires: ming-devel >= 0.3}
%{?with_mm:BuildRequires: mm-devel >= 1.3.0}
BuildRequires: mysql-devel >= 4.0.0
%{?with_mysqli:BuildRequires: mysql-devel >= 4.1}
BuildRequires: ncurses-ext-devel
+%{?with_snmp:BuildRequires: net-snmp-devel >= 5.0.7}
%{?with_ldap:BuildRequires: openldap-devel >= 2.3.0}
%if %{with openssl} || %{with ldap}
BuildRequires: openssl-devel >= 0.9.7d
%endif
-%{?with_snmp:BuildRequires: net-snmp-devel >= 5.0.7}
-%{?with_snmp:%{?with_tests:mibs-net-snmp}}
+%{?with_oci:%{?with_instantclient:BuildRequires: oracle-instantclient-devel}}
BuildRequires: pam-devel
%{?with_pcre:BuildRequires: pcre-devel >= 6.6}
BuildRequires: pkgconfig
%define zend_zts %{!?with_zts:0}%{?with_zts:1}
%define php_debug %{!?debug:0}%{?debug:1}
-%if %{with oci8}
+%if %{with oci}
# ORACLE_HOME is required for oci8 ext to build
%define _preserve_env %_preserve_env_base ORACLE_HOME
%endif
%endif
%{!?with_mysqlnd:Obsoletes: php-mysqlnd}
%{?with_pcre:%requires_ge_to pcre pcre-devel}
+Suggests: browscap
Obsoletes: php-pecl-domxml
Conflicts: php-pecl-memcache < 3.0.4-2
Conflicts: php4-common < 3:4.4.4-8
Obsoletes: php4-devel
Obsoletes: php53-devel
Obsoletes: php54-devel
+Obsoletes: php55-devel
+Obsoletes: php56-devel
+Obsoletes: php70-devel
%description devel
The php-devel package lets you compile dynamic extensions to PHP.
Group: Libraries
Requires: %{name}-common = %{epoch}:%{version}-%{release}
Suggests: %{name}-hash = %{epoch}:%{version}-%{release}
+Suggests: tmpwatch
Provides: php(session)
%description session
%patch69 -p4
%patch70 -p1
%patch71 -p1
+%patch72 -p1
+%patch73 -p1
+%patch74 -p1
+%patch75 -p1
+%patch76 -p1
+%patch77 -p1
# Bugfix backport from 5.3.6
%patch311 -p1 -b .bug-47435
--with-pdo-firebird=shared,/usr \
%endif
--with-pdo-mysql=shared \
- %{?with_oci8:--with-pdo-oci=shared} \
+ %{?with_oci:--with-pdo-oci=shared%{?with_instantclient:,instantclient,%{_libdir}}} \
%{?with_odbc:--with-pdo-odbc=shared,unixODBC,/usr} \
%{?with_pgsql:--with-pdo-pgsql=shared} \
%{?with_sqlite:--with-pdo-sqlite=shared,/usr} \
--with-mysql-sock=/var/lib/mysql/mysql.sock \
%{?with_mysqli:--with-mysqli=shared} \
--with-ncurses=shared \
- %{?with_oci8:--with-oci8=shared} \
+ %{?with_oci:--with-oci8=shared%{?with_instantclient:,instantclient,%{_libdir}}} \
%{?with_openssl:--with-openssl=shared} \
--with-kerberos \
%{!?with_pcre:--without-pcre-regex}%{?with_pcre:--with-pcre-regex=shared,/usr} \
$RPM_BUILD_ROOT%{_mandir}/man1 \
# install the Apache modules' files
-%{__make} install-headers install-build install-modules install-programs \
+%{__make} -j1 install-headers install-build install-modules install-programs \
+ phpbuilddir=%{_libdir}/%{name}/build \
INSTALL_ROOT=$RPM_BUILD_ROOT
# version suffix
ln -s libphp5-$v.so $RPM_BUILD_ROOT%{_libdir}/apache/libphp5.so
%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
libtool --mode=install install -p sapi/cgi/php-cgi $RPM_BUILD_ROOT%{_bindir}/%{name}.cgi
%endif
install %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/php-cgi.ini
install %{SOURCE6} $RPM_BUILD_ROOT%{_sysconfdir}/php-cli.ini
-install %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/browscap.ini
%if %{with apache1}
install %{SOURCE2} $RPM_BUILD_ROOT/etc/apache/conf.d/70_mod_php.conf
mv $RPM_BUILD_ROOT%{_sysconfdir}/{conf.d/{ncurses,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
- 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
- done
- ln -snf %{_datadir}/libtool/config/ltmain.sh $RPM_BUILD_ROOT%{_libdir}/php/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
-%endif
-ln -snf %{_bindir}/shtool $RPM_BUILD_ROOT%{_libdir}/php/build
+ln -snf /usr/share/automake/config.{guess,sub} $RPM_BUILD_ROOT%{_libdir}/%{name}/build
+ln -snf %{_bindir}/shtool $RPM_BUILD_ROOT%{_libdir}/%{name}/build
+for fn in libtool.m4 lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.m4; do
+ f=%{_aclocaldir}/$fn
+ test -f $f || continue
+ ln -snf $f $RPM_BUILD_ROOT%{_libdir}/%{name}/build
+done
+for fn in ltmain.sh config/ltmain.sh build-aux/ltmain.sh; do
+ f=/usr/share/libtool/$fn
+ test -f $f || continue
+ ln -snf $f $RPM_BUILD_ROOT%{_libdir}/%{name}/build
+ break
+done
+sed -i -e '/^phpdir/ s,/php/build,/%{name}/build,' $RPM_BUILD_ROOT%{_bindir}/phpize
# as a result of ext/pcre/pcrelib removal in %%prep, ext/pcre/php_pcre.h
# isn't installed by install-headers make target, we do it manually here.
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
+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}/%{name}/build/acinclude.m4
+
%clean
rm -rf $RPM_BUILD_ROOT
[ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart
[ ! -f /etc/httpd/conf.d/??_mod_php.conf ] || %service -q httpd restart
+%triggerpostun common -- %{name}-common < 4:5.2.17-20130717.9, php-common < 4:5.2.17-20130717.9
+# switch to browscap package if the ini file has original value
+%{__sed} -i -e 's#%{_sysconfdir}/browscap.ini#/usr/share/browscap/php_browscap.ini#' %{_sysconfdir}/php.ini
+# disable browscap, if optional package not present
+if [ ! -e /usr/share/browscap/php_browscap.ini ]; then
+ %{__sed} -i -e 's#^browscap = /usr/share/browscap/php_browscap.ini#;&#' %{_sysconfdir}/php.ini
+fi
+
# common macros called at extension post/postun scriptlet
%define extension_scripts() \
%post %1 \
%dir %{_sysconfdir}
%dir %{_sysconfdir}/conf.d
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php.ini
-%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/browscap.ini
%attr(755,root,root) %{_libdir}/libphp_common-*.so
%dir %{php_extensiondir}
%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*
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/cli.d/ncurses.ini
%attr(755,root,root) %{php_extensiondir}/ncurses.so
-%if %{with oci8}
+%if %{with oci}
%files oci8
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/oci8.ini
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/pdo_mysql.ini
%attr(755,root,root) %{php_extensiondir}/pdo_mysql.so
-%if %{with oci8}
+%if %{with oci}
%files pdo-oci
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/pdo_oci.ini