1 # $Id: PKGBUILD 53281 2009-09-27 20:04:03Z pierre $
2 # Maintainer: Pierre Schmitz <pierre@archlinux.de>
25 _suhosinver=${pkgver}-0.9.8
27 arch=('i686' 'x86_64')
29 url='http://www.php.net'
30 makedepends=('apache' 'imap' 'postgresql-libs' 'mysql' 'libldap' 'postfix'
31 'sqlite3' 'unixodbc' 'net-snmp' 'libzip' 'enchant' 'file'
32 'libmcrypt' 'tidyhtml' 'aspell' 'libtool' 'gd' 'icu'
33 'curl' 'libxslt' 'openssl' 'bzip2' 'db' 'gmp')
34 options=('!makeflags')
35 source=("http://www.php.net/distributions/${pkgbase}-${pkgver}.tar.bz2"
36 "http://download.suhosin.org/suhosin-patch-${_suhosinver}.patch.gz"
37 'php.ini.patch' 'apache.conf' 'db-configure.patch' 'gd-info-segfault.patch'
38 "http://www.acme.com/software/thttpd/thttpd-${_thttpdver}.tar.gz")
40 md5sums=('846760cd655c98dfd86d6d97c3d964b0'
41 'a23a3d54e177ac0ad30f78d928ba8177'
42 '67c63d2c8a976a333bbd2216cdd60413'
43 '96ca078be6729b665be8a865535a97bf'
44 '45ecb6fb0aadfd3462097e3bab951aa5'
45 '1c1a50aae7207b12d27bdecd8967e7ce'
46 '156b249b3b0bcd48b06badd2db0d56c5')
49 phpconfig="--prefix=/usr \
50 --sysconfdir=/etc/php \
52 --with-config-file-path=/etc/php \
53 --with-config-file-scan-dir=/etc/php/conf.d \
54 --enable-inline-optimization \
59 --mandir=/usr/share/man \
63 phpextensions="--enable-bcmath=shared \
64 --enable-calendar=shared \
66 --enable-exif=shared \
68 --enable-gd-native-ttf \
69 --enable-intl=shared \
70 --enable-json=shared \
74 --enable-phar=shared \
75 --enable-posix=shared \
77 --enable-shmop=shared \
78 --enable-soap=shared \
79 --enable-sockets=shared \
80 --enable-sqlite-utf8 \
81 --enable-sysvmsg=shared \
82 --enable-sysvsem=shared \
83 --enable-sysvshm=shared \
89 --with-enchant=shared,/usr \
90 --with-freetype-dir=shared,/usr \
91 --with-gd=shared,/usr \
93 --with-gettext=shared \
97 --with-imap-ssl=shared \
99 --with-jpeg-dir=shared,/usr \
101 --with-mcrypt=shared \
102 --with-mysql-sock=/tmp/mysql.sock \
103 --with-mysql=shared,mysqlnd \
104 --with-mysqli=shared,mysqlnd \
105 --with-openssl=shared \
106 --with-pcre-regex=/usr \
107 --with-pdo-mysql=shared,mysqlnd \
108 --with-pdo-odbc=shared,unixODBC,/usr \
109 --with-pdo-pgsql=shared \
110 --with-pdo-sqlite=shared,/usr \
111 --with-pgsql=shared \
112 --with-png-dir=shared,/usr \
113 --with-pspell=shared \
116 --with-sqlite3=shared,/usr \
117 --with-sqlite=shared \
119 --with-unixODBC=shared,/usr \
120 --with-xmlrpc=shared \
127 EXTENSION_DIR=/usr/lib/php/modules
129 PEAR_INSTALLDIR=/usr/share/pear
130 export PEAR_INSTALLDIR
132 cd ${srcdir}/${pkgbase}-${pkgver}
134 # avoid linking against old db version
135 patch -p0 -i ${srcdir}/db-configure.patch || return 1
137 # apply suhosin patch
138 patch -p1 -i ${srcdir}/suhosin-patch-${_suhosinver}.patch || return 1
141 patch -p0 -i ${srcdir}/php.ini.patch || return 1
143 # fix gd segfault; http://bugs.php.net/bug.php?id=49193
144 patch -p0 -i ${srcdir}/gd-info-segfault.patch || return 1
147 mkdir ${srcdir}/build-php
148 cd ${srcdir}/build-php
149 ln -s ../${pkgbase}-${pkgver}/configure
150 ./configure --srcdir=../${pkgbase}-${pkgver} \
155 ${phpextensions} || return 1
159 # reuse the previous run; this will save us a lot of time
160 cp -a ${srcdir}/build-php ${srcdir}/build-cgi
161 cd ${srcdir}/build-cgi
162 ./configure --srcdir=../${pkgbase}-${pkgver} \
166 ${phpextensions} || return 1
170 cp -a ${srcdir}/build-php ${srcdir}/build-apache
171 cd ${srcdir}/build-apache
172 ./configure --srcdir=../${pkgbase}-${pkgver} \
176 ${phpextensions} || return 1
180 cp -a ${srcdir}/build-php ${srcdir}/build-pear
181 cd ${srcdir}/build-pear
182 ./configure --srcdir=../${pkgbase}-${pkgver} \
188 ${phpextensions} || return 1
192 cp -a ${srcdir}/build-php ${srcdir}/build-thttpd
193 cd ${srcdir}/build-thttpd
194 ./configure --srcdir=../${pkgbase}-${pkgver} \
196 --with-thttpd=${srcdir}/thttpd-${_thttpdver} \
198 ${phpextensions} || return 1
203 package_php-thttpd() {
204 pkgdesc='PHP for tHTTPd'
205 depends=('php' 'thttpd' 'pcre' 'libxml2')
206 #backup=('etc/httpd/conf/extra/php5_module.conf')
209 #install -D -m755 ${srcdir}/build-apache/libs/libphp5.so ${pkgdir}/usr/lib/httpd/modules/libphp5.so
210 #install -D -m644 ${srcdir}/apache.conf ${pkgdir}/etc/httpd/conf/extra/php5_module.conf
215 pkgdesc='An HTML-embedded scripting language'
216 depends=('pcre' 'libxml2' 'bzip2' 'openssl')
217 replaces=('php-fileinfo')
218 provides=('php-fileinfo')
219 conflicts=('php-fileinfo')
220 backup=('etc/php/php.ini')
222 cd ${srcdir}/build-php
223 make INSTALL_ROOT=${pkgdir} install || return 1
224 install -d -m755 ${pkgdir}/usr/share/pear
226 ln -sf phar.phar $pkgdir/usr/bin/phar
228 install -D -m644 ${srcdir}/${pkgbase}-${pkgver}/php.ini-production ${pkgdir}/etc/php/php.ini
229 install -d -m755 ${pkgdir}/etc/php/conf.d/
231 # remove static modules
232 rm -f ${pkgdir}/usr/lib/php/modules/*.a
233 # remove modules provided by sub packages
234 rm -f ${pkgdir}/usr/lib/php/modules/{curl,enchant,gd,gmp,intl,ldap,mcrypt,odbc,pdo_odbc,pgsql,pdo_pgsql,pspell,snmp,sqlite3,pdo_sqlite,tidy,xsl}.so
238 pkgdesc='CGI and FCGI SAPI for PHP'
239 depends=('php' 'pcre' 'libxml2')
241 install -D -m755 ${srcdir}/build-cgi/sapi/cgi/php-cgi ${pkgdir}/usr/bin/php-cgi
244 package_php-apache() {
245 pkgdesc='Apache SAPI for PHP'
246 depends=('php' 'apache' 'pcre' 'libxml2')
247 backup=('etc/httpd/conf/extra/php5_module.conf')
249 install -D -m755 ${srcdir}/build-apache/libs/libphp5.so ${pkgdir}/usr/lib/httpd/modules/libphp5.so
250 install -D -m644 ${srcdir}/apache.conf ${pkgdir}/etc/httpd/conf/extra/php5_module.conf
254 pkgdesc='PHP Extension and Application Repository'
255 depends=('php' 'bash')
256 backup=("etc/php/pear.conf")
258 cd ${srcdir}/build-pear
259 make install-pear INSTALL_ROOT=${pkgdir}
260 for i in $(find ${pkgdir}/ -name '.*'); do
261 [ -e $i ] && rm -rf $i
266 depends=('php' 'curl')
267 pkgdesc="curl module for PHP"
268 install -D -m755 ${srcdir}/build-php/modules/curl.so ${pkgdir}/usr/lib/php/modules/curl.so
271 package_php-enchant() {
272 depends=('php' 'enchant')
273 pkgdesc="enchant module for PHP"
274 install -D -m755 ${srcdir}/build-php/modules/enchant.so ${pkgdir}/usr/lib/php/modules/enchant.so
279 pkgdesc="gd module for PHP"
280 install -D -m755 ${srcdir}/build-php/modules/gd.so ${pkgdir}/usr/lib/php/modules/gd.so
284 depends=('php' 'gmp')
285 pkgdesc="gmp module for PHP"
286 install -D -m755 ${srcdir}/build-php/modules/gmp.so ${pkgdir}/usr/lib/php/modules/gmp.so
290 depends=('php' 'icu')
291 pkgdesc="intl module for PHP"
292 install -D -m755 ${srcdir}/build-php/modules/intl.so ${pkgdir}/usr/lib/php/modules/intl.so
296 depends=('php' 'libldap')
297 pkgdesc="ldap module for PHP"
298 install -D -m755 ${srcdir}/build-php/modules/ldap.so ${pkgdir}/usr/lib/php/modules/ldap.so
301 package_php-mcrypt() {
302 depends=('php' 'libmcrypt' 'libtool')
303 pkgdesc="mcrypt module for PHP"
304 install -D -m755 ${srcdir}/build-php/modules/mcrypt.so ${pkgdir}/usr/lib/php/modules/mcrypt.so
308 depends=('php' 'unixodbc')
309 pkgdesc="ODBC modules for PHP"
310 install -D -m755 ${srcdir}/build-php/modules/odbc.so ${pkgdir}/usr/lib/php/modules/odbc.so
311 install -D -m755 ${srcdir}/build-php/modules/pdo_odbc.so ${pkgdir}/usr/lib/php/modules/pdo_odbc.so
314 package_php-pgsql() {
315 depends=('php' 'postgresql-libs')
316 pkgdesc="PostgreSQL modules for PHP"
317 install -D -m755 ${srcdir}/build-php/modules/pgsql.so ${pkgdir}/usr/lib/php/modules/pgsql.so
318 install -D -m755 ${srcdir}/build-php/modules/pdo_pgsql.so ${pkgdir}/usr/lib/php/modules/pdo_pgsql.so
321 package_php-pspell() {
322 depends=('php' 'aspell')
323 pkgdesc="pspell module for PHP"
324 install -D -m755 ${srcdir}/build-php/modules/pspell.so ${pkgdir}/usr/lib/php/modules/pspell.so
328 depends=('php' 'net-snmp')
329 pkgdesc="snmp module for PHP"
330 install -D -m755 ${srcdir}/build-php/modules/snmp.so ${pkgdir}/usr/lib/php/modules/snmp.so
333 package_php-sqlite() {
334 depends=('php' 'sqlite3')
335 pkgdesc="sqlite3 module for PHP"
336 install -D -m755 ${srcdir}/build-php/modules/sqlite3.so ${pkgdir}/usr/lib/php/modules/sqlite3.so
337 install -D -m755 ${srcdir}/build-php/modules/pdo_sqlite.so ${pkgdir}/usr/lib/php/modules/pdo_sqlite.so
341 depends=('php' 'tidyhtml')
342 pkgdesc="tidy module for PHP"
343 install -D -m755 ${srcdir}/build-php/modules/tidy.so ${pkgdir}/usr/lib/php/modules/tidy.so
347 depends=('php' 'libxslt')
348 pkgdesc="xsl module for PHP"
349 install -D -m755 ${srcdir}/build-php/modules/xsl.so ${pkgdir}/usr/lib/php/modules/xsl.so