mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-03 19:57:14 +08:00
343 lines
9.5 KiB
Bash
343 lines
9.5 KiB
Bash
# Contribution from Arch: Pierre Schmitz <pierre@archlinux.de>
|
|
|
|
pkgbase=php
|
|
pkgname=('php'
|
|
'php-cgi'
|
|
'php-apache'
|
|
'php-fpm'
|
|
'php-embed'
|
|
'php-phpdbg'
|
|
'php-dblib'
|
|
'php-enchant'
|
|
'php-gd'
|
|
'php-imap'
|
|
'php-intl'
|
|
'php-mcrypt'
|
|
'php-odbc'
|
|
'php-pgsql'
|
|
'php-pspell'
|
|
'php-snmp'
|
|
'php-sqlite'
|
|
'php-tidy'
|
|
'php-xsl')
|
|
pkgver=7.1.13
|
|
pkgrel=1
|
|
arch=('x86_64')
|
|
license=('PHP')
|
|
url='http://www.php.net'
|
|
makedepends=('apache' 'aspell' 'imap' 'db' 'enchant' 'gd' 'gmp' 'icu' 'libmcrypt' 'libxpm' 'libxslt' 'libzip' 'net-snmp'
|
|
'postgresql-libs' 'sqlite3' 'systemd' 'tidyhtml' 'unixodbc' 'curl' 'libtool' 'postfix' 'freetds' 'pcre')
|
|
checkdepends=('procps-ng')
|
|
source=("https://php.net/distributions/${pkgbase}-${pkgver}.tar.xz"{,.asc}
|
|
'apache.conf'
|
|
'apache.patch'
|
|
'php-fpm.patch'
|
|
'php-fpm.tmpfiles'
|
|
'php.ini.patch')
|
|
sha256sums=('1a0b3f2fb61959b57a3ee01793a77ed3f19bde5aa90c43dcacc85ea32f64fc10'
|
|
'SKIP'
|
|
'8b5b15f1c348d8897d837ea9894157d9630dc542bbb0dbc7ad93c5dc0235d1d5'
|
|
'258b33b6531b1128d9804c8b608b6013423a421edcf764747042d07e79ec6df3'
|
|
'7d982a3cefb3eaec0b3458340e4991c2959c10d1518ecb7c1d041884b14efc73'
|
|
'640dba0d960bfeaae9ad38d2826d3f6b5d6c175a4d3e16664eefff29141faad5'
|
|
'78f60b1d9f3a0ef8af77208feed76e303b3a13e93b80613c1e5a729004a5343c')
|
|
validpgpkeys=('A917B1ECDA84AEC2B568FED6F50ABC807BD5DCD0'
|
|
'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
|
|
|
|
# Just because our Apache 2.4 is configured with a threaded MPM by default does not mean we want to build a ZTS PHP.
|
|
# Let's supress this behaviour and build a SAPI that works fine with the prefork MPM.
|
|
sed '/APACHE_THREADED_MPM=/d' -i sapi/apache2handler/config.m4 -i configure
|
|
}
|
|
|
|
build() {
|
|
local _phpconfig="--srcdir=../${pkgbase}-${pkgver} \
|
|
--config-cache \
|
|
--prefix=/usr \
|
|
--sbindir=/usr/bin \
|
|
--sysconfdir=/etc/php \
|
|
--localstatedir=/var \
|
|
--with-layout=GNU \
|
|
--with-config-file-path=/etc/php \
|
|
--with-config-file-scan-dir=/etc/php/conf.d \
|
|
--disable-rpath \
|
|
--mandir=/usr/share/man \
|
|
--without-pear \
|
|
--enable-zend-signals \
|
|
"
|
|
|
|
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=shared \
|
|
--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/php/modules
|
|
export EXTENSION_DIR
|
|
|
|
[ -d build ] && rm -r build
|
|
mkdir ${srcdir}/build
|
|
cd ${srcdir}/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
|
|
|
|
# apache
|
|
# reuse the previous run; this will save us a lot of time
|
|
cp -a ${srcdir}/build ${srcdir}/build-apache
|
|
cd ${srcdir}/build-apache
|
|
./configure ${_phpconfig} \
|
|
--with-apxs2 \
|
|
${_phpextensions}
|
|
make
|
|
|
|
# phpdbg
|
|
cp -a ${srcdir}/build ${srcdir}/build-phpdbg
|
|
cd ${srcdir}/build-phpdbg
|
|
./configure ${_phpconfig} \
|
|
--enable-phpdbg \
|
|
${_phpextensions}
|
|
make
|
|
}
|
|
|
|
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_php() {
|
|
pkgdesc='A general-purpose scripting language that is especially suited to web development'
|
|
depends=('pcre' 'libxml2' 'curl' 'libzip' 'pcre')
|
|
replaces=('php-ldap' 'php-mssql' 'php-pear')
|
|
conflicts=('php-ldap' 'php-mssql' 'php-pear')
|
|
provides=("php-ldap=${pkgver}")
|
|
backup=('etc/php/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/php/php.ini
|
|
install -d -m755 ${pkgdir}/etc/php/conf.d/
|
|
|
|
# remove static modules
|
|
rm -f ${pkgdir}/usr/lib/php/modules/*.a
|
|
# remove modules provided by sub packages
|
|
rm -f ${pkgdir}/usr/lib/php/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
|
|
}
|
|
|
|
package_php-cgi() {
|
|
pkgdesc='CGI and FCGI SAPI for PHP'
|
|
depends=('php')
|
|
|
|
cd ${srcdir}/build
|
|
make -j1 INSTALL_ROOT=${pkgdir} install-cgi
|
|
}
|
|
|
|
package_php-apache() {
|
|
pkgdesc='Apache SAPI for PHP'
|
|
depends=('php' 'apache')
|
|
backup=('etc/httpd/conf/extra/php7_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_php-fpm() {
|
|
pkgdesc='FastCGI Process Manager for PHP'
|
|
depends=('php' 'systemd')
|
|
backup=('etc/php/php-fpm.conf' 'etc/php/php-fpm.d/www.conf')
|
|
install='php-fpm.install'
|
|
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/php-fpm.service
|
|
install -D -m644 ${srcdir}/php-fpm.tmpfiles ${pkgdir}/usr/lib/tmpfiles.d/php-fpm.conf
|
|
}
|
|
|
|
package_php-embed() {
|
|
pkgdesc='Embedded PHP SAPI library'
|
|
depends=('php' 'systemd')
|
|
options=('!emptydirs')
|
|
|
|
cd ${srcdir}/build
|
|
make -j1 INSTALL_ROOT=${pkgdir} PHP_SAPI=embed install-sapi
|
|
}
|
|
|
|
package_php-phpdbg() {
|
|
pkgdesc='Interactive PHP debugger'
|
|
depends=('php')
|
|
options=('!emptydirs')
|
|
|
|
cd ${srcdir}/build-phpdbg
|
|
make -j1 INSTALL_ROOT=${pkgdir} install-phpdbg
|
|
}
|
|
|
|
package_php-dblib() {
|
|
pkgdesc='dblib module for PHP'
|
|
depends=('php' 'freetds')
|
|
|
|
install -D -m755 ${srcdir}/build/modules/pdo_dblib.so ${pkgdir}/usr/lib/php/modules/pdo_dblib.so
|
|
}
|
|
|
|
package_php-enchant() {
|
|
pkgdesc='enchant module for PHP'
|
|
depends=('php' 'enchant')
|
|
|
|
install -D -m755 ${srcdir}/build/modules/enchant.so ${pkgdir}/usr/lib/php/modules/enchant.so
|
|
}
|
|
|
|
package_php-gd() {
|
|
pkgdesc='gd module for PHP'
|
|
depends=('php' 'gd' 'libxpm')
|
|
|
|
install -D -m755 ${srcdir}/build/modules/gd.so ${pkgdir}/usr/lib/php/modules/gd.so
|
|
}
|
|
|
|
package_php-imap() {
|
|
pkgdesc='imap module for PHP'
|
|
depends=('php' 'imap')
|
|
|
|
install -D -m755 ${srcdir}/build/modules/imap.so ${pkgdir}/usr/lib/php/modules/imap.so
|
|
}
|
|
|
|
package_php-intl() {
|
|
pkgdesc='intl module for PHP'
|
|
depends=('php' 'icu')
|
|
|
|
install -D -m755 ${srcdir}/build/modules/intl.so ${pkgdir}/usr/lib/php/modules/intl.so
|
|
}
|
|
|
|
package_php-mcrypt() {
|
|
pkgdesc='mcrypt module for PHP'
|
|
depends=('php' 'libmcrypt' 'libtool')
|
|
|
|
install -D -m755 ${srcdir}/build/modules/mcrypt.so ${pkgdir}/usr/lib/php/modules/mcrypt.so
|
|
}
|
|
|
|
package_php-odbc() {
|
|
pkgdesc='ODBC modules for PHP'
|
|
depends=('php' 'unixodbc')
|
|
|
|
install -D -m755 ${srcdir}/build/modules/odbc.so ${pkgdir}/usr/lib/php/modules/odbc.so
|
|
install -D -m755 ${srcdir}/build/modules/pdo_odbc.so ${pkgdir}/usr/lib/php/modules/pdo_odbc.so
|
|
}
|
|
|
|
package_php-pgsql() {
|
|
pkgdesc='PostgreSQL modules for PHP'
|
|
depends=('php' 'postgresql-libs')
|
|
|
|
install -D -m755 ${srcdir}/build/modules/pgsql.so ${pkgdir}/usr/lib/php/modules/pgsql.so
|
|
install -D -m755 ${srcdir}/build/modules/pdo_pgsql.so ${pkgdir}/usr/lib/php/modules/pdo_pgsql.so
|
|
}
|
|
|
|
package_php-pspell() {
|
|
pkgdesc='pspell module for PHP'
|
|
depends=('php' 'aspell')
|
|
|
|
install -D -m755 ${srcdir}/build/modules/pspell.so ${pkgdir}/usr/lib/php/modules/pspell.so
|
|
}
|
|
|
|
package_php-snmp() {
|
|
pkgdesc='snmp module for PHP'
|
|
depends=('php' 'net-snmp')
|
|
|
|
install -D -m755 ${srcdir}/build/modules/snmp.so ${pkgdir}/usr/lib/php/modules/snmp.so
|
|
}
|
|
|
|
package_php-sqlite() {
|
|
pkgdesc='sqlite3 module for PHP'
|
|
depends=('php' 'sqlite3')
|
|
|
|
install -D -m755 ${srcdir}/build/modules/sqlite3.so ${pkgdir}/usr/lib/php/modules/sqlite3.so
|
|
install -D -m755 ${srcdir}/build/modules/pdo_sqlite.so ${pkgdir}/usr/lib/php/modules/pdo_sqlite.so
|
|
}
|
|
|
|
package_php-tidy() {
|
|
pkgdesc='tidy module for PHP'
|
|
depends=('php' 'tidyhtml')
|
|
|
|
install -D -m755 ${srcdir}/build/modules/tidy.so ${pkgdir}/usr/lib/php/modules/tidy.so
|
|
}
|
|
|
|
package_php-xsl() {
|
|
pkgdesc='xsl module for PHP'
|
|
depends=('php' 'libxslt')
|
|
|
|
install -D -m755 ${srcdir}/build/modules/xsl.so ${pkgdir}/usr/lib/php/modules/xsl.so
|
|
}
|