231
|
1 # Copyright 1999-2010 Gentoo Foundation
|
|
2 # Distributed under the terms of the GNU General Public License v2
|
|
3 # $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.3.2.ebuild,v 1.10 2010/07/04 22:40:19 mabi Exp $
|
|
4
|
|
5 EAPI=2
|
|
6
|
|
7 PHPCONFUTILS_MISSING_DEPS="adabas birdstep db2 dbmaker empress empress-bcs esoob interbase oci8 sapdb solid"
|
|
8
|
|
9 inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use phpconfutils php-common-r1 libtool
|
|
10
|
|
11 PHP_PATCHSET="1"
|
|
12 SUHOSIN_VERSION="$PV-0.9.9.1"
|
|
13 EXPECTED_TEST_FAILURES=""
|
|
14
|
|
15 KEYWORDS="~amd64 ~x86"
|
|
16
|
|
17 function php_get_uri ()
|
|
18 {
|
|
19 case "${1}" in
|
|
20 "php-pre")
|
|
21 echo "http://downloads.php.net/johannes/${2}"
|
|
22 ;;
|
|
23 "php")
|
|
24 echo "http://www.php.net/distributions/${2}"
|
|
25 ;;
|
|
26 "suhosin")
|
|
27 echo "http://download.suhosin.org/${2}"
|
|
28 ;;
|
|
29 "gentoo")
|
|
30 echo "mirror://gentoo/${2}"
|
|
31 ;;
|
|
32 *)
|
|
33 die "unhandled case in php_get_uri"
|
|
34 ;;
|
|
35 esac
|
|
36 }
|
|
37
|
|
38 PHP_MV="$(get_major_version)"
|
|
39
|
|
40 # alias, so we can handle different types of releases (finals, rcs, alphas,
|
|
41 # betas, ...) w/o changing the whole ebuild
|
|
42 PHP_PV="${PV}"
|
|
43 PHP_RELEASE="php"
|
|
44 PHP_P="${PN}-${PHP_PV}"
|
|
45 PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")"
|
|
46
|
|
47 PHP_PATCHSET="${PHP_PATCHSET:-${PR/r/}}"
|
|
48 PHP_PATCHSET_URI="
|
|
49 $(php_get_uri gentoo "php-patchset-${PV}-r${PHP_PATCHSET}.tar.bz2")"
|
|
50
|
|
51 if [[ ${SUHOSIN_VERSION} == *-gentoo ]]; then
|
|
52 # in some cases we use our own suhosin patch (very recent version,
|
|
53 # patch conflicts, etc.)
|
|
54 SUHOSIN_TYPE="gentoo"
|
|
55 else
|
|
56 SUHOSIN_TYPE="suhosin"
|
|
57 fi
|
|
58
|
|
59 SUHOSIN_PATCH="suhosin-patch-${SUHOSIN_VERSION}.patch"
|
|
60 SUHOSIN_URI="$(php_get_uri ${SUHOSIN_TYPE} ${SUHOSIN_PATCH}.gz )"
|
|
61
|
|
62 SRC_URI="
|
|
63 ${PHP_SRC_URI}
|
|
64 ${PHP_PATCHSET_URI}
|
|
65 suhosin? ( ${SUHOSIN_URI} )"
|
|
66
|
|
67 DESCRIPTION="The PHP language runtime engine: CLI, CGI, Apache2 and embed SAPIs."
|
|
68 HOMEPAGE="http://php.net/"
|
|
69 LICENSE="PHP-3"
|
|
70
|
|
71 # We can build the following SAPIs in the given order
|
|
72 SAPIS="cli cgi embed apache2"
|
|
73
|
|
74 # Gentoo-specific, common features
|
|
75 IUSE="kolab"
|
|
76
|
|
77 # SAPIs and SAPI-specific USE flags (cli SAPI is default on):
|
|
78 IUSE="${IUSE}
|
|
79 +${SAPIS}
|
|
80 concurrentmodphp threads"
|
|
81
|
|
82 IUSE="${IUSE} adabas bcmath berkdb birdstep bzip2 calendar cdb cjk
|
|
83 crypt +ctype curl curlwrappers db2 dbmaker debug doc empress
|
|
84 empress-bcs enchant esoob exif frontbase +fileinfo +filter firebird
|
|
85 flatfile ftp gd gd-external gdbm gmp +hash +iconv imap inifile
|
|
86 interbase intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit
|
|
87 mssql mysql mysqlnd mysqli nls oci8
|
|
88 oci8-instant-client odbc pcntl pdo +phar pic +posix postgres qdbm
|
|
89 readline recode sapdb +session sharedext sharedmem
|
|
90 +simplexml snmp soap sockets solid spell sqlite sqlite3 ssl suhosin
|
|
91 sybase-ct sysvipc tidy +tokenizer truetype unicode wddx
|
|
92 xml xmlreader xmlwriter xmlrpc xpm xsl zip zlib"
|
|
93
|
|
94 DEPEND="app-admin/php-toolkit
|
|
95 >=dev-libs/libpcre-7.9[unicode]
|
|
96 adabas? ( >=dev-db/unixODBC-1.8.13 )
|
|
97 apache2? ( www-servers/apache[threads=] )
|
|
98 berkdb? ( =sys-libs/db-4* )
|
|
99 birdstep? ( >=dev-db/unixODBC-1.8.13 )
|
|
100 bzip2? ( app-arch/bzip2 )
|
|
101 cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
|
|
102 cjk? ( !gd? ( !gd-external? (
|
|
103 >=media-libs/jpeg-6b
|
|
104 media-libs/libpng
|
|
105 sys-libs/zlib
|
|
106 ) ) )
|
|
107 crypt? ( >=dev-libs/libmcrypt-2.4 )
|
|
108 curl? ( >=net-misc/curl-7.10.5 )
|
|
109 db2? ( >=dev-db/unixODBC-1.8.13 )
|
|
110 dbmaker? ( >=dev-db/unixODBC-1.8.13 )
|
|
111 empress? ( >=dev-db/unixODBC-1.8.13 )
|
|
112 empress-bcs? ( >=dev-db/unixODBC-1.8.13 )
|
|
113 enchant? ( app-text/enchant )
|
|
114 esoob? ( >=dev-db/unixODBC-1.8.13 )
|
|
115 exif? ( !gd? ( !gd-external? (
|
|
116 >=media-libs/jpeg-6b
|
|
117 media-libs/libpng
|
|
118 sys-libs/zlib
|
|
119 ) ) )
|
|
120 firebird? ( dev-db/firebird )
|
|
121 gd? ( >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib )
|
|
122 gd-external? ( media-libs/gd )
|
|
123 gdbm? ( >=sys-libs/gdbm-1.8.0 )
|
|
124 gmp? ( >=dev-libs/gmp-4.1.2 )
|
|
125 iconv? ( virtual/libiconv )
|
|
126 imap? (
|
|
127 virtual/imap-c-client[ssl=]
|
|
128 virtual/imap-c-client[kolab=]
|
|
129 )
|
|
130 intl? ( dev-libs/icu )
|
|
131 iodbc? ( dev-db/libiodbc )
|
|
132 kerberos? ( virtual/krb5 )
|
|
133 kolab? ( >=net-libs/c-client-2004g-r1 )
|
|
134 ldap? ( !oci8? ( >=net-nds/openldap-1.2.11 ) )
|
|
135 ldap-sasl? ( !oci8? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) )
|
|
136 libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
|
|
137 mssql? ( dev-db/freetds[mssql] )
|
|
138 !mysqlnd? (
|
|
139 mysql? ( virtual/mysql )
|
|
140 mysqli? ( >=virtual/mysql-4.1 )
|
|
141 )
|
|
142 nls? ( sys-devel/gettext )
|
|
143 oci8-instant-client? ( dev-db/oracle-instantclient-basic )
|
|
144 odbc? ( >=dev-db/unixODBC-1.8.13 )
|
|
145 postgres? (
|
|
146 || (
|
|
147 >=dev-db/postgresql-base-7.1
|
|
148 (
|
|
149 || (
|
|
150 <dev-db/libpq-8
|
|
151 >=dev-db/libpq-8[threads=]
|
|
152 )
|
|
153 )
|
|
154 )
|
|
155 )
|
|
156 qdbm? ( dev-db/qdbm )
|
|
157 readline? ( sys-libs/readline )
|
|
158 recode? ( app-text/recode )
|
|
159 sapdb? ( >=dev-db/unixODBC-1.8.13 )
|
|
160 sharedmem? ( dev-libs/mm )
|
|
161 simplexml? ( >=dev-libs/libxml2-2.6.8 )
|
|
162 snmp? ( >=net-analyzer/net-snmp-5.2 )
|
|
163 soap? ( >=dev-libs/libxml2-2.6.8 )
|
|
164 solid? ( >=dev-db/unixODBC-1.8.13 )
|
|
165 spell? ( >=app-text/aspell-0.50 )
|
|
166 sqlite? ( =dev-db/sqlite-2* pdo? ( =dev-db/sqlite-3* ) )
|
|
167 sqlite3? ( =dev-db/sqlite-3* )
|
|
168 ssl? ( >=dev-libs/openssl-0.9.7 )
|
|
169 sybase-ct? ( dev-db/freetds )
|
|
170 tidy? ( app-text/htmltidy )
|
|
171 truetype? (
|
|
172 =media-libs/freetype-2*
|
|
173 >=media-libs/t1lib-5.0.0
|
|
174 !gd? ( !gd-external? (
|
|
175 >=media-libs/jpeg-6b media-libs/libpng sys-libs/zlib ) )
|
|
176 )
|
|
177 unicode? ( dev-libs/oniguruma )
|
|
178 wddx? ( >=dev-libs/libxml2-2.6.8 )
|
|
179 xml? ( >=dev-libs/libxml2-2.6.8 )
|
|
180 xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
|
|
181 xmlreader? ( >=dev-libs/libxml2-2.6.8 )
|
|
182 xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
|
|
183 xpm? (
|
|
184 x11-libs/libXpm
|
|
185 >=media-libs/jpeg-6b
|
|
186 media-libs/libpng sys-libs/zlib
|
|
187 )
|
|
188 xsl? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
|
|
189 zip? ( sys-libs/zlib )
|
|
190 zlib? ( sys-libs/zlib )
|
|
191 virtual/mta
|
|
192 "
|
|
193
|
|
194 php="=${CATEGORY}/${PF}"
|
|
195 RDEPEND="${DEPEND}
|
|
196 truetype? ( || ( $php[gd] $php[gd-external] ) )
|
|
197 cjk? ( || ( $php[gd] $php[gd-external] ) )
|
|
198 exif? ( || ( $php[gd] $php[gd-external] ) )
|
|
199
|
|
200 xpm? ( $php[gd] )
|
|
201 gd? ( $php[zlib,-gd-external] )
|
|
202 gd-external? ( $php[-gd] )
|
|
203 simplexml? ( $php[xml] )
|
|
204 soap? ( $php[xml] )
|
|
205 wddx? ( $php[xml] )
|
|
206 xmlrpc? ( || ( $php[xml] $php[iconv] ) )
|
|
207 xmlreader? ( $php[xml] )
|
|
208 xsl? ( $php[xml] )
|
|
209 ldap-sasl? ( $php[ldap,-oci8] )
|
|
210 suhosin? ( $php[unicode] )
|
|
211 adabas? ( $php[odbc] )
|
|
212 birdstep? ( $php[odbc] )
|
|
213 dbmaker? ( $php[odbc] )
|
|
214 empress-bcs? ( $php[empress] )
|
|
215 empress? ( $php[odbc] )
|
|
216 esoob? ( $php[odbc] )
|
|
217 db2? ( $php[odbc] )
|
|
218 sapdb? ( $php[odbc] )
|
|
219 solid? ( $php[odbc] )
|
|
220 kolab? ( $php[imap] )
|
|
221 phar? ( $php[hash] )
|
|
222 mysqlnd? ( || (
|
|
223 $php[mysql]
|
|
224 $php[mysqli]
|
|
225 $php[pdo]
|
|
226 ) )
|
|
227
|
|
228 oci8? ( $php[-oci8-instant-client,-ldap-sasl] )
|
|
229 oci8-instant-client? ( $php[-oci8] )
|
|
230
|
|
231 qdbm? ( $php[-gdbm] )
|
|
232 readline? ( $php[-libedit] )
|
|
233 recode? ( $php[-imap,-mysql,-mysqli] )
|
|
234 firebird? ( $php[-interbase] )
|
|
235 sharedmem? ( $php[-threads] )
|
|
236
|
|
237 !cli? ( !cgi? ( !apache2? ( !embed? ( $php[cli] ) ) ) )
|
|
238
|
|
239 enchant? ( !dev-php${PHP_MV}/pecl-enchant )
|
|
240 fileinfo? ( !dev-php${PHP_MV}/pecl-fileinfo )
|
|
241 filter? ( !dev-php${PHP_MV}/pecl-filter )
|
|
242 json? ( !dev-php${PHP_MV}/pecl-json )
|
|
243 phar? ( !dev-php${PHP_MV}/pecl-phar )
|
|
244 zip? ( !dev-php${PHP_MV}/pecl-zip )"
|
|
245
|
|
246 DEPEND="${DEPEND}
|
|
247 sys-devel/flex
|
|
248 >=sys-devel/m4-1.4.3
|
|
249 >=sys-devel/libtool-1.5.18"
|
|
250
|
|
251 # They are in PDEPEND because we need PHP installed first!
|
|
252 PDEPEND="doc? ( app-doc/php-docs )
|
|
253 suhosin? ( dev-php${PHP_MV}/suhosin )"
|
|
254
|
|
255 # Portage doesn't support setting PROVIDE based on the USE flags that
|
|
256 # have been enabled, so we have to PROVIDE everything for now and hope
|
|
257 # for the best
|
|
258 PROVIDE="virtual/php virtual/httpd-php"
|
|
259
|
|
260 SLOT="${PHP_MV}"
|
|
261 S="${WORKDIR}/${PHP_P}"
|
|
262
|
|
263 PHP_INI_FILE="php.ini"
|
|
264 PHP_INI_UPSTREAM="php.ini-production"
|
|
265
|
|
266 want_apache
|
|
267
|
|
268 # eblit-core
|
|
269 # Usage: <function> [version] [eval]
|
|
270 # Main eblit engine
|
|
271 eblit-core() {
|
|
272 [[ -z $FILESDIR ]] && FILESDIR="$(dirname $EBUILD)/files"
|
|
273 local e v func=$1 ver=$2 eval_=$3
|
|
274 for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
|
|
275 e="${FILESDIR}/eblits/${func}${v}.eblit"
|
|
276 if [[ -e ${e} ]] ; then
|
|
277 . "${e}"
|
|
278 [[ ${eval_} == 1 ]] && eval "${func}() { eblit-run ${func} ${ver} ; }"
|
|
279 return 0
|
|
280 fi
|
|
281 done
|
|
282 return 1
|
|
283 }
|
|
284
|
|
285 # eblit-include
|
|
286 # Usage: [--skip] <function> [version]
|
|
287 # Includes an "eblit" -- a chunk of common code among ebuilds in a given
|
|
288 # package so that its functions can be sourced and utilized within the
|
|
289 # ebuild.
|
|
290 eblit-include() {
|
|
291 local skipable=false r=0
|
|
292 [[ $1 == "--skip" ]] && skipable=true && shift
|
|
293 [[ $1 == pkg_* ]] && skipable=true
|
|
294
|
|
295 [[ -z $1 ]] && die "Usage: eblit-include <function> [version]"
|
|
296 eblit-core $1 $2
|
|
297 r="$?"
|
|
298 ${skipable} && return 0
|
|
299 [[ "$r" -gt "0" ]] && die "Could not locate requested eblit '$1' in ${FILESDIR}/eblits/"
|
|
300 }
|
|
301
|
|
302 # eblit-run-maybe
|
|
303 # Usage: <function>
|
|
304 # Runs a function if it is defined in an eblit
|
|
305 eblit-run-maybe() {
|
|
306 [[ $(type -t "$@") == "function" ]] && "$@"
|
|
307 }
|
|
308
|
|
309 # eblit-run
|
|
310 # Usage: <function> [version]
|
|
311 # Runs a function defined in an eblit
|
|
312 eblit-run() {
|
|
313 eblit-include --skip common "${*:2}"
|
|
314 eblit-include "$@"
|
|
315 eblit-run-maybe eblit-$1-pre
|
|
316 eblit-${PN}-$1
|
|
317 eblit-run-maybe eblit-$1-post
|
|
318 }
|
|
319
|
|
320 # eblit-pkg
|
|
321 # Usage: <phase> [version]
|
|
322 # Includes the given functions AND evals them so they're included in the binpkgs
|
|
323 eblit-pkg() {
|
|
324 [[ -z $1 ]] && die "Usage: eblit-pkg <phase> [version]"
|
|
325 eblit-core $1 $2 1
|
|
326 }
|
|
327
|
|
328 eblit-pkg pkg_setup v1
|
|
329
|
|
330 src_prepare() { eblit-run src_prepare v1 ; }
|
|
331 src_configure() { eblit-run src_configure v1 ; }
|
|
332 src_compile() { eblit-run src_compile v1 ; }
|
|
333 src_install() { eblit-run src_install v1 ; }
|
|
334 src_test() { eblit-run src_test v1 ; }
|
|
335
|
|
336 eblit-pkg pkg_postinst v1
|