mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-29 21:32:22 +01:00
434 lines
13 KiB
Plaintext
434 lines
13 KiB
Plaintext
# Contributor: Valery Kartel <valery.kartel@gmail.com>
|
|
# Maintainer: Valery Kartel <valery.kartel@gmail.com>
|
|
pkgname=php7
|
|
_pkgreal=php
|
|
pkgver=7.0.5
|
|
pkgrel=1
|
|
pkgdesc="The PHP language runtime engine - 7th branch"
|
|
url="http://www.php.net/"
|
|
arch="all"
|
|
license="PHP-3"
|
|
options="textrels"
|
|
depends="$pkgname-common"
|
|
install=
|
|
makedepends="autoconf bison re2c apache2-dev libxml2-dev libxslt-dev libzip-dev bzip2-dev zlib-dev
|
|
xmlrpc-epi-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 libmbfl-dev gsoap-dev recode-dev
|
|
readline-dev mhash-dev paxmark gettext-dev
|
|
"
|
|
|
|
subpackages="$pkgname-dev $pkgname-doc
|
|
$pkgname-apache2 $pkgname-phpdbg $pkgname-embed $pkgname-litespeed $pkgname-cgi $pkgname-fpm
|
|
$pkgname-pear
|
|
$pkgname-bcmath
|
|
$pkgname-bz2
|
|
$pkgname-calendar
|
|
$pkgname-ctype
|
|
$pkgname-curl:_curl
|
|
$pkgname-dba
|
|
$pkgname-dom
|
|
$pkgname-enchant
|
|
$pkgname-exif
|
|
$pkgname-ftp
|
|
$pkgname-gd
|
|
$pkgname-gettext
|
|
$pkgname-gmp
|
|
$pkgname-iconv
|
|
$pkgname-imap
|
|
$pkgname-intl
|
|
$pkgname-json
|
|
$pkgname-ldap
|
|
$pkgname-mbstring
|
|
$pkgname-mcrypt
|
|
$pkgname-mysqli
|
|
$pkgname-mysqlnd
|
|
$pkgname-odbc
|
|
$pkgname-opcache
|
|
$pkgname-openssl
|
|
$pkgname-pcntl
|
|
$pkgname-pdo
|
|
$pkgname-pdo_dblib
|
|
$pkgname-pdo_mysql
|
|
$pkgname-pdo_odbc
|
|
$pkgname-pdo_pgsql
|
|
$pkgname-pdo_sqlite
|
|
$pkgname-pgsql
|
|
$pkgname-phar
|
|
$pkgname-posix
|
|
$pkgname-pspell
|
|
$pkgname-readline
|
|
$pkgname-session
|
|
$pkgname-shmop
|
|
$pkgname-snmp
|
|
$pkgname-soap
|
|
$pkgname-sockets
|
|
$pkgname-sqlite3
|
|
$pkgname-sysvmsg
|
|
$pkgname-sysvsem
|
|
$pkgname-sysvshm
|
|
$pkgname-tidy
|
|
$pkgname-wddx
|
|
$pkgname-xml
|
|
$pkgname-xmlreader
|
|
$pkgname-xmlrpc
|
|
$pkgname-xsl
|
|
$pkgname-zip
|
|
$pkgname-zlib
|
|
"
|
|
subpackages="$subpackages $pkgname-common"
|
|
|
|
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-crypt.patch
|
|
"
|
|
|
|
_apiver="20151012"
|
|
_builddir="$srcdir"/$_pkgreal-$pkgver
|
|
|
|
prepare() {
|
|
cd "$_builddir"
|
|
update_config_sub
|
|
for i in $source; do
|
|
case $i in
|
|
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
|
|
esac
|
|
done
|
|
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-mhash=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-libmbfl \
|
|
--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
|
|
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
|
|
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/
|
|
mv "$pkgdir"/usr/lib/$pkgname/build \
|
|
"$subpkgdir"/usr/lib/$pkgname/
|
|
}
|
|
|
|
doc() {
|
|
default_doc
|
|
mkdir -p "$subpkgdir"/usr/share/doc/$pkgname
|
|
for file in CODING_STANDARDS CREDITS EXTENSIONS INSTALL LICENSE NEWS README* UPGRADING*; do
|
|
cp "$_builddir"/$file "$subpkgdir"/usr/share/doc/$pkgname/
|
|
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 || return 1
|
|
}
|
|
|
|
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"
|
|
mkdir -p "$subpkgdir"/etc/$pkgname "$subpkgdir"/usr
|
|
mv "$pkgdir"/var "$subpkgdir"
|
|
mkdir -p "$subpkgdir"/var/lib "$subpkgdir"/var/log/$pkgname
|
|
mv "$pkgdir"/usr/share/$pkgname/fpm "$subpkgdir"/var/lib/$pkgname
|
|
mv "$pkgdir"/usr/sbin "$subpkgdir"/usr/
|
|
mv "$pkgdir"/etc/$pkgname/php-fpm* "$subpkgdir"/etc/$pkgname
|
|
for file in php-fpm.conf php-fpm.d/www.conf; do
|
|
mv "$subpkgdir"/etc/$pkgname/$file.default \
|
|
"$subpkgdir"/etc/$pkgname/$file
|
|
done
|
|
install -D -m755 "$srcdir"/$pkgname-fpm.initd "$subpkgdir"/etc/init.d/php-fpm7
|
|
install -D -m755 "$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
|
|
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/ || return 1
|
|
}
|
|
|
|
common() {
|
|
arch="noarch"
|
|
pkgdesc="$pkgdesc (common config)"
|
|
mkdir -p "$subpkgdir"/usr
|
|
mv "$pkgdir"/usr/lib "$subpkgdir"/usr/
|
|
mv "$pkgdir"/etc "$subpkgdir"/
|
|
mkdir "$subpkgdir"/etc/$pkgname/conf.d
|
|
}
|
|
|
|
_mv_ext() {
|
|
local ext=$1
|
|
local elo=00
|
|
local prefix=
|
|
pkgdesc="PHP7 extension: $ext"
|
|
|
|
# extension dependencies and loading order
|
|
if [ -n "${2-}" ]; then
|
|
depends=$2
|
|
elo=01
|
|
fi
|
|
|
|
# extension prefix
|
|
[ "$1" = "opcache" ] && prefix="zend_"
|
|
|
|
mkdir -p "$subpkgdir"/usr/lib/$pkgname/modules "$subpkgdir"/etc/$pkgname/conf.d
|
|
mv "$pkgdir"/usr/lib/$pkgname/modules/${ext}.so \
|
|
"$subpkgdir"/usr/lib/$pkgname/modules/ || return 1
|
|
echo "${prefix}extension=${ext}.so" > "$subpkgdir"/etc/$pkgname/conf.d/${elo}_${ext}.ini
|
|
}
|
|
|
|
bcmath() { _mv_ext bcmath; }
|
|
bz2() { _mv_ext bz2; }
|
|
calendar() { _mv_ext calendar; }
|
|
ctype() { _mv_ext ctype; }
|
|
_curl() { _mv_ext curl; }
|
|
dba() { _mv_ext dba; }
|
|
dom() { _mv_ext dom $pkgname-xml; }
|
|
enchant() { _mv_ext enchant; }
|
|
exif() { _mv_ext exif; }
|
|
ftp() { _mv_ext ftp; }
|
|
gd() { _mv_ext gd; }
|
|
gettext() { _mv_ext gettext; }
|
|
gmp() { _mv_ext gmp; }
|
|
iconv() { _mv_ext iconv; }
|
|
imap() { _mv_ext imap; }
|
|
intl() { _mv_ext intl; }
|
|
json() { _mv_ext json; }
|
|
ldap() { _mv_ext ldap; }
|
|
mbstring() { _mv_ext mbstring; }
|
|
mcrypt() { _mv_ext mcrypt; }
|
|
mysqli() { _mv_ext mysqli; }
|
|
mysqlnd() { _mv_ext mysqlnd $pkgname-mysqli; }
|
|
odbc() { _mv_ext odbc; }
|
|
opcache() { _mv_ext opcache; }
|
|
openssl() { _mv_ext openssl; }
|
|
pcntl() { _mv_ext pcntl; }
|
|
pdo() { _mv_ext pdo; }
|
|
pdo_dblib() { _mv_ext pdo_dblib $pkgname-pdo; }
|
|
pdo_mysql() { _mv_ext pdo_mysql $pkgname-pdo; }
|
|
pdo_odbc() { _mv_ext pdo_odbc $pkgname-pdo; }
|
|
pdo_pgsql() { _mv_ext pdo_pgsql $pkgname-pdo; }
|
|
pdo_sqlite() { _mv_ext pdo_sqlite $pkgname-pdo; }
|
|
pgsql() { _mv_ext pgsql; }
|
|
phar() {
|
|
_mv_ext phar $pkgname
|
|
mkdir -p "$subpkgdir"/usr/bin
|
|
mv "$pkgdir"/usr/bin/phar* "$subpkgdir"/usr/bin/
|
|
}
|
|
posix() { _mv_ext posix; }
|
|
pspell() { _mv_ext pspell; }
|
|
readline() { _mv_ext readline; }
|
|
session() { _mv_ext session; }
|
|
shmop() { _mv_ext shmop; }
|
|
snmp() { _mv_ext snmp; }
|
|
soap() { _mv_ext soap $pkgname-xml; }
|
|
sockets() { _mv_ext sockets; }
|
|
sqlite3() { _mv_ext sqlite3; }
|
|
sysvmsg() { _mv_ext sysvmsg; }
|
|
sysvsem() { _mv_ext sysvsem; }
|
|
sysvshm() { _mv_ext sysvshm; }
|
|
tidy() { _mv_ext tidy; }
|
|
wddx() { _mv_ext wddx $pkgname-xml; }
|
|
xml() { _mv_ext xml; }
|
|
xmlreader() { _mv_ext xmlreader $pkgname-dom; }
|
|
xmlrpc() { _mv_ext xmlrpc $pkgname-xml; }
|
|
xsl() { _mv_ext xsl $pkgname-dom; }
|
|
zip() { _mv_ext zip; }
|
|
zlib() { _mv_ext zlib; }
|
|
|
|
md5sums="b15e6836babcbf0aa446678ee38f896b php-7.0.5.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
|
|
7f12fabdd1494e1c994cadd167e401d8 fix-crypt.patch"
|
|
sha256sums="2c09af7fe64537ea795f098b9b542ead407ef83f7cdc65b3787115ccbbb51de9 php-7.0.5.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
|
|
ffc10d325be398a5560fe9265e89f056ef2eba27981c98300be30bbc2f18a4ec fix-crypt.patch"
|
|
sha512sums="13d6dcd339211b22761586f2804c7470634e00b36e5e0b7bcf5188c017f950cbf49a2d4dd41047a7d44c70ed9474097a7290fc84ee3c26532e2ad8a2cbe706d7 php-7.0.5.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
|
|
b4badb1850bf99210498d6e27136ee275379b5c39c52904b292aed204d5c95a845ed53db7dd56856121b3019ffefc7632419f9b2c45f431165ec0b5c5cbe974d fix-crypt.patch"
|