1 |
commit: 148e80786ee24c96d3b0c7de72f28d300aee234e |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jul 18 14:27:57 2017 +0000 |
4 |
Commit: Brian Evans <grknight <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jul 18 14:27:57 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=148e8078 |
7 |
|
8 |
dev-lang/php: Drop olc revision |
9 |
|
10 |
Package-Manager: Portage-2.3.6, Repoman-2.3.2 |
11 |
|
12 |
dev-lang/php/php-5.6.30-r2.ebuild | 772 -------------------------------------- |
13 |
1 file changed, 772 deletions(-) |
14 |
|
15 |
diff --git a/dev-lang/php/php-5.6.30-r2.ebuild b/dev-lang/php/php-5.6.30-r2.ebuild |
16 |
deleted file mode 100644 |
17 |
index a0a35c64a42..00000000000 |
18 |
--- a/dev-lang/php/php-5.6.30-r2.ebuild |
19 |
+++ /dev/null |
20 |
@@ -1,772 +0,0 @@ |
21 |
-# Copyright 1999-2017 Gentoo Foundation |
22 |
-# Distributed under the terms of the GNU General Public License v2 |
23 |
- |
24 |
-EAPI=6 |
25 |
- |
26 |
-inherit autotools flag-o-matic versionator systemd |
27 |
- |
28 |
-DESCRIPTION="The PHP language runtime engine" |
29 |
-HOMEPAGE="http://php.net/" |
30 |
-SRC_URI="http://php.net/distributions/${P}.tar.xz" |
31 |
- |
32 |
-LICENSE="PHP-3.01 |
33 |
- BSD |
34 |
- Zend-2.0 |
35 |
- bcmath? ( LGPL-2.1+ ) |
36 |
- fpm? ( BSD-2 ) |
37 |
- gd? ( gd ) |
38 |
- unicode? ( BSD-2 LGPL-2.1 )" |
39 |
- |
40 |
-SLOT="$(get_version_component_range 1-2)" |
41 |
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" |
42 |
- |
43 |
-# We can build the following SAPIs in the given order |
44 |
-SAPIS="embed cli cgi fpm apache2" |
45 |
- |
46 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
47 |
-IUSE="${IUSE} |
48 |
- ${SAPIS/cli/+cli} |
49 |
- threads" |
50 |
- |
51 |
-IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk |
52 |
- coverage crypt +ctype curl debug |
53 |
- enchant exif +fileinfo +filter firebird |
54 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
55 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl |
56 |
- mhash mssql mysql libmysqlclient mysqli nls |
57 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
58 |
- readline recode selinux +session sharedmem |
59 |
- +simplexml snmp soap sockets spell sqlite ssl |
60 |
- sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx |
61 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
62 |
- |
63 |
-# The supported (that is, autodetected) versions of BDB are listed in |
64 |
-# the ./configure script. Other versions *work*, but we need to stick to |
65 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
66 |
-COMMON_DEPEND=" |
67 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
68 |
- >=dev-libs/libpcre-8.32[unicode] |
69 |
- acl? ( sys-apps/acl ) |
70 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
71 |
- <www-servers/apache-2.4[threads=] ) ) |
72 |
- berkdb? ( || ( sys-libs/db:5.3 |
73 |
- sys-libs/db:5.1 |
74 |
- sys-libs/db:4.8 |
75 |
- sys-libs/db:4.7 |
76 |
- sys-libs/db:4.6 |
77 |
- sys-libs/db:4.5 ) ) |
78 |
- bzip2? ( app-arch/bzip2 ) |
79 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
80 |
- cjk? ( !gd? ( |
81 |
- virtual/jpeg:0 |
82 |
- media-libs/libpng:0= |
83 |
- sys-libs/zlib |
84 |
- ) ) |
85 |
- coverage? ( dev-util/lcov ) |
86 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
87 |
- curl? ( >=net-misc/curl-7.10.5 ) |
88 |
- enchant? ( app-text/enchant ) |
89 |
- exif? ( !gd? ( |
90 |
- virtual/jpeg:0 |
91 |
- media-libs/libpng:0= |
92 |
- sys-libs/zlib |
93 |
- ) ) |
94 |
- firebird? ( dev-db/firebird ) |
95 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
96 |
- gdbm? ( >=sys-libs/gdbm-1.8.0 ) |
97 |
- gmp? ( dev-libs/gmp:0 ) |
98 |
- iconv? ( virtual/libiconv ) |
99 |
- imap? ( virtual/imap-c-client[kerberos=,ssl=] ) |
100 |
- intl? ( dev-libs/icu:= ) |
101 |
- iodbc? ( dev-db/libiodbc ) |
102 |
- kerberos? ( virtual/krb5 ) |
103 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
104 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
105 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
106 |
- mssql? ( dev-db/freetds[mssql] ) |
107 |
- libmysqlclient? ( |
108 |
- mysql? ( virtual/libmysqlclient:= ) |
109 |
- mysqli? ( virtual/libmysqlclient:= ) |
110 |
- ) |
111 |
- nls? ( sys-devel/gettext ) |
112 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
113 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
114 |
- postgres? ( dev-db/postgresql:* ) |
115 |
- qdbm? ( dev-db/qdbm ) |
116 |
- readline? ( sys-libs/readline:0= ) |
117 |
- recode? ( app-text/recode ) |
118 |
- sharedmem? ( dev-libs/mm ) |
119 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
120 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
121 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
122 |
- spell? ( >=app-text/aspell-0.50 ) |
123 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
124 |
- ssl? ( |
125 |
- !libressl? ( dev-libs/openssl:0= ) |
126 |
- libressl? ( dev-libs/libressl ) |
127 |
- ) |
128 |
- sybase-ct? ( dev-db/freetds ) |
129 |
- tidy? ( app-text/htmltidy ) |
130 |
- truetype? ( |
131 |
- =media-libs/freetype-2* |
132 |
- >=media-libs/t1lib-5.0.0 |
133 |
- !gd? ( |
134 |
- virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
135 |
- ) |
136 |
- unicode? ( dev-libs/oniguruma ) |
137 |
- vpx? ( media-libs/libvpx ) |
138 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
139 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
140 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
141 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
142 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
143 |
- xpm? ( |
144 |
- x11-libs/libXpm |
145 |
- virtual/jpeg:0 |
146 |
- media-libs/libpng:0= sys-libs/zlib |
147 |
- ) |
148 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
149 |
- zip? ( sys-libs/zlib ) |
150 |
- zlib? ( sys-libs/zlib ) |
151 |
-" |
152 |
- |
153 |
-RDEPEND="${COMMON_DEPEND} |
154 |
- virtual/mta |
155 |
- fpm? ( |
156 |
- selinux? ( sec-policy/selinux-phpfpm ) |
157 |
- systemd? ( sys-apps/systemd ) )" |
158 |
- |
159 |
-DEPEND="${COMMON_DEPEND} |
160 |
- app-arch/xz-utils |
161 |
- >=sys-devel/bison-3.0.1 |
162 |
- sys-devel/flex |
163 |
- >=sys-devel/m4-1.4.3 |
164 |
- >=sys-devel/libtool-1.5.18" |
165 |
- |
166 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
167 |
-REQUIRED_USE=" |
168 |
- cli? ( ^^ ( readline libedit ) ) |
169 |
- truetype? ( gd ) |
170 |
- vpx? ( gd ) |
171 |
- cjk? ( gd ) |
172 |
- exif? ( gd ) |
173 |
- |
174 |
- xpm? ( gd ) |
175 |
- gd? ( zlib ) |
176 |
- simplexml? ( xml ) |
177 |
- soap? ( xml ) |
178 |
- wddx? ( xml ) |
179 |
- xmlrpc? ( || ( xml iconv ) ) |
180 |
- xmlreader? ( xml ) |
181 |
- xslt? ( xml ) |
182 |
- ldap-sasl? ( ldap ) |
183 |
- mhash? ( hash ) |
184 |
- phar? ( hash ) |
185 |
- libmysqlclient? ( || ( |
186 |
- mysql |
187 |
- mysqli |
188 |
- pdo |
189 |
- ) ) |
190 |
- |
191 |
- qdbm? ( !gdbm ) |
192 |
- readline? ( !libedit ) |
193 |
- recode? ( !imap !mysql !mysqli ) |
194 |
- sharedmem? ( !threads ) |
195 |
- |
196 |
- !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" |
197 |
- |
198 |
-PHP_MV="$(get_major_version)" |
199 |
- |
200 |
-php_install_ini() { |
201 |
- local phpsapi="${1}" |
202 |
- |
203 |
- # work out where we are installing the ini file |
204 |
- php_set_ini_dir "${phpsapi}" |
205 |
- |
206 |
- # Always install the production INI file, bug 611214. |
207 |
- local phpinisrc="php.ini-production-${phpsapi}" |
208 |
- cp php.ini-production "${phpinisrc}" || die |
209 |
- |
210 |
- # default to /tmp for save_path, bug #282768 |
211 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
212 |
- |
213 |
- # Set the extension dir |
214 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ |
215 |
- -i "${phpinisrc}" || die |
216 |
- |
217 |
- # Set the include path to point to where we want to find PEAR packages |
218 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
219 |
- |
220 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
221 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
222 |
- newins "${phpinisrc}" php.ini |
223 |
- |
224 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
225 |
- elog |
226 |
- |
227 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
228 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
229 |
- |
230 |
- if use opcache; then |
231 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
232 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
233 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
234 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \ |
235 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
236 |
- fi |
237 |
- |
238 |
- # SAPI-specific handling |
239 |
- if [[ "${sapi}" == "fpm" ]] ; then |
240 |
- einfo "Installing FPM config file php-fpm.conf" |
241 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
242 |
- doins sapi/fpm/php-fpm.conf |
243 |
- fi |
244 |
- |
245 |
- dodoc php.ini-{development,production} |
246 |
-} |
247 |
- |
248 |
-php_set_ini_dir() { |
249 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
250 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
251 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
252 |
-} |
253 |
- |
254 |
-src_prepare() { |
255 |
- eapply "${FILESDIR}/php-${SLOT}-no-bison-warnings.patch" |
256 |
- |
257 |
- # Change PHP branding |
258 |
- # Get the alpha/beta/rc version |
259 |
- sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ |
260 |
- -i configure.in || die "Unable to change PHP branding" |
261 |
- |
262 |
- # Patch PHP to show Gentoo as the server platform |
263 |
- sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
264 |
- -i configure.in || die "Failed to fix server platform name" |
265 |
- |
266 |
- # Prevent PHP from activating the Apache config, |
267 |
- # as we will do that ourselves |
268 |
- sed -i \ |
269 |
- -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
270 |
- -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
271 |
- configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \ |
272 |
- || die |
273 |
- |
274 |
- # Patch PHP to support heimdal instead of mit-krb5 |
275 |
- if has_version "app-crypt/heimdal" ; then |
276 |
- sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
277 |
- || die "Failed to fix heimdal libname" |
278 |
- sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
279 |
- || die "Failed to fix heimdal crypt library reference" |
280 |
- fi |
281 |
- |
282 |
- eapply_user |
283 |
- |
284 |
- # Force rebuilding aclocal.m4 |
285 |
- rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare" |
286 |
- eautoreconf |
287 |
- |
288 |
- if [[ ${CHOST} == *-darwin* ]] ; then |
289 |
- # http://bugs.php.net/bug.php?id=48795, bug #343481 |
290 |
- sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die |
291 |
- fi |
292 |
-} |
293 |
- |
294 |
-src_configure() { |
295 |
- addpredict /usr/share/snmp/mibs/.index |
296 |
- addpredict /var/lib/net-snmp/mib_indexes |
297 |
- |
298 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
299 |
- |
300 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
301 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
302 |
- local our_conf=( |
303 |
- --prefix="${PHP_DESTDIR}" |
304 |
- --mandir="${PHP_DESTDIR}/man" |
305 |
- --infodir="${PHP_DESTDIR}/info" |
306 |
- --libdir="${PHP_DESTDIR}/lib" |
307 |
- --with-libdir="$(get_libdir)" |
308 |
- --localstatedir="${EPREFIX}/var" |
309 |
- --without-pear |
310 |
- $(use_enable threads maintainer-zts) |
311 |
- ) |
312 |
- |
313 |
- our_conf+=( |
314 |
- $(use_with acl fpm-acl) |
315 |
- $(use_enable bcmath bcmath) |
316 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
317 |
- $(use_enable calendar calendar) |
318 |
- $(use_enable coverage gcov) |
319 |
- $(use_enable ctype ctype) |
320 |
- $(use_with curl curl "${EPREFIX}/usr") |
321 |
- $(use_enable xml dom) |
322 |
- $(use_with enchant enchant "${EPREFIX}/usr") |
323 |
- $(use_enable exif exif) |
324 |
- $(use_enable fileinfo fileinfo) |
325 |
- $(use_enable filter filter) |
326 |
- $(use_enable ftp ftp) |
327 |
- $(use_with nls gettext "${EPREFIX}/usr") |
328 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
329 |
- $(use_enable hash hash) |
330 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
331 |
- $(use_with iconv iconv \ |
332 |
- $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr")) |
333 |
- $(use_enable intl intl) |
334 |
- $(use_enable ipv6 ipv6) |
335 |
- $(use_enable json json) |
336 |
- $(use_with kerberos kerberos "${EPREFIX}/usr") |
337 |
- $(use_enable xml libxml) |
338 |
- $(use_with xml libxml-dir "${EPREFIX}/usr") |
339 |
- $(use_enable unicode mbstring) |
340 |
- $(use_with crypt mcrypt "${EPREFIX}/usr") |
341 |
- $(use_with mssql mssql "${EPREFIX}/usr") |
342 |
- $(use_with unicode onig "${EPREFIX}/usr") |
343 |
- $(use_with ssl openssl "${EPREFIX}/usr") |
344 |
- $(use_with ssl openssl-dir "${EPREFIX}/usr") |
345 |
- $(use_enable pcntl pcntl) |
346 |
- $(use_enable phar phar) |
347 |
- $(use_enable pdo pdo) |
348 |
- $(use_enable opcache opcache) |
349 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
350 |
- $(use_enable posix posix) |
351 |
- $(use_with spell pspell "${EPREFIX}/usr") |
352 |
- $(use_with recode recode "${EPREFIX}/usr") |
353 |
- $(use_enable simplexml simplexml) |
354 |
- $(use_enable sharedmem shmop) |
355 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
356 |
- $(use_enable soap soap) |
357 |
- $(use_enable sockets sockets) |
358 |
- $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
359 |
- $(use_with sybase-ct sybase-ct "${EPREFIX}/usr") |
360 |
- $(use_enable sysvipc sysvmsg) |
361 |
- $(use_enable sysvipc sysvsem) |
362 |
- $(use_enable sysvipc sysvshm) |
363 |
- $(use_with systemd fpm-systemd) |
364 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
365 |
- $(use_enable tokenizer tokenizer) |
366 |
- $(use_enable wddx wddx) |
367 |
- $(use_enable xml xml) |
368 |
- $(use_enable xmlreader xmlreader) |
369 |
- $(use_enable xmlwriter xmlwriter) |
370 |
- $(use_with xmlrpc xmlrpc) |
371 |
- $(use_with xslt xsl "${EPREFIX}/usr") |
372 |
- $(use_enable zip zip) |
373 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
374 |
- $(use_enable debug debug) |
375 |
- ) |
376 |
- |
377 |
- # DBA support |
378 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
379 |
- || use qdbm ; then |
380 |
- our_conf+=( "--enable-dba${shared}" ) |
381 |
- fi |
382 |
- |
383 |
- # DBA drivers support |
384 |
- our_conf+=( |
385 |
- $(use_with cdb cdb) |
386 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
387 |
- $(use_enable flatfile flatfile) |
388 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
389 |
- $(use_enable inifile inifile) |
390 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
391 |
- ) |
392 |
- |
393 |
- # Support for the GD graphics library |
394 |
- our_conf+=( |
395 |
- $(use_with truetype freetype-dir "${EPREFIX}/usr") |
396 |
- $(use_with truetype t1lib "${EPREFIX}/usr") |
397 |
- $(use_enable cjk gd-jis-conv) |
398 |
- $(use_with gd jpeg-dir "${EPREFIX}/usr") |
399 |
- $(use_with gd png-dir "${EPREFIX}/usr") |
400 |
- $(use_with xpm xpm-dir "${EPREFIX}/usr") |
401 |
- $(use_with vpx vpx-dir "${EPREFIX}/usr") |
402 |
- ) |
403 |
- # enable gd last, so configure can pick up the previous settings |
404 |
- our_conf+=( $(use_with gd gd) ) |
405 |
- |
406 |
- # IMAP support |
407 |
- if use imap ; then |
408 |
- our_conf+=( |
409 |
- $(use_with imap imap "${EPREFIX}/usr") |
410 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
411 |
- ) |
412 |
- fi |
413 |
- |
414 |
- # Interbase/firebird support |
415 |
- our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
416 |
- |
417 |
- # LDAP support |
418 |
- if use ldap ; then |
419 |
- our_conf+=( |
420 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
421 |
- $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
422 |
- ) |
423 |
- fi |
424 |
- |
425 |
- # MySQL support |
426 |
- local mysqllib="mysqlnd" |
427 |
- local mysqlilib="mysqlnd" |
428 |
- use libmysqlclient && mysqllib="${EPREFIX}/usr" |
429 |
- use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config" |
430 |
- |
431 |
- our_conf+=( $(use_with mysql mysql "${mysqllib}") ) |
432 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
433 |
- |
434 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
435 |
- if use mysql || use mysqli ; then |
436 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
437 |
- fi |
438 |
- |
439 |
- # ODBC support |
440 |
- our_conf+=( |
441 |
- $(use_with odbc unixODBC "${EPREFIX}/usr") |
442 |
- $(use_with iodbc iodbc "${EPREFIX}/usr") |
443 |
- ) |
444 |
- |
445 |
- # Oracle support |
446 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
447 |
- |
448 |
- # PDO support |
449 |
- if use pdo ; then |
450 |
- our_conf+=( |
451 |
- $(use_with mssql pdo-dblib) |
452 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
453 |
- $(use_with postgres pdo-pgsql) |
454 |
- $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
455 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
456 |
- $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
457 |
- $(use_with oci8-instant-client pdo-oci) |
458 |
- ) |
459 |
- fi |
460 |
- |
461 |
- # readline/libedit support |
462 |
- our_conf+=( |
463 |
- $(use_with readline readline "${EPREFIX}/usr") |
464 |
- $(use_with libedit libedit "${EPREFIX}/usr") |
465 |
- ) |
466 |
- |
467 |
- # Session support |
468 |
- if use session ; then |
469 |
- our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") ) |
470 |
- else |
471 |
- our_conf+=( $(use_enable session session) ) |
472 |
- fi |
473 |
- |
474 |
- # Use pic for shared modules such as apache2's mod_php |
475 |
- our_conf+=( --with-pic ) |
476 |
- |
477 |
- # we use the system copy of pcre |
478 |
- # --with-pcre-regex affects ext/pcre |
479 |
- # --with-pcre-dir affects ext/filter and ext/zip |
480 |
- our_conf+=( |
481 |
- --with-pcre-regex="${EPREFIX}/usr" |
482 |
- --with-pcre-dir="${EPREFIX}/usr" |
483 |
- ) |
484 |
- |
485 |
- # Catch CFLAGS problems |
486 |
- # Fixes bug #14067. |
487 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
488 |
- replace-cpu-flags "k6*" "i586" |
489 |
- |
490 |
- # Cache the ./configure test results between SAPIs. |
491 |
- our_conf+=( --cache-file="${T}/config.cache" ) |
492 |
- |
493 |
- # Support user-passed configuration parameters |
494 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
495 |
- |
496 |
- # Support the Apache2 extras, they must be set globally for all |
497 |
- # SAPIs to work correctly, especially for external PHP extensions |
498 |
- |
499 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
500 |
- for one_sapi in $SAPIS ; do |
501 |
- use "${one_sapi}" || continue |
502 |
- php_set_ini_dir "${one_sapi}" |
503 |
- |
504 |
- # The BUILD_DIR variable is used to determine where to output |
505 |
- # the files that autotools creates. This was all originally |
506 |
- # based on the autotools-utils eclass. |
507 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
508 |
- cp -a "${S}" "${BUILD_DIR}" || die |
509 |
- cd "${BUILD_DIR}" || die |
510 |
- |
511 |
- local sapi_conf=( |
512 |
- --with-config-file-path="${PHP_INI_DIR}" |
513 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
514 |
- ) |
515 |
- |
516 |
- for sapi in $SAPIS ; do |
517 |
- case "$sapi" in |
518 |
- cli|cgi|embed|fpm) |
519 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
520 |
- sapi_conf+=( "--enable-${sapi}" ) |
521 |
- else |
522 |
- sapi_conf+=( "--disable-${sapi}" ) |
523 |
- fi |
524 |
- ;; |
525 |
- |
526 |
- apache2) |
527 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
528 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) |
529 |
- else |
530 |
- sapi_conf+=( --without-apxs2 ) |
531 |
- fi |
532 |
- ;; |
533 |
- esac |
534 |
- done |
535 |
- |
536 |
- # Construct the $myeconfargs array by concatenating $our_conf |
537 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
538 |
- local myeconfargs=( "${our_conf[@]}" ) |
539 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
540 |
- |
541 |
- pushd "${BUILD_DIR}" > /dev/null || die |
542 |
- econf "${myeconfargs[@]}" |
543 |
- popd > /dev/null || die |
544 |
- done |
545 |
-} |
546 |
- |
547 |
-src_compile() { |
548 |
- # snmp seems to run during src_compile, too (bug #324739) |
549 |
- addpredict /usr/share/snmp/mibs/.index |
550 |
- addpredict /var/lib/net-snmp/mib_indexes |
551 |
- |
552 |
- for sapi in ${SAPIS} ; do |
553 |
- if use "${sapi}"; then |
554 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
555 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
556 |
- emake |
557 |
- fi |
558 |
- done |
559 |
-} |
560 |
- |
561 |
-src_install() { |
562 |
- # see bug #324739 for what happens when we don't have that |
563 |
- addpredict /usr/share/snmp/mibs/.index |
564 |
- |
565 |
- # grab the first SAPI that got built and install common files from there |
566 |
- local first_sapi="" |
567 |
- for sapi in $SAPIS ; do |
568 |
- if use $sapi ; then |
569 |
- first_sapi=$sapi |
570 |
- break |
571 |
- fi |
572 |
- done |
573 |
- |
574 |
- # Makefile forgets to create this before trying to write to it... |
575 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
576 |
- |
577 |
- # Install php environment (without any sapis) |
578 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
579 |
- emake INSTALL_ROOT="${D}" \ |
580 |
- install-build install-headers install-programs |
581 |
- |
582 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
583 |
- |
584 |
- # Create the directory where we'll put version-specific php scripts |
585 |
- keepdir "/usr/share/php${PHP_MV}" |
586 |
- |
587 |
- local sapi="", file="" |
588 |
- local sapi_list="" |
589 |
- |
590 |
- for sapi in ${SAPIS}; do |
591 |
- if use "${sapi}" ; then |
592 |
- einfo "Installing SAPI: ${sapi}" |
593 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
594 |
- |
595 |
- if [[ "${sapi}" == "apache2" ]] ; then |
596 |
- # We're specifically not using emake install-sapi as libtool |
597 |
- # may cause unnecessary relink failures (see bug #351266) |
598 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
599 |
- newins ".libs/libphp5$(get_libname)" \ |
600 |
- "libphp${PHP_MV}$(get_libname)" |
601 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
602 |
- else |
603 |
- # needed each time, php_install_ini would reset it |
604 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
605 |
- into "${dest}" |
606 |
- case "$sapi" in |
607 |
- cli) |
608 |
- source="sapi/cli/php" |
609 |
- ;; |
610 |
- cgi) |
611 |
- source="sapi/cgi/php-cgi" |
612 |
- ;; |
613 |
- fpm) |
614 |
- source="sapi/fpm/php-fpm" |
615 |
- ;; |
616 |
- embed) |
617 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
618 |
- ;; |
619 |
- *) |
620 |
- die "unhandled sapi in src_install" |
621 |
- ;; |
622 |
- esac |
623 |
- |
624 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
625 |
- dolib.so "${source}" |
626 |
- else |
627 |
- dobin "${source}" |
628 |
- local name="$(basename ${source})" |
629 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
630 |
- fi |
631 |
- fi |
632 |
- |
633 |
- php_install_ini "${sapi}" |
634 |
- |
635 |
- # construct correct SAPI string for php-config |
636 |
- # thanks to ferringb for the bash voodoo |
637 |
- if [[ "${sapi}" == "apache2" ]]; then |
638 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
639 |
- else |
640 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
641 |
- fi |
642 |
- fi |
643 |
- done |
644 |
- |
645 |
- # Installing opcache module |
646 |
- if use opcache ; then |
647 |
- into "${PHP_DESTDIR#${EPREFIX}}" |
648 |
- dolib.so "modules/opcache$(get_libname)" |
649 |
- fi |
650 |
- |
651 |
- # Install env.d files |
652 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
653 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
654 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
655 |
- |
656 |
- # set php-config variable correctly (bug #278439) |
657 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
658 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
659 |
- |
660 |
- if use fpm ; then |
661 |
- if use systemd; then |
662 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
663 |
- "php-fpm@${SLOT}.service" |
664 |
- else |
665 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
666 |
- "php-fpm@${SLOT}.service" |
667 |
- fi |
668 |
- fi |
669 |
-} |
670 |
- |
671 |
-src_test() { |
672 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
673 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
674 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
675 |
- ewarn "Test phase requires USE=cli, skipping" |
676 |
- return |
677 |
- else |
678 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
679 |
- fi |
680 |
- |
681 |
- if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
682 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
683 |
- fi |
684 |
- |
685 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
686 |
- "session.save_path=${T}" \ |
687 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
688 |
- "session.save_path=${T}" |
689 |
- |
690 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
691 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
692 |
- done |
693 |
- |
694 |
- local failed="$(find -name '*.out')" |
695 |
- if [[ ${failed} != "" ]] ; then |
696 |
- ewarn "The following test cases failed unexpectedly:" |
697 |
- for name in ${failed}; do |
698 |
- ewarn " ${name/.out/}" |
699 |
- done |
700 |
- else |
701 |
- einfo "No unexpected test failures, all fine" |
702 |
- fi |
703 |
- |
704 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
705 |
- local passed="" |
706 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
707 |
- [[ -f "${name}.diff" ]] && continue |
708 |
- passed="${passed} ${name}" |
709 |
- done |
710 |
- if [[ ${passed} != "" ]] ; then |
711 |
- einfo "The following test cases passed unexpectedly:" |
712 |
- for name in ${passed}; do |
713 |
- ewarn " ${passed}" |
714 |
- done |
715 |
- else |
716 |
- einfo "None of the known-to-fail tests passed, all fine" |
717 |
- fi |
718 |
- fi |
719 |
-} |
720 |
- |
721 |
-pkg_postinst() { |
722 |
- # Output some general info to the user |
723 |
- if use apache2 ; then |
724 |
- elog |
725 |
- elog "To enable PHP in apache, you will need to add \"-D PHP\" to" |
726 |
- elog "your apache2 command. OpenRC users can append that string to" |
727 |
- elog "APACHE2_OPTS in /etc/conf.d/apache2." |
728 |
- elog |
729 |
- elog "The apache module configuration file 70_mod_php.conf is" |
730 |
- elog "provided (and maintained) by eselect-php." |
731 |
- elog |
732 |
- fi |
733 |
- |
734 |
- # Create the symlinks for php |
735 |
- for m in ${SAPIS}; do |
736 |
- [[ ${m} == 'embed' ]] && continue; |
737 |
- if use $m ; then |
738 |
- local ci=$(eselect php show $m) |
739 |
- if [[ -z $ci ]]; then |
740 |
- eselect php set $m php${SLOT} || die |
741 |
- einfo "Switched ${m} to use php:${SLOT}" |
742 |
- einfo |
743 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
744 |
- elog "To switch $m to use php:${SLOT}, run" |
745 |
- elog " eselect php set $m php${SLOT}" |
746 |
- elog |
747 |
- fi |
748 |
- fi |
749 |
- done |
750 |
- |
751 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
752 |
- # example, if the user has the cgi SAPI enabled, then he has an |
753 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
754 |
- # USE="-cgi", that symlink will break. This call to eselect is |
755 |
- # supposed to remove that dead link per bug 572436. |
756 |
- eselect php cleanup || die |
757 |
- |
758 |
- if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then |
759 |
- elog "To build extensions for this version of PHP, you will need to" |
760 |
- elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." |
761 |
- elog |
762 |
- fi |
763 |
- |
764 |
- # Warn about the removal of PHP_INI_VERSION if the user has it set. |
765 |
- if [[ -n "${PHP_INI_VERSION}" ]]; then |
766 |
- ewarn 'The PHP_INI_VERSION variable has been phased out. You may' |
767 |
- ewarn 'remove it from your configuration at your convenience. See' |
768 |
- ewarn |
769 |
- ewarn ' https://bugs.gentoo.org/611214' |
770 |
- ewarn |
771 |
- ewarn 'for more information.' |
772 |
- fi |
773 |
- |
774 |
- elog "For details on how version slotting works, please see" |
775 |
- elog "the wiki:" |
776 |
- elog |
777 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
778 |
- elog |
779 |
-} |
780 |
- |
781 |
-pkg_postrm() { |
782 |
- # This serves two purposes. First, if we have just removed the last |
783 |
- # installed version of PHP, then this will remove any dead symlinks |
784 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
785 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
786 |
- # his existing symlinks to point to the new 7.0 installation. The |
787 |
- # latter is bug 432962. |
788 |
- # |
789 |
- # Note: the eselect-php package may not be installed at this point, |
790 |
- # so we can't die() if this command fails. |
791 |
- eselect php cleanup |
792 |
-} |