From 82cd1263a39ff83b95e0f3d899ddf2e1a72181da Mon Sep 17 00:00:00 2001 From: Valery Kartel Date: Fri, 24 Feb 2017 11:25:06 +0200 Subject: testing/php7.1: fixes in extension depends tracking -- - rename submodule phar-phar -> phar-utils - remade APKBUILD and sources from template-based to 7.1 --- testing/php7.1/APKBUILD | 93 +++++++++++++++++----------------- testing/php7.1/includedir.patch.in | 41 --------------- testing/php7.1/php-fpm.initd.in | 87 ------------------------------- testing/php7.1/php-fpm.logrotate.in | 13 ----- testing/php7.1/php-fpm.patch.in | 55 -------------------- testing/php7.1/php-module.conf.in | 5 -- testing/php7.1/php7.1-fpm.initd | 87 +++++++++++++++++++++++++++++++ testing/php7.1/php7.1-fpm.logrotate | 13 +++++ testing/php7.1/php7.1-fpm.patch | 55 ++++++++++++++++++++ testing/php7.1/php7.1-includedir.patch | 41 +++++++++++++++ testing/php7.1/php7.1-module.conf | 5 ++ 11 files changed, 248 insertions(+), 247 deletions(-) delete mode 100644 testing/php7.1/includedir.patch.in delete mode 100644 testing/php7.1/php-fpm.initd.in delete mode 100644 testing/php7.1/php-fpm.logrotate.in delete mode 100644 testing/php7.1/php-fpm.patch.in delete mode 100644 testing/php7.1/php-module.conf.in create mode 100644 testing/php7.1/php7.1-fpm.initd create mode 100644 testing/php7.1/php7.1-fpm.logrotate create mode 100644 testing/php7.1/php7.1-fpm.patch create mode 100644 testing/php7.1/php7.1-includedir.patch create mode 100644 testing/php7.1/php7.1-module.conf diff --git a/testing/php7.1/APKBUILD b/testing/php7.1/APKBUILD index 451dc8c42c..3234471035 100644 --- a/testing/php7.1/APKBUILD +++ b/testing/php7.1/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Valery Kartel pkgname=php7.1 pkgver=7.1.2 -pkgrel=1 +pkgrel=2 _apiver=20160303 _suffix=${pkgname#php} _pkgreal=${pkgname%$_suffix} @@ -16,25 +16,25 @@ depends_dev="$pkgname" replaces="$_pkgreal $_pkgreal-cli" provides="$replaces $pkgname-cli" makedepends="autoconf bison re2c apache2-dev libxml2-dev libxslt-dev libzip-dev bzip2-dev zlib-dev - aspell-dev enchant-dev expat-dev pcre-dev curl-dev gmp-dev icu-dev imap-dev + aspell-dev enchant-dev expat-dev pcre-dev curl-dev gmp-dev icu-dev imap-dev gd-dev libical-dev libressl-dev openldap-dev net-snmp-dev db-dev krb5-dev gdbm-dev sqlite-dev freetds-dev mariadb-dev postgresql-dev unixodbc-dev freetype-dev tidyhtml-dev libxpm-dev - libpng-dev libwebp-dev libjpeg-turbo-dev libmcrypt-dev recode-dev libedit-dev gettext-dev + libpng-dev libjpeg-turbo-dev libmcrypt-dev recode-dev libedit-dev gettext-dev file-dev " source="http://php.net/distributions/$_pkgreal-$pkgver.tar.bz2 - $_pkgreal-module.conf.in - $_pkgreal-fpm.logrotate.in - $_pkgreal-fpm.initd.in - $_pkgreal-fpm.patch.in - includedir.patch.in + $pkgname-module.conf + $pkgname-fpm.logrotate + $pkgname-fpm.initd + $pkgname-fpm.patch + $pkgname-includedir.patch install-pear.patch getrandom.patch " # unimplemented extensions: com_dotnet interbase oci8 pdo_firebird pdo_oci -_extensions="bcmath bz2 calendar ctype curl dba dom enchant exif ftp gd gettext gmp iconv imap:1 intl json - ldap mbstring mcrypt mysqli mysqlnd odbc opcache openssl pcntl pdo pdo_dblib pdo_mysql - pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell recode session shmop snmp soap - sockets sqlite3 sysvmsg sysvsem sysvshm tidy wddx xml xmlreader xmlrpc xmlwriter xsl zip zlib +_extensions="bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo ftp gd gettext gmp iconv imap:1 + intl json ldap mbstring mcrypt mysqli mysqlnd odbc opcache openssl pcntl pdo pdo_dblib pdo_mysql + pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell recode session shmop snmp soap sockets + sqlite3 sysvmsg sysvsem sysvshm tidy wddx xml xmlreader xmlrpc xmlwriter xsl zip zlib " for _extension in $_extensions; do [ -z "${_extension##*:*}" ] && eval _index_${_extension%:*}=${_extension#*:} @@ -43,28 +43,13 @@ done _prefix_opcache="zend_" _pkgdesc_opcache="Zend OPcache" subpackages="$pkgname-dev $pkgname-doc $pkgname-libs $pkgname-apache2 $pkgname-phpdbg - $pkgname-litespeed $pkgname-cgi $pkgname-fpm $pkgname-pear::noarch - $pkgname-phar-phar:_phar:noarch $subpackages $pkgname-config::noarch" + $pkgname-litespeed $pkgname-cgi $pkgname-fpm $pkgname-pear::noarch $pkgname-pecl::noarch + $pkgname-phar-utils:_phar:noarch $subpackages $pkgname-config::noarch" builddir="$srcdir/$_pkgreal-$pkgver" prepare() { cd "$builddir" - local i - for i in $source; do - case $i in - *.patch.in) - msg "${i%.in} [$_suffix]" - sed "s/@_suffix@/$_suffix/g" "$srcdir/$i" \ - | patch "${patch_args:--p1}" || return 1 - ;; - *.in) - msg "$i -> ${i%.in}" - sed "s/@_suffix@/$_suffix/g" "$srcdir/$i" > ${i%.in} - ;; - esac - done - sed "$(($(grep -n 'Pool Definitions' sapi/fpm/php-fpm.conf.in | cut -d: -f1)+3)),\$d" \ -i sapi/fpm/php-fpm.conf.in echo include=@php_fpm_sysconfdir@/php-fpm.d/*.conf >> sapi/fpm/php-fpm.conf.in @@ -99,8 +84,9 @@ _build() { --with-config-file-path=/etc/$pkgname \ --with-config-file-scan-dir=/etc/$pkgname/conf.d \ --disable-short-tags \ + --enable-fileinfo=shared \ --with-openssl=shared --with-kerberos --with-system-ciphers \ - --with-pcre-regex --with-pcre-dir \ + --with-pcre-regex=/usr --with-pcre-dir \ --with-zlib=shared --with-zlib-dir \ --enable-bcmath=shared \ --with-bz2=shared \ @@ -112,8 +98,7 @@ _build() { --with-enchant=shared \ --enable-exif=shared \ --enable-ftp=shared \ - --with-gd=shared --with-webp-dir=shared --with-jpeg-dir=shared --with-png-dir=shared --with-xpm-dir=shared \ - --with-freetype-dir=shared --enable-gd-native-ttf --disable-gd-jis-conv \ + --with-gd=shared,/usr --enable-gd-native-ttf --disable-gd-jis-conv \ --with-gettext=shared \ --with-gmp=shared \ --with-iconv=shared \ @@ -182,6 +167,10 @@ build() { --with-litespeed \ --with-imap=shared --with-imap-ssl \ || return 1 + # rebuild fileinfo with current /usr/share/misc/magic.mgc + sapi/cli/php -n ext/fileinfo/create_data_file.php \ + /usr/share/misc/magic.mgc > ext/fileinfo/data_file.c || return 1 + make } package() { @@ -236,7 +225,7 @@ apache2() { cp "$builddir"/sapi/apache2handler/lib$_pkgreal*.so \ "$subpkgdir"/usr/lib/apache2/mod_$pkgname.so || return 1 - install -Dm644 "$builddir"/$_pkgreal-module.conf \ + install -Dm644 "$srcdir"/$pkgname-module.conf \ "$subpkgdir"/etc/apache2/conf.d/$pkgname-module.conf } @@ -308,9 +297,9 @@ fpm() { "$subpkgdir"/etc/$pkgname/$file || return 1 done - install -Dm755 "$builddir"/$_pkgreal-fpm.initd \ + install -Dm755 "$srcdir"/$pkgname-fpm.initd \ "$subpkgdir"/etc/init.d/$_pkgreal-fpm$_suffix || return 1 - install -Dm644 "$builddir"/$_pkgreal-fpm.logrotate \ + install -Dm644 "$srcdir"/$pkgname-fpm.logrotate \ "$subpkgdir"/etc/logrotate.d/$_pkgreal-fpm$_suffix || return 1 } @@ -318,8 +307,8 @@ pear() { local file provides=$_pkgreal-pear replaces=$provides - pkgdesc="$pkgdesc (extension and application repository)" - depends="$pkgname-dev $pkgname-xml" + pkgdesc="$pkgdesc (php extension and application repository)" + depends="$pkgname $pkgname-xml" mkdir -p "$subpkgdir"/usr/bin \ "$subpkgdir"/etc/$pkgname @@ -343,8 +332,16 @@ pear() { done } +pecl() { + provides=$_pkgreal-pecl + replaces= + pkgdesc="$pkgdesc (php extension community library)" + depends="$pkgname-pear $pkgname-dev autoconf gcc make musl-dev" + mkdir -p "$subpkgdir" +} + config() { - provides="phpapi=$_apiver" + provides="phpapi$_apiver" replaces= depends= pkgdesc="$pkgdesc (common config)" @@ -379,7 +376,7 @@ _phar() { } _extension() { - local dep + local dep deps local name=${subpkgname#$pkgname-} local index=$(eval echo \$_index_$name) provides="$_pkgreal-$name" @@ -390,12 +387,16 @@ _extension() { : ${pkgdesc:=$(head -n1 "$builddir"/ext/$name/CREDITS)} pkgdesc="PHP$_suffix extension: ${pkgdesc:-$name}" - for dep in $(grep -o "_DEP('$name'.*" "$builddir"/ext/$name/config.w32 | sed "s/[',);]//g"); do + [ -f "$builddir"/ext/$name/config.w32 ] && \ + deps=$(grep -o "_DEP('$name'.*" "$builddir"/ext/$name/config.w32 | sed "s/[',);]//g") + [ -f "$builddir"/ext/$name/config.m4 ] && \ + deps="$deps $(grep -o "_DEP($name,.*" "$builddir"/ext/$name/config.m4 | sed "s/[,)]//g")" + for dep in $(echo -e ${deps//[[:space:]]/\\n} | sort -u); do [ -z "${_extensions##*$dep*}" ] && depends="$depends $pkgname-$dep" done : ${index:=$(echo $depends | wc -w)} - depends="$pkgname-config phpapi=$_apiver $depends" + depends="$pkgname-config phpapi$_apiver $depends" mkdir -p "$subpkgdir"/usr/lib/$pkgname/modules \ "$subpkgdir"/etc/$pkgname/conf.d @@ -408,10 +409,10 @@ _extension() { } sha512sums="b4a3492f4af92facd16e7dfb47ec16b43e4c5b25be193ff6e36418173893edb75ca4ca94767b643a6971d60578727fa1f67f20cc84b9a140cb1b9a367ec34a6f php-7.1.2.tar.bz2 -e0f24eea250ed6a8c8286b2ed496a3feb1d9a2e399755f822387a4c26b34168bb346109c08d2b827d8230fe3103295d8b7f7b6bc09219e5b3ad4429271ece5d6 php-module.conf.in -b25c0bcaae4ddc7e001a6484423dec48be8735168dc3ab7471f5a57ce631273f11514c924b368ff846fe9a04bd4e1c7f296f1c8527f6f239a79df84189841983 php-fpm.logrotate.in -809e584304365412ecf80eb2ebb613439342e9a1faf36d0b04c76e60b1bf1345812799a16ffad76dbd3aa5f00c55329a051b308e451301d6e8d673813e37856b php-fpm.initd.in -2b3d60e4c57929a7bc1875c83472a6be1b7695a623893d108f905e742fe72ddf7fec7bf7a42b332ac33304434620a0317fd79d4ad707be886825d4b0fd96b938 php-fpm.patch.in -c7841eef58e1203cb1eb97efff96427d560c1c8d9945286e95dbecc7ccac20e0a29a333194032af9696961c317876d5b971f282644167ba6fe7135e9ac86447e includedir.patch.in +2801d6e0656b0a9eb090c6a3eee711588515a600e1292a6ba5ce24302c57bb7feb128139c0eb7715af0ddc2f40a7a2832c6e4153fe4d3a467297957a4afb3123 php7.1-module.conf +066db134f9cd4695caf62cbb970bd13cbcf8d074a8e378945e2c6e80d3b8f4125f7cee2ee5b379359881958955d9737eb24cbfdb72d11c19bd432101ee119501 php7.1-fpm.logrotate +bf8bfbd33134acaa5395336005361519ded1062f461483c18cf69d0395c4fb950802fcfb186c9b54ac382c51e2b634341757ffff9eb7af2dcf017be5af587d1f php7.1-fpm.initd +5e5073aca1ac3c4b1163d7c943f059d00faf04f29db766a0fc1ed3aecf9b7260491c5703aff651baa7ca944d750ff0318ce66aaac5b8500f41056b5357d3fa9f php7.1-fpm.patch +3f5da2f3b904ceb14f8507b924b046dfbee601e274fd501150a78fe362983ee1209ce596e880ed5481a857c4eb9d3deba26c4c14d04fd58075be93e98436f0cd php7.1-includedir.patch f1177cbf6b1f44402f421c3d317aab1a2a40d0b1209c11519c1158df337c8945f3a313d689c939768584f3e4edbe52e8bd6103fb6777462326a9d94e8ab1f505 install-pear.patch da012a82c00f9dfd3b6e446e2c3e7da597079e9b428f53ca61b5e216c304e3c02e953a5fc2759e516580cb98f08e86b0f5b33ea8df99a8003ae33fcb431463b4 getrandom.patch" diff --git a/testing/php7.1/includedir.patch.in b/testing/php7.1/includedir.patch.in deleted file mode 100644 index 8087b6200d..0000000000 --- a/testing/php7.1/includedir.patch.in +++ /dev/null @@ -1,41 +0,0 @@ ---- a/scripts/Makefile.frag -+++ b/scripts/Makefile.frag -@@ -3,7 +3,7 @@ - # Build environment install - # - --phpincludedir = $(includedir)/php -+phpincludedir = $(includedir)/php@_suffix@ - phpbuilddir = $(libdir)/build - - BUILD_FILES = \ ---- a/ext/pdo/Makefile.frag -+++ b/ext/pdo/Makefile.frag -@@ -1,4 +1,4 @@ --phpincludedir=$(prefix)/include/php -+phpincludedir=$(prefix)/include/php@_suffix@ - - PDO_HEADER_FILES= \ - php_pdo.h \ ---- a/scripts/php-config.in -+++ b/scripts/php-config.in -@@ -6,7 +6,7 @@ - exec_prefix="@exec_prefix@" - version="@PHP_VERSION@" - vernum="@PHP_VERSION_ID@" --include_dir="@includedir@/php" -+include_dir="@includedir@/php@_suffix@" - includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib" - ldflags="@PHP_LDFLAGS@" - libs="@EXTRA_LIBS@" ---- a/scripts/phpize.in -+++ b/scripts/phpize.in -@@ -5,7 +5,7 @@ - datarootdir='@datarootdir@' - exec_prefix="`eval echo @exec_prefix@`" - phpdir="`eval echo @libdir@`/build" --includedir="`eval echo @includedir@`/php" -+includedir="`eval echo @includedir@`/php@_suffix@" - builddir="`pwd`" - SED="@SED@" - diff --git a/testing/php7.1/php-fpm.initd.in b/testing/php7.1/php-fpm.initd.in deleted file mode 100644 index f892559e1b..0000000000 --- a/testing/php7.1/php-fpm.initd.in +++ /dev/null @@ -1,87 +0,0 @@ -#!/sbin/openrc-run - -# If you want to run separate master process per pool, then create a symlink -# to this runscript for each pool. In that mode, the php-fpm daemon is started -# as nobody by default. You can override the user (and group) by declaring -# variable "user" and optionally "group" in conf.d file, or in the $fpm_config -# file (the former has precedence). - -: ${name:="PHP FastCGI Process Manager"} - -command="/usr/sbin/php-fpm@_suffix@" -command_background="yes" -start_stop_daemon_args="--quiet" -pidfile="/run/$RC_SVCNAME/php-fpm.pid" -retry="SIGTERM/20" - -extra_commands="checkconfig" -extra_started_commands="reload reopen" -description_checkconfig="Run php-fpm config check" -description_reload="Gracefully reload workers and config" -description_reopen="Reopen log files" - -required_files="$fpm_config" - -depend() { - need net - before apache2 lighttpd nginx -} - -init_vars() { - # Defaults for single master process with multiple pools - if [ "$RC_SVCNAME" = "php-fpm@_suffix@" ]; then - : ${fpm_config:="/etc/php@_suffix@/php-fpm.conf"} - : ${user:="root"} - # Defaults for master process per pool - else - : ${fpm_config="/etc/php@_suffix@/php-fpm.d/${RC_SVCNAME#php-fpm@_suffix@.}.conf"} - : ${user:="$(conf_get user)"} - : ${user:="nobody"} - : ${group:="$(conf_get group)"} - fi - command_args="--nodaemonize --fpm-config $fpm_config" - start_stop_daemon_args="$start_stop_daemon_args - --user $user ${group:+"--group $group"}" -} - -start_pre() { - checkconfig || return 1 - - # If unix socket is used (instead of TCP/IP), then ensure that the - # directory exists and has correct privileges. - local listen="$(conf_get listen)" - if [ "${listen:0:1}" = "/" ]; then - checkpath -d -o $user:$group "${listen%/*}" - fi - - checkpath -d "${pidfile%/*}" -} - -reload() { - ebegin "Reloading $RC_SVCNAME" - start-stop-daemon --signal USR2 --pidfile "$pidfile" - eend $? -} - -reopen() { - ebegin "Reopening $RC_SVCNAME log files" - start-stop-daemon --signal USR1 --pidfile "$pidfile" - eend $? -} - -checkconfig() { - init_vars - ebegin "Checking $fpm_config" - - local out - out="$(su -s /bin/sh -c "$command --test --fpm-config $fpm_config" $user 2>&1)" || { - printf "%s\n" "$out" - eend 1 "failed, please correct errors above" - return 1 - } -} - -conf_get() { - local key="$1" - sed -nE "s/^${key}\s*=\s*\"?([^\";]+).*/\1/p" "$fpm_config" | head -n 1 -} diff --git a/testing/php7.1/php-fpm.logrotate.in b/testing/php7.1/php-fpm.logrotate.in deleted file mode 100644 index ac1fcb2b35..0000000000 --- a/testing/php7.1/php-fpm.logrotate.in +++ /dev/null @@ -1,13 +0,0 @@ -/var/log/php@_suffix@/*.log { - rotate 7 - daily - missingok - notifempty - delaycompress - compress - dateext - sharedscripts - postrotate - /etc/init.d/php-fpm@_suffix@ --ifstarted --quiet reopen - endscript -} diff --git a/testing/php7.1/php-fpm.patch.in b/testing/php7.1/php-fpm.patch.in deleted file mode 100644 index b6b5917e74..0000000000 --- a/testing/php7.1/php-fpm.patch.in +++ /dev/null @@ -1,55 +0,0 @@ ---- a/sapi/fpm/fpm/fpm_conf.c -+++ b/sapi/fpm/fpm/fpm_conf.c -@@ -1180,3 +1180,3 @@ - if (!fpm_global_config.error_log) { -- fpm_global_config.error_log = strdup("log/php-fpm.log"); -+ fpm_global_config.error_log = strdup("log/php@_suffix@/error.log"); - } -@@ -1191,3 +1191,3 @@ - if (!fpm_global_config.syslog_ident) { -- fpm_global_config.syslog_ident = strdup("php-fpm"); -+ fpm_global_config.syslog_ident = strdup("php-fpm@_suffix@"); - } -@@ -1683,3 +1683,3 @@ - } else { -- spprintf(&tmp, 0, "%s/etc/php-fpm.conf", fpm_globals.prefix); -+ spprintf(&tmp, 0, "%s/etc/php@_suffix@/php-fpm.conf", fpm_globals.prefix); - } ---- a/sapi/fpm/php-fpm.conf.in -+++ b/sapi/fpm/php-fpm.conf.in -@@ -16,3 +16,3 @@ - ; Default Value: none --;pid = run/php-fpm.pid -+;pid = run/php-fpm@_suffix@.pid - -@@ -22,4 +22,4 @@ - ; Note: the default prefix is @EXPANDED_LOCALSTATEDIR@ --; Default Value: log/php-fpm.log --;error_log = log/php-fpm.log -+; Default Value: log/php@_suffix@/error.log -+;error_log = log/php@_suffix@/error.log - -@@ -35,4 +35,4 @@ - ; which must suit common needs. --; Default Value: php-fpm --;syslog.ident = php-fpm -+; Default Value: php-fpm@_suffix@ -+;syslog.ident = php-fpm@_suffix@ - ---- a/sapi/fpm/www.conf.in -+++ b/sapi/fpm/www.conf.in -@@ -252,3 +252,3 @@ - ; Default: not set --;access.log = log/$pool.access.log -+;access.log = log/php@_suffix@/$pool.access.log - -@@ -316,3 +316,3 @@ - ; Note: slowlog is mandatory if request_slowlog_timeout is set --;slowlog = log/$pool.log.slow -+;slowlog = log/php@_suffix@/$pool.slow.log - -@@ -410,3 +410,3 @@ - ;php_flag[display_errors] = off --;php_admin_value[error_log] = /var/log/fpm-php.www.log -+;php_admin_value[error_log] = /var/log/php@_suffix@/$pool.error.log - ;php_admin_flag[log_errors] = on diff --git a/testing/php7.1/php-module.conf.in b/testing/php7.1/php-module.conf.in deleted file mode 100644 index 267ad00e6e..0000000000 --- a/testing/php7.1/php-module.conf.in +++ /dev/null @@ -1,5 +0,0 @@ -LoadModule php@_suffix@_module modules/mod_php@_suffix@.so - -DirectoryIndex index.php index.html -AddHandler application/x-httpd-php .php -AddHandler application/x-httpd-php-source .phps diff --git a/testing/php7.1/php7.1-fpm.initd b/testing/php7.1/php7.1-fpm.initd new file mode 100644 index 0000000000..37e7e02852 --- /dev/null +++ b/testing/php7.1/php7.1-fpm.initd @@ -0,0 +1,87 @@ +#!/sbin/openrc-run + +# If you want to run separate master process per pool, then create a symlink +# to this runscript for each pool. In that mode, the php-fpm daemon is started +# as nobody by default. You can override the user (and group) by declaring +# variable "user" and optionally "group" in conf.d file, or in the $fpm_config +# file (the former has precedence). + +: ${name:="PHP FastCGI Process Manager"} + +command="/usr/sbin/php-fpm7.1" +command_background="yes" +start_stop_daemon_args="--quiet" +pidfile="/run/$RC_SVCNAME/php-fpm.pid" +retry="SIGTERM/20" + +extra_commands="checkconfig" +extra_started_commands="reload reopen" +description_checkconfig="Run php-fpm config check" +description_reload="Gracefully reload workers and config" +description_reopen="Reopen log files" + +required_files="$fpm_config" + +depend() { + need net + before apache2 lighttpd nginx +} + +init_vars() { + # Defaults for single master process with multiple pools + if [ "$RC_SVCNAME" = "php-fpm7.1" ]; then + : ${fpm_config:="/etc/php7.1/php-fpm.conf"} + : ${user:="root"} + # Defaults for master process per pool + else + : ${fpm_config="/etc/php7.1/php-fpm.d/${RC_SVCNAME#php-fpm7.1.}.conf"} + : ${user:="$(conf_get user)"} + : ${user:="nobody"} + : ${group:="$(conf_get group)"} + fi + command_args="--nodaemonize --fpm-config $fpm_config" + start_stop_daemon_args="$start_stop_daemon_args + --user $user ${group:+"--group $group"}" +} + +start_pre() { + checkconfig || return 1 + + # If unix socket is used (instead of TCP/IP), then ensure that the + # directory exists and has correct privileges. + local listen="$(conf_get listen)" + if [ "${listen:0:1}" = "/" ]; then + checkpath -d -o $user:$group "${listen%/*}" + fi + + checkpath -d "${pidfile%/*}" +} + +reload() { + ebegin "Reloading $RC_SVCNAME" + start-stop-daemon --signal USR2 --pidfile "$pidfile" + eend $? +} + +reopen() { + ebegin "Reopening $RC_SVCNAME log files" + start-stop-daemon --signal USR1 --pidfile "$pidfile" + eend $? +} + +checkconfig() { + init_vars + ebegin "Checking $fpm_config" + + local out + out="$(su -s /bin/sh -c "$command --test --fpm-config $fpm_config" $user 2>&1)" || { + printf "%s\n" "$out" + eend 1 "failed, please correct errors above" + return 1 + } +} + +conf_get() { + local key="$1" + sed -nE "s/^${key}\s*=\s*\"?([^\";]+).*/\1/p" "$fpm_config" | head -n 1 +} diff --git a/testing/php7.1/php7.1-fpm.logrotate b/testing/php7.1/php7.1-fpm.logrotate new file mode 100644 index 0000000000..aafe126a62 --- /dev/null +++ b/testing/php7.1/php7.1-fpm.logrotate @@ -0,0 +1,13 @@ +/var/log/php7.1/*.log { + rotate 7 + daily + missingok + notifempty + delaycompress + compress + dateext + sharedscripts + postrotate + /etc/init.d/php-fpm7.1 --ifstarted --quiet reopen + endscript +} diff --git a/testing/php7.1/php7.1-fpm.patch b/testing/php7.1/php7.1-fpm.patch new file mode 100644 index 0000000000..480c5c4b7a --- /dev/null +++ b/testing/php7.1/php7.1-fpm.patch @@ -0,0 +1,55 @@ +--- a/sapi/fpm/fpm/fpm_conf.c ++++ b/sapi/fpm/fpm/fpm_conf.c +@@ -1180,3 +1180,3 @@ + if (!fpm_global_config.error_log) { +- fpm_global_config.error_log = strdup("log/php-fpm.log"); ++ fpm_global_config.error_log = strdup("log/php7.1/error.log"); + } +@@ -1191,3 +1191,3 @@ + if (!fpm_global_config.syslog_ident) { +- fpm_global_config.syslog_ident = strdup("php-fpm"); ++ fpm_global_config.syslog_ident = strdup("php-fpm7.1"); + } +@@ -1683,3 +1683,3 @@ + } else { +- spprintf(&tmp, 0, "%s/etc/php-fpm.conf", fpm_globals.prefix); ++ spprintf(&tmp, 0, "%s/etc/php7.1/php-fpm.conf", fpm_globals.prefix); + } +--- a/sapi/fpm/php-fpm.conf.in ++++ b/sapi/fpm/php-fpm.conf.in +@@ -16,3 +16,3 @@ + ; Default Value: none +-;pid = run/php-fpm.pid ++;pid = run/php-fpm7.1.pid + +@@ -22,4 +22,4 @@ + ; Note: the default prefix is @EXPANDED_LOCALSTATEDIR@ +-; Default Value: log/php-fpm.log +-;error_log = log/php-fpm.log ++; Default Value: log/php7.1/error.log ++;error_log = log/php7.1/error.log + +@@ -35,4 +35,4 @@ + ; which must suit common needs. +-; Default Value: php-fpm +-;syslog.ident = php-fpm ++; Default Value: php-fpm7.1 ++;syslog.ident = php-fpm7.1 + +--- a/sapi/fpm/www.conf.in ++++ b/sapi/fpm/www.conf.in +@@ -252,3 +252,3 @@ + ; Default: not set +-;access.log = log/$pool.access.log ++;access.log = log/php7.1/$pool.access.log + +@@ -316,3 +316,3 @@ + ; Note: slowlog is mandatory if request_slowlog_timeout is set +-;slowlog = log/$pool.log.slow ++;slowlog = log/php7.1/$pool.slow.log + +@@ -410,3 +410,3 @@ + ;php_flag[display_errors] = off +-;php_admin_value[error_log] = /var/log/fpm-php.www.log ++;php_admin_value[error_log] = /var/log/php7.1/$pool.error.log + ;php_admin_flag[log_errors] = on diff --git a/testing/php7.1/php7.1-includedir.patch b/testing/php7.1/php7.1-includedir.patch new file mode 100644 index 0000000000..8075eecb75 --- /dev/null +++ b/testing/php7.1/php7.1-includedir.patch @@ -0,0 +1,41 @@ +--- a/scripts/Makefile.frag ++++ b/scripts/Makefile.frag +@@ -3,7 +3,7 @@ + # Build environment install + # + +-phpincludedir = $(includedir)/php ++phpincludedir = $(includedir)/php7.1 + phpbuilddir = $(libdir)/build + + BUILD_FILES = \ +--- a/ext/pdo/Makefile.frag ++++ b/ext/pdo/Makefile.frag +@@ -1,4 +1,4 @@ +-phpincludedir=$(prefix)/include/php ++phpincludedir=$(prefix)/include/php7.1 + + PDO_HEADER_FILES= \ + php_pdo.h \ +--- a/scripts/php-config.in ++++ b/scripts/php-config.in +@@ -6,7 +6,7 @@ + exec_prefix="@exec_prefix@" + version="@PHP_VERSION@" + vernum="@PHP_VERSION_ID@" +-include_dir="@includedir@/php" ++include_dir="@includedir@/php7.1" + includes="-I$include_dir -I$include_dir/main -I$include_dir/TSRM -I$include_dir/Zend -I$include_dir/ext -I$include_dir/ext/date/lib" + ldflags="@PHP_LDFLAGS@" + libs="@EXTRA_LIBS@" +--- a/scripts/phpize.in ++++ b/scripts/phpize.in +@@ -5,7 +5,7 @@ + datarootdir='@datarootdir@' + exec_prefix="`eval echo @exec_prefix@`" + phpdir="`eval echo @libdir@`/build" +-includedir="`eval echo @includedir@`/php" ++includedir="`eval echo @includedir@`/php7.1" + builddir="`pwd`" + SED="@SED@" + diff --git a/testing/php7.1/php7.1-module.conf b/testing/php7.1/php7.1-module.conf new file mode 100644 index 0000000000..80f2654f63 --- /dev/null +++ b/testing/php7.1/php7.1-module.conf @@ -0,0 +1,5 @@ +LoadModule php7.1_module modules/mod_php7.1.so + +DirectoryIndex index.php index.html +AddHandler application/x-httpd-php .php +AddHandler application/x-httpd-php-source .phps -- cgit v1.2.3