]> git.pld-linux.org Git - packages/php.git/commitdiff
use alternatives for php-fpm binary
authorElan Ruusamäe <glen@delfi.ee>
Mon, 21 Nov 2016 17:11:00 +0000 (19:11 +0200)
committerElan Ruusamäe <glen@delfi.ee>
Mon, 21 Nov 2016 17:37:39 +0000 (19:37 +0200)
php.spec

index 01e06a276db132df3404b36bf34dfd2e9b076293..d9fa2ec9a4e4a7899a095190e292c00a647b2dd9 100644 (file)
--- a/php.spec
+++ b/php.spec
@@ -498,8 +498,9 @@ Requires(postun):   /usr/sbin/userdel
 Requires(pre): /bin/id
 Requires(pre): /usr/sbin/useradd
 Requires:      %{name}-common = %{epoch}:%{version}-%{release}
-Requires:      rc-scripts
+Requires:      alternatives
 Requires:      php-dirs >= 1.4-2
+Requires:      rc-scripts
 Provides:      php(fpm)
 Provides:      user(http)
 Provides:      webserver(php) = %{version}
@@ -2595,6 +2596,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}#
@@ -2708,11 +2712,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
@@ -2945,6 +2951,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
This page took 0.052508 seconds and 4 git commands to generate.