X-Git-Url: http://git.pld-linux.org/?p=packages%2Fphp.git;a=blobdiff_plain;f=php.spec;h=bcbac7a7668f4fe262bd486d5de8840b3007531e;hp=7b21e4749b395d328e2fdf986638e0fffac0634b;hb=62dd4ec;hpb=5589468c722f11a5593f3c0abe0b98ee2869b8a4 diff --git a/php.spec b/php.spec index 7b21e47..bcbac7a 100644 --- a/php.spec +++ b/php.spec @@ -28,11 +28,13 @@ # 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 @@ -75,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" @@ -85,7 +87,7 @@ %endif %endif -%ifnarch %{ix86} %{x8664} +%ifnarch %{ix86} %{x8664} x32 # unsupported, see sapi/cgi/fpm/fpm_atomic.h %undefine with_fpm %endif @@ -101,17 +103,20 @@ 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 +%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 -%else -%define php_suffix %{nil} -%endif - +%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 @@ -120,9 +125,12 @@ Summary(ru.UTF-8): PHP Версии 5 - язык препроцессирова Summary(uk.UTF-8): PHP Версії 5 - мова препроцесування HTML-файлів, виконувана на сервері Name: %{orgname}%{php_suffix} Version: 5.2.17 -Release: 14 +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 @@ -131,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 @@ -141,6 +147,8 @@ Source11: %{orgname}-fpm.logrotate Source12: %{orgname}-branch.sh Source13: dep-tests.sh Source14: skip-tests.sh +Patch100: https://php52-backports.googlecode.com/files/php52-backports-%{backport_date}.patch +# Patch100-md5: 80014a8f7894d4e893a8b1292b8b3032 Patch0: %{orgname}-shared.patch Patch1: %{orgname}-pldlogo.patch Patch2: %{orgname}-mail.patch @@ -204,99 +212,26 @@ Patch60: bug-60986.patch # http://spot.fedorapeople.org/php-5.3.6-libzip.patch Patch65: system-libzip.patch Patch66: bug-47930.patch +Patch67: php-db.patch +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 -# CVE -Patch201: php-5.2.17-CVE-2011-2202.patch -Patch202: php-5.2.17-CVE-2011-1938.patch -Patch203: php-5.2.17-CVE-2011-1148.patch -Patch204: php-5.2.17-CVE-2011-0708.patch -Patch205: php-5.2.17-CVE-2011-1092.patch -Patch206: php-5.2.17-CVE-2011-0421.patch - # Backport from 5.3.6 -Patch301: php-5.3.6-bug-54055.patch -Patch302: php-5.3.6-bug-53577.patch -Patch303: php-5.2.17-bug-48484.patch -Patch304: php-5.3.6-bug-48607.patch -Patch305: php-5.3.6-bug-53574.patch -Patch306: php-5.3.6-bug-52290.patch -Patch307: php-5.2.17-bug-52063.patch -Patch308: php-5.3.6-bug-53924.patch -Patch309: php-5.3.6-bug-53150.patch -Patch310: php-5.3.6-bug-52209.patch -Patch311: php-5.3.6-bug-47435.patch -Patch312: php-5.3.6-bug-53377.patch -Patch313: php-5.2.17-bug-39847.patch -Patch314: php-5.3.6-39199.patch -Patch315: php-5.3.6-bug-53630.patch -Patch316: php-5.3.6-bug-51336.patch -Patch317: php-5.3.6-bug-53515.patch -Patch318: php-5.3.6-bug-54092.patch -Patch319: php-5.3.6-bug-53903.patch -Patch320: php-5.3.6-bug-54089.patch -Patch321: php-5.3.6-bug-53603.patch -Patch322: php-5.3.6-bug-53854.patch -Patch323: php-5.3.6-bug-53579.patch -Patch324: php-5.3.6-bug-53568.patch -Patch325: php-5.2.17-bug-49072.patch +Patch311: php-5.3.6-bug-47435.patch +Patch314: php-5.3.6-39199.patch # 5.3.7 -Patch330: php-5.3.7-bug-55399.patch -Patch331: php-5.2.17-bug-55082.patch -Patch332: php-5.3.7-bug-55014.patch #Patch333: php-5.3.7-bug-54924.patch -Patch334: php-5.3.7-bug-54180.patch -Patch335: php-5.3.7-bug-54137.patch -Patch336: php-5.3.7-bug-53848.patch -Patch337: php-5.3.7-bug-52935.patch -Patch338: php-5.3.7-bug-51997.patch -Patch339: php-5.3.7-bug-50363.patch -Patch340: php-5.3.7-bug-48465.patch -Patch341: php-5.3.7-bug-54529.patch -Patch342: php-5.3.7-bug-52496.patch -Patch343: php-5.3.7-bug-54242.patch -Patch344: php-5.3.7-bug-54121.patch -Patch345: php-5.3.7-bug-53037.patch -Patch346: php-5.3.7-bug-54269.patch -Patch347: php-5.3.7-bug-54601.patch -Patch348: php-5.3.7-bug-54440.patch -Patch349: php-5.3.7-bug-54494.patch -Patch350: php-5.3.7-bug-54221.patch -Patch351: php-5.3.7-bug-52104.patch -Patch352: php-5.3.7-bug-54329.patch -Patch353: php-5.3.7-bug-53782.patch -Patch354: php-5.3.7-bug-54318.patch -Patch355: php-5.3.7-bug-55323.patch -Patch356: php-5.3.7-bug-54312.patch -Patch357: php-5.3.7-bug-51958.patch -Patch358: php-5.3.7-bug-54946.patch -# 5.3.9 backport -Patch359: php-5.2.17-CVE-2011-4566.patch -Patch360: php-5.2.17-bug-60206.patch -Patch361: php-5.2.17-bug-60138.patch -Patch362: php-5.2.17-bug-60120.patch -Patch363: php-5.2.17-bug-55674.patch -Patch364: php-5.2.17-bug-55509.patch -Patch365: php-5.2.17-bug-55504.patch -Patch366: php-5.2.17-bug-52461.patch -Patch367: php-5.2.17-bug-55366.patch -Patch368: php-5.2.17-bug-55273.patch -Patch369: php-5.2.17-bug-52624.patch -Patch370: php-5.2.17-bug-43200.patch -Patch371: php-5.2.17-bug-54682.patch -Patch372: php-5.2.17-bug-60455.patch -Patch373: php-5.2.17-bug-60183.patch -Patch374: php-5.2.17-bug-55478.patch -# Bug-319457 CVE-2011-4153 -Patch375: php-5.2.17-bug-319457.patch -# Bug-55776 CVE-2012-0788 -Patch376: php-5.2.17-bug-55776.patch - -#php-5.2-max-input-vars patch -Patch400: php-5.2.17-max-input-vars.patch -Patch401: php-5.2.17-bug-323007-2.patch +Patch355: php-5.3.7-bug-55323.patch # Bug-323016 CVE-2012-0831 -Patch402: php-5.2.17-bug-323016.patch -URL: http://www.php.net/ +Patch402: php-5.2.17-bug-323016.patch +URL: https://code.google.com/p/php52-backports/ %{?with_interbase:%{!?with_interbase_inst:BuildRequires: Firebird-devel >= 1.0.2.908-2}} %{?with_pspell:BuildRequires: aspell-devel >= 2:0.50.0} BuildRequires: autoconf >= 2.53 @@ -339,17 +274,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 @@ -380,8 +316,8 @@ BuildRequires: libevent-devel >= 1.4.7-3 %endif BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) -%define php_sysconfdir /etc/php -%define php_extensiondir %{_libdir}/php +%define php_sysconfdir /etc/%{name} +%define php_extensiondir %{_libdir}/%{name} %define _sysconfdir %{php_sysconfdir} # must be in sync with source. extra check ensuring that it is so is done in %%build @@ -391,7 +327,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 @@ -504,6 +440,9 @@ Group: Development/Languages/PHP Requires: %{name}-common = %{epoch}:%{version}-%{release} Provides: php(cgi) Provides: webserver(php) = %{version} +%if "%{pld_release}" != "ac" +Conflicts: logrotate < 3.8.0 +%endif %description cgi php as CGI program. @@ -538,6 +477,7 @@ Pakiet dostarczający dowiązanie symboliczne /usr/bin/php do PHP CLI. %package fpm Summary: PHP FastCGI Process Manager +Summary(pl.UTF-8): PHP FastCGI Process Manager - zarządca procesów FastCGI Group: Development/Languages/PHP URL: http://www.php-fpm.org/ Requires(post,preun): /sbin/chkconfig @@ -553,6 +493,9 @@ Provides: webserver(php) = %{version} %description fpm PHP FastCGI Process Manager. +%description fpm -l pl.UTF-8 +PHP FastCGI Process Manager - zarządca procesów FastCGI. + %package common Summary: Common files needed by both Apache modules and CGI/CLI SAPI-s Summary(pl.UTF-8): Wspólne pliki dla modułu Apache'a i programu CGI @@ -561,9 +504,21 @@ Summary(uk.UTF-8): Бібліотеки спільного використан Group: Libraries # because of dlclose() bugs in glibc <= 2.3.4 causing SEGVs on exit Requires: glibc >= 6:2.3.5 -Requires: php-dirs +Requires: php-dirs >= 1.4 Requires: rpm-whiteout >= 1.28 Requires: tzdata +Provides: %{name}(debug) = %{php_debug} +Provides: %{name}(modules_api) = %{php_api_version} +Provides: %{name}(thread-safety) = %{zend_zts} +Provides: %{name}(zend_extension_api) = %{zend_extension_api} +Provides: %{name}(zend_module_api) = %{zend_module_api} +Provides: %{name}-core +Provides: %{name}-date +Provides: %{name}-ereg +%{?with_zend_multibyte:Provides: %{name}-mbstring = %{epoch}:%{version}-%{release}} +Provides: %{name}-overload +Provides: %{name}-reflection +Provides: %{name}-standard Provides: php(core) = %{version} Provides: php(date) Provides: php(ereg) @@ -573,17 +528,6 @@ Provides: php(modules_api) = %{php_api_version} Provides: php(overload) Provides: php(reflection) Provides: php(standard) -Provides: php(zend_extension_api) = %{zend_extension_api} -Provides: php(zend_module_api) = %{zend_module_api} -Provides: php-core -Provides: php-date -Provides: php-ereg -%{?with_zend_multibyte:Provides: php-mbstring = %{epoch}:%{version}-%{release}} -Provides: php-overload -Provides: php-reflection -Provides: php-standard -Provides: php5(debug) = %{php_debug} -Provides: php5(thread-safety) = %{zend_zts} # ensure backward compatibility for Titanium # to be dropped in future but ask Titanium RM before doing so %if "%{pld_release}" == "ti" @@ -596,6 +540,9 @@ Requires: %{name}-pcre = %{epoch}:%{version}-%{release} Requires: %{name}-session = %{epoch}:%{version}-%{release} 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 @@ -637,6 +584,8 @@ Obsoletes: php-pear-devel Obsoletes: php4-devel Obsoletes: php53-devel Obsoletes: php54-devel +Obsoletes: php55-devel +Obsoletes: php56-devel %description devel The php-devel package lets you compile dynamic extensions to PHP. @@ -693,9 +642,9 @@ Summary(pl.UTF-8): Moduł bzip2 dla PHP Group: Libraries URL: http://www.php.net/manual/en/book.bzip2.php Requires: %{name}-common = %{epoch}:%{version}-%{release} +Provides: %{name}-bzip2 = %{epoch}:%{version}-%{release} Provides: php(bz2) Provides: php(bzip2) -Provides: php-bzip2 = %{epoch}:%{version}-%{release} Obsoletes: php-bzip2 %description bz2 @@ -788,8 +737,8 @@ URL: http://www.php.net/manual/en/book.dom.php Requires: %{name}-common = %{epoch}:%{version}-%{release} Provides: php(dom) # it has some compatibility functions +Provides: %{name}-domxml = %{epoch}:%{version}-%{release} Provides: php(domxml) -Provides: php-domxml = %{epoch}:%{version}-%{release} Obsoletes: php-domxml <= 3:4.3.8-1 %description dom @@ -1486,6 +1435,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 @@ -1864,9 +1814,9 @@ Summary(pl.UTF-8): Zarządzanie archiwami zip Group: Libraries URL: http://www.php.net/manual/en/book.zip.php Requires: %{name}-common = %{epoch}:%{version}-%{release} +%{?with_system_libzip:Requires: libzip >= 0.10-3} Provides: php(zip) Obsoletes: php-pecl-zip -%{?with_system_libzip:Requires: libzip >= 0.10-3} %description zip Zip is an extension to create, modify and read zip files. @@ -1892,6 +1842,7 @@ Moduł PHP umożliwiający używanie kompresji zlib. %prep %setup -q -n %{orgname}-%{version} +%patch100 -p1 # for suhosin patch %{__sed} -i -e 's,\r$,,' Zend/Zend.dsp Zend/ZendTS.dsp @@ -1985,92 +1936,25 @@ done %patch60 -p4 %{?with_system_libzip:%patch65 -p1} %patch66 -p2 - -%patch201 -p1 -b .CVE-2011-2202 -%patch202 -p1 -b .CVE-2011-1938 -%patch203 -p1 -b .CVE-2011-1148 -%patch204 -p1 -b .CVE-2011-0708 -%patch205 -p1 -b .CVE-2011-1092 -%patch206 -p1 -b .CVE-2011-0421 +%patch67 -p1 +%patch69 -p4 +%patch70 -p1 +%patch71 -p1 +%patch72 -p1 +%patch73 -p1 +%patch74 -p1 +%patch75 -p1 +%patch76 -p1 +%patch77 -p1 # Bugfix backport from 5.3.6 -%patch301 -p1 -b .bug-54055 -%patch302 -p1 -b .bug-53577 -%patch303 -p1 -b .bug-48484 -%patch304 -p1 -b .bug-48607 -%patch305 -p1 -b .bug-53574 -%patch306 -p1 -b .bug-52290 -%patch307 -p1 -b .bug-52063 -%patch308 -p1 -b .bug-53924 -%patch309 -p1 -b .bug-53150 -%patch310 -p1 -b .bug-52209 %patch311 -p1 -b .bug-47435 -%patch312 -p1 -b .bug-53377 -%patch313 -p1 -b .bug-39847 %patch314 -p1 -b .bug-39199 -%patch315 -p1 -b .bug-53630 -%patch316 -p1 -b .bug-51336 -%patch317 -p1 -b .bug-53515 -%patch318 -p1 -b .bug-54092 -%patch319 -p1 -b .bug-53903 -%patch320 -p1 -b .bug-54089 -%patch321 -p1 -b .bug-53603 -%patch322 -p1 -b .bug-53854 -%patch323 -p1 -b .bug-53579 -%patch324 -p1 -b .bug-53568 -%patch325 -p1 -b .bug-49072 # Bugfix backport from 5.3.7 -%patch330 -p1 -b .bug-55399 -%patch331 -p1 -b .bug-55082 -%patch332 -p1 -b .bug-55014 #accert %patch333 -p1 -b .bug-54924 -%patch334 -p1 -b .bug-54180 -%patch335 -p1 -b .bug-54137 -%patch336 -p1 -b .bug-53848 -%patch337 -p1 -b .bug-52935 -%patch338 -p1 -b .bug-51997 -%patch339 -p1 -b .bug-50363 -%patch340 -p1 -b .bug-48465 -%patch341 -p1 -b .bug-54529 -%patch342 -p1 -b .bug-52496 -%patch343 -p1 -b .bug-54242 -%patch344 -p1 -b .bug-54121 -%patch345 -p1 -b .bug-53037 -%patch346 -p1 -b .bug-54269 -%patch347 -p1 -b .bug-54601 -%patch348 -p1 -b .bug-54440 -%patch349 -p1 -b .bug-54494 -%patch350 -p1 -b .bug-54221 -%patch351 -p1 -b .bug-52104 -%patch352 -p1 -b .bug-54329 -%patch353 -p1 -b .bug-53782 -%patch354 -p1 -b .bug-54318 #soap %patch355 -p1 -b .bug-55323 -%patch356 -p1 -b .bug-54312 -%patch357 -p1 -b .bug-51958 -%patch358 -p1 -b .bug-54946 -%patch359 -p1 -b .CVE-2011-4566 -%patch360 -p1 -b .bug-60206 -%patch361 -p1 -b .bug-60138 -%patch362 -p1 -b .bug-60120 -%patch363 -p1 -b .bug-55674 -%patch364 -p1 -b .bug-55509 -%patch365 -p1 -b .bug-55504 -%patch366 -p1 -b .bug-52461 -%patch367 -p1 -b .bug-55366 -%patch368 -p1 -b .bug-55273 -%patch369 -p1 -b .bug-52624 -%patch370 -p1 -b .bug-43200 -%patch371 -p1 -b .bug-54682 -%patch372 -p1 -b .bug-60455 -%patch373 -p1 -b .bug-60183 -%patch374 -p1 -b .bug-55478 -%patch375 -p1 -b .bug-319457 -%patch376 -p1 -b .bug-55776 - -%patch400 -p1 -b .php-5.2-max-input-vars -%patch401 -p1 -b .bug-323007 -%patch402 -p1 -b .bug-323016 +# causes regression -> magic_quotes_gpc setting cannot be changed +#%%patch402 -p1 -b .bug-323016 # conflict seems to be resolved by recode patches rm -f ext/recode/config9.m4 @@ -2172,16 +2056,17 @@ for sapi in $sapis; do sapi_args='--disable-cli --enable-fastcgi --enable-force-cgi-redirect --enable-fpm' ;; apxs1) - ver=$(rpm -q --qf '%{V}' apache1-devel) - sapi_args="--disable-cli --with-apxs=%{apxs1} --with-apache-version=$ver" + apache_ver=$(rpm -q --qf '%{V}' apache1-devel) + sapi_args="--disable-cli --with-apxs=%{apxs1} --with-apache-version=$apache_ver" ;; apxs2) - ver=$(rpm -q --qf '%{V}' apache-devel) - sapi_args="--disable-cli --with-apxs2=%{apxs2} --with-apache-version=$ver" + apache_ver=$(rpm -q --qf '%{V}' apache-devel) + sapi_args="--disable-cli --with-apxs2=%{apxs2} --with-apache-version=$apache_ver" ;; esac %configure \ + FORCE_APACHE_VERSION="${apache_ver}" \ $sapi_args \ %if "%{!?configure_cache:0}%{?configure_cache}" == "0" --cache-file=config.cache \ @@ -2216,8 +2101,8 @@ for sapi in $sapis; do --enable-xmlwriter=shared \ %if %{with fpm} --with-fpm-conf=%{_sysconfdir}/fpm.conf \ - --with-fpm-log=/var/log/fpm.log \ - --with-fpm-pid=/var/run/php/fpm.pid \ + --with-fpm-log=/var/log/php/%{name}-fpm.log \ + --with-fpm-pid=/var/run/%{name}-fpm.pid \ %endif %if %{with mssql} || %{with sybase} || %{with sybase_ct} --with-pdo-dblib=shared \ @@ -2226,7 +2111,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} \ @@ -2274,7 +2159,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} \ @@ -2425,63 +2310,74 @@ 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 +# version suffix +v=$(echo %{version} | cut -d. -f1-2) + # install Apache1 DSO module %if %{with apache1} -libtool --silent --mode=install install sapi/apache/libphp5.la $RPM_BUILD_ROOT%{_libdir}/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 --silent --mode=install install sapi/apache2handler/libphp5.la $RPM_BUILD_ROOT%{_libdir}/apache +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 -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 --silent --mode=install install sapi/cgi/php-cgi $RPM_BUILD_ROOT%{_bindir}/php.cgi +libtool --mode=install install -p sapi/cgi/php-cgi $RPM_BUILD_ROOT%{_bindir}/%{name}.cgi # install FCGI %if %{with fcgi} -libtool --silent --mode=install install sapi/fcgi/php-cgi $RPM_BUILD_ROOT%{_bindir}/php.fcgi +libtool --mode=install install -p sapi/fcgi/php-cgi $RPM_BUILD_ROOT%{_bindir}/%{name}.fcgi %endif # install FCGI PM %if %{with fpm} install -d $RPM_BUILD_ROOT{%{_sysconfdir}/fpm.d,%{_sbindir}} -libtool --mode=install install -p sapi/fpm/php-fpm $RPM_BUILD_ROOT%{_sbindir}/%{name}-fpm -cp -p sapi/fpm/php-fpm.8 $RPM_BUILD_ROOT%{_mandir}/man8/%{name}-fpm.8 -cp -p sapi/fpm/php-fpm.conf $RPM_BUILD_ROOT%{_sysconfdir} +libtool --mode=install install -p sapi/fpm/php-cgi $RPM_BUILD_ROOT%{_sbindir}/%{name}-fpm +cp -p sapi/fpm/fpm/php-fpm.conf $RPM_BUILD_ROOT%{_sysconfdir}/fpm.conf install -d $RPM_BUILD_ROOT/etc/rc.d/init.d 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}# s#/etc/php#%{_sysconfdir}# s#@processname@#%{name}-fpm#g -' $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name}-fpm $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.conf -install -d $RPM_BUILD_ROOT/etc/logrotate.d -cp -p %{SOURCE11} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-fpm +' $RPM_BUILD_ROOT{/etc/{rc.d/init.d/%{name}-fpm,logrotate.d/%{name}-fpm},%{_sysconfdir}/fpm.conf} %endif # install CLI -libtool --mode=install install -p sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/%{name} -cp -p sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{name}.1 -echo ".so %{name}.1" >$RPM_BUILD_ROOT%{_mandir}/man1/php.1 -ln -sf %{name} $RPM_BUILD_ROOT%{_bindir}/php +# without suffix, install as php.cli +%if "%{?php_suffix}" == "" +%define phpfn %{name}.cli +%else +%define phpfn %{name} +%endif +libtool --silent --mode=install install sapi/cli/php $RPM_BUILD_ROOT%{_bindir}/%{phpfn} +ln -sf %{phpfn} $RPM_BUILD_ROOT%{_bindir}/php +cp -p sapi/cli/php.1 $RPM_BUILD_ROOT%{_mandir}/man1/%{phpfn}.1 +echo ".so man1/%{phpfn}.1" >$RPM_BUILD_ROOT%{_mandir}/man1/php.1 +ln -sf %{phpfn} $RPM_BUILD_ROOT%{_bindir}/php -sed -e 's#%{_prefix}/lib/php#%{_libdir}/php#g' php.ini > $RPM_BUILD_ROOT%{_sysconfdir}/php.ini +cp -p php.ini $RPM_BUILD_ROOT%{_sysconfdir}/php.ini %if %{with fcgi} 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 @@ -2498,6 +2394,13 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/apache/libphp5.la install -d $RPM_BUILD_ROOT%{_sysconfdir}/conf.d cp -a conf.d/*.ini $RPM_BUILD_ROOT%{_sysconfdir}/conf.d +# ensure that paths are correct for current php version and arch +grep -El '/etc/php/|/usr/lib/php/' $RPM_BUILD_ROOT%{_sysconfdir}/*.ini | xargs -r \ +%{__sed} -i -e ' + s#/usr/lib/php#%{php_extensiondir}#g + s#/etc/php#%{_sysconfdir}#g +' + # per SAPI ini directories install -d $RPM_BUILD_ROOT%{_sysconfdir}/{cgi,cli,cgi-fcgi,apache,apache2handler}.d @@ -2505,17 +2408,20 @@ 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}/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. @@ -2530,10 +2436,11 @@ install -d $RPM_BUILD_ROOT%{php_data_dir}/tests/php 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 -%if %{with fpm} -# /var/run/php is in php-dirs, here conflicts with __spec_install_post_check_tmpfiles macro -rmdir $RPM_BUILD_ROOT/var/run/php -%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}/%{name}/build/acinclude.m4 %clean rm -rf $RPM_BUILD_ROOT @@ -2593,6 +2500,14 @@ 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 + # common macros called at extension post/postun scriptlet %define extension_scripts() \ %post %1 \ @@ -2684,6 +2599,7 @@ fi %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} @@ -2693,6 +2609,7 @@ fi %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 fcgi} @@ -2701,21 +2618,21 @@ fi %doc sapi/cgi/README.FastCGI %dir %{_sysconfdir}/cgi-fcgi.d %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-cgi-fcgi.ini -%attr(755,root,root) %{_bindir}/php.fcgi +%attr(755,root,root) %{_bindir}/%{name}.fcgi %endif %files cgi %defattr(644,root,root,755) %dir %{_sysconfdir}/cgi.d %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-cgi.ini -%attr(755,root,root) %{_bindir}/php.cgi +%attr(755,root,root) %{_bindir}/%{name}.cgi %files cli %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}/%{name} -%{_mandir}/man1/%{name}.1* +%attr(755,root,root) %{_bindir}/%{phpfn} +%{_mandir}/man1/%{phpfn}.1* %files program %defattr(644,root,root,755) @@ -2729,7 +2646,6 @@ fi %attr(755,root,root) %{_sbindir}/%{name}-fpm %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 -%{_mandir}/man8/%{name}-fpm.8 %endif %files common @@ -2742,7 +2658,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} @@ -2757,7 +2672,7 @@ fi %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* @@ -2936,7 +2851,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 @@ -2993,7 +2908,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