summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rynn2017-02-05 19:12:06 +1100
committerMichael Rynn2017-02-05 19:12:06 +1100
commit004cb1d7fbfd7ea6a162c62fc9649028c913e2d4 (patch)
tree4a057f424a8ed0f9b59cda3162de0076e215a576
downloadaur-004cb1d7fbfd7ea6a162c62fc9649028c913e2d4.tar.gz
First Commit
-rw-r--r--.SRCINFO165
-rw-r--r--PKGBUILD389
-rw-r--r--apache.conf13
-rw-r--r--apache.patch20
-rwxr-xr-xgenerate_patches49
-rw-r--r--php-fpm.patch76
-rw-r--r--php-fpm.tmpfiles1
-rw-r--r--php.ini.patch97
8 files changed, 810 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..76785c30275
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,165 @@
+pkgbase = php70
+ pkgdesc = PHP scripting language package for stable release of 7.0 series
+ pkgver = 7.0.15
+ pkgrel = 1
+ url = http://www.php.net
+ arch = i686
+ arch = x86_64
+ license = PHP
+ checkdepends = procps-ng
+ makedepends = apache
+ makedepends = aspell
+ makedepends = db
+ makedepends = enchant
+ makedepends = gd
+ makedepends = gmp
+ makedepends = icu
+ makedepends = libmcrypt
+ makedepends = libxslt
+ makedepends = libzip
+ makedepends = net-snmp
+ makedepends = postgresql-libs
+ makedepends = sqlite
+ makedepends = systemd
+ makedepends = tidy
+ makedepends = unixodbc
+ makedepends = curl
+ makedepends = libtool
+ makedepends = freetds
+ makedepends = pcre
+ source = https://php.net/distributions/php-7.0.15.tar.xz
+ source = https://php.net/distributions/php-7.0.15.tar.xz.asc
+ source = apache.patch
+ source = apache.conf
+ source = php-fpm.patch
+ source = php-fpm.tmpfiles
+ source = php.ini.patch
+ validpgpkeys = 1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763
+ validpgpkeys = 528995BFEDFBA7191D46839EF9BA0ADA31CBD89E
+ sha256sums = 300364d57fc4a6176ff7d52d390ee870ab6e30df121026649f8e7e0b9657fe93
+ sha256sums = SKIP
+ sha256sums = 819f05d2fd5a75c96e93c863517ca77dbd021a1224dc2d8096f758fb2937df6a
+ sha256sums = df075b89484eb3a08402788580de16d23123f95541b2e9aed8d928105de9b874
+ sha256sums = 651e3f9ba7ac337cbcf54b759f9367cdfadad1f3055d086750d45b0b20056ba7
+ sha256sums = b6b7f3ced56b75bf95513a46f43cde41fc28da714f5e0ed181caf2266f2f0c27
+ sha256sums = 2f678d039313ee613d59c8b4bf9f48068085df0fa8ac7ca4cf807e168061a8c9
+
+pkgname = php70
+ pkgdesc = A general-purpose scripting language that is especially suited to web development
+ depends = libxml2
+ depends = curl
+ depends = libzip
+ depends = pcre
+ provides = php=7.0.15
+ conflicts = php-ldap
+ replaces = php-ldap
+ backup = etc/${pkgbase}/php.ini
+
+pkgname = php70-cgi
+ pkgdesc = CGI and FCGI SAPI for PHP
+ depends = php70
+ provides = php-cgi=7.0.15
+
+pkgname = php70-apache
+ pkgdesc = Apache SAPI for PHP
+ depends = php70
+ depends = apache
+ backup = etc/httpd/conf/extra/php_module.conf
+
+pkgname = php70-fpm
+ pkgdesc = FastCGI Process Manager for PHP
+ depends = php70
+ depends = systemd
+ options = !emptydirs
+ backup = etc/php70/php-fpm.conf
+
+pkgname = php70-embed
+ pkgdesc = Embedded PHP SAPI library
+ depends = php70
+ provides = php70-embed=7.0.15
+ options = !emptydirs
+
+pkgname = php70-phpdbg
+ pkgdesc = Interactive PHP debugger
+ depends = php70
+ provides = php70-phpdbg=7.0.15
+ options = !emptydirs
+
+pkgname = php70-dblib
+ pkgdesc = dblib module for PHP
+ depends = php70
+ provides = php70-dblib=7.0.15
+
+pkgname = php70-enchant
+ pkgdesc = enchant module for PHP
+ depends = php70
+ depends = enchant
+ provides = php70-enchant=7.0.15
+
+pkgname = php70-gd
+ pkgdesc = gd module for PHP
+ depends = php70
+ depends = gd
+ provides = php70-gd=7.0.15
+
+pkgname = php70-imap
+ pkgdesc = imap module for PHP
+ depends = php70
+ depends = c-client
+ provides = php70-imap=7.0.15
+
+pkgname = php70-intl
+ pkgdesc = intl module for PHP
+ depends = php70
+ depends = icu
+ provides = php70-intl=7.0.15
+
+pkgname = php70-mcrypt
+ pkgdesc = mcrypt module for PHP
+ depends = php70
+ depends = libmcrypt
+ depends = libltdl
+ provides = php70-mcrypt=7.0.15
+
+pkgname = php70-odbc
+ pkgdesc = ODBC modules for PHP
+ depends = php70
+ depends = unixodbc
+ provides = php70-odbc=7.0.15
+
+pkgname = php70-pgsql
+ pkgdesc = PostgreSQL modules for PHP
+ depends = php70
+ depends = postgresql-libs
+ provides = php70-pgsql=7.0.15
+
+pkgname = php70-pspell
+ pkgdesc = pspell module for PHP
+ depends = php70
+ depends = aspell
+ provides = php70-pspell=7.0.15
+
+pkgname = php70-snmp
+ pkgdesc = snmp module for PHP
+ depends = php70
+ depends = net-snmp
+ provides = php70-snmp=7.0.15
+
+pkgname = php70-sqlite
+ pkgdesc = sqlite module for PHP
+ depends = php70
+ depends = sqlite
+ provides = php70-sqlite=7.0.15
+
+pkgname = php70-tidy
+ pkgdesc = tidy module for PHP
+ depends = php70
+ depends = tidyhtml
+ provides = php70-tidy=7.0.15
+
+pkgname = php70-xsl
+ pkgdesc = xsl module for PHP
+ depends = php70
+ depends = libxslt
+ provides = php70-xsl=7.0.15
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..d688a17df47
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,389 @@
+# $Id$
+# Maintainer: Michael Rynn <michael.rynn@parracan.org>
+# Derived very much from arch php packages for 7.1.1 in extra and php56 in AUR
+# This is much the same as php56 package
+# Maintainer: mickael9 <mickael9 at gmail.com>
+# Contributor: Pierre Schmitz <pierre@archlinux.de>
+# Contributor: Thore Bödecker <me@foxxx0.de>
+#
+pkgbase=php70
+_pkgbase=${pkgbase%70}
+pkgname=("${pkgbase}"
+ "${pkgbase}-cgi"
+ "${pkgbase}-apache"
+ "${pkgbase}-fpm"
+ "${pkgbase}-embed"
+ "${pkgbase}-phpdbg"
+ "${pkgbase}-dblib"
+ "${pkgbase}-enchant"
+ "${pkgbase}-gd"
+ "${pkgbase}-imap"
+ "${pkgbase}-intl"
+ "${pkgbase}-mcrypt"
+ "${pkgbase}-odbc"
+ "${pkgbase}-pgsql"
+ "${pkgbase}-pspell"
+ "${pkgbase}-snmp"
+ "${pkgbase}-sqlite"
+ "${pkgbase}-tidy"
+ "${pkgbase}-xsl")
+pkgver=7.0.15
+pkgrel=1
+pkgdesc="PHP scripting language package for stable release of 7.0 series"
+arch=('i686' 'x86_64')
+license=('PHP')
+
+
+url='http://www.php.net'
+makedepends=('apache' 'aspell' 'db' 'enchant' 'gd' 'gmp' 'icu' 'libmcrypt' 'libxslt' 'libzip' 'net-snmp'
+ 'postgresql-libs' 'sqlite' 'systemd' 'tidy' 'unixodbc' 'curl' 'libtool' 'freetds' 'pcre')
+
+checkdepends=('procps-ng')
+source=("https://php.net/distributions/${_pkgbase}-${pkgver}.tar.xz"{,.asc}
+ 'apache.patch' 'apache.conf' 'php-fpm.patch' 'php-fpm.tmpfiles' 'php.ini.patch'
+ )
+sha256sums=('300364d57fc4a6176ff7d52d390ee870ab6e30df121026649f8e7e0b9657fe93'
+ 'SKIP'
+ '819f05d2fd5a75c96e93c863517ca77dbd021a1224dc2d8096f758fb2937df6a'
+ 'df075b89484eb3a08402788580de16d23123f95541b2e9aed8d928105de9b874'
+ '651e3f9ba7ac337cbcf54b759f9367cdfadad1f3055d086750d45b0b20056ba7'
+ 'b6b7f3ced56b75bf95513a46f43cde41fc28da714f5e0ed181caf2266f2f0c27'
+ '2f678d039313ee613d59c8b4bf9f48068085df0fa8ac7ca4cf807e168061a8c9'
+ )
+validpgpkeys=('1A4E8B7277C42E53DBA9C7B9BCAA30EA9C0D5763'
+ '528995BFEDFBA7191D46839EF9BA0ADA31CBD89E')
+
+prepare() {
+ cd ${srcdir}/${_pkgbase}-${pkgver}
+
+ patch -p0 -i ${srcdir}/apache.patch
+ patch -p0 -i ${srcdir}/php-fpm.patch
+ patch -p0 -i ${srcdir}/php.ini.patch
+}
+
+
+build() {
+ local _phpconfig="--srcdir=../${_pkgbase}-${pkgver} \
+ --config-cache \
+ --prefix=/usr \
+ --sbindir=/usr/bin \
+ --sysconfdir=/etc/${pkgbase} \
+ --localstatedir=/var \
+ --libdir=/usr/lib/${pkgbase} \
+ --datarootdir=/usr/share/${pkgbase} \
+ --datadir=/usr/share/${pkgbase} \
+ --program-suffix=${pkgbase#php} \
+ --with-layout=GNU \
+ --with-config-file-path=/etc/${pkgbase} \
+ --with-config-file-scan-dir=/etc/${pkgbase}/conf.d \
+ --disable-rpath \
+ --without-pear \
+ "
+
+ local _phpextensions="\
+ --enable-bcmath=shared \
+ --enable-calendar=shared \
+ --enable-dba=shared \
+ --enable-exif=shared \
+ --enable-ftp=shared \
+ --enable-gd-native-ttf \
+ --enable-intl=shared \
+ --enable-mbstring \
+ --enable-shmop=shared \
+ --enable-soap=shared \
+ --enable-sockets=shared \
+ --enable-sysvmsg=shared \
+ --enable-sysvsem=shared \
+ --enable-sysvshm=shared \
+ --enable-zip=shared \
+ --with-bz2=shared \
+ --with-curl=shared \
+ --with-db4=/usr \
+ --with-enchant=shared,/usr \
+ --with-freetype-dir=/usr \
+ --with-gd=shared,/usr \
+ --with-gdbm \
+ --with-gettext=shared \
+ --with-gmp=shared \
+ --with-iconv=shared \
+ --with-imap-ssl \
+ --with-imap=shared \
+ --with-kerberos=/usr \
+ --with-ldap=shared \
+ --with-ldap-sasl \
+ --with-libzip \
+ --with-mcrypt=shared \
+ --with-mhash \
+ --with-mysql-sock=/run/mysqld/mysqld.sock \
+ --with-mysqli=shared,mysqlnd \
+ --with-openssl \
+ --with-pcre-regex=/usr \
+ --with-pdo-dblib=shared,/usr \
+ --with-pdo-mysql=shared,mysqlnd \
+ --with-pdo-odbc=shared,unixODBC,/usr \
+ --with-pdo-pgsql=shared \
+ --with-pdo-sqlite=shared,/usr \
+ --with-pgsql=shared \
+ --with-pspell=shared \
+ --with-readline \
+ --with-snmp=shared \
+ --with-sqlite3=shared,/usr \
+ --with-tidy=shared \
+ --with-unixODBC=shared,/usr \
+ --with-xmlrpc=shared \
+ --with-xsl=shared \
+ --with-zlib \
+ --enable-pcntl
+ "
+
+ EXTENSION_DIR=/usr/lib/${pkgbase}/modules
+ export EXTENSION_DIR
+
+ local _build="${srcdir}/build"
+ mkdir ${_build}
+ cd ${_build}
+ ln -s ../${_pkgbase}-${pkgver}/configure
+ ./configure ${_phpconfig} \
+ --enable-cgi \
+ --enable-fpm \
+ --with-fpm-systemd \
+ --with-fpm-acl \
+ --with-fpm-user=http \
+ --with-fpm-group=http \
+ --enable-embed=shared \
+ ${_phpextensions}
+ make
+ cd ../../
+ # apache
+ # reuse the previous run; this will save us a lot of time
+ cp -a ${_build} ${srcdir}/build-apache
+ cd ${srcdir}/build-apache
+ ./configure ${_phpconfig} \
+ --with-apxs2 \
+ ${_phpextensions}
+ make
+ cd ../../
+ # phpdbg
+ cp -a ${_build} ${srcdir}/build-phpdbg
+ cd ${srcdir}/build-phpdbg
+ ./configure ${_phpconfig} \
+ --enable-phpdbg \
+ ${_phpextensions}
+ make
+ cd ../../
+}
+
+check() {
+ cd ${srcdir}/${_pkgbase}-${pkgver}
+
+ # Check if sendmail was configured correctly (FS#47600)
+ ${srcdir}/build/sapi/cli/php -n -r 'echo ini_get("sendmail_path");' | grep -q '/usr/bin/sendmail'
+
+ export REPORT_EXIT_STATUS=1
+ export NO_INTERACTION=1
+ export SKIP_ONLINE_TESTS=1
+ export SKIP_SLOW_TESTS=1
+
+ ${srcdir}/build/sapi/cli/php -n run-tests.php -n -P {tests,Zend}
+}
+
+package_php70() {
+ pkgdesc='A general-purpose scripting language that is especially suited to web development'
+ depends=('libxml2' 'curl' 'libzip' 'pcre')
+ replaces=('php-ldap')
+ conflicts=('php-ldap')
+ provides=("${_pkgbase}=$pkgver")
+ backup=('etc/${pkgbase}/php.ini')
+
+ cd ${srcdir}/build
+ make -j1 INSTALL_ROOT=${pkgdir} install-{modules,cli,build,headers,programs,pharcmd}
+ install -D -m644 ${srcdir}/${_pkgbase}-${pkgver}/php.ini-production ${pkgdir}/etc/${pkgbase}/php.ini
+ install -d -m755 ${pkgdir}/etc/${pkgbase}/conf.d/
+
+ # remove static modules
+ rm -f ${pkgdir}/usr/lib/${pkgbase}/modules/*.a
+ # remove modules provided by sub packages
+ rm -f ${pkgdir}/usr/lib/${pkgbase}/modules/{enchant,gd,imap,intl,mcrypt,odbc,pdo_dblib,pdo_odbc,pgsql,pdo_pgsql,pspell,snmp,sqlite3,pdo_sqlite,tidy,xsl}.so
+ # remove empty directory
+ rmdir ${pkgdir}/usr/include/php/include
+
+# move include directory
+ mv ${pkgdir}/usr/include/php ${pkgdir}/usr/include/${pkgbase}
+
+# fix phar symlink
+ rm ${pkgdir}/usr/bin/phar
+ ln -sf phar.${pkgbase/php/phar} ${pkgdir}/usr/bin/${pkgbase/php/phar}
+
+ # rename executables
+ mv ${pkgdir}/usr/bin/phar.{phar,${pkgbase/php/phar}}
+
+ # rename man pages
+ mv ${pkgdir}/usr/share/man/man1/{phar,${pkgbase/php/phar}}.1
+ mv ${pkgdir}/usr/share/man/man1/phar.{phar,${pkgbase/php/phar}}.1
+
+ # fix paths in executables
+ sed -i "/^includedir=/c \includedir=/usr/include/${pkgbase}" ${pkgdir}/usr/bin/${pkgbase/php/phpize}
+ sed -i "/^include_dir=/c \include_dir=/usr/include/${pkgbase}" ${pkgdir}/usr/bin/${pkgbase/php/php-config}
+
+ # make phpize use php-config70
+ sed -i "/^\[ --with-php-config=/c \[ --with-php-config=PATH Path to php-config [${pkgbase/php/php-config}]], ${pkgbase/php/php-config}, no)" ${pkgdir}/usr/lib/${pkgbase}/build/phpize.m4
+
+}
+
+# It seems apache only allows one version
+package_php70-cgi() {
+ pkgdesc='CGI and FCGI SAPI for PHP'
+ depends=("${pkgbase}")
+ provides=("${_pkgbase}-cgi=$pkgver")
+
+ cd ${srcdir}/build
+ make -j1 INSTALL_ROOT=${pkgdir} install-cgi
+}
+
+package_php70-apache() {
+ pkgdesc='Apache SAPI for PHP'
+ depends=("${pkgbase}" 'apache')
+ backup=("etc/httpd/conf/extra/${_pkgbase}_module.conf")
+
+ install -D -m755 ${srcdir}/build-apache/libs/libphp7.so ${pkgdir}/usr/lib/httpd/modules/libphp7.so
+ install -D -m644 ${srcdir}/apache.conf ${pkgdir}/etc/httpd/conf/extra/php7_module.conf
+}
+
+package_php70-fpm() {
+ pkgdesc='FastCGI Process Manager for PHP'
+ depends=("${pkgbase}" 'systemd')
+ backup=("etc/${pkgbase}/php-fpm.conf")
+ options=('!emptydirs')
+
+ cd ${srcdir}/build
+ make -j1 INSTALL_ROOT=${pkgdir} install-fpm
+ install -D -m644 sapi/fpm/php-fpm.service ${pkgdir}/usr/lib/systemd/system/${pkgbase}-fpm.service
+ install -D -m644 ${srcdir}/../php-fpm.tmpfiles ${pkgdir}/usr/lib/tmpfiles.d/${pkgbase}-fpm.conf
+}
+
+package_php70-embed() {
+ pkgdesc='Embedded PHP SAPI library'
+ depends=("${pkgbase}")
+ provides=("${pkgbase}-embed=$pkgver")
+ options=('!emptydirs')
+
+ cd ${srcdir}/build
+ make -j1 INSTALL_ROOT=${pkgdir} PHP_SAPI=embed install-sapi
+}
+
+package_php70-phpdbg() {
+ pkgdesc='Interactive PHP debugger'
+ depends=("${pkgbase}")
+ provides=("${pkgbase}-phpdbg=$pkgver")
+ options=('!emptydirs')
+
+ cd ${srcdir}/build-phpdbg
+ make -j1 INSTALL_ROOT=${pkgdir} install-phpdbg
+}
+
+package_php70-dblib() {
+ pkgdesc='dblib module for PHP'
+ depends=("${pkgbase}")
+ provides=("${pkgbase}-dblib=$pkgver")
+
+ install -D -m755 ${srcdir}/build/modules/pdo_dblib.so ${pkgdir}/usr/lib/${pkgbase}/modules/pdo_dblib.so
+}
+
+package_php70-enchant() {
+ pkgdesc='enchant module for PHP'
+ depends=("${pkgbase}" 'enchant')
+ provides=("${pkgbase}-enchant=$pkgver")
+
+ install -D -m755 ${srcdir}/build/modules/enchant.so ${pkgdir}/usr/lib/${pkgbase}/modules/enchant.so
+}
+
+package_php70-gd() {
+ pkgdesc='gd module for PHP'
+ depends=("${pkgbase}" 'gd')
+ provides=("${pkgbase}-gd=$pkgver")
+
+ install -D -m755 ${srcdir}/build/modules/gd.so ${pkgdir}/usr/lib/${pkgbase}/modules/gd.so
+}
+
+package_php70-imap() {
+ pkgdesc='imap module for PHP'
+ depends=("${pkgbase}" 'c-client')
+ provides=("${pkgbase}-imap=$pkgver")
+
+ install -D -m755 ${srcdir}/build/modules/imap.so ${pkgdir}/usr/lib/${pkgbase}/modules/imap.so
+}
+
+package_php70-intl() {
+ pkgdesc='intl module for PHP'
+ depends=("${pkgbase}" 'icu')
+ provides=("${pkgbase}-intl=$pkgver")
+
+ install -D -m755 ${srcdir}/build/modules/intl.so ${pkgdir}/usr/lib/${pkgbase}/modules/intl.so
+}
+
+package_php70-mcrypt() {
+ pkgdesc='mcrypt module for PHP'
+ depends=("${pkgbase}" 'libmcrypt' 'libltdl')
+ provides=("${pkgbase}-mcrypt=$pkgver")
+
+ install -D -m755 ${srcdir}/build/modules/mcrypt.so ${pkgdir}/usr/lib/${pkgbase}/modules/mcrypt.so
+}
+
+package_php70-odbc() {
+ pkgdesc='ODBC modules for PHP'
+ depends=("${pkgbase}" 'unixodbc')
+ provides=("${pkgbase}-odbc=$pkgver")
+
+ install -D -m755 ${srcdir}/build/modules/odbc.so ${pkgdir}/usr/lib/${pkgbase}/modules/odbc.so
+ install -D -m755 ${srcdir}/build/modules/pdo_odbc.so ${pkgdir}/usr/lib/${pkgbase}/modules/pdo_odbc.so
+}
+
+package_php70-pgsql() {
+ pkgdesc='PostgreSQL modules for PHP'
+ depends=("${pkgbase}" 'postgresql-libs')
+ provides=("${pkgbase}-pgsql=$pkgver")
+
+ install -D -m755 ${srcdir}/build/modules/pgsql.so ${pkgdir}/usr/lib/${pkgbase}/modules/pgsql.so
+ install -D -m755 ${srcdir}/build/modules/pdo_pgsql.so ${pkgdir}/usr/lib/${pkgbase}/modules/pdo_pgsql.so
+}
+
+package_php70-pspell() {
+ pkgdesc='pspell module for PHP'
+ depends=("${pkgbase}" 'aspell')
+ provides=("${pkgbase}-pspell=$pkgver")
+
+ install -D -m755 ${srcdir}/build/modules/pspell.so ${pkgdir}/usr/lib/${pkgbase}/modules/pspell.so
+}
+
+package_php70-snmp() {
+ pkgdesc='snmp module for PHP'
+ depends=("${pkgbase}" 'net-snmp')
+ provides=("${pkgbase}-snmp=$pkgver")
+
+ install -D -m755 ${srcdir}/build/modules/snmp.so ${pkgdir}/usr/lib/${pkgbase}/modules/snmp.so
+}
+
+package_php70-sqlite() {
+ pkgdesc='sqlite module for PHP'
+ depends=("${pkgbase}" 'sqlite')
+ provides=("${pkgbase}-sqlite=$pkgver")
+
+ install -D -m755 ${srcdir}/build/modules/sqlite3.so ${pkgdir}/usr/lib/${pkgbase}/modules/sqlite3.so
+ install -D -m755 ${srcdir}/build/modules/pdo_sqlite.so ${pkgdir}/usr/lib/${pkgbase}/modules/pdo_sqlite.so
+}
+
+package_php70-tidy() {
+ pkgdesc='tidy module for PHP'
+ depends=("${pkgbase}" 'tidyhtml')
+ provides=("${pkgbase}-tidy=$pkgver")
+
+ install -D -m755 ${srcdir}/build/modules/tidy.so ${pkgdir}/usr/lib/${pkgbase}/modules/tidy.so
+}
+
+package_php70-xsl() {
+ pkgdesc='xsl module for PHP'
+ depends=("${pkgbase}" 'libxslt')
+ provides=("${pkgbase}-xsl=$pkgver")
+
+ install -D -m755 ${srcdir}/build/modules/xsl.so ${pkgdir}/usr/lib/${pkgbase}/modules/xsl.so
+} \ No newline at end of file
diff --git a/apache.conf b/apache.conf
new file mode 100644
index 00000000000..dd5acf40b58
--- /dev/null
+++ b/apache.conf
@@ -0,0 +1,13 @@
+# Required modules: dir_module, php7_module
+
+<IfModule dir_module>
+ <IfModule php7_module>
+ DirectoryIndex index.php index.html
+ <FilesMatch "\.php$">
+ SetHandler application/x-httpd-php
+ </FilesMatch>
+ <FilesMatch "\.phps$">
+ SetHandler application/x-httpd-php-source
+ </FilesMatch>
+ </IfModule>
+</IfModule> \ No newline at end of file
diff --git a/apache.patch b/apache.patch
new file mode 100644
index 00000000000..aae3e3d9ac9
--- /dev/null
+++ b/apache.patch
@@ -0,0 +1,20 @@
+--- sapi/apache2handler/config.m4.orig
++++ sapi/apache2handler/config.m4
+@@ -122,7 +122,6 @@
+ PHP_BUILD_THREAD_SAFE
+ fi
+ else
+- APACHE_THREADED_MPM=`$APXS_HTTPD -V | grep 'threaded:.*yes'`
+ if test -n "$APACHE_THREADED_MPM"; then
+ PHP_BUILD_THREAD_SAFE
+ fi
+--- configure.orig
++++ configure
+@@ -6919,7 +6919,6 @@
+
+ fi
+ else
+- APACHE_THREADED_MPM=`$APXS_HTTPD -V | grep 'threaded:.*yes'`
+ if test -n "$APACHE_THREADED_MPM"; then
+
+ enable_maintainer_zts=yes
diff --git a/generate_patches b/generate_patches
new file mode 100755
index 00000000000..d024aaeeca6
--- /dev/null
+++ b/generate_patches
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+. PKGBUILD
+
+makepkg -o --nodeps --noprepare --skipinteg
+
+pushd src/${_pkgbase}-${pkgver}
+
+sed '/APACHE_THREADED_MPM=/d' -i.orig sapi/apache2handler/config.m4 -i.orig configure
+
+sed 's/.conf.default/.conf/g' -i.orig sapi/fpm/Makefile.frag
+
+sed \
+ -e 's#run/php-fpm.pid#/run/php70-fpm/php-fpm.pid#' \
+ -e 's#^;error_log =.*#error_log = syslog#' \
+ -i.orig sapi/fpm/php-fpm.conf.in
+
+sed \
+ -e 's#^listen =.*#listen = /run/php70-fpm/php-fpm.sock#' \
+ -e 's#^;listen.owner =#listen.owner =#' \
+ -e 's#^;listen.group =#listen.group =#' \
+ -e 's#^;chdir =.*#;chdir = /srv/http#' \
+ -i.orig sapi/fpm/www.conf.in
+
+sed \
+ -e 's#^PIDFile=.*#PIDFile=/run/php70-fpm/php-fpm.pid#' \
+ -e 's#^ExecStart=.*#ExecStart=@sbindir@/php-fpm70 --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf#' \
+ -i.orig sapi/fpm/php-fpm.service.in
+
+extensions=";extension=bcmath.so\n;extension=bz2.so\n;extension=calendar.so\nextension=curl.so\n;extension=dba.so\n;extension=enchant.so\n;extension=exif.so\n;extension=ftp.so\n;extension=gd.so\n;extension=gettext.so\n;extension=gmp.so\n;extension=iconv.so\n;extension=imap.so\n;extension=intl.so\n;extension=ldap.so\n;extension=mcrypt.so\n;extension=mysqli.so\n;extension=odbc.so\n;zend_extension=opcache.so\n;extension=pdo_dblib.so\n;extension=pdo_mysql.so\n;extension=pdo_odbc.so\n;extension=pdo_pgsql.so\n;extension=pdo_sqlite.so\n;extension=pgsql.so\n;extension=pspell.so\n;extension=shmop.so\n;extension=snmp.so\n;extension=soap.so\n;extension=sockets.so\n;extension=sqlite3.so\n;extension=sysvmsg.so\n;extension=sysvsem.so\n;extension=sysvshm.so\n;extension=tidy.so\n;extension=xmlrpc.so\n;extension=xsl.so\nextension=zip.so\n"
+
+sed \
+ -r ":a;N;\$!ba;s/; Windows Extensions\n.+;?extension=php_[a-z]+\.dll\n/${extensions}/g" \
+ -i.orig php.ini-production
+sed \
+ -e 's#^; extension_dir = "\./"$#extension_dir = "/usr/lib/php70/modules/"#g' \
+ -i php.ini-production
+
+diff -u sapi/apache2handler/config.m4.orig sapi/apache2handler/config.m4 | filterdiff --clean --remove-timestamps > ../../apache.patch
+diff -u configure.orig configure | filterdiff --clean --remove-timestamps >> ../../apache.patch
+
+diff -u sapi/fpm/Makefile.frag.orig sapi/fpm/Makefile.frag | filterdiff --clean --remove-timestamps > ../../php-fpm.patch
+diff -u sapi/fpm/php-fpm.conf.in.orig sapi/fpm/php-fpm.conf.in | filterdiff --clean --remove-timestamps >> ../../php-fpm.patch
+diff -u sapi/fpm/www.conf.in.orig sapi/fpm/www.conf.in | filterdiff --clean --remove-timestamps >> ../../php-fpm.patch
+diff -u sapi/fpm/php-fpm.service.in.orig sapi/fpm/php-fpm.service.in | filterdiff --clean --remove-timestamps >> ../../php-fpm.patch
+
+diff -u php.ini-production.orig php.ini-production | filterdiff --clean --remove-timestamps > ../../php.ini.patch
+
+popd
diff --git a/php-fpm.patch b/php-fpm.patch
new file mode 100644
index 00000000000..9b4cf35ea6d
--- /dev/null
+++ b/php-fpm.patch
@@ -0,0 +1,76 @@
+--- sapi/fpm/Makefile.frag.orig
++++ sapi/fpm/Makefile.frag
+@@ -12,8 +12,8 @@
+
+ @echo "Installing PHP FPM config: $(INSTALL_ROOT)$(sysconfdir)/" && \
+ $(mkinstalldirs) $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d || :
+- @$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf.default || :
+- @$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf.default || :
++ @$(INSTALL_DATA) sapi/fpm/php-fpm.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.conf || :
++ @$(INSTALL_DATA) sapi/fpm/www.conf $(INSTALL_ROOT)$(sysconfdir)/php-fpm.d/www.conf || :
+
+ @echo "Installing PHP FPM man page: $(INSTALL_ROOT)$(mandir)/man8/"
+ @$(mkinstalldirs) $(INSTALL_ROOT)$(mandir)/man8
+--- sapi/fpm/php-fpm.conf.in.orig
++++ 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/php70-fpm/php-fpm.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 = syslog
+
+ ; syslog_facility is used to specify what type of program is logging the
+ ; message. This lets syslogd specify that messages from different facilities
+--- sapi/fpm/www.conf.in.orig
++++ sapi/fpm/www.conf.in
+@@ -33,7 +33,7 @@
+ ; (IPv6 and IPv4-mapped) on a specific port;
+ ; '/path/to/unix/socket' - to listen on a unix socket.
+ ; Note: This value is mandatory.
+-listen = 127.0.0.1:9000
++listen = /run/php70-fpm/php-fpm.sock
+
+ ; Set listen(2) backlog.
+ ; Default Value: 511 (-1 on FreeBSD and OpenBSD)
+@@ -44,8 +44,8 @@
+ ; BSD-derived systems allow connections regardless of permissions.
+ ; Default Values: user and group are set as the running user
+ ; mode is set to 0660
+-;listen.owner = @php_fpm_user@
+-;listen.group = @php_fpm_group@
++listen.owner = @php_fpm_user@
++listen.group = @php_fpm_group@
+ ;listen.mode = 0660
+ ; When POSIX Access Control Lists are supported you can set them using
+ ; these options, value is a comma separated list of user/group names.
+@@ -352,7 +352,7 @@
+ ; Chdir to this directory at the start.
+ ; Note: relative path can be used.
+ ; Default Value: current directory or / when chroot
+-;chdir = /var/www
++;chdir = /srv/http
+
+ ; Redirect worker stdout and stderr into main error log. If not set, stdout and
+ ; stderr will be redirected to /dev/null according to FastCGI specs.
+--- sapi/fpm/php-fpm.service.in.orig
++++ sapi/fpm/php-fpm.service.in
+@@ -4,8 +4,8 @@
+
+ [Service]
+ Type=@php_fpm_systemd@
+-PIDFile=@localstatedir@/run/php-fpm.pid
+-ExecStart=@sbindir@/php-fpm --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf
++PIDFile=/run/php70-fpm/php-fpm.pid
++ExecStart=@sbindir@/php-fpm70 --nodaemonize --fpm-config @sysconfdir@/php-fpm.conf
+ ExecReload=/bin/kill -USR2 $MAINPID
+
+ [Install]
diff --git a/php-fpm.tmpfiles b/php-fpm.tmpfiles
new file mode 100644
index 00000000000..a156fd41c09
--- /dev/null
+++ b/php-fpm.tmpfiles
@@ -0,0 +1 @@
+d /run/php70-fpm 755 root root \ No newline at end of file
diff --git a/php.ini.patch b/php.ini.patch
new file mode 100644
index 00000000000..66f1c0c5bd2
--- /dev/null
+++ b/php.ini.patch
@@ -0,0 +1,97 @@
+--- php.ini-production.orig
++++ php.ini-production
+@@ -718,7 +718,7 @@
+
+ ; Directory in which the loadable extensions (modules) reside.
+ ; http://php.net/extension-dir
+-; extension_dir = "./"
++extension_dir = "/usr/lib/php70/modules/"
+ ; On windows:
+ ; extension_dir = "ext"
+
+@@ -868,47 +868,44 @@
+ ; If you only provide the name of the extension, PHP will look for it in its
+ ; default extension directory.
+ ;
+-; Windows Extensions
+-; Note that ODBC support is built in, so no dll is needed for it.
+-; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+)
+-; extension folders as well as the separate PECL DLL download (PHP 5+).
+-; Be sure to appropriately set the extension_dir directive.
+-;
+-;extension=php_bz2.dll
+-;extension=php_curl.dll
+-;extension=php_fileinfo.dll
+-;extension=php_ftp.dll
+-;extension=php_gd2.dll
+-;extension=php_gettext.dll
+-;extension=php_gmp.dll
+-;extension=php_intl.dll
+-;extension=php_imap.dll
+-;extension=php_interbase.dll
+-;extension=php_ldap.dll
+-;extension=php_mbstring.dll
+-;extension=php_exif.dll ; Must be after mbstring as it depends on it
+-;extension=php_mysqli.dll
+-;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client
+-;extension=php_openssl.dll
+-;extension=php_pdo_firebird.dll
+-;extension=php_pdo_mysql.dll
+-;extension=php_pdo_oci.dll
+-;extension=php_pdo_odbc.dll
+-;extension=php_pdo_pgsql.dll
+-;extension=php_pdo_sqlite.dll
+-;extension=php_pgsql.dll
+-;extension=php_shmop.dll
+-
+-; The MIBS data available in the PHP distribution must be installed.
+-; See http://www.php.net/manual/en/snmp.installation.php
+-;extension=php_snmp.dll
+-
+-;extension=php_soap.dll
+-;extension=php_sockets.dll
+-;extension=php_sqlite3.dll
+-;extension=php_tidy.dll
+-;extension=php_xmlrpc.dll
+-;extension=php_xsl.dll
++;extension=bcmath.so
++;extension=bz2.so
++;extension=calendar.so
++extension=curl.so
++;extension=dba.so
++;extension=enchant.so
++;extension=exif.so
++;extension=ftp.so
++;extension=gd.so
++;extension=gettext.so
++;extension=gmp.so
++;extension=iconv.so
++;extension=imap.so
++;extension=intl.so
++;extension=ldap.so
++;extension=mcrypt.so
++;extension=mysqli.so
++;extension=odbc.so
++;zend_extension=opcache.so
++;extension=pdo_dblib.so
++;extension=pdo_mysql.so
++;extension=pdo_odbc.so
++;extension=pdo_pgsql.so
++;extension=pdo_sqlite.so
++;extension=pgsql.so
++;extension=pspell.so
++;extension=shmop.so
++;extension=snmp.so
++;extension=soap.so
++;extension=sockets.so
++;extension=sqlite3.so
++;extension=sysvmsg.so
++;extension=sysvsem.so
++;extension=sysvshm.so
++;extension=tidy.so
++;extension=xmlrpc.so
++;extension=xsl.so
++extension=zip.so
+
+ ;;;;;;;;;;;;;;;;;;;
+ ; Module Settings ;