summaryrefslogtreecommitdiffstats
path: root/abs/core/php/PKGBUILD
blob: 394f49577446520d8abc168d61468ea906ecbb56 (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
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'
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')

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

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

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

	# php
        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

	# cgi and fcgi
        cp -a ${srcdir}/build-php ${srcdir}/build-cgi
        cd ${srcdir}/build-cgi
	./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
}

package_php() {
        pkgdesc='An HTML-embedded scripting language'
        depends=('pcre' 'libxml2' 'bzip2' 'openssl')
        replaces=('php')
        provides=('php')
        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/

        # 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
}

package_php-cgi() {
        pkgdesc='CGI and FCGI SAPI for PHP'
        depends=('php' 'pcre' 'libxml2')

        install -D -m755 ${srcdir}/build-cgi/sapi/cgi/php-cgi ${pkgdir}/usr/bin/php-cgi
}

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')