diff options
Diffstat (limited to 'abs/core/php/PKGBUILD')
-rw-r--r-- | abs/core/php/PKGBUILD | 472 |
1 files changed, 316 insertions, 156 deletions
diff --git a/abs/core/php/PKGBUILD b/abs/core/php/PKGBUILD index 394f495..19e1b66 100644 --- a/abs/core/php/PKGBUILD +++ b/abs/core/php/PKGBUILD @@ -1,187 +1,347 @@ +# $Id: PKGBUILD 163752 2012-07-19 05:20:23Z pierre $ +# Maintainer: Pierre Schmitz <pierre@archlinux.de> + pkgbase=php -pkgname=('php' 'php-cgi' 'php-pear') -pkgver=5.3.3 -pkgrel=8 -_suhosinver=${pkgver}-0.9.10 -pkgdesc='A high-level scripting language' +pkgname=('php' + 'php-cgi' + 'php-apache' + 'php-fpm' + 'php-embed' + 'php-pear' + 'php-enchant' + 'php-gd' + 'php-intl' + 'php-ldap' + 'php-mcrypt' + 'php-mssql' + 'php-odbc' + 'php-pgsql' + 'php-pspell' + 'php-snmp' + 'php-sqlite' + 'php-tidy' + 'php-xsl') +pkgver=5.4.5 +pkgrel=1 arch=('i686' 'x86_64') license=('PHP') url='http://www.php.net' -backup=('etc/php/php.ini') -install=php.install -depends=('glibc' 'readline' 'ncurses' 'libxml2' 'pcre') -#makedepends=('apache' 'imap' 'postgresql-libs' 'mysql' 'libldap' \ -# 'libpng' 'libjpeg' 'sqlite3' 'unixodbc' 'net-snmp' \ -# 'libmcrypt' 'tidyhtml' 'aspell' 'libtool' 'freetype2' 'libjpeg' \ -# 'curl' 'libxslt' 'pam' 'openssl' 'bzip2' 'gdbm' 'db>=4.7') - -makedepends=('mysql' 'libpng' 'libjpeg' 'sqlite3' 'libmcrypt' 'libtool' \ - 'freetype2' 'libjpeg' 'curl' 'libxslt' 'pam' 'openssl' 'bzip2' \ - 'gdbm' 'db>=4.8.26') -options=('emptydirs') -source=("http://museum.php.net/php5/${pkgname}-${pkgver}.tar.bz2" \ - "http://download.suhosin.org/suhosin-patch-${_suhosinver}.patch.gz" \ - 'php.ini' 'apache.conf') +makedepends=('apache' 'imap' 'postgresql-libs' 'libldap' 'postfix' 'libvpx' + 'sqlite' 'unixodbc' 'net-snmp' 'libzip' 'enchant' 'file' 'freetds' + 'libmcrypt' 'tidyhtml' 'aspell' 'libltdl' 'libpng' 'libjpeg' 'icu' + 'curl' 'libxslt' 'openssl' 'bzip2' 'db' 'gmp' 'freetype2') +source=("http://www.php.net/distributions/${pkgbase}-${pkgver}.tar.bz2" + 'php.ini.patch' 'apache.conf' 'rc.d.php-fpm' 'php-fpm.conf.in.patch' + 'logrotate.d.php-fpm' 'php-fpm.service' 'php-fpm.tmpfiles') +md5sums=('ffcc7f4dcf2b79d667fe0c110e6cb724' + '0b0bc7a917fc592bdf11dcd3c5c255e9' + 'dec2cbaad64e3abf4f0ec70e1de4e8e9' + '6d46667e00d65933ec0c958279c0a803' + '825e580dd5708d959b50944afa1b12b6' + 'f56b5bb7e93c802ae8519182fbea3387' + '86c73d481f3099e740e602869bacf637' + 'c60343df74f8e1afb13b084d5c0e47ed') build() { - phpconfig="--srcdir=${srcdir}/${pkgbase}-${pkgver} \ - --prefix=/usr \ - --sysconfdir=/etc/php \ - --with-layout=GNU \ - --with-config-file-path=/etc/php \ - --with-config-file-scan-dir=/etc/php/conf.d \ - --enable-inline-optimization \ - --disable-debug \ - --disable-rpath \ - --disable-static \ - --enable-shared \ - --mandir=/usr/share/man \ - --without-pear \ - " - - phpextensions="--with-openssl=shared \ - --with-zlib=shared \ - --enable-bcmath=shared \ - --with-bz2=shared \ - --enable-calendar=shared \ - --with-curl=shared \ - --enable-dba=shared \ - --without-db2 \ - --without-db3 \ - --with-db4=shared \ - --with-gdbm=shared \ - --enable-exif=shared \ - --enable-ftp=shared \ - --with-gd=shared \ - --enable-gd-native-ttf \ - --with-jpeg-dir=shared,/usr \ - --with-png-dir=shared,/usr \ - --with-gettext=shared \ - --without-imap \ - --without-imap-ssl \ - --without-ldap \ - --enable-mbstring=shared \ - --with-mcrypt=shared \ - --with-mysql=shared \ - --with-mysql-sock=/tmp/mysql.sock \ - --with-mysql=shared \ - --with-mysqli=shared \ - --without-unixODBC \ - --enable-pdo=shared \ - --with-pdo-mysql=shared \ - --with-pdo-sqlite=shared \ - --without-pdo-odbc \ - --without-pdo-pgsql \ - --with-sqlite=shared \ - --without-pgsql \ - --enable-shmop=shared \ - --without-snmp \ - --enable-soap=shared \ - --enable-sqlite-utf8=shared \ - --enable-sysvmsg=shared \ - --enable-sysvsem=shared \ - --enable-sysvshm=shared \ - --without-tidy \ - --with-xsl=shared \ - --enable-zip=shared \ - --enable-posix=shared \ - --enable-sockets=shared \ - --enable-xml \ - --enable-session=shared \ - --with-regex=php \ - --with-pcre-regex=/usr \ - --enable-mbstring=all \ - --enable-mbregex \ - --enable-json=shared \ - --with-iconv=shared \ - --with-xmlrpc=shared \ - --without-pspell \ - --with-freetype-dir=shared,/usr \ - " - EXTENSION_DIR=/usr/lib/php/modules - export EXTENSION_DIR - PEAR_INSTALLDIR=/usr/share/pear - export PEAR_INSTALLDIR + phpconfig="--srcdir=../${pkgbase}-${pkgver} \ + --config-cache \ + --prefix=/usr \ + --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 \ + " + + 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-phar=shared \ + --enable-posix=shared \ + --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 \ + --with-gdbm \ + --with-gettext=shared \ + --with-gmp=shared \ + --with-iconv=shared \ + --with-icu-dir=/usr \ + --with-imap-ssl \ + --with-imap=shared \ + --with-jpeg-dir=/usr \ + --with-vpx-dir=/usr \ + --with-ldap=shared \ + --with-ldap-sasl \ + --with-mcrypt=shared \ + --with-mhash \ + --with-mssql=shared \ + --with-mysql-sock=/var/run/mysqld/mysqld.sock \ + --with-mysql=shared,mysqlnd \ + --with-mysqli=shared,mysqlnd \ + --with-openssl=shared \ + --with-pcre-regex=/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-png-dir=/usr \ + --with-pspell=shared \ + --with-snmp=shared \ + --with-sqlite3=shared,/usr \ + --with-tidy=shared \ + --with-unixODBC=shared,/usr \ + --with-xmlrpc=shared \ + --with-xsl=shared \ + --with-zlib \ + " + + EXTENSION_DIR=/usr/lib/php/modules + export EXTENSION_DIR + PEAR_INSTALLDIR=/usr/share/pear + export PEAR_INSTALLDIR cd ${srcdir}/${pkgbase}-${pkgver} - # apply suhosin patch - patch -p1 -i ${srcdir}/suhosin-patch-${_suhosinver}.patch || return 1 + # adjust paths + patch -p0 -i ${srcdir}/php.ini.patch + patch -p0 -i ${srcdir}/php-fpm.conf.in.patch # php - mkdir ${srcdir}/build-php - cd ${srcdir}/build-php - ln -s ../${pkgbase}-${pkgver}/configure + mkdir ${srcdir}/build-php + cd ${srcdir}/build-php + ln -s ../${pkgbase}-${pkgver}/configure ./configure ${phpconfig} \ --disable-cgi \ --with-readline \ --enable-pcntl \ - ${phpextensions} || return 1 - make || return 1 + ${phpextensions} + make # cgi and fcgi - cp -a ${srcdir}/build-php ${srcdir}/build-cgi - cd ${srcdir}/build-cgi + # reuse the previous run; this will save us a lot of time + cp -a ${srcdir}/build-php ${srcdir}/build-cgi + cd ${srcdir}/build-cgi + ./configure ${phpconfig} \ + --disable-cli \ + --enable-cgi \ + ${phpextensions} + make + + # apache + cp -a ${srcdir}/build-php ${srcdir}/build-apache + cd ${srcdir}/build-apache + ./configure ${phpconfig} \ + --disable-cli \ + --with-apxs2 \ + ${phpextensions} + make + + # fpm + cp -a ${srcdir}/build-php ${srcdir}/build-fpm + cd ${srcdir}/build-fpm + ./configure ${phpconfig} \ + --disable-cli \ + --enable-fpm \ + --with-fpm-user=http \ + --with-fpm-group=http \ + ${phpextensions} + make + + # embed + cp -a ${srcdir}/build-php ${srcdir}/build-embed + cd ${srcdir}/build-embed ./configure ${phpconfig} \ - --disable-cli \ - --enable-cgi \ - ${phpextensions} || return 1 - make || return 1 - - # pear - cp -a ${srcdir}/build-php ${srcdir}/build-pear - cd ${srcdir}/build-pear - ./configure ${phpconfig} \ - --disable-cgi \ - --with-readline \ - --enable-pcntl \ - --with-pear \ - ${phpextensions} - make || return 1 + --disable-cli \ + --enable-embed=shared \ + ${phpextensions} + make + + # pear + cp -a ${srcdir}/build-php ${srcdir}/build-pear + cd ${srcdir}/build-pear + ./configure ${phpconfig} \ + --disable-cgi \ + --with-readline \ + --enable-pcntl \ + --with-pear \ + ${phpextensions} + make } +# check() { +# cd ${srcdir}/build-php +# make test +# } + package_php() { - pkgdesc='An HTML-embedded scripting language' - depends=('pcre' 'libxml2' 'bzip2' 'openssl') - replaces=('php') - provides=('php') - backup=('etc/php/php.ini') + pkgdesc='An HTML-embedded scripting language' + depends=('pcre' 'libxml2' 'bzip2' 'curl') + replaces=('php-fileinfo' 'php-gmp' 'php-curl') + provides=('php-fileinfo' 'php-gmp' 'php-curl') + conflicts=('php-fileinfo' 'php-gmp' 'php-curl') + backup=('etc/php/php.ini') cd ${srcdir}/build-php - make INSTALL_ROOT=${pkgdir} install || return 1 - install -d -m755 ${pkgdir}/usr/share/pear - # fix broken link - ln -sf phar.phar $pkgdir/usr/bin/phar - # install php.ini - install -D -m644 ${srcdir}/php.ini ${pkgdir}/etc/php/php.ini - install -d -m755 ${pkgdir}/etc/php/conf.d/ + make -j1 INSTALL_ROOT=${pkgdir} install + install -d -m755 ${pkgdir}/usr/share/pear + # install php.ini + 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/{curl,enchant,gd,gmp,intl,ldap,mcrypt,mssql,odbc,pdo_odbc,pgsql,pdo_pgsql,pspell,snmp,sqlite3,pdo_sqlite,tidy,xsl}.so + # 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,intl,ldap,mcrypt,mssql,odbc,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' 'pcre' 'libxml2') + pkgdesc='CGI and FCGI SAPI for PHP' + depends=('php') - install -D -m755 ${srcdir}/build-cgi/sapi/cgi/php-cgi ${pkgdir}/usr/bin/php-cgi + install -D -m755 ${srcdir}/build-cgi/sapi/cgi/php-cgi ${pkgdir}/usr/bin/php-cgi +} + +package_php-apache() { + pkgdesc='Apache SAPI for PHP' + depends=('php' 'apache') + backup=('etc/httpd/conf/extra/php5_module.conf') + + install -D -m755 ${srcdir}/build-apache/libs/libphp5.so ${pkgdir}/usr/lib/httpd/modules/libphp5.so + install -D -m644 ${srcdir}/apache.conf ${pkgdir}/etc/httpd/conf/extra/php5_module.conf +} + +package_php-fpm() { + pkgdesc='FastCGI Process Manager for PHP' + depends=('php') + backup=('etc/php/php-fpm.conf') + install='php-fpm.install' + + install -D -m755 ${srcdir}/build-fpm/sapi/fpm/php-fpm ${pkgdir}/usr/sbin/php-fpm + install -D -m644 ${srcdir}/build-fpm/sapi/fpm/php-fpm.8 ${pkgdir}/usr/share/man/man8/php-fpm.8 + install -D -m644 ${srcdir}/build-fpm/sapi/fpm/php-fpm.conf ${pkgdir}/etc/php/php-fpm.conf + install -D -m755 ${srcdir}/rc.d.php-fpm ${pkgdir}/etc/rc.d/php-fpm + install -D -m644 ${srcdir}/logrotate.d.php-fpm ${pkgdir}/etc/logrotate.d/php-fpm + install -d -m755 ${pkgdir}/etc/php/fpm.d + install -D -m644 ${srcdir}/php-fpm.tmpfiles ${pkgdir}/usr/lib/tmpfiles.d/php-fpm.conf + install -D -m644 ${srcdir}/php-fpm.service ${pkgdir}/usr/lib/systemd/system/php-fpm.service +} + +package_php-embed() { + pkgdesc='Embed SAPI for PHP' + depends=('php') + + install -D -m755 ${srcdir}/build-embed/libs/libphp5.so ${pkgdir}/usr/lib/libphp5.so + install -D -m644 ${srcdir}/${pkgbase}-${pkgver}/sapi/embed/php_embed.h ${pkgdir}/usr/include/php/sapi/embed/php_embed.h } package_php-pear() { - pkgdesc='PHP Extension and Application Repository' - depends=('php' 'bash') - backup=('etc/php/pear.conf') - - cd ${srcdir}/build-pear - make install-pear INSTALL_ROOT=${pkgdir} || return 1 - local i - while read i; do - [ ! -e "$i" ] || rm -rf "$i" - done < <(find ${pkgdir} -name '.*') -} -md5sums=('21ceeeb232813c10283a5ca1b4c87b48' - 'b66b27c43b1332400ef8982944c3b95b' - '25bf81e701f7914a3d8472a5636640e7' - '96ca078be6729b665be8a865535a97bf') + pkgdesc='PHP Extension and Application Repository' + depends=('php') + backup=('etc/php/pear.conf') + + cd ${srcdir}/build-pear + make install-pear INSTALL_ROOT=${pkgdir} + rm -rf ${pkgdir}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry} +} + +package_php-enchant() { + depends=('php' 'enchant') + pkgdesc='enchant module for PHP' + install -D -m755 ${srcdir}/build-php/modules/enchant.so ${pkgdir}/usr/lib/php/modules/enchant.so +} + +package_php-gd() { + depends=('php' 'libpng' 'libjpeg' 'freetype2' 'libvpx') + pkgdesc='gd module for PHP' + install -D -m755 ${srcdir}/build-php/modules/gd.so ${pkgdir}/usr/lib/php/modules/gd.so +} + +package_php-intl() { + depends=('php' 'icu') + pkgdesc='intl module for PHP' + install -D -m755 ${srcdir}/build-php/modules/intl.so ${pkgdir}/usr/lib/php/modules/intl.so +} + +package_php-ldap() { + depends=('php' 'libldap') + pkgdesc='ldap module for PHP' + install -D -m755 ${srcdir}/build-php/modules/ldap.so ${pkgdir}/usr/lib/php/modules/ldap.so +} + +package_php-mcrypt() { + depends=('php' 'libmcrypt' 'libltdl') + pkgdesc='mcrypt module for PHP' + install -D -m755 ${srcdir}/build-php/modules/mcrypt.so ${pkgdir}/usr/lib/php/modules/mcrypt.so +} + +package_php-mssql() { + depends=('php' 'freetds') + pkgdesc='mssql module for PHP' + install -D -m755 ${srcdir}/build-php/modules/mssql.so ${pkgdir}/usr/lib/php/modules/mssql.so +} + +package_php-odbc() { + depends=('php' 'unixodbc') + pkgdesc='ODBC modules for PHP' + install -D -m755 ${srcdir}/build-php/modules/odbc.so ${pkgdir}/usr/lib/php/modules/odbc.so + install -D -m755 ${srcdir}/build-php/modules/pdo_odbc.so ${pkgdir}/usr/lib/php/modules/pdo_odbc.so +} + +package_php-pgsql() { + depends=('php' 'postgresql-libs') + pkgdesc='PostgreSQL modules for PHP' + install -D -m755 ${srcdir}/build-php/modules/pgsql.so ${pkgdir}/usr/lib/php/modules/pgsql.so + install -D -m755 ${srcdir}/build-php/modules/pdo_pgsql.so ${pkgdir}/usr/lib/php/modules/pdo_pgsql.so +} + +package_php-pspell() { + depends=('php' 'aspell') + pkgdesc='pspell module for PHP' + install -D -m755 ${srcdir}/build-php/modules/pspell.so ${pkgdir}/usr/lib/php/modules/pspell.so +} + +package_php-snmp() { + depends=('php' 'net-snmp') + pkgdesc='snmp module for PHP' + install -D -m755 ${srcdir}/build-php/modules/snmp.so ${pkgdir}/usr/lib/php/modules/snmp.so +} + +package_php-sqlite() { + depends=('php' 'sqlite') + pkgdesc='sqlite module for PHP' + install -D -m755 ${srcdir}/build-php/modules/sqlite3.so ${pkgdir}/usr/lib/php/modules/sqlite3.so + install -D -m755 ${srcdir}/build-php/modules/pdo_sqlite.so ${pkgdir}/usr/lib/php/modules/pdo_sqlite.so +} + +package_php-tidy() { + depends=('php' 'tidyhtml') + pkgdesc='tidy module for PHP' + install -D -m755 ${srcdir}/build-php/modules/tidy.so ${pkgdir}/usr/lib/php/modules/tidy.so +} + +package_php-xsl() { + depends=('php' 'libxslt') + pkgdesc='xsl module for PHP' + install -D -m755 ${srcdir}/build-php/modules/xsl.so ${pkgdir}/usr/lib/php/modules/xsl.so +} |