From 780c9ac71d85d5b5e7654cd8b5622d47195a7e4e Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 7 Sep 2009 14:11:02 +0000 Subject: main/php: clean up the php 5.3 upgrade * remove php-session extension (its compiled in by default) fixes #156 * added various php extensions * added the suhosinver php hardening patch * renamed php-postgresql to php-pgsql --- main/php/APKBUILD | 222 ++++++++++++++++++++++++++++------------ main/php/gd-info-segfault.patch | 26 +++++ 2 files changed, 181 insertions(+), 67 deletions(-) create mode 100644 main/php/gd-info-segfault.patch diff --git a/main/php/APKBUILD b/main/php/APKBUILD index b50e8932b..05f709a18 100644 --- a/main/php/APKBUILD +++ b/main/php/APKBUILD @@ -2,7 +2,8 @@ # Maintainer: Natanael Copa pkgname=php pkgver=5.3.0 -pkgrel=0 +_suhosinver=${pkgver}-0.9.8-BETA-1 +pkgrel=1 pkgdesc="The PHP language runtime engine" url="http://www.php.net/" license="PHP-3" @@ -10,84 +11,155 @@ depends= install="$pkgname.post-upgrade" makedepends="pcre-dev libxml2-dev libiconv-dev openssl-dev zlib-dev bzip2-dev curl-dev libpng-dev jpeg-dev freetype-dev libmcrypt-dev mysql-dev - sqlite-dev libtool libltdl postgresql-dev" -subpackages="$pkgname-doc $pkgname-dev $pkgname-bcmath $pkgname-bz2 - $pkgname-calendar $pkgname-curl $pkgname-exif $pkgname-ftp $pkgname-gd - $pkgname-iconv $pkgname-json $pkgname-mcrypt - $pkgname-mysql $pkgname-mysqli $pkgname-openssl $pkgname-pdo - $pkgname-pdo_mysql $pkgname-pdo_sqlite $pkgname-posix $pkgname-session - $pkgname-shmop $pkgname-soap $pkgname-sockets $pkgname-sqlite - $pkgname-sysvmsg $pkgname-sysvsem $pkgname-sysvshm $pkgname-xmlrpc - $pkgname-zip $pkgname-zlib $pkgname-postgresql $pkgname-pdo_pgsql" -source="http://www.php.net/distributions/${pkgname}-${pkgver}.tar.bz2" + sqlite-dev libtool libltdl postgresql-dev db-dev unixodbc-dev icu-dev + enchant-dev gd-dev gmp-dev gettext-dev imap-dev aspell-dev + net-snmp-dev libxslt-dev cyrus-sasl-dev openldap-dev pkgconfig + libgcrypt-dev" +subpackages="$pkgname-dev $pkgname-doc + $pkgname-bcmath + $pkgname-bz2 + $pkgname-calendar + $pkgname-curl + $pkgname-dba + $pkgname-enchant + $pkgname-exif + $pkgname-ftp + $pkgname-gd + $pkgname-gettext + $pkgname-gmp + $pkgname-iconv + $pkgname-imap + $pkgname-intl + $pkgname-json + $pkgname-ldap + $pkgname-mcrypt + $pkgname-mysql + $pkgname-mysqli + $pkgname-odbc + $pkgname-openssl + $pkgname-pdo + $pkgname-pdo_mysql + $pkgname-pdo_odbc + $pkgname-pdo_pgsql + $pkgname-pdo_sqlite + $pkgname-pgsql + $pkgname-phar + $pkgname-posix + $pkgname-pspell + $pkgname-shmop + $pkgname-snmp + $pkgname-soap + $pkgname-sockets + $pkgname-sqlite + $pkgname-sqlite3 + $pkgname-sysvmsg + $pkgname-sysvsem + $pkgname-sysvshm + $pkgname-xml + $pkgname-xmlrpc + $pkgname-xsl + $pkgname-zip + $pkgname-zlib + " + +source="http://www.php.net/distributions/${pkgname}-${pkgver}.tar.bz2 + http://download.suhosin.org/suhosin-patch-${_suhosinver}.patch.gz + gd-info-segfault.patch + " build() { cd "$srcdir/$pkgname-$pkgver" - ./configure --build=${CHOST:-i486-alpine-linux-uclibc} \ - --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 \ - --with-openssl=shared \ - --with-zlib=shared \ - --enable-bcmath=shared \ - --with-bz2=shared \ + # apply suhosin patch + gunzip -c ${srcdir}/suhosin-patch-${_suhosinver}.patch.gz \ + | patch -p1 || return 1 + + # fix gd segfault; http://bugs.php.net/bug.php?id=49193 + patch -p0 -i ${srcdir}/gd-info-segfault.patch || return 1 + + phpextensions="--enable-bcmath=shared \ --enable-calendar=shared \ - --with-curl=shared \ + --enable-dba=shared \ --enable-exif=shared \ --enable-ftp=shared \ - --with-gd=shared \ - --with-jpeg-dir=shared,/usr \ - --with-png-dir=shared,/usr \ --enable-gd-native-ttf \ - --enable-mbstring=shared \ - --with-mcrypt=shared \ - --with-mysql=shared \ - --with-mysql-sock=/tmp/mysql.sock \ - --with-mysql=shared \ - --with-mysqli=shared \ - --with-pear=/usr/share/pear \ + --enable-intl=shared \ + --enable-json=shared \ + --enable-mbregex \ + --enable-mbstring \ --enable-pdo=shared \ - --with-pdo-mysql=shared \ - --with-pdo-sqlite=shared,/usr \ - --enable-fastcgi \ - --with-sqlite=shared \ - --enable-sqlite-utf8 \ + --enable-phar=shared \ + --enable-posix=shared \ + --enable-session \ --enable-shmop=shared \ --enable-soap=shared \ + --enable-sockets=shared \ + --enable-sqlite-utf8 \ --enable-sysvmsg=shared \ --enable-sysvsem=shared \ --enable-sysvshm=shared \ + --enable-xml=shared \ --enable-zip=shared \ - --enable-posix=shared \ - --enable-sockets=shared \ - --enable-xml \ - --with-ttf=shared \ - --enable-session=shared \ - --with-regex=php \ - --with-pcre-regex=/usr \ - --enable-mbstring=all \ - --enable-mbregex \ - --enable-json=shared \ + --with-bz2=shared \ + --with-curl=shared \ + --with-db4=shared \ + --with-enchant=shared,/usr \ + --with-freetype-dir=shared,/usr \ + --with-gd=shared,/usr \ + --with-gettext=shared \ + --with-gmp=shared \ --with-iconv=shared \ + --with-icu-dir=/usr \ + --with-imap-ssl=shared \ + --with-imap=shared \ + --with-jpeg-dir=shared,/usr \ + --with-ldap=shared \ + --with-mcrypt=shared \ + --with-mysql-sock=/tmp/mysql.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=shared,/usr \ + --with-pspell=shared \ + --with-regex=php \ + --with-snmp=shared \ + --with-sqlite3=shared,/usr \ + --with-sqlite=shared \ + --with-unixODBC=shared,/usr \ --with-xmlrpc=shared \ + --with-xsl=shared \ + --with-zlib=shared \ + --without-db1 \ + --without-db2 \ + --without-db3 \ + --without-qdbm \ + " +# --with-tidy=shared \ + ./configure --build=${CHOST:-i486-alpine-linux-uclibc} \ + --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 \ + --enable-fastcgi \ --enable-cgi \ - --with-freetype-dir=shared,/usr \ - --with-fileinfo=shared \ + --disable-cli \ --enable-discard-path \ --enable-force-cgi-redirect \ - --disable-cli \ - --with-pgsql=shared \ - --with-pdo-pgsql=shared \ - --with-pic + --with-pic \ + $phpextensions make || return 1 make -j1 INSTALL_ROOT="$pkgdir" install || return 1 @@ -95,11 +167,10 @@ build() { } _mv_mod() { + pkgdesc="$1 php extension" local d=usr/lib/php/20090626 mkdir -p "$subpkgdir/$d" mv "$pkgdir/$d/${1}.so" "$subpkgdir/$d/" || return 1 - # last one removed the dir - rmdir "$pkgdir/$d" 2>/dev/null return 0 } @@ -107,39 +178,56 @@ bcmath() { _mv_mod bcmath; } bz2() { _mv_mod bz2; } calendar() { _mv_mod calendar; } curl() { _mv_mod curl; } +dba() { _mv_mod dba; } +enchant() { _mv_mod enchant; } exif() { _mv_mod exif; } ftp() { _mv_mod ftp; } gd() { _mv_mod gd; } +gettext() { _mv_mod gettext; } +gmp() { _mv_mod gmp; } iconv() { _mv_mod iconv; } +imap() { _mv_mod imap; } +intl() { _mv_mod intl; } json() { _mv_mod json; } +ldap() { _mv_mod ldap; } mcrypt() { _mv_mod mcrypt; } -# mime_magic() { _mv_mod mime_magic; } mysql() { _mv_mod mysql; } mysqli() { _mv_mod mysqli; } +odbc() { _mv_mod odbc; } openssl() { _mv_mod openssl; } pdo() { _mv_mod pdo; } pdo_mysql() { _mv_mod pdo_mysql; } +pdo_odbc() { _mv_mod pdo_odbc; } +pdo_pgsql() { _mv_mod pdo_pgsql; } pdo_sqlite() { _mv_mod pdo_sqlite; } +phar() { _mv_mod phar; } posix() { _mv_mod posix; } -session() { _mv_mod session; } +pgsql() { _mv_mod pgsql; } +pspell() { _mv_mod pspell; } +#session() { _mv_mod session; } shmop() { _mv_mod shmop; } +snmp() { _mv_mod snmp; } soap() { _mv_mod soap; } sockets() { _mv_mod sockets; } sqlite() { _mv_mod sqlite; } +sqlite3() { _mv_mod sqlite3; } sysvmsg() { _mv_mod sysvmsg; } sysvsem() { _mv_mod sysvsem; } sysvshm() { _mv_mod sysvshm; } +xml() { _mv_mod xml; } xmlrpc() { _mv_mod xmlrpc; } +xsl() { _mv_mod xsl; } zip() { _mv_mod zip; } zlib() { _mv_mod zlib; } -postgresql() { _mv_mod pgsql; } -pdo_pgsql() { _mv_mod pdo_pgsql; } # devleoper package dev() { default_dev - mkdir -p "$subpkgdir"/usr/lib/php/ + mkdir -p "$subpkgdir"/usr/lib/php/ "$subpkgdir"/usr/bin/ mv "$pkgdir"/usr/lib/php/build "$subpkgdir"/usr/lib/php/ + mv "$pkgdir"/usr/bin/phpize "$subpkgdir"/usr/bin/ } -md5sums="846760cd655c98dfd86d6d97c3d964b0 php-5.3.0.tar.bz2" +md5sums="846760cd655c98dfd86d6d97c3d964b0 php-5.3.0.tar.bz2 +62dc36545b86bf86e44ada1fccc17d0a suhosin-patch-5.3.0-0.9.8-BETA-1.patch.gz +1c1a50aae7207b12d27bdecd8967e7ce gd-info-segfault.patch" diff --git a/main/php/gd-info-segfault.patch b/main/php/gd-info-segfault.patch new file mode 100644 index 000000000..846a19ef7 --- /dev/null +++ b/main/php/gd-info-segfault.patch @@ -0,0 +1,26 @@ +Index: ext/gd/libgd/gd_compat.c +=================================================================== +--- ext/gd/libgd/gd_compat.c (Revision 286947) ++++ ext/gd/libgd/gd_compat.c (Revision 286948) +@@ -14,7 +14,7 @@ + return JPEG_LIB_VERSION; + } + +-int gdJpegGetVersionString() ++const char * gdJpegGetVersionString() + { + switch(JPEG_LIB_VERSION) { + case 62: +Index: ext/gd/libgd/gd_compat.h +=================================================================== +--- ext/gd/libgd/gd_compat.h (Revision 286947) ++++ ext/gd/libgd/gd_compat.h (Revision 286948) +@@ -8,7 +8,7 @@ + #endif + + const char * gdPngGetVersionString(); +-int gdJpegGetVersionString(); ++const char * gdJpegGetVersionString(); + int gdJpegGetVersionInt(); + int overflow2(int a, int b); + -- cgit v1.2.3