diff options
-rw-r--r-- | php.spec | 32 |
1 files changed, 8 insertions, 24 deletions
@@ -82,23 +82,13 @@ %global isasuffix %nil %endif -# systemd to manage the service -%if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 -%global with_systemd 1 -%else -%global with_systemd 0 -%endif -# systemd with notify mode -%if 0%{?fedora} >= 16 || 0%{?rhel} >= 7 -%global with_systemdfull 1 -%else -%global with_systemdfull 0 -%endif +# systemd to manage the service, Fedora >= 15 +# systemd with notify mode, Fedora >= 16 # systemd with additional service config %if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 -%global with_systemdmax 1 +%global with_systemd 1 %else -%global with_systemdmax 0 +%global with_systemd 0 %endif # httpd 2.4.10 with httpd-filesystem and sethandler support %if 0%{?fedora} >= 21 @@ -247,10 +237,8 @@ Summary: PHP FastCGI Process Manager License: PHP and Zend and BSD Requires(pre): %{_root_sbindir}/useradd Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} -%if %{with_systemdfull} -BuildRequires: systemd-devel -%endif %if %{with_systemd} +BuildRequires: systemd-devel BuildRequires: systemd-units Requires: systemd-units Requires(post): systemd-units @@ -1062,7 +1050,7 @@ popd # Build php-fpm pushd build-fpm build --enable-fpm \ -%if %{with_systemdfull} +%if %{with_systemd} --with-fpm-systemd \ %endif --libdir=%{_libdir}/php \ @@ -1176,10 +1164,6 @@ sed -e 's:/var/lib:%{_localstatedir}/lib:' \ -i $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.d/www.conf mv $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.conf.default . # install systemd unit files and scripts for handling server startup -%if %{with_systemdmax} -# this folder requires systemd >= 204 -install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/systemd/system/%{?scl_prefix}php-fpm.service.d -%endif %if %{with_systemd} install -m 755 -d $RPM_BUILD_ROOT%{_unitdir} install -m 644 %{SOURCE6} $RPM_BUILD_ROOT%{_unitdir}/%{?scl_prefix}php-fpm.service @@ -1187,6 +1171,8 @@ sed -e 's:/run:%{_localstatedir}/run:' \ -e 's:/etc:%{_sysconfdir}:' \ -e 's:/usr/sbin:%{_sbindir}:' \ -i $RPM_BUILD_ROOT%{_unitdir}/%{?scl_prefix}php-fpm.service +# this folder requires systemd >= 204 +install -m 755 -d $RPM_BUILD_ROOT%{_sysconfdir}/systemd/system/%{?scl_prefix}php-fpm.service.d %else # Service install -m 755 -d $RPM_BUILD_ROOT%{_root_initddir} @@ -1468,9 +1454,7 @@ fi %config(noreplace) %{_sysconfdir}/sysconfig/php-fpm %if %{with_systemd} %{_unitdir}/%{?scl_prefix}php-fpm.service -%if %{with_systemdmax} %dir %{_sysconfdir}/systemd/system/%{?scl_prefix}php-fpm.service.d -%endif %else %{_root_initddir}/%{?scl_prefix}php-fpm %endif |