aboutsummaryrefslogtreecommitdiffstats
path: root/testing/php7.1/APKBUILD
diff options
context:
space:
mode:
authorValery Kartel <valery.kartel@gmail.com>2017-02-13 23:43:29 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2017-02-14 19:02:29 +0000
commit15e434419f5b0896610dcf7d30b36044b9faf88f (patch)
treeb77d70aed5860d6212652cf81d06aad8b40bc35b /testing/php7.1/APKBUILD
parentf9076aa05a5d999a832ea135e0dec918d8b32cc2 (diff)
downloadaports-15e434419f5b0896610dcf7d30b36044b9faf88f.tar.bz2
aports-15e434419f5b0896610dcf7d30b36044b9faf88f.tar.xz
testing/php7.1: new aport
The PHP7.1 language runtime engine http://php.net/
Diffstat (limited to 'testing/php7.1/APKBUILD')
-rw-r--r--testing/php7.1/APKBUILD419
1 files changed, 419 insertions, 0 deletions
diff --git a/testing/php7.1/APKBUILD b/testing/php7.1/APKBUILD
new file mode 100644
index 0000000000..fbdff9392a
--- /dev/null
+++ b/testing/php7.1/APKBUILD
@@ -0,0 +1,419 @@
+# Contributor: Valery Kartel <valery.kartel@gmail.com>
+# Maintainer: Valery Kartel <valery.kartel@gmail.com>
+_suffix=7.1
+_pkgreal=php
+provides=$_pkgreal
+replaces=$provides
+pkgname=$_pkgreal$_suffix
+pkgver=7.1.1
+pkgrel=0
+_apiver="20160303"
+pkgdesc="The PHP${pkgver%.*} language runtime engine"
+url="http://www.php.net/"
+arch="all"
+license="PHP-3"
+options=""
+depends="$pkgname-config"
+depends_dev="$pkgname"
+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
+ libedit-dev gettext-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
+ install-pear.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
+ "
+for _extension in $_extensions; do
+ [ -z "${_extension##*:*}" ] && eval _index_${_extension%:*}=${_extension#*:}
+ subpackages="$subpackages $pkgname-${_extension%:*}:_extension"
+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"
+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
+
+ 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"
+ error "After updating _apiver, all 3rd-party extensions must be rebuilt"
+ return 1
+ fi
+
+ autoconf
+}
+
+_build() {
+ export EXTENSION_DIR=/usr/lib/$pkgname/modules
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --program-suffix=$_suffix \
+ --libdir=/usr/lib/$pkgname \
+ --datadir=/usr/share/$pkgname \
+ --sysconfdir=/etc/$pkgname \
+ --localstatedir=/var \
+ --with-layout=GNU \
+ --with-pic \
+ --with-pear=/usr/share/pear \
+ --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 --disable-gd-jis-conv \
+ --with-gettext=shared \
+ --with-gmp=shared \
+ --with-iconv=shared \
+ --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 \
+ --without-readline \
+ --with-libedit \
+ --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 \
+ --enable-xmlwriter=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
+ make || return 1
+}
+
+build() {
+ cd "$builddir"
+ # build phpdbg
+ _build --enable-phpdbg \
+ --enable-phpdbg-webhelper \
+ --disable-cgi \
+ --disable-cli \
+ || return 1
+ # build apache2 module + recode extension
+ _build --disable-phpdbg \
+ --disable-cgi \
+ --disable-cli \
+ --with-apxs2 \
+ --with-recode=shared \
+ || return 1
+ mv libs/lib$_pkgreal*.so sapi/apache2handler/
+ # build all other + imap extension
+ _build --disable-phpdbg \
+ --enable-fpm \
+ --enable-embed \
+ --with-litespeed \
+ --with-imap=shared --with-imap-ssl \
+ || return 1
+}
+
+package() {
+ pkgdesc="$pkgdesc (command line interface)"
+
+ cd "$builddir"
+ make -j1 INSTALL_ROOT="$pkgdir" install || return 1
+
+ ln -sf /usr/bin/php$_suffix "$pkgdir"/usr/bin/php
+
+ rm -fr "$pkgdir"/.[[:alpha:]]* || return 1
+}
+
+dev() {
+ provides=$_pkgreal-dev
+ replaces=$provides
+ default_dev
+
+ mkdir -p "$subpkgdir"/usr/bin \
+ "$subpkgdir"/usr/lib/$pkgname
+
+ local file
+ for file in php-config phpize; do
+ mv "$pkgdir"/usr/bin/$file$_suffix \
+ "$subpkgdir"/usr/bin/ || return 1
+ ln -sf /usr/bin/$file$_suffix "$subpkgdir"/usr/bin/$file
+ done
+
+ mv "$pkgdir"/usr/lib/$pkgname/build "$subpkgdir"/usr/lib/$pkgname/
+}
+
+doc() {
+ provides=$_pkgreal-doc
+ replaces=
+ default_doc
+ install_if="docs $pkgname-config=$pkgver-r$pkgrel"
+
+ cd "$builddir"
+ local file
+ for file in $(ls CODING_STANDARDS CREDITS EXTENSIONS INSTALL LICENSE NEWS README* UPGRADING*); do
+ install -Dm644 $file "$subpkgdir"/usr/share/doc/$pkgname/$file || return 1
+ done
+}
+
+apache2() {
+ provides=$_pkgreal-apache2
+ replaces=
+ pkgdesc="$pkgdesc (apache2 module)"
+ depends="$pkgname-config apache2"
+
+ mkdir -p "$subpkgdir"/usr/lib/apache2
+ cp "$builddir"/sapi/apache2handler/lib$_pkgreal*.so \
+ "$subpkgdir"/usr/lib/apache2/mod_$pkgname.so || return 1
+
+ install -D -m644 "$builddir"/$_pkgreal-module.conf \
+ "$subpkgdir"/etc/apache2/conf.d/$pkgname-module.conf
+}
+
+phpdbg() {
+ provides=$_pkgreal-phpdbg
+ replaces=$provides
+ pkgdesc="$pkgdesc (interactive debugger)"
+ depends="$pkgname-config"
+
+ install -Dm755 "$builddir"/sapi/phpdbg/phpdbg \
+ "$subpkgdir"/usr/bin/phpdbg$_suffix || return 1
+ ln -sf /usr/bin/phpdbg$_suffix "$subpkgdir"/usr/bin/phpdbg
+}
+
+libs() {
+ provides=$_pkgreal-libs
+ replaces=
+ pkgdesc="$pkgdesc (embedded library)"
+ depends="$pkgname-config"
+
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/lib$_pkgreal*.so \
+ "$subpkgdir"/usr/lib/lib$pkgname.so || return 1
+}
+
+litespeed() {
+ provides=$_pkgreal-litespeed
+ replaces=$provides
+ pkgdesc="$pkgdesc (litespeed)"
+ depends="$pkgname-config"
+
+ mkdir -p "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/bin/lsphp \
+ "$subpkgdir"/usr/bin/lsphp$_suffix || return 1
+ ln -sf /usr/bin/lsphp$_suffix "$subpkgdir"/usr/bin/lsphp
+}
+
+cgi() {
+ provides=$_pkgreal-cgi
+ replaces=$provides
+ pkgdesc="$pkgdesc (common gateway interface)"
+ depends="$pkgname-config"
+
+ mkdir -p "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/bin/php-cgi$_suffix \
+ "$subpkgdir"/usr/bin/ || return 1
+ ln -sf /usr/bin/php-cgi$_suffix "$subpkgdir"/usr/bin/php-cgi
+}
+
+fpm() {
+ provides=$_pkgreal-fpm
+ replaces=
+ pkgdesc="$pkgdesc (fastcgi process manager)"
+ depends="$pkgname-config"
+
+ mkdir -p "$subpkgdir"/usr/share \
+ "$subpkgdir"/etc/$pkgname \
+ "$subpkgdir"/var/log/$pkgname
+
+ mv "$pkgdir"/usr/sbin "$subpkgdir"/usr/ || return 1
+ mv "$pkgdir"/usr/share/$pkgname \
+ "$subpkgdir"/usr/share/ || 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 "$builddir"/$_pkgreal-fpm.initd \
+ "$subpkgdir"/etc/init.d/$_pkgreal-fpm$_suffix || return 1
+ install -D -m644 "$builddir"/$_pkgreal-fpm.logrotate \
+ "$subpkgdir"/etc/logrotate.d/$_pkgreal-fpm$_suffix || return 1
+}
+
+pear() {
+ provides=$_pkgreal-pear
+ replaces=$provides
+ pkgdesc="$pkgdesc (extension and application repository)"
+ depends="$pkgname $pkgname-xml"
+
+ mkdir -p "$subpkgdir"/usr/bin \
+ "$subpkgdir"/etc/$pkgname
+
+ mv "$pkgdir"/usr/bin/pecl \
+ "$pkgdir"/usr/bin/pear \
+ "$pkgdir"/usr/bin/peardev \
+ "$subpkgdir"/usr/bin/ || return 1
+
+ mv "$pkgdir"/etc/$pkgname/pear.conf \
+ "$subpkgdir"/etc/$pkgname/ || return 1
+
+ mv "$pkgdir"/usr/share \
+ "$subpkgdir"/usr/ || return 1
+}
+
+config() {
+ provides="php-$_apiver"
+ replaces=
+ depends=
+ pkgdesc="$pkgdesc (common config)"
+
+ mkdir -p "$subpkgdir"/etc/$pkgname/conf.d
+
+ install -Dm644 "$builddir"/php.ini-production \
+ "$subpkgdir"/etc/$pkgname/php.ini || return 1
+
+ # exit with an error if some modules were not in subpackages
+ rmdir "$pkgdir"/usr/lib/$pkgname/modules || return 1
+
+ rm -fr "$pkgdir"/etc "$pkgdir"/var "$pkgdir"/usr/lib
+}
+
+_phar() {
+ provides=$_pkgreal-phar-phar
+ replaces=$provides
+ pkgdesc="$pkgdesc (archive script)"
+ depends="$pkgname $pkgname-phar"
+
+ mkdir -p "$subpkgdir"/usr/bin
+
+ mv "$pkgdir"/usr/bin/phar* \
+ "$subpkgdir"/usr/bin/ || return 1
+}
+
+_extension() {
+ provides=
+ replaces=
+ depends=
+
+ local name=${subpkgname#$pkgname-}
+ local index=$(eval echo \$_index_$name)
+
+ pkgdesc=$(eval echo \$_pkgdesc_$name)
+ : ${pkgdesc:=$(head -n1 "$builddir"/ext/$name/CREDITS)}
+ pkgdesc="PHP${pkgver%.*} extension: ${pkgdesc:-$name}"
+
+ local dep
+ for dep in $(grep -o "_DEP('$name'.*" "$builddir"/ext/$name/config.w32 | sed "s/[',);]//g"); do
+ [ -z "${_extensions##*$dep*}" ] && depends="$depends $pkgname-$dep"
+ done
+
+ : ${index:=$(echo $depends | wc -w)}
+ depends="$pkgname-config $depends"
+
+ mkdir -p "$subpkgdir"/usr/lib/$pkgname/modules \
+ "$subpkgdir"/etc/$pkgname/conf.d
+
+ mv "$pkgdir"/usr/lib/$pkgname/modules/$name.so \
+ "$subpkgdir"/usr/lib/$pkgname/modules/ || return 1
+
+ echo $(eval echo \$_prefix_$name)extension=$name.so > \
+ "$subpkgdir"/etc/$pkgname/conf.d/$(printf %02d $index)_$name.ini
+}
+
+md5sums="cd5b7dfc4bcf99fe11cae7917e9453e1 php-7.1.1.tar.bz2
+95d27e9f8f62f91531fc2c76af9065d0 php-module.conf.in
+ad13602a44d28092abc5681778f82b31 php-fpm.logrotate.in
+f5e8b469983f851d7665e32a9d529bbf php-fpm.initd.in
+d088f00c226840bf7234c465de4118bb php-fpm.patch.in
+c32f5ba7412548e5b233319ab32b6e50 includedir.patch.in
+483bc0a85c50a9a9aedbe14a19ed4526 install-pear.patch"
+sha256sums="d791d39d7b54ec42441a05a5f06d68a495647d843210e3ae4f2c6adb99c675bc php-7.1.1.tar.bz2
+c197232950e8d60f87bb8bbd231445737c2efc3ff1b907a70fe43db7a0a1c0f3 php-module.conf.in
+606741a9ec11ff2162d1dd4fe469fb0c1b66ee33ba302f0aac4cb6f0be2f8ae0 php-fpm.logrotate.in
+cdc24d2e2e0e74ef7b8823ec8e058128dedcf9298f1e57c0450f3590137e1148 php-fpm.initd.in
+110928a5d3f15f6826d8be0a97b393e7e6676acb57c2e1eac32b80dafb3b7a6f php-fpm.patch.in
+dff44c133f5023b03f8771dd826ce7ad529fb996a84a933a82cf4c4f71e86b94 includedir.patch.in
+f739ca427a1dd53a388bad0823565299c5d4a5796b1171b892884e4d7d099bab install-pear.patch"
+sha512sums="005471c0233e04fd95e159f8106ecfb059500076482cd49b26d2597ac390f4fa09ec14146058cdcd38e7d27665ac1d2afdc758f41b86e7fb88c8ba405b6e6415 php-7.1.1.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
+f1177cbf6b1f44402f421c3d317aab1a2a40d0b1209c11519c1158df337c8945f3a313d689c939768584f3e4edbe52e8bd6103fb6777462326a9d94e8ab1f505 install-pear.patch"