diff options
author | Carlo Landmeter <clandmeter@gmail.com> | 2016-08-27 16:07:08 +0000 |
---|---|---|
committer | Carlo Landmeter <clandmeter@gmail.com> | 2016-08-27 16:07:08 +0000 |
commit | 4fb3c8ed11196e0b6c254c8d984bf7e4f3987f19 (patch) | |
tree | 554a61c1b028a37874dfbcbeb4b38b1091674284 /community/php7 | |
parent | 8658427f6876de9d444f2865f8dfb9f93e4e12ea (diff) | |
download | aports-4fb3c8ed11196e0b6c254c8d984bf7e4f3987f19.tar.bz2 aports-4fb3c8ed11196e0b6c254c8d984bf7e4f3987f19.tar.xz |
testing/php7: move to community
Diffstat (limited to 'community/php7')
-rw-r--r-- | community/php7/APKBUILD | 370 | ||||
-rw-r--r-- | community/php7/fix-x86-build-bug_571658.patch | 51 | ||||
-rw-r--r-- | community/php7/includedir.patch | 41 | ||||
-rw-r--r-- | community/php7/install-pear.patch | 15 | ||||
-rw-r--r-- | community/php7/php7-fpm.initd | 35 | ||||
-rw-r--r-- | community/php7/php7-fpm.logrotate | 13 | ||||
-rw-r--r-- | community/php7/php7-module.conf | 5 | ||||
-rw-r--r-- | community/php7/pid_log.patch | 76 | ||||
-rw-r--r-- | community/php7/tidy-buffio.patch | 11 |
9 files changed, 617 insertions, 0 deletions
diff --git a/community/php7/APKBUILD b/community/php7/APKBUILD new file mode 100644 index 0000000000..e2c362f9b8 --- /dev/null +++ b/community/php7/APKBUILD @@ -0,0 +1,370 @@ +# Contributor: Valery Kartel <valery.kartel@gmail.com> +# Maintainer: Valery Kartel <valery.kartel@gmail.com> +pkgname=php7 +_pkgreal=php +pkgver=7.0.10 +pkgrel=2 +pkgdesc="The PHP language runtime engine - 7th branch" +url="http://www.php.net/" +arch="all" +license="PHP-3" +options="" +depends="$pkgname-common" +depends_dom="$pkgname-xml" +depends_mysqlnd="$pkgname-mysqli" +depends_phar="$pkgname" +depends_soap="$pkgname-xml" +depends_wddx="$pkgname-xml" +depends_xmlreader="$pkgname-dom" +depends_xmlrpc="$pkgname-xml" +depends_xsl="$pkgname-dom" +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 + libical-dev openssl-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 gsoap-dev recode-dev + readline-dev paxmark gettext-dev + " +source="http://php.net/distributions/$_pkgreal-$pkgver.tar.bz2 + $pkgname-fpm.initd + $pkgname-fpm.logrotate + $pkgname-module.conf + install-pear.patch + tidy-buffio.patch + includedir.patch + pid_log.patch + fix-x86-build-bug_571658.patch + " +builddir="$srcdir/$_pkgreal-$pkgver" + +_exts="bcmath bz2 calendar ctype curl dba dom enchant exif ftp gd gettext gmp iconv imap intl json + ldap mbstring mcrypt mysqli mysqlnd odbc opcache openssl pcntl pdo pdo_dblib pdo_mysql + pdo_odbc pdo_pgsql pdo_sqlite pgsql phar:phar posix pspell readline session shmop snmp soap + sockets sqlite3 sysvmsg sysvsem sysvshm tidy wddx xml xmlreader xmlrpc xsl zip zlib + " +subpackages="$pkgname-dev $pkgname-doc $pkgname-apache2 $pkgname-phpdbg $pkgname-embed + $pkgname-litespeed $pkgname-cgi $pkgname-fpm $pkgname-pear + " +for _ext in $_exts; do + case "$_ext" in + *:*) subpackages="$subpackages $pkgname-$_ext";; + *) subpackages="$subpackages $pkgname-$_ext:_package_ext";; + esac +done +subpackages="$subpackages $pkgname-common" + +_apiver="20151012" + +prepare() { + cd "$builddir" + + default_prepare || return 1 + update_config_sub || return 1 + + local vapi=$(sed -n '/#define PHP_API_VERSION/{s/.* //;p}' main/php.h) + if [ "$vapi" != "$_apiver" ]; then + error "Upstreram API version is now $vapi. Expecting $_apiver" + return 1 + fi + autoconf +} + +_build() { + export EXTENSION_DIR=/usr/lib/$pkgname/modules + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --program-suffix=7 \ + --libdir=/usr/lib/$pkgname \ + --datadir=/usr/share/$pkgname \ + --sysconfdir=/etc/$pkgname \ + --localstatedir=/var \ + --with-layout=GNU \ + --with-pic \ + --with-pear=/usr/share/$pkgname \ + --with-config-file-path=/etc/$pkgname \ + --with-config-file-scan-dir=/etc/$pkgname/conf.d \ + --disable-short-tags \ + --with-openssl=shared --with-kerberos --with-system-ciphers \ + --with-pcre-regex --with-pcre-dir \ + --with-zlib=shared --with-zlib-dir \ + --enable-bcmath=shared \ + --with-bz2=shared \ + --enable-calendar=shared \ + --enable-ctype=shared \ + --with-curl=shared \ + --enable-dba=shared --with-gdbm --with-db4 \ + --enable-dom=shared \ + --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 --enable-gd-jis-conv \ + --with-gettext=shared \ + --with-gmp=shared \ + --with-iconv=shared \ + --with-imap=shared --with-imap-ssl \ + --enable-intl=shared --with-icu-dir=/usr \ + --enable-json=shared \ + --enable-libxml=shared --with-libxml-dir=shared --with-libexpat-dir=shared \ + --with-ldap=shared --with-ldap-sasl \ + --enable-mbstring=shared --enable-mbregex \ + --with-mcrypt=shared \ + --with-sqlite3=shared,/usr --with-pdo-sqlite=shared,/usr \ + --with-pdo-dblib=shared \ + --with-mysqli=shared,/usr/bin/mysql_config \ + --enable-mysqlnd=shared --with-pdo-mysql=shared,/usr/bin/mysql_config --with-mysql-sock=/run/mysqld/mysqld.sock \ + --with-pgsql=shared --with-pdo-pgsql=shared \ + --with-unixODBC=shared,/usr -with-pdo-odbc=shared,unixODBC,/usr \ + --with-dbmaker=shared \ + --enable-opcache=shared \ + --enable-pdo=shared \ + --enable-pcntl=shared \ + --enable-posix=shared \ + --enable-phar=shared \ + --with-pspell=shared \ + --enable-session=shared \ + --enable-shmop=shared \ + --with-snmp=shared \ + --enable-soap=shared \ + --enable-sockets=shared \ + --enable-sysvmsg=shared \ + --enable-sysvsem=shared \ + --enable-sysvshm=shared \ + --with-tidy=shared \ + --enable-xml=shared \ + --enable-xmlreader=shared \ + --with-xmlrpc=shared \ + --with-xsl=shared \ + --enable-wddx=shared \ + --enable-zip=shared --with-libzip=shared \ + $@ || return 1 + sed -ri "s/^(EXTRA_LDFLAGS[ ]*\=.*)/\1 -lpthread/" Makefile # see #183 (from main/php) + make || return 1 +} + +build() { + cd "$builddir" + + # phpdbg + _build --enable-phpdbg \ + --enable-phpdbg \ + --enable-phpdbg-webhelper \ + --enable-phpdbg-debug \ + --disable-cgi \ + --disable-cli \ + --with-readline \ + || return 1 + # apache2 module + _build --disable-phpdbg \ + --disable-cgi \ + --disable-cli \ + --with-apxs2 \ + --with-readline=shared \ + || return 1 + mv libs/libphp7.so sapi/apache2handler/mod_php7.so + # cgi,cli,fpm,embed,litespeed + _build --disable-phpdbg \ + --enable-fpm \ + --enable-embed \ + --with-litespeed \ + --with-readline=shared \ + || return 1 +} + +package() { + cd "$builddir" + + make -j1 INSTALL_ROOT="$pkgdir" install || return 1 + + install -Dm644 php.ini-production "$pkgdir"/etc/$pkgname/php.ini || return 1 + + local file; for file in pear peardev pecl; do + sed -i -e "s~/usr/bin/php~/usr/bin/php7~g" \ + -e "s~PHP=php~PHP=php7~" \ + "$pkgdir"/usr/bin/$file || return 1 + done + paxmark -m "$pkgdir"/usr/bin/php7 + + find "$pkgdir" -name '.*' | xargs rm -rf || return 1 + rmdir "$pkgdir"/var/run +} + +dev() { + default_dev + depends="$depends $pkgname $pkgname-pear" + + mkdir -p "$subpkgdir"/usr/bin \ + "$subpkgdir"/usr/lib/$pkgname + + mv "$pkgdir"/usr/bin/php-config7 "$pkgdir"/usr/bin/peardev \ + "$subpkgdir"/usr/bin/ || return 1 + mv "$pkgdir"/usr/lib/$pkgname/build \ + "$subpkgdir"/usr/lib/$pkgname/ +} + +doc() { + default_doc + + mkdir -p "$subpkgdir"/usr/share/doc/$pkgname + + local file + for file in CODING_STANDARDS CREDITS EXTENSIONS INSTALL LICENSE NEWS README* UPGRADING*; do + cp "$builddir"/$file "$subpkgdir"/usr/share/doc/$pkgname/ || return 1 + done +} + +apache2() { + pkgdesc="PHP Module for Apache2" + depends="$pkgname-common apache2" + + install -D -m755 "$builddir"/sapi/apache2handler/mod_php7.so \ + "$subpkgdir"/usr/lib/apache2/mod_php7.so || return 1 + + install -D -m644 "$srcdir"/php7-module.conf \ + "$subpkgdir"/etc/apache2/conf.d/php7-module.conf +} + +phpdbg() { + pkgdesc="Interactive PHP debugger" + depends="$pkgname-common" + + install -Dm755 "$builddir"/sapi/phpdbg/phpdbg \ + "$subpkgdir"/usr/bin/phpdbg7 +} + +embed() { + pkgdesc="PHP Embedded Library" + depends="$pkgname-common" + + mkdir -p "$subpkgdir"/usr/lib + mv "$pkgdir"/usr/lib/libphp*.so "$subpkgdir"/usr/lib/ +} + +litespeed() { + pkgdesc="PHP LiteSpeed SAPI" + depends="$pkgname-common" + + mkdir -p "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/lsphp "$subpkgdir"/usr/bin/lsphp7 +} + +cgi() { + pkgdesc="PHP Common Gateway Interface" + depends="$pkgname-common" + + mkdir -p "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/php-cgi7 "$subpkgdir"/usr/bin/ +} + +fpm() { + pkgdesc="PHP FastCGI Process Manager" + depends="$pkgname-common" + + mv "$pkgdir"/var "$subpkgdir"/ || return 1 + + mkdir -p "$subpkgdir"/etc/$pkgname \ + "$subpkgdir"/usr \ + "$subpkgdir"/var/lib \ + "$subpkgdir"/var/log/$pkgname + + mv "$pkgdir"/usr/share/$pkgname/fpm "$subpkgdir"/var/lib/$pkgname/ || return 1 + mv "$pkgdir"/usr/sbin "$subpkgdir"/usr/ || return 1 + mv "$pkgdir"/etc/$pkgname/php-fpm* "$subpkgdir"/etc/$pkgname/ || return 1 + + local file; for file in php-fpm.conf php-fpm.d/www.conf; do + mv "$subpkgdir"/etc/$pkgname/$file.default \ + "$subpkgdir"/etc/$pkgname/$file || return 1 + done + + install -D -m755 "$srcdir"/$pkgname-fpm.initd "$subpkgdir"/etc/init.d/php-fpm7 || return 1 + install -D -m644 "$srcdir"/$pkgname-fpm.logrotate "$subpkgdir"/etc/logrotate.d/php-fpm7 +} + +pear() { + arch="noarch" + pkgdesc="PHP Extension and Application Repository" + depends="$pkgname $pkgname-xml" + + mkdir -p "$subpkgdir"/usr/bin \ + "$subpkgdir"/etc/$pkgname + + local file; for file in phpize7 pecl pear; do + mv "$pkgdir"/usr/bin/$file "$subpkgdir"/usr/bin/ + done + mv "$pkgdir"/etc/$pkgname/pear.conf "$subpkgdir"/etc/$pkgname/ || return 1 + mv "$pkgdir"/usr/share "$subpkgdir"/usr/ +} + +common() { + arch="noarch" + pkgdesc="$pkgdesc (common config)" + + mkdir -p "$subpkgdir"/usr + mv "$pkgdir"/usr/lib "$subpkgdir"/usr/ || return 1 + mv "$pkgdir"/etc "$subpkgdir"/ || return 1 + + mkdir "$subpkgdir"/etc/$pkgname/conf.d +} + +phar() { + _package_ext || return 1 + mkdir -p "$subpkgdir"/usr/bin + mv "$pkgdir"/usr/bin/phar* "$subpkgdir"/usr/bin/ +} + +_package_ext() { + local extname="${subpkgname#$pkgname-}" + local extdepends="$(eval "echo \$depends_$extname")" + pkgdesc="PHP7 extension: $extname" + depends="$depends $extdepends" + + case "$extname" in + pdo_*) depends="$depends $pkgname-pdo" + esac + + # extension dependencies and loading order + local elo=00 + [ -z "$extdepends" ] || elo=01 + + # extension prefix + local prefix= + [ "$extname" != "opcache" ] || prefix="zend_" + + mkdir -p "$subpkgdir"/usr/lib/$pkgname/modules \ + "$subpkgdir"/etc/$pkgname/conf.d + mv "$pkgdir"/usr/lib/$pkgname/modules/$extname.so \ + "$subpkgdir"/usr/lib/$pkgname/modules/ || return 1 + + echo "${prefix}extension=$extname.so" \ + > "$subpkgdir"/etc/$pkgname/conf.d/${elo}_${extname}.ini +} + +md5sums="cd1d27be3f522b0543e43c8c2b7116e4 php-7.0.10.tar.bz2 +a340f27e83ed4482d2fbb98658ef71cb php7-fpm.initd +25bde13e7894c2930d97fad68d5dd3b3 php7-fpm.logrotate +47be6cd1ed92f21579e15bf2003a709f php7-module.conf +483bc0a85c50a9a9aedbe14a19ed4526 install-pear.patch +66f0037a029f9eed2b31d2e1d50f1860 tidy-buffio.patch +d872e633c9b33c3c9f629dd2edd2e5c5 includedir.patch +6ba762ab7a105163b8e5b3913deae109 pid_log.patch +0c066f4c7f6cbc2e26379ce565197d26 fix-x86-build-bug_571658.patch" +sha256sums="8055bbe5a736986931c0c6a08b765d6d778271ec7d2d56c50a1ad259ec09f6de php-7.0.10.tar.bz2 +eca59e8b0498c1c93b35f9a5109ae56d0cda9d94822727d689371ccad31b3615 php7-fpm.initd +6e4406f21b69085714cdb9d9a67c08e27a1c737ab353f9813cb2fc268352d2c6 php7-fpm.logrotate +276c823ee666ea73b36d4e97174eeea05713125b61f7f8681e350453c4123143 php7-module.conf +f739ca427a1dd53a388bad0823565299c5d4a5796b1171b892884e4d7d099bab install-pear.patch +5dc8f32e5e2b1cd6317ada5a5adb9b5f0802ed6e0dbe065d7bfcc0f55d47e0d5 tidy-buffio.patch +ea74966a23b1b54548ee35e9ccc2fc8d2b7c2285c385c44d6b23d9e2f25ea1a7 includedir.patch +0cca8729c64682387a8c44ed74f0966da697f2817152d8d05bb25bedc7eaafec pid_log.patch +64480b65408caaa98af045270337dc074274a8b98b6a1a853df5d21af426d61e fix-x86-build-bug_571658.patch" +sha512sums="521ba5f57c1dbd8c8b7c0c2839e7054cce192f6688fd0f6f98bb30802a3bf2990ea3843fd366a18d20960797bd8ff410819847cae5717ec605674fb8a910e0e9 php-7.0.10.tar.bz2 +89076ab8e170a8f886b88bb30aa3e6a6b4463155a18ea53485cc9e3898c81afa3d01fb8403d28a45dc1680f09c645c2d81d8272bc8b9c7ced41e59b0ba226216 php7-fpm.initd +cacce7bf789467ff40647b7319e3760c6c587218720538516e8d400baa75651f72165c4e28056cd0c1dc89efecb4d00d0d7823bed80b29136262c825ce816691 php7-fpm.logrotate +fbf9a1572d37370ec0d126502e1d066e045a992484d8fc4f1e2ede330134c1a15f4029f29fa4daebd48eed78b045dc051ced69fbf1f11efc7ad81d884a639a99 php7-module.conf +f1177cbf6b1f44402f421c3d317aab1a2a40d0b1209c11519c1158df337c8945f3a313d689c939768584f3e4edbe52e8bd6103fb6777462326a9d94e8ab1f505 install-pear.patch +6894c9cba7752a3406e774d9efc0e058c37433493c1c20101e9563bf247c112157a67e306b06b9517b0422eca521f543d637a6cbd2cea7639e43f13d773b3d2b tidy-buffio.patch +199aecdbd3b4035aabf5379c215f82412d3c98b79a1ee186944e7fe1f0ed6f40789ea30e2355149491de6be34fc66c5e486e2a79a7e41ab2ae18706ef3ffe79b includedir.patch +82231c7b27b4d044272857dc713674884715ed8e36e54be06faa5d2a949ba4bca597628958a9c5683ec51c36e05a00f6be811c7e95112b0314c98528f584a8d6 pid_log.patch +644c12a5f6d63351b71d18033e2cfeeb78f59427fb0a68fced29e1417b4d46b9044ca0c524a89e9bb315b702bc1c2e76eca57a7b4f97626fa39c9537dcd32fc7 fix-x86-build-bug_571658.patch" diff --git a/community/php7/fix-x86-build-bug_571658.patch b/community/php7/fix-x86-build-bug_571658.patch new file mode 100644 index 0000000000..46f68b6865 --- /dev/null +++ b/community/php7/fix-x86-build-bug_571658.patch @@ -0,0 +1,51 @@ +From 2fcc388d9bf238673ed84b8f38d7753279aea48c Mon Sep 17 00:00:00 2001 +From: Michael Orlitzky <michael@orlitzky.com> +Date: Thu, 4 Aug 2016 11:42:56 -0400 +Subject: [PATCH 1/1] Zend/zend_operators.h: disable x86 assembly on all newer + GCC-4.x. + +In bug 69896, a fix was committed to work around a build error: 'asm' +operand has impossible constraints, in zend_operators.h, on x86. At +the time, the problem was only visible with gcc-4.8, and the fix was +to disable that chunk of assembly for gcc-4.8. With gcc-4.9, the +problem persists, so we now need to check for gcc-4.9 (at least) in +addition to gcc-4.8. + +This commit modifies the earlier conditional that checks for +gcc-4.8. The existing check was for equality on the minor component of +the gcc version, namely 8. The == operator that performs the +comparison has been changed to <=, so that it catches any gcc-4.x with +x >= 8. This has been tested and fixes the build on x86 hardware with +gcc-4.9. + +PHP-Bug: 69896 +Gentoo-Bug: 571658 +--- + Zend/zend_operators.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h +index 3705022..dd7c354 100644 +--- a/Zend/zend_operators.h ++++ b/Zend/zend_operators.h +@@ -520,7 +520,7 @@ static zend_always_inline void fast_long_decrement_function(zval *op1) + + static zend_always_inline void fast_long_add_function(zval *result, zval *op1, zval *op2) + { +-#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__) ++#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 <= __GNUC_MINOR__) + __asm__( + "movl (%1), %%eax\n\t" + "addl (%2), %%eax\n\t" +@@ -606,7 +606,7 @@ static zend_always_inline int fast_add_function(zval *result, zval *op1, zval *o + + static zend_always_inline void fast_long_sub_function(zval *result, zval *op1, zval *op2) + { +-#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 == __GNUC_MINOR__) ++#if defined(__GNUC__) && defined(__i386__) && !(4 == __GNUC__ && 8 <= __GNUC_MINOR__) + __asm__( + "movl (%1), %%eax\n\t" + "subl (%2), %%eax\n\t" +-- +2.7.3 + diff --git a/community/php7/includedir.patch b/community/php7/includedir.patch new file mode 100644 index 0000000000..0e1eafe83d --- /dev/null +++ b/community/php7/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 + 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 + + 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" + 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" + builddir="`pwd`" + SED="@SED@" + diff --git a/community/php7/install-pear.patch b/community/php7/install-pear.patch new file mode 100644 index 0000000000..18747be94b --- /dev/null +++ b/community/php7/install-pear.patch @@ -0,0 +1,15 @@ +--- ./pear/Makefile.frag.orig 2013-04-12 07:02:27.041602514 +0000 ++++ ./pear/Makefile.frag 2013-04-12 07:04:09.065836822 +0000 +@@ -2,8 +2,11 @@ + + peardir=$(PEAR_INSTALLDIR) + ++# help the built php to find xml extension so we can install pear ++PEAR_INSTALL_XML_FLAGS = -d extension_dir="$(top_builddir)/modules" -d extension=xml.so ++ + # Skip all php.ini files altogether +-PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dopen_basedir= -derror_reporting=1803 -dmemory_limit=-1 -ddetect_unicode=0 ++PEAR_INSTALL_FLAGS = -n -dshort_open_tag=0 -dopen_basedir= -derror_reporting=1803 -dmemory_limit=-1 -ddetect_unicode=0 $(PEAR_INSTALL_XML_FLAGS) + + WGET = `which wget 2>/dev/null` + FETCH = `which fetch 2>/dev/null` diff --git a/community/php7/php7-fpm.initd b/community/php7/php7-fpm.initd new file mode 100644 index 0000000000..1016c68f0d --- /dev/null +++ b/community/php7/php7-fpm.initd @@ -0,0 +1,35 @@ +#!/sbin/openrc-run + +name="PHP7 FastCGI Process Manager" +cfgfile="/etc/php7/php-fpm.conf" +pidfile="/var/run/php-fpm7.pid" +command="/usr/sbin/php-fpm7" +command_args="--fpm-config $cfgfile --pid $pidfile" +required_files="$cfgfile" + +extra_started_commands="reload reopen" +description_reload="Reload configuration" +description_reopen="Reopen log files" + +depend() { + need net + before apache2 lighttpd nginx +} + +start_pre() { + ebegin + $command $command_args -t 2>/dev/null + eend $? +} + +reload() { + ebegin "Reloading ${SVCNAME} configuration" + start-stop-daemon --signal USR2 --pidfile $pidfile + eend $? +} + +reopen() { + ebegin Reopening ${SVCNAME} log files"" + start-stop-daemon --signal USR1 --pidfile $pidfile + eend $? +} diff --git a/community/php7/php7-fpm.logrotate b/community/php7/php7-fpm.logrotate new file mode 100644 index 0000000000..10e53e4683 --- /dev/null +++ b/community/php7/php7-fpm.logrotate @@ -0,0 +1,13 @@ +/var/log/php7/*.log { + rotate 7 + daily + missingok + notifempty + delaycompress + compress + dateext + sharedscripts + postrotate + /etc/init.d/php-fpm7 --ifstarted --quiet reopen + endscript +} diff --git a/community/php7/php7-module.conf b/community/php7/php7-module.conf new file mode 100644 index 0000000000..cf7573bb10 --- /dev/null +++ b/community/php7/php7-module.conf @@ -0,0 +1,5 @@ +LoadModule php7_module modules/mod_php7.so + +DirectoryIndex index.php index.html +AddHandler application/x-httpd-php .php +AddHandler application/x-httpd-php-source .phps diff --git a/community/php7/pid_log.patch b/community/php7/pid_log.patch new file mode 100644 index 0000000000..bc586dbd69 --- /dev/null +++ b/community/php7/pid_log.patch @@ -0,0 +1,76 @@ +--- a/sapi/fpm/fpm/fpm_conf.c ++++ b/sapi/fpm/fpm/fpm_conf.c +@@ -1178,7 +1178,7 @@ + } + + if (!fpm_global_config.error_log) { +- fpm_global_config.error_log = strdup("log/php-fpm.log"); ++ fpm_global_config.error_log = strdup("log/php7/error.log"); + } + + #ifdef HAVE_SYSTEMD +@@ -1189,7 +1189,7 @@ + + #ifdef HAVE_SYSLOG_H + if (!fpm_global_config.syslog_ident) { +- fpm_global_config.syslog_ident = strdup("php-fpm"); ++ fpm_global_config.syslog_ident = strdup("php-fpm7"); + } + + if (fpm_global_config.syslog_facility < 0) { +@@ -1681,7 +1681,7 @@ + if (fpm_globals.prefix == NULL) { + spprintf(&tmp, 0, "%s/php-fpm.conf", PHP_SYSCONFDIR); + } else { +- spprintf(&tmp, 0, "%s/etc/php-fpm.conf", fpm_globals.prefix); ++ spprintf(&tmp, 0, "%s/etc/php-fpm7.conf", fpm_globals.prefix); + } + + if (!tmp) { +--- a/sapi/fpm/php-fpm.conf.in ++++ b/sapi/fpm/php-fpm.conf.in +@@ -14,14 +14,14 @@ + ; Pid file + ; Note: the default prefix is @EXPANDED_LOCALSTATEDIR@ + ; Default Value: none +-;pid = run/php-fpm.pid ++;pid = run/php-fpm7.pid + + ; Error log file + ; If it's set to "syslog", log is sent to syslogd instead of being written + ; in a local file. + ; Note: the default prefix is @EXPANDED_LOCALSTATEDIR@ + ; Default Value: log/php-fpm.log +-;error_log = log/php-fpm.log ++;error_log = log/php7/error.log + + ; syslog_facility is used to specify what type of program is logging the + ; message. This lets syslogd specify that messages from different facilities +--- a/sapi/fpm/www.conf.in ++++ b/sapi/fpm/www.conf.in +@@ -250,7 +250,7 @@ + + ; The access log file + ; Default: not set +-;access.log = log/$pool.access.log ++;access.log = log/php7/$pool.access.log + + ; The access log format. + ; The following syntax is allowed +@@ -314,7 +314,7 @@ + ; The log file for slow requests + ; Default Value: not set + ; Note: slowlog is mandatory if request_slowlog_timeout is set +-;slowlog = log/$pool.log.slow ++;slowlog = log/php7/$pool.slow.log + + ; The timeout for serving a single request after which a PHP backtrace will be + ; dumped to the 'slowlog' file. A value of '0s' means 'off'. +@@ -408,6 +408,6 @@ + ; specified at startup with the -d argument + ;php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f www@my.domain.com + ;php_flag[display_errors] = off +-;php_admin_value[error_log] = /var/log/fpm-php.www.log ++;php_admin_value[error_log] = /var/log/php7/www.error.log + ;php_admin_flag[log_errors] = on + ;php_admin_value[memory_limit] = 32M diff --git a/community/php7/tidy-buffio.patch b/community/php7/tidy-buffio.patch new file mode 100644 index 0000000000..c15f9540a4 --- /dev/null +++ b/community/php7/tidy-buffio.patch @@ -0,0 +1,11 @@ +--- a/ext/tidy/tidy.c ++++ b/ext/tidy/tidy.c +@@ -31,7 +31,7 @@ + #include "ext/standard/info.h" + + #include "tidy.h" +-#include "buffio.h" ++#include "tidybuffio.h" + + /* compatibility with older versions of libtidy */ + #ifndef TIDY_CALL |