]> git.pld-linux.org Git - packages/php.git/blobdiff - php.spec
- hack flex scanners to avoid colliding global symbol
[packages/php.git] / php.spec
index bcefee2dac370318b3e00fee0f9918a1cd53788b..d8e7a7e92ff52d8d1a131d70a46fa28e5bce1f6c 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -28,7 +28,8 @@
 # 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
@@ -76,7 +77,7 @@
 %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"
@@ -86,7 +87,7 @@
 %endif
 %endif
 
-%ifnarch %{ix86} %{x8664}
+%ifnarch %{ix86} %{x8664} x32
 # unsupported, see sapi/cgi/fpm/fpm_atomic.h
 %undefine      with_fpm
 %endif
@@ -103,15 +104,15 @@ ERROR: You need to select at least one Apache SAPI to build shared modules.
 %if "%{pld_release}" == "ac"
 %define                magic_mime      /usr/share/file/magic.mime
 %define                _noautoreqdep libphp_common.*
-# if commandline --without was given. respect that
-%if 0%{!?_without_default_php:1}
-%define                with_default_php        1
+# 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             2
+%define                rel     35
 %define                orgname php
 %define                ver_suffix 52
 %define                php_suffix %{!?with_default_php:%{ver_suffix}}
@@ -126,7 +127,10 @@ Name:              %{orgname}%{php_suffix}
 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
@@ -135,8 +139,6 @@ Source3:    %{orgname}-cgi-fcgi.ini
 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
@@ -195,6 +197,7 @@ Patch44:    %{orgname}-include_path.patch
 Patch45:       %{orgname}-imap-annotations.patch
 Patch46:       %{orgname}-imap-myrights.patch
 Patch47:       suhosin.patch
+Patch48:       no-sslv2.patch
 Patch49:       %{orgname}-m4-divert.patch
 Patch50:       extension-shared-optional-dep.patch
 Patch51:       spl-shared.patch
@@ -207,6 +210,7 @@ Patch57:    php-php_dl.patch
 Patch58:       php-svn-281516.patch
 Patch59:       %{orgname}-systzdata.patch
 Patch60:       bug-60986.patch
+Patch61:       php-bug-71475.patch
 # http://spot.fedorapeople.org/php-5.3.6-libzip.patch
 Patch65:       system-libzip.patch
 Patch66:       bug-47930.patch
@@ -215,6 +219,15 @@ 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
+Patch78:       php-bug-68486.patch
+Patch79:       libevent-2.1.patch
+Patch80:       mysqli-err.patch
+Patch81:       openssl.patch
 # CENTALT patches
 # Backport from 5.3.6
 Patch311:      php-5.3.6-bug-47435.patch
@@ -267,17 +280,18 @@ BuildRequires:    libwrap-devel
 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
@@ -319,7 +333,7 @@ BuildRoot:  %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %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
@@ -396,19 +410,32 @@ PHP as DSO module for Apache 1.3.x.
 PHP jako moduł DSO (Dynamic Shared Object) dla Apache 1.3.x.
 
 %package -n apache-mod_%{name}
+Summary:       PHP support for Apache 2.x
+Summary(pl.UTF-8):     Wsparcie PHP dla Apache 2.x
+Group:         Development/Languages/PHP
+Requires:      apache-mod_%{name}-core = %{epoch}:%{version}-%{release}
+Requires:      %{name}-common = %{epoch}:%{version}-%{release}
+Provides:      webserver(php) = %{version}
+Obsoletes:     phpfi
+
+%description -n apache-mod_%{name}
+PHP support for Apache 2.x.
+
+%description -n apache-mod_%{name} -l pl.UTF-8
+Wsparcie PHP dla Apache 2.x.
+
+%package -n apache-mod_%{name}-core
 Summary:       PHP DSO module for Apache 2.x
 Summary(pl.UTF-8):     Moduł DSO (Dynamic Shared Object) PHP dla Apache 2.x
 Group:         Development/Languages/PHP
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
 Requires:      apache(modules-api) = %{apache_modules_api}
 Requires:      apache-mod_mime
-Provides:      webserver(php) = %{version}
-Obsoletes:     phpfi
 
-%description -n apache-mod_%{name}
+%description -n apache-mod_%{name}-core
 PHP as DSO module for Apache 2.x.
 
-%description -n apache-mod_%{name} -l pl.UTF-8
+%description -n apache-mod_%{name}-core -l pl.UTF-8
 PHP jako moduł DSO (Dynamic Shared Object) dla Apache 2.x.
 
 %package fcgi
@@ -534,6 +561,7 @@ Requires:   %{name}-spl = %{epoch}:%{version}-%{release}
 %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
@@ -575,6 +603,12 @@ Obsoletes: php-pear-devel
 Obsoletes:     php4-devel
 Obsoletes:     php53-devel
 Obsoletes:     php54-devel
+Obsoletes:     php55-devel
+Obsoletes:     php56-devel
+Obsoletes:     php70-devel
+Obsoletes:     php71-devel
+Obsoletes:     php72-devel
+Obsoletes:     php73-devel
 
 %description devel
 The php-devel package lets you compile dynamic extensions to PHP.
@@ -634,7 +668,7 @@ Requires:   %{name}-common = %{epoch}:%{version}-%{release}
 Provides:      %{name}-bzip2 = %{epoch}:%{version}-%{release}
 Provides:      php(bz2)
 Provides:      php(bzip2)
-Obsoletes:     php-bzip2
+Obsoletes:     php-bzip2 < 4:5.2.14-3
 
 %description bz2
 This is a dynamic shared object (DSO) for PHP that will add bzip2
@@ -1307,8 +1341,7 @@ URL:              http://www.php.net/manual/en/ref.pdo-pgsql.php
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
 Requires:      %{name}-pdo = %{epoch}:%{version}-%{release}
 Provides:      php(pdo-pgsql)
-Provides:      php-pecl-PDO_PGSQL
-Obsoletes:     php-pecl-PDO_PGSQL
+Obsoletes:     php-pecl-PDO_PGSQL < 4:5.2.17-1
 
 %description pdo-pgsql
 This is a dynamic shared object (DSO) for PHP that will add PDO
@@ -1424,6 +1457,7 @@ Summary(pl.UTF-8):        Moduł session dla PHP
 Group:         Libraries
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
 Suggests:      %{name}-hash = %{epoch}:%{version}-%{release}
+Suggests:      tmpwatch
 Provides:      php(session)
 
 %description session
@@ -1910,6 +1944,7 @@ done
 %if %{with suhosin}
 %patch47 -p1
 %endif
+%patch48 -p1
 %patch49 -p1
 %patch50 -p1
 %patch51 -p1
@@ -1922,6 +1957,7 @@ done
 %patch58 -p4
 %patch59 -p1
 %patch60 -p4
+%patch61 -p1
 %{?with_system_libzip:%patch65 -p1}
 %patch66 -p2
 %patch67 -p1
@@ -1929,6 +1965,15 @@ done
 %patch70 -p1
 %patch71 -p1
 %patch72 -p1
+%patch73 -p1
+%patch74 -p1
+%patch75 -p1
+%patch76 -p1
+%patch77 -p1
+%patch78 -p1
+%patch79 -p1
+%patch80 -p1
+%patch81 -p1
 
 # Bugfix backport from 5.3.6
 %patch311 -p1 -b .bug-47435
@@ -1939,6 +1984,9 @@ done
 # causes regression -> magic_quotes_gpc setting cannot be changed
 #%%patch402 -p1 -b .bug-323016
 
+# cleanup backups after patching
+find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
+
 # conflict seems to be resolved by recode patches
 rm -f ext/recode/config9.m4
 
@@ -1975,6 +2023,9 @@ mv sapi/cli/tests/022.phpt{,.broken}
 
 sh -xe %{_sourcedir}/skip-tests.sh
 
+# make colliding symbol static
+%{__sed} -i -e 's/^char \*yytext/static &/' Zend/zend_{ini,language}_scanner.c
+
 %build
 API=$(awk '/#define PHP_API_VERSION/{print $3}' main/php.h)
 if [ $API != %{php_api_version} ]; then
@@ -2049,7 +2100,9 @@ for sapi in $sapis; do
        esac
 
        %configure \
+       CFLAGS="%{rpmcflags} -DOPENSSL_NO_SSL2=1 -DOPENSSL_NO_SSL3=1" \
        FORCE_APACHE_VERSION="${apache_ver}" \
+       EXTRA_LDFLAGS="%{rpmldflags}" \
        $sapi_args \
 %if "%{!?configure_cache:0}%{?configure_cache}" == "0"
        --cache-file=config.cache \
@@ -2061,7 +2114,6 @@ for sapi in $sapis; do
        --with-system-tzdata \
        --%{!?debug:dis}%{?debug:en}able-debug \
        %{?with_zts:--enable-maintainer-zts} \
-       %{?with_suhosin:--enable-suhosin} \
        %{?with_zend_multibyte:--enable-zend-multibyte} \
        --enable-inline-optimization \
        --enable-bcmath=shared \
@@ -2094,7 +2146,7 @@ for sapi in $sapis; do
        --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} \
@@ -2142,7 +2194,7 @@ for sapi in $sapis; do
        --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} \
@@ -2293,7 +2345,7 @@ install -d $RPM_BUILD_ROOT{%{_libdir}/{php,apache{,1}},%{_sysconfdir}/{apache,cg
        $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
 
@@ -2304,14 +2356,14 @@ 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 CGI
@@ -2361,7 +2413,6 @@ install %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/php-cgi-fcgi.ini
 %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
@@ -2392,17 +2443,19 @@ install -d $RPM_BUILD_ROOT%{_sysconfdir}/{cgi,cli,cgi-fcgi,apache,apache2handler
 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}/%{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}/%{name}/build
-       done
-       ln -snf %{_datadir}/libtool/config/ltmain.sh $RPM_BUILD_ROOT%{_libdir}/%{name}/build
-%else
-       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 /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
@@ -2482,6 +2535,20 @@ fi
 [ ! -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
+
+%triggerpostun -n apache1-mod_%{name} -- apache1-mod_%{name} < 4:5.2.17-14
+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.2.17-14
+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 \
@@ -2572,7 +2639,7 @@ fi
 %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
 
@@ -2580,9 +2647,12 @@ fi
 %files -n apache-mod_%{name}
 %defattr(644,root,root,755)
 %attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/httpd/conf.d/*_mod_php.conf
+%attr(755,root,root) %{_libdir}/apache/mod_php.so
+
+%files -n apache-mod_%{name}-core
+%defattr(644,root,root,755)
 %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
 
@@ -2632,7 +2702,6 @@ fi
 %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}
 
@@ -2826,7 +2895,7 @@ fi
 %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
@@ -2883,7 +2952,7 @@ fi
 %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
This page took 0.073185 seconds and 4 git commands to generate.