X-Original-To: alpine-aports@lists.alpinelinux.org Received: from mail.infogroup.kiev.ua (tera.infogroup.kiev.ua [195.144.25.26]) by lists.alpinelinux.org (Postfix) with ESMTP id 8666F5C455C for ; Thu, 8 Dec 2016 12:55:04 +0000 (GMT) Received: from ost.org.ua ([195.144.25.230] helo=alpine.ost.org.ua) by mail.infogroup.kiev.ua with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80.1) (envelope-from ) id 1cEyE3-0003uP-MM for alpine-aports@lists.alpinelinux.org; Thu, 08 Dec 2016 14:55:03 +0200 From: Valery Kartel To: alpine-aports@lists.alpinelinux.org Subject: [alpine-aports] [PATCH v2] community/php7: upgrade to 7.1.0, close issues #5367, #5670, #6450 Date: Thu, 8 Dec 2016 14:54:59 +0200 Message-Id: <20161208125459.28266-1-valery.kartel@gmail.com> X-Mailer: git-send-email 2.11.0 Sender: droid@infogroup.kiev.ua X-Mailinglist: alpine-aports Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: -- WARN: PHP API version changed. All external extensions needs to be rebuilded! - some fixes in APKBUILD and others - added shared extension 'recode' - fixed imap loading order (http://php.net/manual/en/recode.installation.php) - removed shared extension 'readline', made it compiled-in (Bug #5670) - removed suffix in development binaries, so php5-dev and php7-dev blocked each other - cli, cgi and dbg binaries are symlinked to non-suffixed ones (Support #5367, Bug #6450) to fix symlinks to php7 just run: "apk fix php7-common", but the same idea needs to be implemented in php5 to allow choose which one would be system default --- community/php7/APKBUILD | 228 ++++++++++++++----------------- community/php7/php7-common.pre-uninstall | 5 + community/php7/php7-common.pre-upgrade | 7 + community/php7/php7-common.trigger | 9 ++ community/php7/php7-fpm.initd | 35 ++--- community/php7/php7-fpm.logrotate | 2 +- community/php7/php7-module.conf | 2 +- community/php7/pid_log.patch | 24 +++- community/php7/tidy-buffio.patch | 11 -- 9 files changed, 153 insertions(+), 170 deletions(-) create mode 100644 community/php7/php7-common.pre-uninstall create mode 100644 community/php7/php7-common.pre-upgrade create mode 100644 community/php7/php7-common.trigger delete mode 100644 community/php7/tidy-buffio.patch diff --git a/community/php7/APKBUILD b/community/php7/APKBUILD index c0b1f5cdc3..f4e7aab8a2 100644 --- a/community/php7/APKBUILD +++ b/community/php7/APKBUILD @@ -2,35 +2,42 @@ # Maintainer: Valery Kartel pkgname=php7 _pkgreal=php -pkgver=7.0.13 -pkgrel=1 +pkgver=7.1.0 +pkgrel=0 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" +install="$pkgname-common.pre-upgrade $pkgname-common.pre-uninstall" +triggers="$pkgname-common.trigger=/usr/bin" +depends_imap="-- $depends_recode" +depends_mysqlnd="$pkgname-mysqli $depends_mysqli" +depends_pdo_mysql="$pkgname-pdo $depends_pdo" +depends_pdo_odbc="$pkgname-pdo $depends_pdo" +depends_pdo_pgsql="$pkgname-pdo $depends_pdo" +depends_pdo_sqlite="$pkgname-pdo $depends_pdo" +depends_dom="$pkgname-xml $depends_xml" +depends_soap="$pkgname-xml $depends_xml" +depends_wddx="$pkgname-xml $depends_xml" +depends_xmlrpc="$pkgname-xml $depends_xml" +depends_xmlreader="$pkgname-dom $depends_dom" +depends_xsl="$pkgname-dom $depends_dom" +_prefix_opcache="zend_" 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 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 gsoap-dev recode-dev - readline-dev paxmark gettext-dev + readline-dev 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 " @@ -38,8 +45,8 @@ 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 + pdo_odbc pdo_pgsql pdo_sqlite pgsql phar:phar posix pspell recode 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::noarch @@ -52,14 +59,12 @@ for _ext in $_exts; do done subpackages="$subpackages $pkgname-common::noarch" -_apiver="20151012" +_apiver="20160303" 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" @@ -74,7 +79,6 @@ _build() { --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ - --program-suffix=7 \ --libdir=/usr/lib/$pkgname \ --datadir=/usr/share/$pkgname \ --sysconfdir=/etc/$pkgname \ @@ -138,226 +142,194 @@ _build() { --with-xsl=shared \ --enable-wddx=shared \ --enable-zip=shared --with-libzip=shared \ + --with-readline \ $@ || return 1 - sed -ri "s/^(EXTRA_LDFLAGS[ ]*\=.*)/\1 -lpthread/" Makefile # see #183 (from main/php) + sed -ri "s/^(EXTRA_LDFLAGS[ ]*\=.*)/\1 -lpthread/" Makefile # see #183 (from main/php5) make || return 1 } build() { cd "$builddir" - # phpdbg _build --enable-phpdbg \ --enable-phpdbg \ --enable-phpdbg-webhelper \ --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 + mv libs/lib$pkgname.so sapi/apache2handler + # cgi,cli,fpm,embed,litespeed - with recode, without imap + _build --disable-phpdbg \ + --enable-fpm \ + --enable-embed \ + --with-litespeed \ + --without-imap --without-imap-ssl \ + --with-recode=shared \ + || return 1 # 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 + rm -fr "$pkgdir"/.[[:alpha:]]* "$pkgdir"/var || return 1 + mv "$pkgdir"/usr/share/man/man1/php.1 \ + "$pkgdir"/usr/share/man/man1/$pkgname.1 + mv "$pkgdir"/usr/share/man/man1/php-cgi.1 \ + "$pkgdir"/usr/share/man/man1/$pkgname-cgi.1 + mv "$pkgdir"/usr/share/man/man8/php-fpm.8 \ + "$pkgdir"/usr/share/man/man8/$pkgname-fpm.8 + mv "$pkgdir"/usr/bin/php "$pkgdir"/usr/bin/$pkgname } 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/ + depends="$depends $pkgname-pear" + mv "$pkgdir"/usr/bin/phpize "$pkgdir"/usr/bin/peardev \ + "$subpkgdir"/usr/bin/ + mv "$pkgdir"/usr/lib/$pkgname/build "$subpkgdir"/usr/lib/$pkgname/ } doc() { default_doc - - mkdir -p "$subpkgdir"/usr/share/doc/$pkgname - - local file + install_if="docs $pkgname-common=$pkgver-r$pkgrel" for file in CODING_STANDARDS CREDITS EXTENSIONS INSTALL LICENSE NEWS README* UPGRADING*; do - cp "$builddir"/$file "$subpkgdir"/usr/share/doc/$pkgname/ || return 1 + install -Dm644 "$builddir"/$file "$subpkgdir"/usr/share/doc/$pkgname/$file || 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 + install -Dm755 "$builddir"/sapi/apache2handler/lib$pkgname.so \ + "$subpkgdir"/usr/lib/apache2/lib$pkgname.so || return 1 + install -Dm644 "$srcdir"/$pkgname-module.conf \ + "$subpkgdir"/etc/apache2/conf.d/$pkgname-module.conf } phpdbg() { pkgdesc="Interactive PHP debugger" depends="$pkgname-common" - install -Dm755 "$builddir"/sapi/phpdbg/phpdbg \ - "$subpkgdir"/usr/bin/phpdbg7 + "$subpkgdir"/usr/bin/${pkgname}dbg } embed() { pkgdesc="PHP Embedded Library" depends="$pkgname-common" - mkdir -p "$subpkgdir"/usr/lib - mv "$pkgdir"/usr/lib/libphp*.so "$subpkgdir"/usr/lib/ + mv "$pkgdir"/usr/lib/lib$pkgname.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 + mv "$pkgdir"/usr/bin/lsphp "$subpkgdir"/usr/bin/ls$pkgname } cgi() { pkgdesc="PHP Common Gateway Interface" depends="$pkgname-common" - mkdir -p "$subpkgdir"/usr/bin - mv "$pkgdir"/usr/bin/php-cgi7 "$subpkgdir"/usr/bin/ + mv "$pkgdir"/usr/bin/php-cgi "$subpkgdir"/usr/bin/$pkgname-cgi } 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"/usr/share/$pkgname/fpm "$subpkgdir"/var/lib/$pkgname || return 1 + mv "$pkgdir"/usr/sbin "$subpkgdir"/usr/ + mv "$subpkgdir"/usr/sbin/php-fpm "$subpkgdir"/usr/sbin/$pkgname-fpm || 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 + find "$subpkgdir"/etc/$pkgname -name *.default \ + -exec sh -c 'f={}; mv $f ${f%.default}' \; + install -D -m755 "$srcdir"/$pkgname-fpm.initd "$subpkgdir"/etc/init.d/$pkgname-fpm + install -D -m644 "$srcdir"/$pkgname-fpm.logrotate "$subpkgdir"/etc/logrotate.d/$pkgname-fpm } pear() { 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"/usr/bin/pecl "$pkgdir"/usr/bin/pear \ + "$subpkgdir"/usr/bin/ mv "$pkgdir"/etc/$pkgname/pear.conf "$subpkgdir"/etc/$pkgname/ || return 1 mv "$pkgdir"/usr/share "$subpkgdir"/usr/ } common() { - 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 + pkgdesc="$pkgdesc (common config and system-default symlinks)" + depends= + install -Dm644 "$builddir"/php.ini-production \ + "$subpkgdir"/etc/$pkgname/php.ini || return 1 + # exit with an error if there is any configs + # or if some modules were not in subpackages + rmdir "$pkgdir"/usr/lib/$pkgname/modules \ + "$pkgdir"/etc/$pkgname || return 1 + rm -fr "$pkgdir"/etc "$pkgdir"/usr/lib } phar() { + depends="$pkgname" _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")" + local dep= + local sep= + local elo=0 + local extname=${subpkgname#$pkgname-} 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_" - + for dep in $(eval echo \$depends_$extname); do + elo=$(expr $elo + 1) + [ "$dep" = "--" ] && sep=$dep + [ "$sep" = "--" ] || depends="$depends $dep" + done 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 + echo $(eval echo \$_prefix_$extname)extension=$extname.so >\ + "$subpkgdir"/etc/$pkgname/conf.d/$(printf %02d $elo)_${extname}.ini } -md5sums="f62d1c9ddb3a791b7eac423c7b2a769c php-7.0.13.tar.bz2 -4115cbd0843c72adc3bd42fecd6d4540 php7-fpm.initd -25bde13e7894c2930d97fad68d5dd3b3 php7-fpm.logrotate -47be6cd1ed92f21579e15bf2003a709f php7-module.conf +md5sums="54e364b60a88db77adb96aacb10f10a4 php-7.1.0.tar.bz2 +ec640f739750171e5264b557eaa9f79e php7-fpm.initd +6085eb7854c192b6a533bb18eeaebe2f php7-fpm.logrotate +3cea5c5334508dfc43591cd5bb1483c6 php7-module.conf 483bc0a85c50a9a9aedbe14a19ed4526 install-pear.patch -66f0037a029f9eed2b31d2e1d50f1860 tidy-buffio.patch d872e633c9b33c3c9f629dd2edd2e5c5 includedir.patch -6ba762ab7a105163b8e5b3913deae109 pid_log.patch" -sha256sums="d090bb523812117ec0c08d8f0b5c5f0616aa7a29a2eeee0374efe53a7cfe88c1 php-7.0.13.tar.bz2 -a7e4fc0eeba18aec019f62ed966915afd82b6b5fb1e1af93b59f964b5bd66172 php7-fpm.initd -6e4406f21b69085714cdb9d9a67c08e27a1c737ab353f9813cb2fc268352d2c6 php7-fpm.logrotate -276c823ee666ea73b36d4e97174eeea05713125b61f7f8681e350453c4123143 php7-module.conf +edb29ea13fab52e50d3ee305e3f38060 pid_log.patch" +sha256sums="68bcfd7deed5b3474d81dec9f74d122058327e2bed0ac25bbc9ec70995228e61 php-7.1.0.tar.bz2 +6a54a569cbab64d98a1682f9cece0ac6424b32402110e273f6ee1a0996b558e8 php7-fpm.initd +bcd2f0a5caed573e4ac31a0dea6a7cd2584cdb9943f8a390b80ed900180dbb2a php7-fpm.logrotate +dc73bb3a3bca94cdf070338ecfed85940548eda978e9392a711226ba62c1ce60 php7-module.conf f739ca427a1dd53a388bad0823565299c5d4a5796b1171b892884e4d7d099bab install-pear.patch -5dc8f32e5e2b1cd6317ada5a5adb9b5f0802ed6e0dbe065d7bfcc0f55d47e0d5 tidy-buffio.patch ea74966a23b1b54548ee35e9ccc2fc8d2b7c2285c385c44d6b23d9e2f25ea1a7 includedir.patch -0cca8729c64682387a8c44ed74f0966da697f2817152d8d05bb25bedc7eaafec pid_log.patch" -sha512sums="53276fbd35855b9337120fd74f6932e70822b8e5508b6bed068a78805049d36960300e781ec5640f4a90f2d4a09e506084a865341d151bc5c87b7777cb5ff6a3 php-7.0.13.tar.bz2 -1c708de82d1086f272f484faf6cf6d087af7c31750cc2550b0b94ed723961b363f28a947b015b2dfc0765caea185a75f5d2c2f2b099c948b65c290924f606e4f php7-fpm.initd -cacce7bf789467ff40647b7319e3760c6c587218720538516e8d400baa75651f72165c4e28056cd0c1dc89efecb4d00d0d7823bed80b29136262c825ce816691 php7-fpm.logrotate -fbf9a1572d37370ec0d126502e1d066e045a992484d8fc4f1e2ede330134c1a15f4029f29fa4daebd48eed78b045dc051ced69fbf1f11efc7ad81d884a639a99 php7-module.conf +60ced777af95bd0110c71a3d00a3169fd4b1e599560028e799c45599cc14c2a6 pid_log.patch" +sha512sums="94c051abd19dbdf3d016f068269b5c6d667938def4df1732f7826a0ab2dd1fa541ff838dafc1531e1c4fa790df0b07feaef97512b28dda3e4ce5e724ede89b37 php-7.1.0.tar.bz2 +2647092005006184ef8fdb13c43a551a8ab7c4b4eff80c0d14a8ee5c1519cfcf635142862f60c3cdc5d63fabf0b96d4a5a260c31a3e48be663b3cbf447a2806e php7-fpm.initd +da404e9d7bb7af484351b6c9d2a2e8f1eff8d44704da3d877bc6af11c638e0a1f7225ea5ac381cada316876dfaaa81254c87fe3867849fb898478f459fdc367b php7-fpm.logrotate +ebfa4365c88c745fb27d9271d66daabeaecb26ce31e01716d42c187a0afd06e22e815a66e2aafb29e1e88a23248e3b4182928033294928985c9b8362174738c8 php7-module.conf f1177cbf6b1f44402f421c3d317aab1a2a40d0b1209c11519c1158df337c8945f3a313d689c939768584f3e4edbe52e8bd6103fb6777462326a9d94e8ab1f505 install-pear.patch -6894c9cba7752a3406e774d9efc0e058c37433493c1c20101e9563bf247c112157a67e306b06b9517b0422eca521f543d637a6cbd2cea7639e43f13d773b3d2b tidy-buffio.patch 199aecdbd3b4035aabf5379c215f82412d3c98b79a1ee186944e7fe1f0ed6f40789ea30e2355149491de6be34fc66c5e486e2a79a7e41ab2ae18706ef3ffe79b includedir.patch -82231c7b27b4d044272857dc713674884715ed8e36e54be06faa5d2a949ba4bca597628958a9c5683ec51c36e05a00f6be811c7e95112b0314c98528f584a8d6 pid_log.patch" +9503514f22d591125fb08da23f4bcc9fc47e9b2cf8b53c6ca0130e1325acce621c21a59a60ab687c87972feba7f0007d52f4bd4790a1aca592383212891c4e7c pid_log.patch" diff --git a/community/php7/php7-common.pre-uninstall b/community/php7/php7-common.pre-uninstall new file mode 100644 index 0000000000..cec8da2a94 --- /dev/null +++ b/community/php7/php7-common.pre-uninstall @@ -0,0 +1,5 @@ +#!/bin/sh + +find -L /usr/bin -type l -name "*php*" -delete + +exit 0 diff --git a/community/php7/php7-common.pre-upgrade b/community/php7/php7-common.pre-upgrade new file mode 100644 index 0000000000..c337c8c658 --- /dev/null +++ b/community/php7/php7-common.pre-upgrade @@ -0,0 +1,7 @@ +#!/bin/sh + +for file in $(find /usr/bin -type f -name "*php7*"); do + [ ! -e ${file/7/} -o -L ${file/7/} ] && ln -sf $file ${file/7/} +done + +exit 0 diff --git a/community/php7/php7-common.trigger b/community/php7/php7-common.trigger new file mode 100644 index 0000000000..eb577df7b9 --- /dev/null +++ b/community/php7/php7-common.trigger @@ -0,0 +1,9 @@ +#!/bin/sh + +find -L /usr/bin -type l -name "*php*" -delete + +for file in $(find /usr/bin -type f -name "*php7*"); do + [ ! -e ${file/7/} ] && ln -sf $file ${file/7/} +done + +exit 0 diff --git a/community/php7/php7-fpm.initd b/community/php7/php7-fpm.initd index f56fdb5234..99fccd599f 100644 --- a/community/php7/php7-fpm.initd +++ b/community/php7/php7-fpm.initd @@ -6,18 +6,17 @@ # 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" +command="/usr/sbin/php7-fpm" command_background="yes" start_stop_daemon_args="--quiet" -pidfile="/run/$RC_SVCNAME/php-fpm.pid" +pidfile="/run/$RC_SVCNAME/php7-fpm.pid" retry="SIGTERM/20" # configtest is here only for backward compatibility -extra_commands="checkconfig configtest" +extra_commands="checkconfig" extra_started_commands="reload reopen" -description_checkconfig="Run php-fpm config check" +description="PHP FastCGI Process Manager" +description_checkconfig="Run config check" description_reload="Gracefully reload workers and config" description_reopen="Reopen log files" @@ -25,47 +24,43 @@ required_files="$fpm_config" depend() { need net - use apache2 lighttpd nginx + before apache2 lighttpd nginx } init_vars() { # Defaults for single master process with multiple pools - if [ "$RC_SVCNAME" = "php-fpm7" ]; then + if [ "$RC_SVCNAME" = "php7-fpm" ]; then : ${fpm_config:="/etc/php7/php-fpm.conf"} : ${user:="root"} # Defaults for master process per pool else - : ${fpm_config="/etc/php7/php-fpm.d/${RC_SVCNAME#php-fpm7.}.conf"} + : ${fpm_config="/etc/php7/php-fpm.d/${RC_SVCNAME#php7-fpm.}.conf"} : ${user:="$(conf_get user)"} : ${user:="nobody"} : ${group:="$(conf_get group)"} fi - command_args="--nodaemonize --fpm-config $fpm_config" + command_args="--nodaemonize --fpm-config $fpm_config --pid $pidfile" 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 "$(dirname "$listen")" - fi - + [ "${listen:0:1}" = "/" ] && checkpath -d -o $user:$group "$(dirname "$listen")" checkpath -d "$(dirname "$pidfile")" } reload() { - ebegin "Reloading $name" + ebegin "Reloading $RC_SVCNAME" start-stop-daemon --signal USR2 --pidfile "$pidfile" eend $? } reopen() { - ebegin "Reopening $name log files" + ebegin "Reopening $RC_SVCNAME log files" start-stop-daemon --signal USR1 --pidfile "$pidfile" eend $? } @@ -73,7 +68,6 @@ reopen() { 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" @@ -82,11 +76,6 @@ checkconfig() { } } -configtest() { - ewarn "configtest is deprecated, use checkconfig instead" - checkconfig -} - conf_get() { local key="$1" sed -nE "s/^${key}\s*=\s*\"?([^\";]+).*/\1/p" "$fpm_config" | head -n 1 diff --git a/community/php7/php7-fpm.logrotate b/community/php7/php7-fpm.logrotate index 10e53e4683..4273f72474 100644 --- a/community/php7/php7-fpm.logrotate +++ b/community/php7/php7-fpm.logrotate @@ -8,6 +8,6 @@ dateext sharedscripts postrotate - /etc/init.d/php-fpm7 --ifstarted --quiet reopen + /etc/init.d/php7-fpm --ifstarted --quiet reopen endscript } diff --git a/community/php7/php7-module.conf b/community/php7/php7-module.conf index cf7573bb10..f0a0b47a00 100644 --- a/community/php7/php7-module.conf +++ b/community/php7/php7-module.conf @@ -1,4 +1,4 @@ -LoadModule php7_module modules/mod_php7.so +LoadModule php7_module modules/libphp7.so DirectoryIndex index.php index.html AddHandler application/x-httpd-php .php diff --git a/community/php7/pid_log.patch b/community/php7/pid_log.patch index bc586dbd69..b44361db19 100644 --- a/community/php7/pid_log.patch +++ b/community/php7/pid_log.patch @@ -14,7 +14,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"); ++ fpm_global_config.syslog_ident = strdup("php7-fpm"); } if (fpm_global_config.syslog_facility < 0) { @@ -23,7 +23,7 @@ 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); ++ spprintf(&tmp, 0, "%s/etc/php7/php-fpm.conf", fpm_globals.prefix); } if (!tmp) { @@ -34,18 +34,30 @@ ; Note: the default prefix is @EXPANDED_LOCALSTATEDIR@ ; Default Value: none -;pid = run/php-fpm.pid -+;pid = run/php-fpm7.pid ++;pid = run/php7-fpm.pid ; Error log file ; If it's set to "syslog", log is sent to syslogd instead of being written - ; in a local file. + ; into a local file. ; Note: the default prefix is @EXPANDED_LOCALSTATEDIR@ - ; Default Value: log/php-fpm.log +-; Default Value: log/php-fpm.log -;error_log = log/php-fpm.log ++; Default Value: log/php7/error.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 +@@ -33,8 +33,8 @@ + ; syslog_ident is prepended to every message. If you have multiple FPM + ; instances running on the same server, you can change the default value + ; which must suit common needs. +-; Default Value: php-fpm +-;syslog.ident = php-fpm ++; Default Value: php7-fpm ++;syslog.ident = php7-fpm + + ; Log level + ; Possible Values: alert, error, warning, notice, debug --- a/sapi/fpm/www.conf.in +++ b/sapi/fpm/www.conf.in @@ -250,7 +250,7 @@ @@ -71,6 +83,6 @@ ;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_value[error_log] = /var/log/php7/$pool.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 deleted file mode 100644 index c15f9540a4..0000000000 --- a/community/php7/tidy-buffio.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- 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 -- 2.11.0 --- Unsubscribe: alpine-aports+unsubscribe@lists.alpinelinux.org Help: alpine-aports+help@lists.alpinelinux.org ---