raven-rhel6/isp-php54/isp-php54.spec

697 lines
19 KiB
RPMSpec
Raw Normal View History

2024-02-21 20:14:44 +06:00
%define php_ver 54
%define php_prefix /opt/php%{php_ver}
%define opcache_ver 7.0.5
%define memcached_ver 2.2.0
%define _default_patch_fuzz 2
%undefine _missing_build_ids_terminate_build
%if 0%{?rhel} >= 7
%define apxs /usr/bin/apxs
%else
%define apxs /usr/sbin/apxs
%endif
%bcond_without libgd
Requires: freetds
Summary: PHP scripting language for creating dynamic web sites
Name: isp-php%{php_ver}
Version: 5.4.45
Release: 1500%{?dist}
License: PHP
Group: Development/Languages
URL: http://www.php.net/
Source0: http://www.php.net/distributions/php-%{version}.tar.bz2
Source1: php.conf
Source2: php.ini
Source3: macros.php
Source4: php%{php_ver}.conf
Source10: https://pecl.php.net/get/zendopcache-%{opcache_ver}.tgz
Source11: https://pecl.php.net/get/memcached-%{memcached_ver}.tgz
Source12: memcache-3.0.8.tgz
Source20: ioncube_loaders_lin_x86-64.tar.gz
Source21: ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64.tar.gz
# Build fixes
Patch1: php-5.3.3-gnusrc.patch
Patch2: php-5.3.0-install.patch
Patch3: php-5.2.4-norpath.patch
Patch4: php-5.3.0-phpize64.patch
Patch5: php-5.2.0-includedir.patch
Patch6: php-5.2.4-embed.patch
Patch7: php-5.3.0-recode.patch
Patch8: php-5.4.7-libdb.patch
# Fixes for extensions
Patch26: php-5.3.3-odbc.patch
# Functional changes
Patch40: php-5.0.4-dlopen.patch
Patch41: php-5.3.0-easter.patch
Patch42: php-5.3.1-systzdata-v7.patch
# Fixes for tests
Patch61: php-5.0.4-tests-wddx.patch
# Upstream fixes
# Backported from 5.5.18 for https://bugs.php.net/65641
Patch100: php-5.4.33-bug65641.patch
# Backported from 5.5.14 for https://bugs.php.net/50444
Patch102: php-5.4.39-bug50444.patch
Patch120: close_stderr.patch
Patch121: php_fpm_stop.patch
Patch122: php_fpm_service.patch
# Fix gd for centos-8
Patch126: vpx_gd.patch
# Fox php-mysql and mariadb10
Patch127: php52-mariadb10.patch
Patch128: disable_zts.patch
%if 0%{?rhel} >= 8
Patch129: openssl_path.patch
Patch130: memcache-faulty-inline.patch
%endif
Patch131: mysql8_unicode.patch
Patch132: CVE-2021-21703.php-fpm_lower_5.6.patch
# Security fixes
Patch200: bug69720.patch
Patch201: bug70433.patch
Patch202: bug70755.patch
Patch203: bug70728.patch
Patch204: bug70741.patch
Patch205: bug70661.patch
Patch206: bug71354.patch
Patch207: bug71335.patch
Patch208: bug71391.patch
Patch209: bug71323.patch
Patch210: bug71459.patch
Patch211: bug71039.patch
Patch212: bug71488.patch
Patch213: pcre838.patch
Patch214: bug71498.patch
Patch215: bug71587.patch
Patch216: bug71860.patch
Patch217: bug71906.patch
Patch218: bug71798.patch
Patch219: bug71704.patch
Patch220: bug71527.patch
Patch221: bug64938.patch
Patch222: bug71912.patch
Patch223: bug72061.patch
Patch224: bug72093.patch
Patch225: bug72094.patch
Patch226: bug72099.patch
Patch227: bug71331.patch
Patch228: bug72114.patch
Patch229: bugoverflow.patch
Patch230: bug72135.patch
Patch231: bug72241.patch
Patch232: bug66387.patch
Patch233: bug72340.patch
Patch234: bug72275.patch
# For #72400, #72403, #72268
Patch235: bug72400.patch
Patch236: bug72339.patch
Patch237: bug72298.patch
Patch238: bug72402.patch
Patch239: bug72433.patch
Patch240: bug72434.patch
Patch241: bug72455.patch
Patch242: bug72446.patch
Patch243: bug70480.patch
Patch244: bug69975.patch
Patch245: bug72479.patch
Patch246: bug72573.patch
Patch247: bug72513.patch
Patch248: bug72520.patch
Patch249: bug72533.patch
Patch250: bug72562.patch
Patch251: bug72603.patch
Patch252: bug72606.patch
Patch253: bug72613.patch
Patch254: bug72618.patch
Patch255: bug72519.patch
Patch256: bug72735.patch
Patch257: bug72627.patch
Patch258: bug72926.patch
Patch259: bug73035.patch
Patch260: bug72928.patch
Patch261: bug73737.patch
Patch262: bug73764.patch
Patch263: bug73768.patch
Patch264: bug73773.patch
Patch265: bug73549.patch
Patch266: bug73868.patch
Patch267: bug73869.patch
Patch268: bug74435.patch
Patch269: bug75571.patch
Patch270: bug75981.patch
Patch271: bug76582.patch
Patch272: bug77153.patch
Patch273: bug77020.patch
Patch274: bug77231.patch
Patch275: bug77242.patch
Patch276: bug77380.patch
Patch277: bug78599.patch
Patch278: bug81719.patch
BuildRequires: autoconf
BuildRequires: wget, tar, gcc
BuildRequires: gcc-c++, libxml2-devel, bzip2-devel
BuildRequires: curl-devel >= 7.20
BuildRequires: gmp-devel
BuildRequires: pam-devel, libstdc++-devel
BuildRequires: openssl-devel
BuildRequires: sqlite-devel, zlib-devel, pcre-devel
BuildRequires: smtpdaemon, libedit-devel, libtool
BuildRequires: perl
BuildRequires: mysqlclient18-devel
BuildRequires: enchant-devel
BuildRequires: libicu-devel < 50.0, recode-devel, aspell-devel
BuildRequires: libtidy-devel, libxslt-devel, t1lib-devel
BuildRequires: net-snmp-devel, libxml2-devel, unixODBC-devel
BuildRequires: postgresql-devel < 9.2, krb5-devel, cyrus-sasl-devel
BuildRequires: openldap-devel, libtool-ltdl-devel
%if 0%{?rhel} < 7
BuildRequires: db4-devel
BuildRequires: libc-client-devel
%else
BuildRequires: libdb-devel
BuildRequires: uw-imap-static
%endif
BuildRequires: openldap-devel, unixODBC-devel
BuildRequires: patch, ImageMagick6-devel
BuildRequires: libmcrypt-devel
BuildRequires: httpd-devel
BuildRequires: freetds-devel
BuildRequires: libmemcached-devel
BuildRequires: libvpx-devel
BuildRequires: libssh2-devel
BuildRequires: bats
%if %{with libgd}
BuildRequires: pkgconfig(gdlib) >= 2.3.3
%else
# Required to build the bundled GD library
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(libjpeg)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(freetype2)
BuildRequires: pkgconfig(xpm)
BuildRequires: pkgconfig(libwebp)
%endif
%description
PHP is an HTML-embedded scripting language. PHP attempts to make it
easy for developers to write dynamically generated webpages. PHP also
offers built-in database integration for several commercial and
non-commercial database management systems, so writing a
database-enabled webpage with PHP is fairly simple. The most common
use of PHP coding is probably as a replacement for CGI scripts.
The php package contains the module which adds support for the PHP
language to Apache HTTP Server.
%package mod-apache
Summary: Apache module
Requires: %{name}%{?_isa} = %{version}-%{release}
%description mod-apache
Apache module
%package fpm
Summary: Fpm service
Requires: %{name}%{?_isa} = %{version}-%{release}
%description fpm
PHP-fpm service %{version}
%package lsapi
Summary: LSAPI module
Requires: %{name}%{?_isa} = %{version}-%{release}
%description lsapi
LSAPI module %{version}
%prep
%setup -q -n php-%{version}
%patch1 -p1 -b .gnusrc
%patch2 -p1 -b .install
%patch3 -p1 -b .norpath
%patch4 -p1 -b .phpize64
%patch5 -p1 -b .includedir
%patch6 -p1 -b .embed
%patch7 -p1 -b .recode
%patch8 -p1 -b .libdb
%patch26 -p1 -b .pdoodbc
%patch40 -p1 -b .dlopen
%patch41 -p1 -b .easter
%patch42 -p1 -b .systzdata
%patch61 -p1 -b .tests-wddx
%patch120 -p1 -b .bug69865
%patch121 -p1 -b .fpmstop
%patch122 -p1 -b .fpmservice
#%patch125 -p1 -b .bug78599
%if 0%{?rhel} != 7
%patch126 -p1 -b .gd_vpx
%endif
%patch127 -p1 -b .mariadb10
# Disable ZTS on high apache version
%patch128 -p1
# Fix openssl10.cnf path
%if 0%{?rhel} >= 8
%patch129 -p1
%patch130 -p1
%endif
# upstream patches
%patch100 -p1 -b .bug65641
%patch102 -p1 -b .bug50444
# Fix mysql8 unicode
%patch131 -p1
# CVE-2021-21703 php-fpm
%patch132 -p1
# security patches
%patch200 -p1 -b .bug69720
%patch201 -p1 -b .bug70433
%patch202 -p1 -b .bug70755
%patch203 -p1 -b .bug70728
%patch204 -p1 -b .bug70741
%patch205 -p1 -b .bug70661
%patch206 -p1 -b .bug71354
%patch207 -p1 -b .bug71335
%patch208 -p1 -b .bug71391
%patch209 -p1 -b .bug71323
%patch210 -p1 -b .bug71459
%patch211 -p1 -b .bug71039
%patch212 -p1 -b .bug71488
%patch213 -p1 -b .pcre838
%patch214 -p1 -b .bug71498
%patch215 -p1 -b .bug71587
%patch216 -p1 -b .bug71860
%patch217 -p1 -b .bug71906
%patch218 -p1 -b .bug71798
%patch219 -p1 -b .bug71704
%patch220 -p1 -b .bug71527
%patch221 -p1 -b .bug64938
%patch222 -p1 -b .bug71912
%patch223 -p1 -b .bug72061
%patch224 -p1 -b .bug72093
%patch225 -p1 -b .bug72094
%patch226 -p1 -b .bug72099
%patch227 -p1 -b .bug71331
%patch228 -p1 -b .bug72114
%patch229 -p1 -b .bugoverflow
%patch230 -p1 -b .bug72135
%patch231 -p1 -b .bug72241
%patch232 -p1 -b .bug66387
%patch233 -p1 -b .bug72340
%patch234 -p1 -b .bug72275
%patch235 -p1 -b .bug72400
%patch236 -p1 -b .bug72339
%patch237 -p1 -b .bug72298
%patch238 -p1 -b .bug72402
%patch239 -p1 -b .bug72433
%patch240 -p1 -b .bug72434
%patch241 -p1 -b .bug72455
%patch242 -p1 -b .bug72446
%patch243 -p1 -b .bug70480
%patch244 -p1 -b .bug69975
%patch245 -p1 -b .bug72479
%patch246 -p1 -b .bug72573
%patch247 -p1 -b .bug72513
%patch248 -p1 -b .bug72520
%patch249 -p1 -b .bug72533
%patch250 -p1 -b .bug72562
%patch251 -p1 -b .bug72603
%patch252 -p1 -b .bug72606
%patch253 -p1 -b .bug72613
%patch254 -p1 -b .bug72618
%patch255 -p1 -b .bug72519
%patch256 -p1 -b .bug72735
%patch257 -p1 -b .bug72627
%patch258 -p1 -b .bug72926
%patch259 -p1 -b .bug73035
%patch260 -p1 -b .bug72928
%patch261 -p1 -b .bug73737
%patch262 -p1 -b .bug73764
%patch263 -p1 -b .bug73768
%patch264 -p1 -b .bug73773
%patch265 -p1 -b .bug73549
%patch266 -p1 -b .bug73868
%patch267 -p1 -b .bug73869
%patch268 -p1 -b .bug74435
%patch269 -p1 -b .bug75571
%patch270 -p1 -b .bug75981
%patch271 -p1 -b .bug76582
%patch272 -p1 -b .bug77153
%patch273 -p1 -b .bug77020
%patch274 -p1 -b .bug77231
%patch275 -p1 -b .bug77242
%patch276 -p1 -b .bug77380
%patch277 -p1 -b .bug78599
%patch278 -p1 -b .bug81719
pushd ext
tar -xf %{SOURCE10}
tar -xf %{SOURCE11}
tar -xf %{SOURCE12}
popd
tar -xf %{SOURCE20}
tar -xf %{SOURCE21}
%build
mv ext/zendopcache-%{opcache_ver} ext/opcache
mv ext/memcached-%{memcached_ver} ext/memcached
mv ext/memcache-3.0.8 ext/memcache
./buildconf --force
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -Wno-pointer-sign"
export CFLAGS
PREFIX=%{php_prefix}
syspref=/usr
EXTENSION_DIR=%{php_prefix}/lib/php/modules; export EXTENSION_DIR
PEAR_INSTALLDIR=%{php_prefix}/share/pear; export PEAR_INSTALLDIR
CONFIGURE_COMMON="--prefix=${PREFIX} \
--cache-file=../config.cache \
--with-config-file-path=${PREFIX}/etc \
--with-config-file-scan-dir=${PREFIX}/etc/php.d \
--disable-debug \
--with-libdir=%{_lib} \
--with-pic \
--disable-rpath \
--with-bz2 \
%if %{with libgd}
--with-gd \
%else
--with-webp \
--with-jpeg \
--with-xpm \
--with-freetype \
--with-png} \
--with-vpx-dir \
%endif
--enable-gd-native-ttf \
--without-gdbm \
--with-gettext \
--with-gmp \
--with-iconv \
--with-openssl=${syspref} \
--with-pcre-regex=${syspref} \
--with-zlib \
--with-layout=GNU \
--enable-exif \
--enable-ftp \
--enable-sockets \
--with-kerberos \
--enable-shmop \
--enable-calendar \
--with-libxml-dir=${syspref} \
--enable-xml \
--with-mhash \
--with-system-tzdata \
--enable-pcntl \
--enable-mbregex \
--without-readline \
--with-libedit \
--with-db4=${syspref}"
CONFIGURE_DISABLED=" --disable-dom \
--disable-json \
--disable-pdo \
--disable-mysqli \
--enable-timezonedb=shared \
--disable-xmlreader \
--disable-xmlwriter \
--enable-dba=shared \
--disable-posix"
mkdir cgi apache2 fpm lsapi
cd cgi
../configure \
${CONFIGURE_COMMON} \
--enable-sysvsem --enable-sysvshm --enable-sysvmsg \
--with-imap=shared --with-imap-ssl \
--enable-mbstring=shared \
--with-gd=shared \
--enable-bcmath=shared \
--enable-dba=shared \
--with-xmlrpc=shared \
--with-ldap=shared --with-ldap-sasl \
--with-mysql=shared,${syspref} \
--with-mysqli=shared \
--enable-mysqlnd=shared \
--with-mysql-sock=/var/lib/mysql/mysql.sock \
--with-mysqli-sock=/var/lib/mysql/mysql.sock \
--enable-dom=shared \
--with-pgsql=shared,${syspref} \
--enable-wddx=shared \
--with-snmp=shared,${syspref} \
--enable-soap=shared \
--with-xsl=shared,${syspref} \
--enable-xmlreader=shared --enable-xmlwriter=shared \
--with-curl=shared,${syspref} \
--enable-pdo=shared \
--with-pdo-odbc=shared,unixODBC,${syspref} \
--with-pdo-mysql=shared,${syspref} \
--with-pdo-pgsql=shared,${syspref} \
--with-pdo-sqlite=shared,${syspref} \
--with-pdo-dblib=shared \
--with-sybase-ct=shared,${syspref} \
--enable-json=shared \
--enable-zip=shared \
--with-pspell=shared \
--with-tidy=shared,${syspref} \
--enable-sysvmsg=shared --enable-sysvshm=shared --enable-sysvsem=shared \
--enable-posix=shared \
--with-unixODBC=shared,${syspref} \
--with-recode=shared,${syspref} \
--with-db4=${syspref} \
--with-imagick=shared,${syspref} \
--enable-intl=shared,${syspref} \
--enable-htscanner=shared,${syspref} \
--enable-timezonedb=shared,${syspref} \
--with-ssh2=shared,${syspref} \
--enable-memcache=shared \
--enable-memcached=shared \
--with-libmemcached-dir=shared,${syspref} \
--enable-opcache=shared \
--with-mcrypt=shared
make %{?_smp_mflags}
cd .. && cd apache2
../configure \
${CONFIGURE_COMMON} \
${CONFIGURE_DISABLED} \
--with-apxs2=%{apxs} \
--disable-cli
make %{?_smp_mflags}
cd .. && cd fpm
../configure \
${CONFIGURE_COMMON} \
${CONFIGURE_DISABLED} \
--enable-fpm \
--disable-cli
make %{?_smp_mflags}
cd .. && cd lsapi
../configure \
${CONFIGURE_COMMON} \
${CONFIGURE_DISABLED} \
--with-litespeed \
--disable-cli
make %{?_smp_mflags}
cd ..
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -Wno-pointer-sign"
export CFLAGS
make -C cgi install INSTALL_ROOT=$RPM_BUILD_ROOT
make -C fpm install INSTALL_ROOT=$RPM_BUILD_ROOT
make -C lsapi install INSTALL_ROOT=$RPM_BUILD_ROOT
install -m 755 -d $RPM_BUILD_ROOT/%{php_prefix}/lib/httpd/modules
install -m 755 apache2/libs/libphp5.so $RPM_BUILD_ROOT/%{php_prefix}/lib/httpd/modules
# apache load
install -m 755 -d $RPM_BUILD_ROOT/etc/httpd/php-available.d
install -m 644 %{SOURCE4} $RPM_BUILD_ROOT/etc/httpd/php-available.d
# ZendOptimizer
install -m 755 ZendGuardLoader-70429-PHP-5.4-linux-glibc23-x86_64/php-5.4.x/ZendGuardLoader.so $RPM_BUILD_ROOT/%{php_prefix}/lib/php/modules/
# Ioncube
install -m 755 ioncube/ioncube_loader_lin_5.4.so $RPM_BUILD_ROOT/%{php_prefix}/lib/php/modules/
# php.ini
mkdir -p $RPM_BUILD_ROOT/%{php_prefix}/etc
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/%{php_prefix}/etc/php.ini
# fpm.conf
cp $RPM_BUILD_ROOT/%{php_prefix}/etc/php-fpm.conf.default $RPM_BUILD_ROOT/%{php_prefix}/etc/php-fpm.conf
sed -i -r '/('"'"'|\[)www('"'"'|\])/Q' $RPM_BUILD_ROOT/%{php_prefix}/etc/php-fpm.conf
echo "include = %{php_prefix}/etc/php-fpm.d/*.conf" >> $RPM_BUILD_ROOT/%{php_prefix}/etc/php-fpm.conf
echo "include=%{php_prefix}/etc/php-fpm.d/pool.d/*.conf" >> $RPM_BUILD_ROOT/%{php_prefix}/etc/php-fpm.conf
sed -i -r "s/^;(syslog.ident = ).*/\1php-fpm%{php_ver}/" $RPM_BUILD_ROOT/%{php_prefix}/etc/php-fpm.conf
sed -i -r "s/^;(error_log = ).*/\1syslog/" $RPM_BUILD_ROOT/%{php_prefix}/etc/php-fpm.conf
mkdir -p $RPM_BUILD_ROOT/%{php_prefix}/etc/php-fpm.d
mkdir -p $RPM_BUILD_ROOT/%{php_prefix}/etc/php-fpm.d/pool.d
# fpm service
%if 0%{?rhel} >= 7
install -d -m 755 %{buildroot}%{_unitdir}
sed -i -r 's|\$\{prefix\}|%{php_prefix}|g; s|\$\{exec_prefix\}|%{php_prefix}|g' fpm/sapi/fpm/php-fpm.service
install -m 644 fpm/sapi/fpm/php-fpm.service %{buildroot}%{_unitdir}/php-fpm%{php_ver}.service
%else
install -d -m 755 %{buildroot}%{_initrddir}
install -p -D -m 0755 fpm/sapi/fpm/init.d.php-fpm %{buildroot}%{_initrddir}/php-fpm%{php_ver}
sed -i -r "/### BEGIN/,/### END/s/php-fpm/php-fpm%{php_ver}/g" %{buildroot}%{_initrddir}/php-fpm%{php_ver}
%endif
# fpm var run
install -d -m 755 %{buildroot}%{php_prefix}/var/run
mkdir -p $RPM_BUILD_ROOT/%{php_prefix}/etc/php.d
mkdir -p $RPM_BUILD_ROOT/%{php_prefix}/etc/mods-available
for ext in $(find $RPM_BUILD_ROOT/%{php_prefix}/lib/php/modules/ -name '*.so' | grep -Evi 'zend|ioncube|opcache.so' | awk -F/ '{print $NF}' | sed 's/\.so$//'); do
echo "extension=${ext}.so" > $RPM_BUILD_ROOT/%{php_prefix}/etc/mods-available/${ext}.ini
done
echo "zend_extension=%{php_prefix}/lib/php/modules/opcache.so" >> $RPM_BUILD_ROOT/%{php_prefix}/etc/mods-available/zendopcache.ini
echo "zend_extension=%{php_prefix}/lib/php/modules/ioncube_loader_lin_5.4.so" > $RPM_BUILD_ROOT/%{php_prefix}/etc/mods-available/ioncube.ini
echo "zend_extension=%{php_prefix}/lib/php/modules/ZendGuardLoader.so" > $RPM_BUILD_ROOT/%{php_prefix}/etc/mods-available/zendguardloader.ini
rm -rf $RPM_BUILD_ROOT/%{php_prefix}/lib/php/modules/*.a \
$RPM_BUILD_ROOT/\.channels* \
$RPM_BUILD_ROOT/\.depdb* \
$RPM_BUILD_ROOT/\.filemap \
$RPM_BUILD_ROOT/\.lock \
$RPM_BUILD_ROOT/\.registry
%check
installdir=%{buildroot} bats -t bats/test.bats
%post
if [ $1 -eq 1 ]; then
if [ -f /etc/sysconfig/clock ]; then
TZ=$(cat /etc/sysconfig/clock | sed "s|\"||g" | awk -F= '{print $2}')
elif [ -x /usr/bin/timedatectl ]; then
TZ=$(/usr/bin/timedatectl | awk '$1 ~ /Timezone:/ {print $2}')
test -z "${TZ}" && TZ=$(timedatectl | awk '$0 ~ /Time zone:/ {print $3}')
else
TZ=UTC
fi
if grep -qE "^date.timezone\s*=" %{php_prefix}/etc/php.ini ; then
sed -i -r "s|^date.timezone\s*=.*|date.timezone = ${TZ}|" %{php_prefix}/etc/php.ini
else
echo "date.timezone = ${TZ}" >> %{php_prefix}/etc/php.ini
fi
for ext in dom gd mbstring mysqlnd mysqli pdo pdo_mysql xml json curl mcrypt soap ssh2 xmlrpc zendopcache intl xmlreader xmlwriter zip ; do
case ${ext} in
mysqlnd|pdo)
extl=10-${ext}
;;
*)
extl=20-${ext}
;;
esac
ln -sf ../mods-available/${ext}.ini %{php_prefix}/etc/php.d/${extl}.ini
done
else
if [ -f %{php_prefix}/etc/php.d/mysqli.ini ]; then
if [ ! -f %{php_prefix}/etc/php.d/10-mysqlnd.ini ] && [ ! -f %{php_prefix}/etc/php.d/mysqlnd.ini ]; then
ln -s ../mods-available/mysqlnd.ini %{php_prefix}/etc/php.d/10-mysqlnd.ini
fi
fi
fi
%postun
if [ $1 -eq 0 ]; then
find %{php_prefix}/etc/php.d -type l -delete
fi
%post fpm
%if 0%{?rhel} >= 7
%systemd_post php-fpm%{php_ver}.service
if [ $1 -ge 1 ] ; then
systemctl try-restart php-fpm%{php_ver}.service >/dev/null 2>&1 || :
fi
%endif
%preun fpm
%if 0%{?rhel} >= 7
%systemd_preun php-fpm%{php_ver}.service
%endif
%postun fpm
%if 0%{?rhel} >= 7
%systemd_postun_with_restart php-fpm%{php_ver}.service
%endif
%files
%{php_prefix}/bin/p*
%{php_prefix}/lib/php
%{php_prefix}/share/man/man1
%{php_prefix}/share/pear
%{php_prefix}/include
%config(noreplace) %{php_prefix}/etc/php.ini
%config(noreplace) %{php_prefix}/etc/pear.conf
%config(noreplace) %{php_prefix}/etc/mods-available/*.ini
%dir %{php_prefix}/etc/php.d
%dir %{php_prefix}/etc/mods-available
%files mod-apache
%{php_prefix}/lib/httpd/modules/*
%config(noreplace) /etc/httpd/php-available.d/php%{php_ver}.conf
%files fpm
%{php_prefix}/sbin/php-fpm
%dir %{php_prefix}/etc/php-fpm.d
%dir %{php_prefix}/etc/php-fpm.d/pool.d
%dir %{php_prefix}/var/run
%{php_prefix}/share/man/man8/php-fpm.8
%{php_prefix}/share/fpm/status.html
%{php_prefix}/etc/php-fpm.conf.default
%config(noreplace) %{php_prefix}/etc/php-fpm.conf
%if 0%{?rhel} >= 7
%{_unitdir}/php-fpm%{php_ver}.service
%else
%{_initrddir}/php-fpm%{php_ver}
%endif
%files lsapi
%{php_prefix}/bin/lsphp