]> git.pld-linux.org Git - packages/php.git/blobdiff - php.spec
setup timezone in %posttrans, not %post
[packages/php.git] / php.spec
index f2b4aab69beefca4d88e28d0b068ad71f3604985..67adacc98a1fc0d06ebbd105e0d8d1638c789eb7 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -82,7 +82,7 @@
 %bcond_without cgi             # disable CGI/FCGI SAPI
 %bcond_without fpm             # disable FPM
 %bcond_with    embed           # disable Embedded API
-%bcond_without suhosin         # with suhosin patch
+%bcond_with    suhosin         # with suhosin patch
 %bcond_with    tests           # default off; test process very often hangs on builders, approx run time 45m; perform "make test"
 %bcond_with    gcov            # Enable Code coverage reporting
 %bcond_with    type_hints      # experimental support for strict typing/casting
 %undefine      with_mm
 %endif
 
-%ifnarch %{ix86} %{x8664} sparc sparcv9 alpha
+%ifnarch %{ix86} %{x8664} x32 sparc sparcv9 alpha
 # ppc disabled (broken on th-ppc)
 %undefine      with_interbase
 %endif
 
-%ifnarch %{ix86} %{x8664}
+%ifnarch %{ix86} %{x8664} x32
 # unsupported, see sapi/cgi/fpm/fpm_atomic.h
 %undefine      with_fpm
 %endif
@@ -124,7 +124,7 @@ ERROR: You need to select at least one Apache SAPI to build shared modules.
 %undefine      with_filter
 %endif
 
-%define                rel     1
+%define                rel     10
 %define                orgname php
 %define                ver_suffix 54
 %define                php_suffix %{!?with_default_php:%{ver_suffix}}
@@ -135,13 +135,16 @@ Summary(pt_BR.UTF-8):     A linguagem de script PHP
 Summary(ru.UTF-8):     PHP Версии 5 - язык препроцессирования HTML-файлов, выполняемый на сервере
 Summary(uk.UTF-8):     PHP Версії 5 - мова препроцесування HTML-файлів, виконувана на сервері
 Name:          %{orgname}%{php_suffix}
-Version:       5.4.38
+Version:       5.4.45
 Release:       %{rel}%{?with_type_hints:.th}%{?with_oci8:.oci}
 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: 2bf5007ba4bd012f9895c1b441dd4f50
+# Source0-md5: 185f67f1ca652b18bc0cca9d7edbde7c
 Source2:       %{orgname}-mod_%{orgname}.conf
 Source3:       %{orgname}-cgi-fcgi.ini
 Source4:       %{orgname}-apache.ini
@@ -160,6 +163,7 @@ Patch5:             %{orgname}-filter-shared.patch
 Patch6:                %{orgname}-build_modules.patch
 Patch7:                %{orgname}-sapi-ini-file.patch
 Patch8:                %{orgname}-config-file-scan-dir.patch
+Patch9:                php-bug-71475.patch
 Patch10:       %{orgname}-ini.patch
 Patch11:       embed.patch
 %if %{with type_hints}
@@ -211,6 +215,9 @@ Patch63:    %{orgname}-mysql-nowarning.patch
 Patch65:       system-libzip.patch
 Patch66:       php-db.patch
 Patch67:       mysql-lib-ver-mismatch.patch
+Patch68:       x32.patch
+Patch70:       libvpx2.patch
+Patch71:       zend_operators_from_5.5.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}
@@ -249,7 +256,7 @@ BuildRequires:      libpng-devel >= 1.0.8
 %{?with_webp:BuildRequires:    libvpx-devel}
 BuildRequires: tokyocabinet-devel
 %if "%{pld_release}" != "ac"
-BuildRequires: libtool >= 2:2.2
+BuildRequires: libtool >= 2:2.4.6
 %else
 BuildRequires: libtool >= 1.4.3
 %endif
@@ -498,6 +505,7 @@ Requires(postun):   /usr/sbin/userdel
 Requires(pre): /bin/id
 Requires(pre): /usr/sbin/useradd
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
+Requires:      php-dirs >= 1.4-2
 Requires:      rc-scripts
 Provides:      php(fpm)
 Provides:      user(http)
@@ -569,18 +577,21 @@ Requires: %{name}-common = %{epoch}:%{version}-%{release}
 Requires:      autoconf >= 2.13
 Requires:      automake
 %if "%{pld_release}" != "ac"
-Requires:      libtool >= 2:2.2
+Requires:      libtool >= 2:2.4.6
 %else
 Requires:      libtool
 %endif
 %{?with_pcre:Requires: pcre-devel >= 8.10}
 Requires:      shtool
+Provides:      php-devel = %{epoch}:%{version}-%{release}
 Obsoletes:     php-devel
 Obsoletes:     php-pear-devel
 Obsoletes:     php4-devel
 Obsoletes:     php52-devel
 Obsoletes:     php53-devel
 Obsoletes:     php55-devel
+Obsoletes:     php56-devel
+Obsoletes:     php70-devel
 
 %description devel
 The php-devel package lets you compile dynamic extensions to PHP.
@@ -1394,12 +1405,13 @@ Moduł PHP umożliwiający dostęp do bazy danych PostgreSQL.
 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}-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
@@ -1878,6 +1890,7 @@ Moduł PHP umożliwiający używanie kompresji zlib.
 %patch5 -p1
 %patch6 -p1
 %patch8 -p1
+%patch9 -p1
 %patch7 -p1
 cp -p php.ini-production php.ini
 %patch10 -p1
@@ -1918,6 +1931,7 @@ cp -p php.ini-production php.ini
 #%patch46 -p1 # imap myrights. fixme
 %if %{with suhosin}
 %patch47 -p1
+%patch68 -p1
 %endif
 %patch50 -p1
 %patch51 -p1
@@ -1932,8 +1946,14 @@ cp -p php.ini-production php.ini
 %{?with_system_libzip:%patch65 -p1}
 %patch66 -p1
 %patch67 -p1
+%patch70 -p1
 
-sed -i -e '/PHP_ADD_LIBRARY_WITH_PATH/s#xmlrpc,#xmlrpc-epi,#' ext/xmlrpc/config.m4
+%ifarch x32
+# asm part of zend_operators.h of php-5.5
+%patch71 -p1
+%endif
+
+%{__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
@@ -2006,6 +2026,9 @@ ix86= x8664=:
 %endif
 %ifarch %{x8664}
 ix86=: x8664= \
+%endif
+%ifarch x32
+ix86=: x8664=: \
 %endif
        sh -xe %{_sourcedir}/skip-tests.sh
 
@@ -2153,6 +2176,7 @@ for sapi in $sapis; do
        esac
 
        %configure \
+       EXTRA_LDFLAGS="%{rpmldflags}" \
        $sapi_args \
 %if "%{!?configure_cache:0}%{?configure_cache}" == "0"
        --cache-file=config.cache \
@@ -2397,8 +2421,13 @@ cp -pf Makefile.cli Makefile
        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)
@@ -2407,14 +2436,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 litespeed sapi
@@ -2500,17 +2529,19 @@ install -d $RPM_BUILD_ROOT%{_sysconfdir}/{cgi-fcgi,cli,apache,apache2handler}.d
 mv $RPM_BUILD_ROOT%{_sysconfdir}/{conf.d/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
 
 # for php-pecl-mailparse
@@ -2575,7 +2606,7 @@ fi
 %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=
@@ -2585,7 +2616,6 @@ if ! grep -q '^date.timezone[[:space:]]*=' %{_sysconfdir}/php.ini && [ -f /etc/s
        fi
 fi
 
-%posttrans common
 # minimizing apache restarts logics. we restart webserver:
 #
 # 1. at the end of transaction. (posttrans, feature from rpm 4.4.2)
@@ -2607,17 +2637,31 @@ 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.4.45-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.4.45-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
@@ -2662,7 +2706,6 @@ fi
 %extension_scripts pdo-pgsql
 %extension_scripts pdo-sqlite
 %extension_scripts pgsql
-%extension_scripts phar
 %extension_scripts pcntl
 %extension_scripts posix
 %extension_scripts pspell
@@ -2690,13 +2733,25 @@ fi
 %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
 
@@ -2706,7 +2761,7 @@ fi
 %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
 
@@ -3082,8 +3137,11 @@ fi
 %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
+%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
 
 %files posix
This page took 0.918341 seconds and 4 git commands to generate.