From 1980e23d65c295d7a9ff5026a7f01612b52e4458 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 22 May 2019 14:30:41 +0200 Subject: cleanup EL-6 stuff, no more supported --- php-fpm.init | 111 ----------------------------------------------------------- php.spec | 83 ++------------------------------------------ 2 files changed, 3 insertions(+), 191 deletions(-) delete mode 100644 php-fpm.init diff --git a/php-fpm.init b/php-fpm.init deleted file mode 100644 index 63aac66..0000000 --- a/php-fpm.init +++ /dev/null @@ -1,111 +0,0 @@ -#! /bin/sh -# -# chkconfig: - 84 16 -# description: PHP FastCGI Process Manager -# processname: php-fpm -# config: /etc/php-fpm.conf -# config: /etc/sysconfig/php-fpm -# pidfile: /var/run/php-fpm/php-fpm.pid -# -### BEGIN INIT INFO -# Provides: php-fpm -# Required-Start: $local_fs $remote_fs $network $named -# Required-Stop: $local_fs $remote_fs $network -# Short-Description: start and stop PHP FPM -# Description: PHP FastCGI Process Manager -### END INIT INFO - -# Standard LSB functions -#. /lib/lsb/init-functions - -# Source function library. -. /etc/init.d/functions - -# Check that networking is up. -. /etc/sysconfig/network - -# Additional environment file -if [ -f /etc/sysconfig/php-fpm ]; then - . /etc/sysconfig/php-fpm -fi - -if [ "$NETWORKING" = "no" ] -then - exit 0 -fi - -RETVAL=0 -prog="php-fpm" -pidfile=${PIDFILE-/var/run/php-fpm/php-fpm.pid} -lockfile=${LOCKFILE-/var/lock/subsys/php-fpm} - -start () { - echo -n $"Starting $prog: " - dir=$(dirname ${pidfile}) - [ -d $dir ] || mkdir $dir - daemon --pidfile ${pidfile} /usr/sbin/php-fpm --daemonize - RETVAL=$? - echo - [ $RETVAL -eq 0 ] && touch ${lockfile} -} -stop () { - echo -n $"Stopping $prog: " - killproc -p ${pidfile} php-fpm - RETVAL=$? - echo - if [ $RETVAL -eq 0 ] ; then - rm -f ${lockfile} ${pidfile} - fi -} - -restart () { - stop - start -} - -reload () { - echo -n $"Reloading $prog: " - if ! /usr/sbin/php-fpm --test ; then - RETVAL=6 - echo $"not reloading due to configuration syntax error" - failure $"not reloading $prog due to configuration syntax error" - else - killproc -p ${pidfile} php-fpm -USR2 - RETVAL=$? - fi - echo -} - - -# See how we were called. -case "$1" in - start) - start - ;; - stop) - stop - ;; - status) - status -p ${pidfile} php-fpm - RETVAL=$? - ;; - restart) - restart - ;; - reload|force-reload) - reload - ;; - configtest) - /usr/sbin/php-fpm --test - RETVAL=$? - ;; - condrestart|try-restart) - [ -f ${lockfile} ] && restart || : - ;; - *) - echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart|try-restart|configtest}" - RETVAL=2 - ;; -esac - -exit $RETVAL diff --git a/php.spec b/php.spec index 9168e6d..d14c14d 100644 --- a/php.spec +++ b/php.spec @@ -39,17 +39,10 @@ %global _httpd_confdir %{_root_sysconfdir}/httpd/conf.d %global _httpd_moddir %{_libdir}/httpd/modules %global _root_httpd_moddir %{_root_libdir}/httpd/modules -%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 # httpd 2.4 values %global _httpd_apxs %{_root_bindir}/apxs %global _httpd_modconfdir %{_root_sysconfdir}/httpd/conf.modules.d %global _httpd_contentdir /usr/share/httpd -%else -# httpd 2.2 values -%global _httpd_apxs %{_root_sbindir}/apxs -%global _httpd_modconfdir %{_root_sysconfdir}/httpd/conf.d -%global _httpd_contentdir /var/www -%endif %global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_root_sysconfdir}/rpm; echo $d) @@ -89,25 +82,11 @@ %endif %global with_onig 1 -%if 0%{?__isa_bits:1} -%global isasuffix -%{__isa_bits} -%else -%global isasuffix %nil -%endif - %global with_dtrace 1 # build with system libgd (gd-last in remi repo) %global with_libgd 1 -# 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_systemd 1 -%else -%global with_systemd 0 -%endif # httpd 2.4.10 with httpd-filesystem and sethandler support %if 0%{?fedora} >= 21 || 0%{?rhel} >= 8 %global with_httpd2410 1 @@ -117,13 +96,6 @@ %global with_zip 0 - -%if 0%{?fedora} < 18 && 0%{?rhel} < 7 -%global db_devel db4-devel -%else -%global db_devel libdb-devel -%endif - %global gh_commit 9ef03a94ba68be0f8bae36f46c4763ba3c88a02a %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_date 20190521 @@ -162,7 +134,6 @@ Source7: php-fpm.logrotate Source8: php-fpm.sysconfig Source9: php.modconf Source10: php.conf2 -Source11: php-fpm.init Source12: php-fpm.wants # Configuration files for some extensions Source50: 10-opcache.ini @@ -203,7 +174,7 @@ Patch300: php-7.0.10-datetests.patch BuildRequires: bzip2-devel BuildRequires: pkgconfig(libcurl) >= 7.15.5 -BuildRequires: %{db_devel} +BuildRequires: libdb-devel BuildRequires: httpd-devel >= 2.0.46-1 BuildRequires: pam-devel %if %{with_httpd2410} @@ -307,17 +278,11 @@ BuildRequires: libacl-devel BuildRequires: pkgconfig(libsystemd) >= 209 Requires(pre): %{_root_sbindir}/useradd Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} -%if %{with_systemd} %{?systemd_requires} # This is actually needed for the %%triggerun script but Requires(triggerun) # is not valid. We can use %%post because this particular %%triggerun script # should fire just after this package is installed. Requires(post): systemd-sysv -%else -# This is for /sbin/service -Requires(preun): initscripts -Requires(postun): initscripts -%endif %if %{with_httpd2410} # To ensure correct /var/lib/php/session ownership: Requires(pre): httpd-filesystem @@ -783,7 +748,7 @@ Summary: A database abstraction layer module for PHP applications Group: Development/Languages # All files licensed under PHP version 3.01 License: PHP -BuildRequires: %{db_devel} +BuildRequires: libdb-devel BuildRequires: tokyocabinet-devel BuildRequires: lmdb-devel Requires: %{?scl_prefix}php-common%{?_isa} = %{version}-%{release} @@ -941,7 +906,7 @@ in pure PHP. %prep -: Building %{name}-%{version}-%{release} with systemd=%{with_systemd} imap=%{with_imap} freetds=%{with_freetds} sqlite3=%{with_sqlite3} tidy=%{with_tidy} zip=%{with_zip} +: Building %{name}-%{version}-%{release} with imap=%{with_imap} freetds=%{with_freetds} sqlite3=%{with_sqlite3} tidy=%{with_tidy} zip=%{with_zip} %if 0%{?gh_date} %setup -q -n %{gh_project}-%{gh_commit} %else @@ -1334,9 +1299,7 @@ popd # Build php-fpm pushd build-fpm build --enable-fpm \ -%if %{with_systemd} --with-fpm-systemd \ -%endif --with-fpm-acl \ --libdir=%{_libdir}/php \ --without-mysqli \ @@ -1467,7 +1430,6 @@ mv $RPM_BUILD_ROOT%{_sysconfdir}/php-fpm.d/www.conf.default . # install -m 755 -d $RPM_BUILD_ROOT%{_prefix}/lib/tmpfiles.d # install -m 644 php-fpm.tmpfiles $RPM_BUILD_ROOT%{_prefix}/lib/tmpfiles.d/php-fpm.conf # install systemd unit files and scripts for handling server startup -%if %{with_systemd} install -Dm 644 %{SOURCE6} $RPM_BUILD_ROOT%{_unitdir}/%{?scl_prefix}php-fpm.service %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 install -Dm 644 %{SOURCE12} $RPM_BUILD_ROOT%{_unitdir}/httpd.service.d/%{?scl_prefix}php-fpm.conf @@ -1480,18 +1442,6 @@ sed -e 's:/run:%{_localstatedir}/run:' \ -i $RPM_BUILD_ROOT%{_unitdir}/%{?scl_prefix}php-fpm.service # this folder requires systemd >= 204 install -m 755 -d $RPM_BUILD_ROOT%{_root_sysconfdir}/systemd/system/%{?scl_prefix}php-fpm.service.d -%else -# Service -install -m 755 -d $RPM_BUILD_ROOT%{_root_initddir} -install -m 755 %{SOURCE11} $RPM_BUILD_ROOT%{_root_initddir}/%{?scl_prefix}php-fpm -# Needed relocation for SCL -sed -e '/php-fpm.pid/s:/var:%{_localstatedir}:' \ - -e '/subsys/s/php-fpm/%{?scl_prefix}php-fpm/' \ - -e 's:/etc/sysconfig/php-fpm:%{_sysconfdir}/sysconfig/php-fpm:' \ - -e 's:/etc/php-fpm.conf:%{_sysconfdir}/php-fpm.conf:' \ - -e 's:/usr/sbin:%{_sbindir}:' \ - -i $RPM_BUILD_ROOT%{_root_initddir}/%{?scl_prefix}php-fpm -%endif %if %{with_httpd2410} # Switch to UDS @@ -1662,35 +1612,14 @@ exit 0 %endif %post fpm -%if %{with_systemd} %systemd_post %{?scl:%{scl}-}php-fpm.service -%else -if [ $1 = 1 ]; then - # Initial installation - /sbin/chkconfig --add %{?scl_prefix}php-fpm -fi -%endif %preun fpm -%if %{with_systemd} %systemd_preun %{?scl:%{scl}-}php-fpm.service -%else -if [ $1 = 0 ]; then - # Package removal, not upgrade - /sbin/service %{?scl_prefix}php-fpm stop >/dev/null 2>&1 - /sbin/chkconfig --del %{?scl_prefix}php-fpm -fi -%endif %if 0%{?fedora} < 27 && 0%{?rhel} < 8 %postun fpm -%if %{with_systemd} %systemd_postun_with_restart %{?scl:%{scl}-}php-fpm.service -%else -if [ $1 -ge 1 ]; then - /sbin/service %{?scl_prefix}php-fpm condrestart >/dev/null 2>&1 || : -fi -%endif %endif %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 @@ -1703,7 +1632,6 @@ systemctl try-restart %{?scl:%{scl}-}php-fpm.service >/dev/null 2>&1 || : # We can tell if a SysV version of php-fpm was previously installed by # checking to see if the initscript is present. %triggerun fpm -- %{?scl_prefix}php-fpm -%if %{with_systemd} if [ -f /etc/rc.d/init.d/%{?scl_prefix}php-fpm ]; then # Save the current service runlevel info # User must manually run systemd-sysv-convert --apply php-fpm @@ -1714,7 +1642,6 @@ if [ -f /etc/rc.d/init.d/%{?scl_prefix}php-fpm ]; then /sbin/chkconfig --del %{?scl_prefix}php-fpm >/dev/null 2>&1 || : /bin/systemctl try-restart %{?scl_prefix}php-fpm.service >/dev/null 2>&1 || : fi -%endif %if 0%{?fedora} < 28 && 0%{?rhel} < 8 @@ -1801,16 +1728,12 @@ fi %config(noreplace) %{_sysconfdir}/sysconfig/php-fpm %endif # {_prefix}/lib/tmpfiles.d/php-fpm.conf -%if %{with_systemd} %{_unitdir}/%{?scl_prefix}php-fpm.service %dir %{_root_sysconfdir}/systemd/system/%{?scl_prefix}php-fpm.service.d %if 0%{?fedora} >= 27 || 0%{?rhel} >= 8 %{_unitdir}/httpd.service.d/%{?scl_prefix}php-fpm.conf %{_unitdir}/nginx.service.d/%{?scl_prefix}php-fpm.conf %endif -%else -%{_root_initddir}/%{?scl_prefix}php-fpm -%endif %{_sbindir}/php-fpm %dir %{_sysconfdir}/php-fpm.d # log owned by apache for log -- cgit