summaryrefslogtreecommitdiff
path: root/community/php52/PKGBUILD
blob: eee88a905ef275cf50faaed4b3b563f1daa77966 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# Maintainer: Evangelos Foutras <foutrelis@gmail.com>
# Contributor: Pierre Schmitz <pierre@archlinux.de>

pkgname=php52
pkgver=5.2.17
pkgrel=5
_suhosinver=5.2.16-0.9.7
pkgdesc='A high-level scripting language'
arch=('i686' 'x86_64')
license=('PHP')
url='http://www.php.net'
backup=('etc/php/php.ini')
depends=('glibc' 'readline' 'ncurses' 'libxml2' 'pcre')
makedepends=('apache' 'imap' 'postgresql-libs' 'libmysqlclient'
             'libldap' 'postfix' 'libpng' 'libjpeg' 'sqlite3' 'unixodbc'
             'net-snmp' 'mhash' 'gmp' 'libmcrypt' 'tidyhtml' 'aspell' 'libtool'
             'freetype2' 'curl' 'libxslt' 'pam' 'openssl' 'bzip2' 'gdbm' 'db')
optdepends=('bzip2: bz2'
            'curl: curl'
            'gdbm: dba'
            'libpng: gd'
            'libjpeg: gd'
            'freetype2: gd'
            'pam: imap'
            'libldap: ldap'
            'libmcrypt: mcrypt'
            'libtool: mcrypt'
            'libmysqlclient: mysql/mysqli/pdo_mysql'
            'unixodbc: odbc/pdo_odbc'
            'openssl: openssl'
            'postgresql-libs: pgsql/pdo_pgsql'
            'aspell: pspell'
            'net-snmp: snmp'
            'sqlite3: pdo_sqlite'
            'tidyhtml: tidy'
            'libxslt: xsl'
            'mhash: mhash'
            'gmp: gmp')
provides=("php=$pkgver")
conflicts=('php')
source=("http://php.net/distributions/php-${pkgver}.tar.bz2"
        "http://download.suhosin.org/suhosin-patch-${_suhosinver}.patch.gz"
        'php.ini'
        'apache.conf'
        'db-configure.patch'
        'db-5.patch'
        'libpng14.patch')
md5sums=('b27947f3045220faf16e4d9158cbfe13'
         'd815fc99a0c25c21f5df28551fcbb001'
         '55c09c89e34eb5c555d842a4d01590e6'
         '96ca078be6729b665be8a865535a97bf'
         'f3da248d934bc99354fdfa98cdac23ad'
         '40f3d5f546087dac33bfa21a85b79203'
         '77ea0756996df0932fce472ff3ec2693')

build() {
	phpconfig="--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 \
	"

	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-dbase=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 \
	--with-imap=shared \
	--with-imap-ssl=shared \
	--with-ldap=shared \
	--enable-mbstring=shared \
	--with-mcrypt=shared \
	--with-mysql=shared \
	--with-mysql-sock=/var/run/mysqld/mysqld.sock \
	--with-mysql=shared \
	--with-mysqli=shared \
	--with-ncurses=shared \
	--with-unixODBC=shared,/usr \
	--enable-pdo=shared \
	--with-pdo-mysql=shared \
	--with-pdo-sqlite=shared,/usr \
	--with-pdo-odbc=shared,unixODBC,/usr \
	--with-pdo-pgsql=shared \
	--with-sqlite=shared \
	--enable-sqlite-utf8 \
	--with-pgsql=shared \
	--enable-shmop=shared \
	--with-snmp=shared \
	--enable-soap=shared \
	--enable-sysvmsg=shared \
	--enable-sysvsem=shared \
	--enable-sysvshm=shared \
	--with-tidy=shared \
	--with-xsl=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-iconv=shared \
	--with-xmlrpc=shared \
	--with-pspell=shared \
	--with-freetype-dir=shared,/usr \
	--with-mime-magic=shared \
	--with-gmp=shared \
	--with-mhash=shared \
	"

	PEAR_INSTALLDIR=/usr/share/pear
	export PEAR_INSTALLDIR

	cd ${srcdir}/php-${pkgver}

	# db 5.1 fix
	patch -p4 -i ${srcdir}/db-5.patch

	# avoid linking against old db version
	patch -p0 -i ${srcdir}/db-configure.patch

	# libpng 1.4 fix
	patch -p3 -i ${srcdir}/libpng14.patch

	# gmp 5.0 fix
	sed -i 's/__GMP_BITS_PER_MP_LIMB/GMP_LIMB_BITS/g' ext/gmp/gmp.c

	# apply suhosin patch
	patch -p1 -i ${srcdir}/suhosin-patch-${_suhosinver}.patch

	# cli
	./configure ${phpconfig} \
		--disable-cgi \
		--with-readline \
		--enable-pcntl \
		--with-pear=/usr/share/pear \
		${phpextensions}
	make
	# make test
	make -j1 INSTALL_ROOT=${pkgdir} install

	# cleanup
	rm -f ${pkgdir}`${pkgdir}/usr/bin/php-config --extension-dir`/*.a
	# install php.ini
	install -D -m644 ${srcdir}/php.ini ${pkgdir}/etc/php/php.ini
	install -d -m755 ${pkgdir}/etc/php/conf.d/

	# cgi and fcgi
	./configure ${phpconfig} \
		--enable-fastcgi \
		--enable-cgi \
		--enable-discard-path \
		--enable-force-cgi-redirect \
		--disable-cli \
		${phpextensions}
	make
	install -D -m755 sapi/cgi/php-cgi ${pkgdir}/usr/bin/php-cgi

	# mod_php
	./configure ${phpconfig} \
		--with-apxs2 \
		--disable-cli \
		${phpextensions}
	make
	install -D -m644 libs/libphp5.so ${pkgdir}/usr/lib/httpd/modules/libphp5.so
	install -D -m644 ${srcdir}/apache.conf ${pkgdir}/etc/httpd/conf/extra/php5_module.conf
}