]> git.pld-linux.org Git - packages/php.git/blobdiff - php.spec
setup timezone in %posttrans, not %post
[packages/php.git] / php.spec
index 472204ab39d9b79d5c970689d085cc9fb0642739..67adacc98a1fc0d06ebbd105e0d8d1638c789eb7 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -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}}
@@ -163,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}
@@ -504,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)
@@ -1403,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
@@ -1887,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
@@ -1949,7 +1953,7 @@ cp -p php.ini-production php.ini
 %patch71 -p1
 %endif
 
-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
@@ -2172,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 \
@@ -2418,9 +2423,11 @@ cp -pf Makefile.cli Makefile
 
 # version the .phar files
 mv $RPM_BUILD_ROOT%{_bindir}/phar{,%{ver_suffix}}.phar
-mv $RPM_BUILD_ROOT%{_mandir}/man1/phar{,%{ver_suffix}}.phar.1
-# make link relative
-ln -sfn phar%{ver_suffix}.phar $RPM_BUILD_ROOT%{_bindir}/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)
@@ -2429,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
@@ -2599,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=
@@ -2609,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)
@@ -2631,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
@@ -2686,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
@@ -2714,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
 
@@ -2730,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
 
@@ -3106,10 +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%{ver_suffix}.phar
-%{_mandir}/man1/phar.1*
-%{_mandir}/man1/phar%{ver_suffix}.phar.1
+%{_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.346121 seconds and 4 git commands to generate.