[packages/php/PHP_5_6] use alternatives for php-fpm binary
glen
glen at pld-linux.org
Tue Nov 22 11:11:51 CET 2016
commit 7da71bbe193c01fbdc494911f8f9b93bea491cbb
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Mon Nov 21 19:11:00 2016 +0200
use alternatives for php-fpm binary
php.spec | 7 +++++++
1 file changed, 7 insertions(+)
---
diff --git a/php.spec b/php.spec
index c1a7b58..2cc6529 100644
--- a/php.spec
+++ b/php.spec
@@ -521,6 +521,7 @@ Requires(postun): /usr/sbin/userdel
Requires(pre): /bin/id
Requires(pre): /usr/sbin/useradd
Requires: %{name}-common = %{epoch}:%{version}-%{release}
+Requires: alternatives
Requires: php-dirs >= 1.4-2
Requires: rc-scripts
Provides: php(fcgi)
@@ -2683,6 +2684,9 @@ cp -p %{SOURCE11} $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-fpm
%{__sed} -i -e '/su/d' $RPM_BUILD_ROOT/etc/logrotate.d/%{name}-fpm
%endif
+# touch for ghost for alternatives
+touch $RPM_BUILD_ROOT%{_sbindir}/php-fpm
+
%{__sed} -i -e '
s#/usr/lib/php#%{php_extensiondir}#
s#/etc/php#%{_sysconfdir}#
@@ -2803,11 +2807,13 @@ fi
%post fpm
/sbin/chkconfig --add %{name}-fpm
%service %{name}-fpm restart
+update-alternatives --install %{_sbindir}/php-fpm php-fpm %{_sbindir}/php%{ver_suffix}-fpm %{ver_suffix} || :
%preun fpm
if [ "$1" = "0" ]; then
%service %{name}-fpm stop
/sbin/chkconfig --del %{name}-fpm
+ update-alternatives --remove php-fpm %{_sbindir}/php-fpm || :
fi
%postun fpm
@@ -3040,6 +3046,7 @@ fi
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/php-fpm.conf
%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/fpm.d/www.conf
%attr(755,root,root) %{_sbindir}/%{name}-fpm
+%ghost %{_sbindir}/php-fpm
%{_mandir}/man8/%{name}-fpm.8*
%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
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/php.git/commitdiff/7da71bbe193c01fbdc494911f8f9b93bea491cbb
More information about the pld-cvs-commit
mailing list