Gentoo Archives: gentoo-commits

From: "Matti Bickel (mabi)" <mabi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-lang/php/files/eblits: pkg_postinst-v1.eblit src_configure-v1.eblit common-v2.eblit src_install-v1.eblit src_compile-v2.eblit pkg_setup-v1.eblit src_compile-v1.eblit src_test-v1.eblit src_prepare-v1.eblit common-v1.eblit src_install-v2.eblit
Date: Thu, 27 May 2010 23:05:09
Message-Id: 20100527230504.9F81E2CF38@corvid.gentoo.org
1 mabi 10/05/27 23:05:04
2
3 Added: pkg_postinst-v1.eblit src_configure-v1.eblit
4 common-v2.eblit src_install-v1.eblit
5 src_compile-v2.eblit pkg_setup-v1.eblit
6 src_compile-v1.eblit src_test-v1.eblit
7 src_prepare-v1.eblit common-v1.eblit
8 src_install-v2.eblit
9 Log:
10 version bump
11 (Portage version: 2.1.8.3/cvs/Linux x86_64)
12
13 Revision Changes Path
14 1.1 dev-lang/php/files/eblits/pkg_postinst-v1.eblit
15
16 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/pkg_postinst-v1.eblit?rev=1.1&view=markup
17 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/pkg_postinst-v1.eblit?rev=1.1&content-type=text/plain
18
19 Index: pkg_postinst-v1.eblit
20 ===================================================================
21 # Copyright 1999-2010 Gentoo Foundation
22 # Distributed under the terms of the GNU General Public License v2
23 # $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/pkg_postinst-v1.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
24
25 eblit-php-pkg_postinst() {
26 # Output some general info to the user
27 if use apache2 ; then
28 APACHE2_MOD_DEFINE="PHP${PHP_MV}"
29 if use concurrentmodphp ; then
30 APACHE2_MOD_CONF="70_mod_php${PHP_MV}_concurr"
31 else
32 APACHE2_MOD_CONF="70_mod_php${PHP_MV}"
33 fi
34 apache-module_pkg_postinst
35 fi
36
37 # Update Apache2 to use mod_php
38 if use apache2 ; then
39 "${ROOT}/usr/sbin/php-select" -t apache2 php${PHP_MV} > /dev/null 2>&1
40 exitStatus=$?
41 if [[ ${exitStatus} == 2 ]] ; then
42 php-select apache2 php${PHP_MV}
43 elif [[ ${exitStatus} == 4 ]] ; then
44 ewarn "To make Apache2 use php-${PHP_MV}, use"
45 ewarn " php-select apache2 php${PHP_MV}"
46 ewarn
47 fi
48 fi
49
50 # Create the symlinks for php-cli
51 if use cli ; then
52 "${ROOT}/usr/sbin/php-select" -t php php${PHP_MV} > /dev/null 2>&1
53 exitStatus=$?
54 if [[ ${exitStatus} == 5 ]] ; then
55 php-select php php${PHP_MV}
56 elif [[ ${exitStatus} == 4 ]] ; then
57 ewarn "To make usr/bin/php point to php-${PHP_MV}, use"
58 ewarn " php-select php php${PHP_MV}"
59 ewarn
60 fi
61 fi
62
63 # Create the symlinks for php-cgi
64 if use cgi ; then
65 "${ROOT}/usr/sbin/php-select" -t php-cgi php${PHP_MV} > /dev/null 2>&1
66 exitStatus=$?
67 if [[ ${exitStatus} == 5 ]] ; then
68 php-select php-cgi php${PHP_MV}
69 elif [[ ${exitStatus} == 4 ]] ; then
70 ewarn "To make usr/bin/php-cgi point to php-${PHP_MV}, use"
71 ewarn " php-select php-cgi php${PHP_MV}"
72 ewarn
73 fi
74 fi
75
76 # Create the symlinks for php-devel
77 "${ROOT}/usr/sbin/php-select" -t php-devel php${PHP_MV} > /dev/null 2>&1
78 exitStatus=$?
79 if [[ $exitStatus == 5 ]] ; then
80 php-select php-devel php${PHP_MV}
81 elif [[ $exitStatus == 4 ]] ; then
82 ewarn "To make usr/bin/php-config and usr/bin/phpize point to php-${PHP_MV}, use"
83 ewarn " php-select php-devel php${PHP_MV}"
84 ewarn
85 fi
86
87 ewarn "You may have to recompile third-party extensions now"
88 ewarn "(includes every dev-php5/pecl-* package and probably others in that category)"
89 ewarn
90 }
91
92
93
94
95
96 1.1 dev-lang/php/files/eblits/src_configure-v1.eblit
97
98 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/src_configure-v1.eblit?rev=1.1&view=markup
99 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/src_configure-v1.eblit?rev=1.1&content-type=text/plain
100
101 Index: src_configure-v1.eblit
102 ===================================================================
103 # Copyright 1999-2010 Gentoo Foundation
104 # Distributed under the terms of the GNU General Public License v2
105 # $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_configure-v1.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
106
107 eblit-php-src_configure() {
108 PHP_DESTDIR="/usr/$(get_libdir)/php${PHP_MV}"
109
110 # This is a global variable and should be in caps. It isn't because the
111 # phpconfutils eclass relies on exactly this name...
112 my_conf="
113 --prefix="${PHP_DESTDIR}"
114 --mandir="${PHP_DESTDIR}"/man
115 --infodir="${PHP_DESTDIR}"/info
116 --libdir="${PHP_DESTDIR}"/lib
117 --without-pear
118 $(use_enable threads maintainer-zts)"
119
120 phpconfutils_init
121
122 # extension USE flag shared
123 phpconfutils_extension_enable "bcmath" "bcmath" 1
124 phpconfutils_extension_with "bz2" "bzip2" 1
125 phpconfutils_extension_enable "calendar" "calendar" 1
126 phpconfutils_extension_disable "ctype" "ctype" 0
127 phpconfutils_extension_with "curl" "curl" 1
128 phpconfutils_extension_with "curlwrappers" "curlwrappers" 0
129 phpconfutils_extension_disable "dom" "xml" 0
130 phpconfutils_extension_with "enchant" "enchant" 1 "/usr"
131 phpconfutils_extension_enable "exif" "exif" 1
132 phpconfutils_extension_disable "fileinfo" "fileinfo" 1
133 phpconfutils_extension_disable "filter" "filter" 0
134 phpconfutils_extension_enable "ftp" "ftp" 1
135 phpconfutils_extension_with "gettext" "nls" 1
136 phpconfutils_extension_with "gmp" "gmp" 1
137 phpconfutils_extension_disable "hash" "hash" 0
138 phpconfutils_extension_without "iconv" "iconv" 0
139 phpconfutils_extension_enable "intl" "intl" 1
140 phpconfutils_extension_disable "ipv6" "ipv6" 0
141 phpconfutils_extension_disable "json" "json" 0
142 phpconfutils_extension_with "kerberos" "kerberos" 0 "/usr"
143 phpconfutils_extension_disable "libxml" "xml" 0
144 phpconfutils_extension_enable "mbstring" "unicode" 1
145 phpconfutils_extension_with "mcrypt" "crypt" 1
146 phpconfutils_extension_with "mssql" "mssql" 1
147 phpconfutils_extension_with "onig" "unicode" 0 "/usr"
148 phpconfutils_extension_with "openssl" "ssl" 0
149 phpconfutils_extension_with "openssl-dir" "ssl" 0 "/usr"
150 phpconfutils_extension_enable "pcntl" "pcntl" 1
151 phpconfutils_extension_disable "phar" "phar" 1
152 phpconfutils_extension_disable "pdo" "pdo" 0
153 phpconfutils_extension_with "pgsql" "postgres" 1
154 phpconfutils_extension_disable "posix" "posix" 0
155 phpconfutils_extension_with "pspell" "spell" 1
156 phpconfutils_extension_with "recode" "recode" 1
157 phpconfutils_extension_disable "simplexml" "simplexml" 0
158 phpconfutils_extension_enable "shmop" "sharedmem" 0
159 phpconfutils_extension_with "snmp" "snmp" 1
160 phpconfutils_extension_enable "soap" "soap" 1
161 phpconfutils_extension_enable "sockets" "sockets" 1
162 phpconfutils_extension_without "sqlite3" "sqlite3" 1 "/usr"
163 phpconfutils_extension_with "sybase-ct" "sybase-ct" 1
164 phpconfutils_extension_enable "sysvmsg" "sysvipc" 1
165 phpconfutils_extension_enable "sysvsem" "sysvipc" 1
166 phpconfutils_extension_enable "sysvshm" "sysvipc" 1
167 phpconfutils_extension_with "tidy" "tidy" 1
168 phpconfutils_extension_disable "tokenizer" "tokenizer" 0
169 phpconfutils_extension_enable "wddx" "wddx" 1
170 phpconfutils_extension_disable "xml" "xml" 0
171 phpconfutils_extension_disable "xmlreader" "xmlreader" 0
172 phpconfutils_extension_disable "xmlwriter" "xmlwriter" 0
173 phpconfutils_extension_with "xmlrpc" "xmlrpc" 1
174 phpconfutils_extension_with "xsl" "xsl" 1
175 phpconfutils_extension_enable "zip" "zip" 1
176 phpconfutils_extension_with "zlib" "zlib" 1
177 phpconfutils_extension_enable "debug" "debug" 0
178
179 # DBA support
180 if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
181 || use qdbm ; then
182 my_conf="${my_conf} --enable-dba${shared}"
183 fi
184
185 # DBA drivers support
186 phpconfutils_extension_with "cdb" "cdb" 0
187 phpconfutils_extension_with "db4" "berkdb" 0
188 phpconfutils_extension_enable "flatfile" "flatfile" 0
189 phpconfutils_extension_with "gdbm" "gdbm" 0
190 phpconfutils_extension_enable "inifile" "inifile" 0
191 phpconfutils_extension_with "qdbm" "qdbm" 0
192
193 # Support for the GD graphics library
194 if use gd-external ; then
195 phpconfutils_extension_with "freetype-dir" "truetype" 0 "/usr"
196 phpconfutils_extension_with "t1lib" "truetype" 0 "/usr"
197 phpconfutils_extension_enable "gd-jis-conv" "cjk" 0
198 phpconfutils_extension_with "gd" "gd-external" 1 "/usr"
199 else
200 phpconfutils_extension_with "freetype-dir" "truetype" 0 "/usr"
201 phpconfutils_extension_with "t1lib" "truetype" 0 "/usr"
202 phpconfutils_extension_enable "gd-jis-conv" "cjk" 0
203 phpconfutils_extension_with "jpeg-dir" "gd" 0 "/usr"
204 phpconfutils_extension_with "png-dir" "gd" 0 "/usr"
205 phpconfutils_extension_with "xpm-dir" "xpm" 0 "/usr"
206 # enable gd last, so configure can pick up the previous settings
207 phpconfutils_extension_with "gd" "gd" 0
208 fi
209
210 # IMAP support
211 if use imap ; then
212 phpconfutils_extension_with "imap" "imap" 1
213 phpconfutils_extension_with "imap-ssl" "ssl" 0
214 fi
215
216 phpconfutils_extension_with "interbase" "interbase" 0 "/opt"
217 phpconfutils_extension_with "interbase" "firebird" 0 "/usr"
218
219 # LDAP support
220 if use ldap ; then
221 if use oci8 ; then
222 phpconfutils_extension_with "ldap" "ldap" 1 "${ORACLE_HOME}"
223 else
224 phpconfutils_extension_with "ldap" "ldap" 1
225 phpconfutils_extension_with "ldap-sasl" "ldap-sasl" 0
226 fi
227 fi
228
229 # MySQL support
230 if use mysql ; then
231 if use mysqlnd ; then
232 phpconfutils_extension_with "mysql" "mysql" 1 "mysqlnd"
233 else
234 phpconfutils_extension_with "mysql" "mysql" 1 "/usr"
235 fi
236 phpconfutils_extension_with "mysql-sock" "mysql" 0 "/var/run/mysqld/mysqld.sock"
237 fi
238
239 # MySQLi support
240 if use mysqlnd ; then
241 phpconfutils_extension_with "mysqli" "mysqli" 1 "mysqlnd"
242 else
243 phpconfutils_extension_with "mysqli" "mysqli" 1 "/usr/bin/mysql_config"
244 fi
245
246 # ODBC support
247 if use odbc ; then
248 phpconfutils_extension_with "unixODBC" "odbc" 1 "/usr"
249 phpconfutils_extension_with "adabas" "adabas" 1
250 phpconfutils_extension_with "birdstep" "birdstep" 1
251 phpconfutils_extension_with "dbmaker" "dbmaker" 1
252 phpconfutils_extension_with "empress" "empress" 1
253 if use empress ; then
254 phpconfutils_extension_with "empress-bcs" "empress-bcs" 0
255 fi
256 phpconfutils_extension_with "esoob" "esoob" 1
257 phpconfutils_extension_with "ibm-db2" "db2" 1
258 phpconfutils_extension_with "iodbc" "iodbc" 1 "/usr"
259 phpconfutils_extension_with "sapdb" "sapdb" 1
260 phpconfutils_extension_with "solid" "solid" 1
261 fi
262
263 # Oracle support
264 phpconfutils_extension_with "oci8" "oci8" 1
265 if use oci8-instant-client ; then
266 OCI8IC_PKG="$(best_version dev-db/oracle-instantclient-basic | \
267 sed -e 's|dev-db/oracle-instantclient-basic-||g' | \
268 sed -e 's|-r.*||g')"
269
270 phpconfutils_extension_with "oci8" "oci8-instant-client" 1 \
271 "instantclient,/usr/lib/oracle/${OCI8IC_PKG}/client/lib"
272 fi
273
274 # PDO support
275 if use pdo ; then
276 phpconfutils_extension_with "pdo-dblib" "mssql" 1
277 if use mysqlnd ; then
278 phpconfutils_extension_with "pdo-mysql" "mysql" 1 "mysqlnd"
279 else
280 phpconfutils_extension_with "pdo-mysql" "mysql" 1 "/usr"
281 fi
282 phpconfutils_extension_with "pdo-pgsql" "postgres" 1
283 phpconfutils_extension_with "pdo-sqlite" "sqlite" 1 "/usr"
284 phpconfutils_extension_with "pdo-odbc" "odbc" 1 "unixODBC,/usr"
285 if use oci8 ; then
286 phpconfutils_extension_with "pdo-oci" "oci8" 1
287 fi
288 if use oci8-instant-client ; then
289 phpconfutils_extension_with "pdo-oci" "oci8-instant-client" 1 \
290 "instantclient,/usr,${OCI8IC_PKG}"
291 fi
292 fi
293
294 # readline/libedit support
295 phpconfutils_extension_with "readline" "readline" 0
296 phpconfutils_extension_with "libedit" "libedit" 0
297
298 # Session support
299 if use session ; then
300 phpconfutils_extension_with "mm" "sharedmem" 0
301 else
302 phpconfutils_extension_disable "session" "session" 0
303 fi
304
305 # SQLite support
306 if use sqlite ; then
307 phpconfutils_extension_with "sqlite" "sqlite" 0 "/usr"
308 phpconfutils_extension_enable "sqlite-utf8" "unicode" 0
309 else
310 phpconfutils_extension_without "sqlite" "sqlite" 0
311 fi
312
313 if use pic ; then
314 my_conf="${my_conf} --with-pic"
315 fi
316
317 # we use the system copy of pcre
318 # --with-pcre-regex affects ext/pcre
319 # --with-pcre-dir affects ext/filter and ext/zip
320 my_conf="${my_conf} --with-pcre-regex=/usr --with-pcre-dir=/usr"
321
322 # Catch CFLAGS problems
323 php_check_cflags
324
325 # Support user-passed configuration parameters
326 my_conf="${my_conf} ${EXTRA_ECONF:-}"
327
328 # Support the Apache2 extras, they must be set globally for all
329 # SAPIs to work correctly, especially for external PHP extensions
330 if use apache2 ; then
331 # Concurrent PHP Apache2 modules support
332 if use concurrentmodphp ; then
333 append-ldflags "-Wl,--version-script=${FILESDIR}/php${PHP_MV}-ldvs"
334 fi
335 fi
336 }
337
338
339
340
341
342 1.1 dev-lang/php/files/eblits/common-v2.eblit
343
344 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/common-v2.eblit?rev=1.1&view=markup
345 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/common-v2.eblit?rev=1.1&content-type=text/plain
346
347 Index: common-v2.eblit
348 ===================================================================
349 # Copyright 1999-2010 Gentoo Foundation
350 # Distributed under the terms of the GNU General Public License v2
351 # $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/common-v2.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
352
353 php_set_ini_dir() {
354 PHP_INI_DIR="/etc/php/${1}-php${PHP_MV}"
355 PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
356 PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
357 }
358
359
360
361
362 1.1 dev-lang/php/files/eblits/src_install-v1.eblit
363
364 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/src_install-v1.eblit?rev=1.1&view=markup
365 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/src_install-v1.eblit?rev=1.1&content-type=text/plain
366
367 Index: src_install-v1.eblit
368 ===================================================================
369 # Copyright 1999-2010 Gentoo Foundation
370 # Distributed under the terms of the GNU General Public License v2
371 # $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_install-v1.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
372
373 eblit-php-src_install() {
374 # Makefile forgets to create this before trying to write to it...
375 dodir "${PHP_DESTDIR}/bin"
376
377 # Install php environment (without any sapis)
378 emake INSTALL_ROOT="${D}" \
379 install-build install-headers install-programs \
380 || die "emake install failed"
381
382 local extension_dir="$("${D}/${PHP_DESTDIR}/bin/php-config" --extension-dir)"
383
384 # And install the modules to it
385 if use sharedext ; then
386 insinto "${extension_dir}"
387 doins "${S}/modules/"*.so
388 fi
389
390 # Generate the USE file for PHP
391 phpconfutils_generate_usefile
392
393 # Create the directory where we'll put version-specific php scripts
394 keepdir /usr/share/php${PHP_MV}
395
396 if use cli ; then
397 einfo "Installing SAPI: cli"
398 into "${PHP_DESTDIR}"
399 dobin "${SAPIS}"/cli/php \
400 || die "Unable to install cli sapi"
401 php_install_ini cli
402 fi
403
404 if use cgi ; then
405 einfo "Installing SAPI: cgi"
406 into "${PHP_DESTDIR}" # needed each time, php_install_ini would reset it
407 dobin "${SAPIS}"/cgi/php-cgi \
408 || die "Unable to install cgi sapi"
409 php_install_ini cgi
410 fi
411
412 if use embed ; then
413 einfo "Installing SAPI: embed"
414 into "${PHP_DESTDIR}"
415 dolib.so "${SAPIS}"/embed/libphp5.so \
416 || die "Unable to install embed sapi"
417 php_install_ini embed
418 fi
419
420 if use apache2 ; then
421 einfo "Installing SAPI: apache2"
422 emake INSTALL_ROOT="${D}" install-sapi || \
423 die "Unable to install apache2 SAPI"
424
425 if use concurrentmodphp ; then
426 einfo "Installing Apache2 config file 70_mod_php${PHP_MV}_concurr.conf"
427 insinto "${APACHE_MODULES_CONFDIR}"
428 newins "${FILESDIR}/70_mod_php${PHP_MV}_concurr.conf-apache2" \
429 "70_mod_php${PHP_MV}_concurr.conf"
430
431 # Put the ld version script in the right place so it's alwayas
432 # accessible
433 insinto "/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/"
434 doins "${FILESDIR}/php${PHP_MV}-ldvs"
435 else
436 einfo "Installing Apache2 config 70_mod_php${PHP_MV}.conf)"
437 insinto ${APACHE_MODULES_CONFDIR}
438 newins "${FILESDIR}/70_mod_php${PHP_MV}.conf-apache2" \
439 "70_mod_php${PHP_MV}.conf"
440 fi
441 php_install_ini apache2
442 fi
443
444 # Install env.d files
445 newenvd "${FILESDIR}/20php${PHP_MV}-envd" \
446 "20php${PHP_MV}"
447 sed -e "s|/lib/|/$(get_libdir)/|g" -i \
448 "${D}/etc/env.d/20php${PHP_MV}"
449 }
450
451 php_install_ini() {
452 local phpsapi="${1}"
453
454 # work out where we are installing the ini file
455 php_set_ini_dir "${phpsapi}"
456
457 local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
458 cp "${PHP_INI_UPSTREAM}" "${phpinisrc}"
459
460 # default to expose_php=Off, bug 300695
461 sed -e 's|^expose_php .*|expose_php = Off|g' -i "${phpinisrc}"
462
463 # Set the extension dir
464 sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}"
465
466 # Set the include path to point to where we want to find PEAR packages
467 sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:/usr/share/php'${PHP_MV}':/usr/share/php"|' -i "${phpinisrc}"
468
469 dodir ${PHP_INI_DIR}
470 insinto ${PHP_INI_DIR}
471 newins "${phpinisrc}" ${PHP_INI_FILE}
472
473 dodir ${PHP_EXT_INI_DIR}
474 dodir ${PHP_EXT_INI_DIR_ACTIVE}
475
476 # Install any extensions built as shared objects
477 if use sharedext ; then
478 insinto "${PHP_EXT_INI_DIR}"
479 for extension in "${D}/${extension_dir}/"*.so ; do
480 extension="${extension##*/}"
481 inifilename="${extension/.so/.ini}"
482 echo "extension=${extension}" > "${S}/modules/$inifilename"
483 doins "${S}/modules/$inifilename"
484 dosym "${PHP_EXT_INI_DIR}/${inifilename}" "${PHP_EXT_INI_DIR_ACTIVE}/${inifilename}"
485 done
486 fi
487 }
488
489
490
491
492
493 1.1 dev-lang/php/files/eblits/src_compile-v2.eblit
494
495 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/src_compile-v2.eblit?rev=1.1&view=markup
496 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/src_compile-v2.eblit?rev=1.1&content-type=text/plain
497
498 Index: src_compile-v2.eblit
499 ===================================================================
500 # Copyright 1999-2010 Gentoo Foundation
501 # Distributed under the terms of the GNU General Public License v2
502 # $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_compile-v2.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
503
504 eblit-php-src_compile() {
505 SAPI_DIR="${WORKDIR}/sapis"
506 local is_first_sapi=1
507
508 for sapi in ${SAPIS} ; do
509 use "${sapi}" || continue
510 if [[ ${is_first_sapi} == 1 ]]; then
511 is_first_sapi=0
512 else
513 emake clean
514 fi
515
516 php_sapi_build "${sapi}"
517 php_sapi_copy "${sapi}"
518 done
519 }
520
521 php_sapi_build() {
522 local sapi="$1"
523 php_set_ini_dir "${sapi}"
524
525 mkdir -p "${SAPI_DIR}/${sapi}"
526
527 sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR}
528 --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}"
529
530 for one_sapi in $SAPIS ; do
531 case "$one_sapi" in
532 cli|cgi|embed)
533 if [[ "${one_sapi}" == "${sapi}" ]] ; then
534 sapi_conf="${sapi_conf} --enable-${available_sapi}"
535 else
536 sapi_conf="${sapi_conf} --disable-${available_sapi}"
537 fi
538 ;;
539
540 apache2)
541 if [[ "${one_sapi}" == "${sapi}" ]] ; then
542 sapi_conf="${sapi_conf} --with-apxs2=/usr/sbin/apxs"
543 else
544 sapi_conf="${sapi_conf} --without-apxs2"
545 fi
546 ;;
547
548 esac
549 done
550
551 econf ${sapi_conf}
552 emake || die "emake failed"
553 }
554
555 php_sapi_copy() {
556 local sapi="$1"
557 local source=""
558
559 case "$sapi" in
560 cli)
561 source="sapi/cli/php"
562 ;;
563 cgi)
564 source="sapi/cgi/php-cgi"
565 ;;
566 embed)
567 source="libs/libphp${PHP_MV}.so"
568 ;;
569
570 apache2)
571 # apache2 is a special case; the necessary files
572 # (yes, multiple) are copied by make install, not
573 # by the ebuild; that's the reason, why apache2 has
574 # to be the last sapi
575 emake INSTALL_ROOT="${SAPI_DIR}/${sapi}/" install-sapi
576 ;;
577
578 *)
579 die "unhandled sapi in php_sapi_copy"
580 ;;
581 esac
582
583 if [[ "${source}" ]] ; then
584 cp "$source" "${SAPI_DIR}/$sapi" || die "Unable to copy ${sapi} SAPI"
585 fi
586 }
587
588
589
590 1.1 dev-lang/php/files/eblits/pkg_setup-v1.eblit
591
592 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/pkg_setup-v1.eblit?rev=1.1&view=markup
593 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/pkg_setup-v1.eblit?rev=1.1&content-type=text/plain
594
595 Index: pkg_setup-v1.eblit
596 ===================================================================
597 # Copyright 1999-2010 Gentoo Foundation
598 # Distributed under the terms of the GNU General Public License v2
599 # $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/pkg_setup-v1.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
600
601 eblit-php-pkg_setup() {
602 if use concurrentmodphp || use kolab ; then
603 ewarn "concurrentmodphp and kolab are Gentoo-specific experimental"
604 ewarn "patches. Before reporting any bugs to bugs.php.net, make sure to"
605 ewarn "rebuild PHP with those USE flags disabled"
606 ewarn
607 fi
608
609 # Mail support
610 php_check_mta
611
612 # Oracle support
613 php_check_oracle_8
614
615 phpconfutils_warn_about_external_deps
616 depend.apache_pkg_setup
617 }
618
619
620
621
622
623 1.1 dev-lang/php/files/eblits/src_compile-v1.eblit
624
625 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/src_compile-v1.eblit?rev=1.1&view=markup
626 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/src_compile-v1.eblit?rev=1.1&content-type=text/plain
627
628 Index: src_compile-v1.eblit
629 ===================================================================
630 # Copyright 1999-2010 Gentoo Foundation
631 # Distributed under the terms of the GNU General Public License v2
632 # $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_compile-v1.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
633
634 eblit-php-src_compile() {
635 SAPIS="${WORKDIR}/sapis"
636
637 if use cli ; then
638 php_sapi_build cli
639 cp sapi/cli/php "${SAPIS}/cli/" \
640 || die "Unable to copy cli SAPI"
641 fi
642
643 if use cgi ; then
644 php_sapi_build cgi
645 cp sapi/cgi/php-cgi "${SAPIS}/cgi/" \
646 || die "Unable to copy cgi SAPI"
647 fi
648
649 if use embed ; then
650 php_sapi_build embed
651 cp libs/libphp${PHP_MV}.so "${SAPIS}"/embed \
652 || die "Unable to copy embed SAPI"
653 fi
654
655 if use apache2 ; then
656 php_sapi_build apache2
657 # apache2 is a special case; the necessary files (yes, multiple)
658 # are copied by make install, not by the ebuild; that's the reason,
659 # why apache2 has to be the last sapi
660 fi
661 }
662
663 php_sapi_build() {
664 local sapi="$1"
665 php_set_ini_dir ${sapi}
666
667 mkdir -p "${SAPIS}/${sapi}"
668
669 sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR}
670 --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}"
671
672 for available_sapi in cli cgi embed ; do
673 if [[ $sapi == $available_sapi ]] ; then
674 sapi_conf="${sapi_conf} --enable-${available_sapi}"
675 else
676 sapi_conf="${sapi_conf} --disable-${available_sapi}"
677 fi
678 done
679
680 if [[ $sapi == "apache2" ]] ; then
681 sapi_conf="${sapi_conf} --with-apxs2=/usr/sbin/apxs"
682 else
683 sapi_conf="${sapi_conf} --without-apxs2"
684 fi
685
686 econf ${sapi_conf}
687 emake || die "emake failed"
688
689 rm -f main/main.o main/main.lo main/php_ini.o \
690 main/php_ini.lo 2>/dev/null
691 }
692
693
694
695
696
697 1.1 dev-lang/php/files/eblits/src_test-v1.eblit
698
699 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/src_test-v1.eblit?rev=1.1&view=markup
700 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/src_test-v1.eblit?rev=1.1&content-type=text/plain
701
702 Index: src_test-v1.eblit
703 ===================================================================
704 # Copyright 1999-2010 Gentoo Foundation
705 # Distributed under the terms of the GNU General Public License v2
706 # $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_test-v1.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
707
708 eblit-php-src_test() {
709 vecho ">>> Test phase [test]: ${CATEGORY}/${PF}"
710
711 if [[ ! -x "${S}/sapi/cli/php" ]] ; then
712 ewarn "Test phase requires USE=cli, skipping"
713 return
714 else
715 export TEST_PHP_EXECUTABLE="${S}/sapi/cli/php"
716 fi
717
718 if [[ -x "${S}/sapi/cgi/php-cgi" ]] ; then
719 export TEST_PHP_CGI_EXECUTABLE="${S}/sapi/cgi/php-cgi"
720 fi
721
722
723 REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \
724 "${S}/run-tests.php" -n -q -d "session.save_path=${T}"
725
726 for name in ${EXPECTED_TEST_FAILURES}; do
727 mv "${name}.out" "${name}.out.orig" 2>/dev/null
728 done
729
730 local failed="$(find -name '*.out')"
731 if [[ ${failed} != "" ]] ; then
732 ewarn "The following test cases failed unexpectedly:"
733 for name in ${failed}; do
734 ewarn " ${name/.out/}"
735 done
736 else
737 einfo "No unexpected test failures, all fine"
738 fi
739
740 if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
741 local passed=""
742 for name in ${EXPECTED_TEST_FAILURES}; do
743 [[ -f "${name}.diff" ]] && continue
744 passed="${passed} ${name}"
745 done
746 if [[ ${passed} != "" ]] ; then
747 einfo "The following test cases passed unexpectedly:"
748 for name in ${passed}; do
749 ewarn " ${passed}"
750 done
751 else
752 einfo "None of the known-to-fail tests passed, all fine"
753 fi
754 fi
755 }
756
757
758
759
760
761 1.1 dev-lang/php/files/eblits/src_prepare-v1.eblit
762
763 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/src_prepare-v1.eblit?rev=1.1&view=markup
764 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/src_prepare-v1.eblit?rev=1.1&content-type=text/plain
765
766 Index: src_prepare-v1.eblit
767 ===================================================================
768 # Copyright 1999-2010 Gentoo Foundation
769 # Distributed under the terms of the GNU General Public License v2
770 # $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_prepare-v1.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
771
772 eblit-php-src_prepare() {
773 # USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path
774 # ([empty session.save_path]/session_mm_[sapi][gid].sem)
775 # there is no easy way to circumvent that, all php calls during
776 # install use -n, so no php.ini file will be used.
777 # As such, this is the easiest way to get around
778 addpredict /session_mm_cli250.sem
779 addpredict /session_mm_cli0.sem
780
781 # Concurrent PHP Apache2 modules support
782 use apache2 && use concurrentmodphp && \
783 epatch "${WORKDIR}/${PV}/opt/concurrent_apache_modules.patch"
784
785 # kolab support (support for imap annotations)
786 use kolab && epatch "${WORKDIR}/${PV}/opt/imap-kolab-annotations.patch"
787
788 # Change PHP branding
789 sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1${PHP_EXTRA_BRANDING}-pl${PR/r/}-gentoo\2|g" \
790 -i configure.in || die "Unable to change PHP branding"
791
792 # Apply generic PHP patches
793 EPATCH_SOURCE="${WORKDIR}/${PV}/generic" EPATCH_SUFFIX="patch" \
794 EPATCH_FORCE="yes" \
795 EPATCH_MULTI_MSG="Applying generic patches and fixes from upstream..." epatch
796
797 # Patch PHP to show Gentoo as the server platform
798 sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
799 -i configure.in || die "Failed to fix server platform name"
800
801 # Disable interactive make test
802 sed -e 's/'`echo "\!getenv('NO_INTERACTION')"`'/false/g' -i run-tests.php
803
804 # Prevent PHP from activating the Apache config,
805 # as we will do that ourselves
806 sed -i \
807 -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
808 -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
809 configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4
810
811 # Patch PHP to support heimdal instead of mit-krb5
812 if has_version "app-crypt/heimdal" ; then
813 sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
814 || die "Failed to fix heimdal libname"
815 sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
816 || die "Failed to fix heimdal crypt library reference"
817 fi
818
819 # Suhosin support
820 if use suhosin ; then
821 epatch "${WORKDIR}/${SUHOSIN_PATCH}"
822 fi
823
824 # rebuild the whole autotools stuff as we are heavily patching it
825 # (suhosin, fastbuild, ...)
826
827 # eaclocal doesn't accept --force, so we try to force re-generation
828 # this way
829 rm aclocal.m4
830
831 # work around divert() issues with newer autoconf, bug #281697
832 if has_version '>=sys-devel/autoconf-2.64' ; then
833 sed -i -r \
834 -e 's:^((m4_)?divert)[(]([0-9]*)[)]:\1(600\3):' \
835 $(grep -l divert $(find -name '*.m4') configure.in) || die
836 fi
837 eautoreconf --force -W no-cross
838 }
839
840
841
842
843
844 1.1 dev-lang/php/files/eblits/common-v1.eblit
845
846 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/common-v1.eblit?rev=1.1&view=markup
847 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/common-v1.eblit?rev=1.1&content-type=text/plain
848
849 Index: common-v1.eblit
850 ===================================================================
851 # Copyright 1999-2010 Gentoo Foundation
852 # Distributed under the terms of the GNU General Public License v2
853 # $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/common-v1.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
854
855 php_set_ini_dir() {
856 PHP_INI_DIR="/etc/php/${1}-php${PHP_MV}"
857 PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
858 PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
859 }
860
861
862
863 1.1 dev-lang/php/files/eblits/src_install-v2.eblit
864
865 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/src_install-v2.eblit?rev=1.1&view=markup
866 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/php/files/eblits/src_install-v2.eblit?rev=1.1&content-type=text/plain
867
868 Index: src_install-v2.eblit
869 ===================================================================
870 # Copyright 1999-2010 Gentoo Foundation
871 # Distributed under the terms of the GNU General Public License v2
872 # $Header: /var/cvsroot/gentoo-x86/dev-lang/php/files/eblits/src_install-v2.eblit,v 1.1 2010/05/27 23:05:04 mabi Exp $
873
874 eblit-php-src_install() {
875 # Makefile forgets to create this before trying to write to it...
876 dodir "${PHP_DESTDIR}/bin"
877
878 # Install php environment (without any sapis)
879 emake INSTALL_ROOT="${D}" \
880 install-build install-headers install-programs \
881 || die "emake install failed"
882
883 local extension_dir="$("${D}/${PHP_DESTDIR}/bin/php-config" --extension-dir)"
884
885 # And install the modules to it
886 if use sharedext ; then
887 insinto "${extension_dir}"
888 doins "${S}/modules/"*.so
889 fi
890
891 # Generate the USE file for PHP
892 phpconfutils_generate_usefile
893
894 # Create the directory where we'll put version-specific php scripts
895 keepdir /usr/share/php${PHP_MV}
896
897 local sapi="", file=""
898
899 for sapi in ${SAPIS}; do
900 if use "${sapi}" ; then
901 einfo "Installing SAPI: ${sapi}"
902 # needed each time, php_install_ini would reset it
903 into "${PHP_DESTDIR}"
904 file=$(find "${SAPI_DIR}/${sapi}/" -type f | head -n 1)
905
906 if [[ "${file: -3}" == ".so" ]]; then
907 if [[ "${sapi}" == "apache2" ]]; then
908 insinto "${PHP_DESTDIR}/../apache2/modules/"
909 newins "${file}" "${file/*\/}"
910 else
911 dolib.so "${file}" || die "Unable to install ${sapi} sapi"
912 fi
913 else
914 dobin "${file}" || die "Unable to install ${sapi} sapi"
915 fi
916
917 php_install_ini "${sapi}"
918 fi
919 done
920
921 # Install env.d files
922 newenvd "${FILESDIR}/20php${PHP_MV}-envd" \
923 "20php${PHP_MV}"
924 sed -e "s|/lib/|/$(get_libdir)/|g" -i \
925 "${D}/etc/env.d/20php${PHP_MV}"
926 }
927
928 php_install_ini() {
929 local phpsapi="${1}"
930
931 # work out where we are installing the ini file
932 php_set_ini_dir "${phpsapi}"
933
934 local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
935 cp "${PHP_INI_UPSTREAM}" "${phpinisrc}"
936
937 # default to expose_php=Off, bug 300695
938 sed -e 's|^expose_php .*|expose_php = Off|g' -i "${phpinisrc}"
939
940 # Set the extension dir
941 sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}"
942
943 # Set the include path to point to where we want to find PEAR packages
944 sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:/usr/share/php'${PHP_MV}':/usr/share/php"|' -i "${phpinisrc}"
945
946 dodir "${PHP_INI_DIR}"
947 insinto "${PHP_INI_DIR}"
948 newins "${phpinisrc}" "${PHP_INI_FILE}"
949
950 dodir "${PHP_EXT_INI_DIR}"
951 dodir "${PHP_EXT_INI_DIR_ACTIVE}"
952
953 # Install any extensions built as shared objects
954 if use sharedext ; then
955 insinto "${PHP_EXT_INI_DIR}"
956 for extension in "${D}/${extension_dir}/"*.so ; do
957 extension="${extension##*/}"
958 inifilename="${extension/.so/.ini}"
959 echo "extension=${extension}" > "${S}/modules/$inifilename"
960 doins "${S}/modules/$inifilename"
961 dosym "${PHP_EXT_INI_DIR}/${inifilename}" "${PHP_EXT_INI_DIR_ACTIVE}/${inifilename}"
962 done
963 fi
964
965 # SAPI-specific handling
966 if [[ "${sapi}" == "apache2" ]] ; then
967 if use concurrentmodphp ; then
968 einfo "Installing Apache2 config file 70_mod_php${PHP_MV}_concurr.conf"
969 insinto "${APACHE_MODULES_CONFDIR}"
970 newins "${FILESDIR}/70_mod_php${PHP_MV}_concurr.conf-apache2" \
971 "70_mod_php${PHP_MV}_concurr.conf"
972
973 # Put the ld version script in the right place so
974 # it's always accessible
975 insinto "/var/lib/php-pkg/${CATEGORY}/${PN}-${PVR}/"
976 doins "${FILESDIR}/php${PHP_MV}-ldvs"
977 else
978 einfo "Installing Apache2 config 70_mod_php${PHP_MV}.conf)"
979 insinto ${APACHE_MODULES_CONFDIR}
980 newins "${FILESDIR}/70_mod_php${PHP_MV}.conf-apache2" \
981 "70_mod_php${PHP_MV}.conf"
982 fi
983 fi
984 }