summaryrefslogtreecommitdiffstats
path: root/abs/core-testing/php/PKGBUILD
blob: f824ec79760a3f284c171a5756a066d2ea2f5f69 (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
pkgname=php
pkgver=5.2.6
pkgrel=7
_suhosinver=0.9.6.2
pkgdesc='A high-level scripting language'
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.7')

optdepends=('bzip2: bz2' \
            'curl: curl' \
            'gdbm: dba' \
            'libpng: gd' \
            'libjpeg: gd' \
            'freetype2: gd' \
            'pam: imap' \
            'libldap: ldap' \
            'mcrypt: mcrypt' \
            'libtool: mcrypt' \
            'libmysqlclient: mysql/mysqli' \
            'unixodbc: odbc/pdo_odbc' \
            'openssl: openssl' \
            'postgresql-libs: pgsql/pdo_pgsql' \
            'aspell: pspell' \
            'net-snmp: snmp' \
            'sqlite3: sqlite' \
            'tidyhtml: tidy' \
            'libxslt: xsl' \
            )
options=('emptydirs')
source=("http://www.php.net/distributions/${pkgname}-${pkgver}.tar.bz2" \
        "http://download.suhosin.org/suhosin-patch-${pkgver}-${_suhosinver}.patch.gz" \
        'php.ini' 'apache.conf' 'db-configure.patch')


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 \
	"

	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 \
	--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 \
	--with-ncurses=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 \
	--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 \
	--without-pspell \
	--with-freetype-dir=shared,/usr \
	--with-mime-magic=shared \
	"

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

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

	# apply suhosin patch
	patch -p1 -i ${srcdir}/suhosin-patch-${pkgver}-${_suhosinver}.patch || return 1

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

	# fix pear path
	sed "s|$PWD||g" -i ${pkgdir}/usr/{bin/pear,share/pear/pearcmd.php}
	# cleanup
	rm -f ${pkgdir}`${pkgdir}/usr/bin/php-config --extension-dir`/*.a
	rm -rf ${pkgdir}/{.registry,.channels,.depdb*,.lock,.filemap}
	rmdir ${pkgdir}/usr/include/php/include
	# 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} || return 1
	make || return 1
	install -D -m755 sapi/cgi/php-cgi ${pkgdir}/usr/bin/php-cgi || return 1

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