1 |
commit: 09c1028c0eb45b9f991b2200c77477554e787c1b |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 28 15:16:05 2016 +0000 |
4 |
Commit: Brian Evans <grknight <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Nov 28 15:16:05 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=09c1028c |
7 |
|
8 |
dev-lang/php: Security cleanup wrt bug 599326 |
9 |
|
10 |
Package-Manager: portage-2.3.2 |
11 |
|
12 |
dev-lang/php/Manifest | 2 - |
13 |
dev-lang/php/php-5.6.26.ebuild | 766 ---------------------------------------- |
14 |
dev-lang/php/php-5.6.27.ebuild | 777 ----------------------------------------- |
15 |
3 files changed, 1545 deletions(-) |
16 |
|
17 |
diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest |
18 |
index 60630bb..b2ab4ce 100644 |
19 |
--- a/dev-lang/php/Manifest |
20 |
+++ b/dev-lang/php/Manifest |
21 |
@@ -1,6 +1,4 @@ |
22 |
DIST php-5.5.37.tar.bz2 13699851 SHA256 d2380ebe46caf17f2c4cd055867d00a82e6702dc5f62dc29ce864a5742905d88 SHA512 d2da921f3efd858e1cb8004873e377ca9c5821d5269d5b8e7c9be830b183f4d18f737b14653f65a43c0957bdca994e09a476d77e3a29a11e357abc24618c4c0f WHIRLPOOL 8db12b1d090bc1bfb3f5b20c661ba05588b8f988484d1887a959f943dd6f1756cb62bac811c809af516e6c3582b64388443546a3b4a17f0527a69fcbafc0452c |
23 |
DIST php-5.5.38.tar.xz 11077780 SHA256 cb527c44b48343c8557fe2446464ff1d4695155a95601083e5d1f175df95580f SHA512 c2cdb18b2c9edaeff66591e8f58f8ff488260f537cdf9ce09820c163f20ff5209c0def89343d429932c9506ad4ef3daacf224946dac1c59622501092483f30c6 WHIRLPOOL 4380c1daa39f04f90d1457152e366720b295e96aba6859625c6b375a3785b4e0f30fea590c1ee1edb439c2a405446526c702a003d68ea6c817ab8684068a7581 |
24 |
-DIST php-5.6.26.tar.xz 12412992 SHA256 203a854f0f243cb2810d1c832bc871ff133eccdf1ff69d32846f93bc1bef58a8 SHA512 06ef6990c1ab6ef3c94157b72039ddbc40a8373b8f38c88ec4dfa771fcd422a0673ff5f6cbf3cf67a0fb10bedd8b9fa85aa95e08abb0d74163a90a322a1d8c24 WHIRLPOOL 11b183089a43bfad1ee787bd2512faf8d4611916cdfe348fb8ba3a2c2d35d560dcd38656e3a5b3ee98efb649e9f7ab219a89da7a72c163270760ad44a64bba09 |
25 |
-DIST php-5.6.27.tar.xz 12439168 SHA256 16eb544498339d1d855292826e2e547ab01a31600141094959073e5e10e93ab5 SHA512 e9fdcf0feaa94d385459124e58694d69afcfe8d34ebdd10bfce5bf5828b7c20e7eb92ca75282be8eaef2bdfad0a0f25424fbf9eb9d2f77584f8a80d43f178bf7 WHIRLPOOL 3a942e408ede25daa2f4cb52337a26ccfce7724f2c401ea903e2fa152eef7b25e0ed0a22f53371a7145e8b043894ce5c145b29879de93f01c64c315113b3698d |
26 |
DIST php-5.6.28.tar.xz 12441072 SHA256 07187ba2870f89cef334cd2ad6cb801aeec5eaf283da0293a9a6be75d6786d11 SHA512 3af54c0533bba23fa74c3815143cb27890900d8b0726ba8ae99a5f7dde4b5411e8eb7f559f73cf41559f11437036da70c7842b64f5555e4fab00d40cf7c35cd1 WHIRLPOOL 6b288cbb8bb005360b67fe998bf024674d685399fa411c03f5feb39a285a639012864c66ab166e2cdb6d468b59c5114f245b172813b5edd384cee598d488306a |
27 |
DIST php-7.0.13.tar.xz 12528816 SHA256 357ba7f93975d7d836abed0852dc3ed96a988af539e87750613294cbee82f1bf SHA512 745877913889be629a4b5faefad7949e3634fa3f61fa1d8642ac42196fca187e50fbcc330f1af409a62b2e2a6b5c7f782ddff8022937a61403207439659c3f5a WHIRLPOOL dce465f943c278ae58dc3183ee4a303c21650cc5f3ddabf468d9de5f3a4dc1cc07a230decdbc502d03e6bc7c6f5d6ab2f6965353f1c87e966613223739780856 |
28 |
|
29 |
diff --git a/dev-lang/php/php-5.6.26.ebuild b/dev-lang/php/php-5.6.26.ebuild |
30 |
deleted file mode 100644 |
31 |
index dcc42f2..00000000 |
32 |
--- a/dev-lang/php/php-5.6.26.ebuild |
33 |
+++ /dev/null |
34 |
@@ -1,766 +0,0 @@ |
35 |
-# Copyright 1999-2016 Gentoo Foundation |
36 |
-# Distributed under the terms of the GNU General Public License v2 |
37 |
-# $Id$ |
38 |
- |
39 |
-EAPI=6 |
40 |
- |
41 |
-inherit autotools flag-o-matic versionator libtool systemd |
42 |
- |
43 |
-DESCRIPTION="The PHP language runtime engine" |
44 |
-HOMEPAGE="http://php.net/" |
45 |
-SRC_URI="http://php.net/distributions/${P}.tar.xz" |
46 |
-LICENSE="PHP-3" |
47 |
-SLOT="$(get_version_component_range 1-2)" |
48 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" |
49 |
- |
50 |
-# We can build the following SAPIs in the given order |
51 |
-SAPIS="embed cli cgi fpm apache2" |
52 |
- |
53 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
54 |
-IUSE="${IUSE} |
55 |
- ${SAPIS/cli/+cli} |
56 |
- threads" |
57 |
- |
58 |
-IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk |
59 |
- crypt +ctype curl debug |
60 |
- enchant exif frontbase +fileinfo +filter firebird |
61 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
62 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl |
63 |
- mhash mssql mysql libmysqlclient mysqli nls |
64 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
65 |
- readline recode selinux +session sharedmem |
66 |
- +simplexml snmp soap sockets spell sqlite ssl |
67 |
- sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx |
68 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
69 |
- |
70 |
-# The supported (that is, autodetected) versions of BDB are listed in |
71 |
-# the ./configure script. Other versions *work*, but we need to stick to |
72 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
73 |
-COMMON_DEPEND=" |
74 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
75 |
- >=dev-libs/libpcre-8.32[unicode] |
76 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
77 |
- <www-servers/apache-2.4[threads=] ) ) |
78 |
- berkdb? ( || ( sys-libs/db:5.3 |
79 |
- sys-libs/db:5.1 |
80 |
- sys-libs/db:4.8 |
81 |
- sys-libs/db:4.7 |
82 |
- sys-libs/db:4.6 |
83 |
- sys-libs/db:4.5 ) ) |
84 |
- bzip2? ( app-arch/bzip2 ) |
85 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
86 |
- cjk? ( !gd? ( |
87 |
- virtual/jpeg:0 |
88 |
- media-libs/libpng:0= |
89 |
- sys-libs/zlib |
90 |
- ) ) |
91 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
92 |
- curl? ( >=net-misc/curl-7.10.5 ) |
93 |
- enchant? ( app-text/enchant ) |
94 |
- exif? ( !gd? ( |
95 |
- virtual/jpeg:0 |
96 |
- media-libs/libpng:0= |
97 |
- sys-libs/zlib |
98 |
- ) ) |
99 |
- firebird? ( dev-db/firebird ) |
100 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
101 |
- gdbm? ( >=sys-libs/gdbm-1.8.0 ) |
102 |
- gmp? ( dev-libs/gmp:0 ) |
103 |
- iconv? ( virtual/libiconv ) |
104 |
- imap? ( virtual/imap-c-client[ssl=] ) |
105 |
- intl? ( dev-libs/icu:= ) |
106 |
- iodbc? ( dev-db/libiodbc ) |
107 |
- kerberos? ( virtual/krb5 ) |
108 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
109 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
110 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
111 |
- mssql? ( dev-db/freetds[mssql] ) |
112 |
- libmysqlclient? ( |
113 |
- mysql? ( virtual/libmysqlclient:= ) |
114 |
- mysqli? ( virtual/libmysqlclient:= ) |
115 |
- ) |
116 |
- nls? ( sys-devel/gettext ) |
117 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
118 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
119 |
- postgres? ( dev-db/postgresql:* ) |
120 |
- qdbm? ( dev-db/qdbm ) |
121 |
- readline? ( sys-libs/readline:0= ) |
122 |
- recode? ( app-text/recode ) |
123 |
- sharedmem? ( dev-libs/mm ) |
124 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
125 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
126 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
127 |
- spell? ( >=app-text/aspell-0.50 ) |
128 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
129 |
- ssl? ( |
130 |
- !libressl? ( dev-libs/openssl:0= ) |
131 |
- libressl? ( dev-libs/libressl ) |
132 |
- ) |
133 |
- sybase-ct? ( dev-db/freetds ) |
134 |
- tidy? ( app-text/htmltidy ) |
135 |
- truetype? ( |
136 |
- =media-libs/freetype-2* |
137 |
- >=media-libs/t1lib-5.0.0 |
138 |
- !gd? ( |
139 |
- virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
140 |
- ) |
141 |
- unicode? ( dev-libs/oniguruma ) |
142 |
- vpx? ( media-libs/libvpx ) |
143 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
144 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
145 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
146 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
147 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
148 |
- xpm? ( |
149 |
- x11-libs/libXpm |
150 |
- virtual/jpeg:0 |
151 |
- media-libs/libpng:0= sys-libs/zlib |
152 |
- ) |
153 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
154 |
- zip? ( sys-libs/zlib ) |
155 |
- zlib? ( sys-libs/zlib ) |
156 |
-" |
157 |
- |
158 |
-RDEPEND="${COMMON_DEPEND} |
159 |
- virtual/mta |
160 |
- fpm? ( |
161 |
- selinux? ( sec-policy/selinux-phpfpm ) |
162 |
- systemd? ( sys-apps/systemd ) )" |
163 |
- |
164 |
-DEPEND="${COMMON_DEPEND} |
165 |
- app-arch/xz-utils |
166 |
- sys-devel/flex |
167 |
- >=sys-devel/m4-1.4.3 |
168 |
- >=sys-devel/libtool-1.5.18" |
169 |
- |
170 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
171 |
-REQUIRED_USE=" |
172 |
- cli? ( ^^ ( readline libedit ) ) |
173 |
- truetype? ( gd ) |
174 |
- vpx? ( gd ) |
175 |
- cjk? ( gd ) |
176 |
- exif? ( gd ) |
177 |
- |
178 |
- xpm? ( gd ) |
179 |
- gd? ( zlib ) |
180 |
- simplexml? ( xml ) |
181 |
- soap? ( xml ) |
182 |
- wddx? ( xml ) |
183 |
- xmlrpc? ( || ( xml iconv ) ) |
184 |
- xmlreader? ( xml ) |
185 |
- xslt? ( xml ) |
186 |
- ldap-sasl? ( ldap ) |
187 |
- mhash? ( hash ) |
188 |
- phar? ( hash ) |
189 |
- libmysqlclient? ( || ( |
190 |
- mysql |
191 |
- mysqli |
192 |
- pdo |
193 |
- ) ) |
194 |
- |
195 |
- qdbm? ( !gdbm ) |
196 |
- readline? ( !libedit ) |
197 |
- recode? ( !imap !mysql !mysqli ) |
198 |
- sharedmem? ( !threads ) |
199 |
- |
200 |
- !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" |
201 |
- |
202 |
-PHP_MV="$(get_major_version)" |
203 |
- |
204 |
-# Allow users to install production version if they want to |
205 |
-if [[ "${PHP_INI_VERSION}" == "production" ]]; then |
206 |
- PHP_INI_UPSTREAM="php.ini-production" |
207 |
-else |
208 |
- PHP_INI_UPSTREAM="php.ini-development" |
209 |
-fi |
210 |
- |
211 |
-php_install_ini() { |
212 |
- local phpsapi="${1}" |
213 |
- |
214 |
- # work out where we are installing the ini file |
215 |
- php_set_ini_dir "${phpsapi}" |
216 |
- |
217 |
- local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}" |
218 |
- cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die |
219 |
- |
220 |
- # default to /tmp for save_path, bug #282768 |
221 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
222 |
- |
223 |
- # Set the extension dir |
224 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" || die |
225 |
- |
226 |
- # Set the include path to point to where we want to find PEAR packages |
227 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
228 |
- |
229 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
230 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
231 |
- newins "${phpinisrc}" php.ini |
232 |
- |
233 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
234 |
- elog |
235 |
- |
236 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
237 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
238 |
- |
239 |
- if use opcache; then |
240 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
241 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
242 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
243 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \ |
244 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
245 |
- fi |
246 |
- |
247 |
- # SAPI-specific handling |
248 |
- if [[ "${sapi}" == "fpm" ]] ; then |
249 |
- einfo "Installing FPM config file php-fpm.conf" |
250 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
251 |
- doins sapi/fpm/php-fpm.conf |
252 |
- fi |
253 |
- |
254 |
- dodoc php.ini-development |
255 |
- dodoc php.ini-production |
256 |
-} |
257 |
- |
258 |
-php_set_ini_dir() { |
259 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
260 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
261 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
262 |
-} |
263 |
- |
264 |
-src_prepare() { |
265 |
- # Change PHP branding |
266 |
- # Get the alpha/beta/rc version |
267 |
- sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ |
268 |
- -i configure.in || die "Unable to change PHP branding" |
269 |
- |
270 |
- # Patch PHP to show Gentoo as the server platform |
271 |
- sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
272 |
- -i configure.in || die "Failed to fix server platform name" |
273 |
- |
274 |
- # Prevent PHP from activating the Apache config, |
275 |
- # as we will do that ourselves |
276 |
- sed -i \ |
277 |
- -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
278 |
- -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
279 |
- configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \ |
280 |
- || die |
281 |
- |
282 |
- # Patch PHP to support heimdal instead of mit-krb5 |
283 |
- if has_version "app-crypt/heimdal" ; then |
284 |
- sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
285 |
- || die "Failed to fix heimdal libname" |
286 |
- sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
287 |
- || die "Failed to fix heimdal crypt library reference" |
288 |
- fi |
289 |
- |
290 |
- eapply_user |
291 |
- |
292 |
- # Force rebuilding aclocal.m4 |
293 |
- rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare" |
294 |
- eautoreconf |
295 |
- |
296 |
- if [[ ${CHOST} == *-darwin* ]] ; then |
297 |
- # http://bugs.php.net/bug.php?id=48795, bug #343481 |
298 |
- sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die |
299 |
- fi |
300 |
-} |
301 |
- |
302 |
-src_configure() { |
303 |
- addpredict /usr/share/snmp/mibs/.index |
304 |
- addpredict /var/lib/net-snmp/mib_indexes |
305 |
- |
306 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
307 |
- |
308 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
309 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
310 |
- local our_conf=( |
311 |
- --prefix="${PHP_DESTDIR}" |
312 |
- --mandir="${PHP_DESTDIR}/man" |
313 |
- --infodir="${PHP_DESTDIR}/info" |
314 |
- --libdir="${PHP_DESTDIR}/lib" |
315 |
- --with-libdir="$(get_libdir)" |
316 |
- --localstatedir="${EPREFIX}/var" |
317 |
- --without-pear |
318 |
- $(use_enable threads maintainer-zts) |
319 |
- ) |
320 |
- |
321 |
- our_conf+=( |
322 |
- $(use_enable bcmath bcmath) |
323 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
324 |
- $(use_enable calendar calendar) |
325 |
- $(use_enable ctype ctype) |
326 |
- $(use_with curl curl "${EPREFIX}/usr") |
327 |
- $(use_enable xml dom) |
328 |
- $(use_with enchant enchant "${EPREFIX}/usr") |
329 |
- $(use_enable exif exif) |
330 |
- $(use_enable fileinfo fileinfo) |
331 |
- $(use_enable filter filter) |
332 |
- $(use_enable ftp ftp) |
333 |
- $(use_with nls gettext "${EPREFIX}/usr") |
334 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
335 |
- $(use_enable hash hash) |
336 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
337 |
- $(use_with iconv iconv \ |
338 |
- $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr")) |
339 |
- $(use_enable intl intl) |
340 |
- $(use_enable ipv6 ipv6) |
341 |
- $(use_enable json json) |
342 |
- $(use_with kerberos kerberos "${EPREFIX}/usr") |
343 |
- $(use_enable xml libxml) |
344 |
- $(use_with xml libxml-dir "${EPREFIX}/usr") |
345 |
- $(use_enable unicode mbstring) |
346 |
- $(use_with crypt mcrypt "${EPREFIX}/usr") |
347 |
- $(use_with mssql mssql "${EPREFIX}/usr") |
348 |
- $(use_with unicode onig "${EPREFIX}/usr") |
349 |
- $(use_with ssl openssl "${EPREFIX}/usr") |
350 |
- $(use_with ssl openssl-dir "${EPREFIX}/usr") |
351 |
- $(use_enable pcntl pcntl) |
352 |
- $(use_enable phar phar) |
353 |
- $(use_enable pdo pdo) |
354 |
- $(use_enable opcache opcache) |
355 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
356 |
- $(use_enable posix posix) |
357 |
- $(use_with spell pspell "${EPREFIX}/usr") |
358 |
- $(use_with recode recode "${EPREFIX}/usr") |
359 |
- $(use_enable simplexml simplexml) |
360 |
- $(use_enable sharedmem shmop) |
361 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
362 |
- $(use_enable soap soap) |
363 |
- $(use_enable sockets sockets) |
364 |
- $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
365 |
- $(use_with sybase-ct sybase-ct "${EPREFIX}/usr") |
366 |
- $(use_enable sysvipc sysvmsg) |
367 |
- $(use_enable sysvipc sysvsem) |
368 |
- $(use_enable sysvipc sysvshm) |
369 |
- $(use_with systemd fpm-systemd) |
370 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
371 |
- $(use_enable tokenizer tokenizer) |
372 |
- $(use_enable wddx wddx) |
373 |
- $(use_enable xml xml) |
374 |
- $(use_enable xmlreader xmlreader) |
375 |
- $(use_enable xmlwriter xmlwriter) |
376 |
- $(use_with xmlrpc xmlrpc) |
377 |
- $(use_with xslt xsl "${EPREFIX}/usr") |
378 |
- $(use_enable zip zip) |
379 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
380 |
- $(use_enable debug debug) |
381 |
- ) |
382 |
- |
383 |
- # DBA support |
384 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
385 |
- || use qdbm ; then |
386 |
- our_conf+=( "--enable-dba${shared}" ) |
387 |
- fi |
388 |
- |
389 |
- # DBA drivers support |
390 |
- our_conf+=( |
391 |
- $(use_with cdb cdb) |
392 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
393 |
- $(use_enable flatfile flatfile) |
394 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
395 |
- $(use_enable inifile inifile) |
396 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
397 |
- ) |
398 |
- |
399 |
- # Support for the GD graphics library |
400 |
- our_conf+=( |
401 |
- $(use_with truetype freetype-dir "${EPREFIX}/usr") |
402 |
- $(use_with truetype t1lib "${EPREFIX}/usr") |
403 |
- $(use_enable cjk gd-jis-conv) |
404 |
- $(use_with gd jpeg-dir "${EPREFIX}/usr") |
405 |
- $(use_with gd png-dir "${EPREFIX}/usr") |
406 |
- $(use_with xpm xpm-dir "${EPREFIX}/usr") |
407 |
- $(use_with vpx vpx-dir "${EPREFIX}/usr") |
408 |
- ) |
409 |
- # enable gd last, so configure can pick up the previous settings |
410 |
- our_conf+=( $(use_with gd gd) ) |
411 |
- |
412 |
- # IMAP support |
413 |
- if use imap ; then |
414 |
- our_conf+=( |
415 |
- $(use_with imap imap "${EPREFIX}/usr") |
416 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
417 |
- ) |
418 |
- fi |
419 |
- |
420 |
- # Interbase/firebird support |
421 |
- our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
422 |
- |
423 |
- # LDAP support |
424 |
- if use ldap ; then |
425 |
- our_conf+=( |
426 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
427 |
- $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
428 |
- ) |
429 |
- fi |
430 |
- |
431 |
- # MySQL support |
432 |
- local mysqllib="mysqlnd" |
433 |
- local mysqlilib="mysqlnd" |
434 |
- use libmysqlclient && mysqllib="${EPREFIX}/usr" |
435 |
- use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config" |
436 |
- |
437 |
- our_conf+=( $(use_with mysql mysql "${mysqllib}") ) |
438 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
439 |
- |
440 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
441 |
- if use mysql || use mysqli ; then |
442 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
443 |
- fi |
444 |
- |
445 |
- # ODBC support |
446 |
- our_conf+=( |
447 |
- $(use_with odbc unixODBC "${EPREFIX}/usr") |
448 |
- $(use_with iodbc iodbc "${EPREFIX}/usr") |
449 |
- ) |
450 |
- |
451 |
- # Oracle support |
452 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
453 |
- |
454 |
- # PDO support |
455 |
- if use pdo ; then |
456 |
- our_conf+=( |
457 |
- $(use_with mssql pdo-dblib) |
458 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
459 |
- $(use_with postgres pdo-pgsql) |
460 |
- $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
461 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
462 |
- $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
463 |
- $(use_with oci8-instant-client pdo-oci) |
464 |
- ) |
465 |
- fi |
466 |
- |
467 |
- # readline/libedit support |
468 |
- our_conf+=( |
469 |
- $(use_with readline readline "${EPREFIX}/usr") |
470 |
- $(use_with libedit libedit "${EPREFIX}/usr") |
471 |
- ) |
472 |
- |
473 |
- # Session support |
474 |
- if use session ; then |
475 |
- our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") ) |
476 |
- else |
477 |
- our_conf+=( $(use_enable session session) ) |
478 |
- fi |
479 |
- |
480 |
- # Use pic for shared modules such as apache2's mod_php |
481 |
- our_conf+=( --with-pic ) |
482 |
- |
483 |
- # we use the system copy of pcre |
484 |
- # --with-pcre-regex affects ext/pcre |
485 |
- # --with-pcre-dir affects ext/filter and ext/zip |
486 |
- our_conf+=( |
487 |
- --with-pcre-regex="${EPREFIX}/usr" |
488 |
- --with-pcre-dir="${EPREFIX}/usr" |
489 |
- ) |
490 |
- |
491 |
- # Catch CFLAGS problems |
492 |
- # Fixes bug #14067. |
493 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
494 |
- replace-cpu-flags "k6*" "i586" |
495 |
- |
496 |
- # Support user-passed configuration parameters |
497 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
498 |
- |
499 |
- # Support the Apache2 extras, they must be set globally for all |
500 |
- # SAPIs to work correctly, especially for external PHP extensions |
501 |
- |
502 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
503 |
- for one_sapi in $SAPIS ; do |
504 |
- use "${one_sapi}" || continue |
505 |
- php_set_ini_dir "${one_sapi}" |
506 |
- |
507 |
- # The BUILD_DIR variable is used to determine where to output |
508 |
- # the files that autotools creates. This was all originally |
509 |
- # based on the autotools-utils eclass. |
510 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
511 |
- cp -r "${S}" "${BUILD_DIR}" || die |
512 |
- cd "${BUILD_DIR}" || die |
513 |
- |
514 |
- local sapi_conf=( |
515 |
- --with-config-file-path="${PHP_INI_DIR}" |
516 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
517 |
- ) |
518 |
- |
519 |
- for sapi in $SAPIS ; do |
520 |
- case "$sapi" in |
521 |
- cli|cgi|embed|fpm) |
522 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
523 |
- sapi_conf+=( "--enable-${sapi}" ) |
524 |
- else |
525 |
- sapi_conf+=( "--disable-${sapi}" ) |
526 |
- fi |
527 |
- ;; |
528 |
- |
529 |
- apache2) |
530 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
531 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) |
532 |
- else |
533 |
- sapi_conf+=( --without-apxs2 ) |
534 |
- fi |
535 |
- ;; |
536 |
- esac |
537 |
- done |
538 |
- |
539 |
- # Construct the $myeconfargs array by concatenating $our_conf |
540 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
541 |
- local myeconfargs=( "${our_conf[@]}" ) |
542 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
543 |
- |
544 |
- pushd "${BUILD_DIR}" > /dev/null || die |
545 |
- econf "${myeconfargs[@]}" |
546 |
- popd > /dev/null || die |
547 |
- done |
548 |
-} |
549 |
- |
550 |
-src_compile() { |
551 |
- # snmp seems to run during src_compile, too (bug #324739) |
552 |
- addpredict /usr/share/snmp/mibs/.index |
553 |
- addpredict /var/lib/net-snmp/mib_indexes |
554 |
- |
555 |
- for sapi in ${SAPIS} ; do |
556 |
- if use "${sapi}"; then |
557 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
558 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
559 |
- emake |
560 |
- fi |
561 |
- done |
562 |
-} |
563 |
- |
564 |
-src_install() { |
565 |
- # see bug #324739 for what happens when we don't have that |
566 |
- addpredict /usr/share/snmp/mibs/.index |
567 |
- |
568 |
- # grab the first SAPI that got built and install common files from there |
569 |
- local first_sapi="" |
570 |
- for sapi in $SAPIS ; do |
571 |
- if use $sapi ; then |
572 |
- first_sapi=$sapi |
573 |
- break |
574 |
- fi |
575 |
- done |
576 |
- |
577 |
- # Makefile forgets to create this before trying to write to it... |
578 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
579 |
- |
580 |
- # Install php environment (without any sapis) |
581 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
582 |
- emake INSTALL_ROOT="${D}" \ |
583 |
- install-build install-headers install-programs |
584 |
- |
585 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
586 |
- |
587 |
- # Create the directory where we'll put version-specific php scripts |
588 |
- keepdir "/usr/share/php${PHP_MV}" |
589 |
- |
590 |
- local sapi="", file="" |
591 |
- local sapi_list="" |
592 |
- |
593 |
- for sapi in ${SAPIS}; do |
594 |
- if use "${sapi}" ; then |
595 |
- einfo "Installing SAPI: ${sapi}" |
596 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
597 |
- |
598 |
- if [[ "${sapi}" == "apache2" ]] ; then |
599 |
- # We're specifically not using emake install-sapi as libtool |
600 |
- # may cause unnecessary relink failures (see bug #351266) |
601 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
602 |
- newins ".libs/libphp5$(get_libname)" \ |
603 |
- "libphp${PHP_MV}$(get_libname)" |
604 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
605 |
- else |
606 |
- # needed each time, php_install_ini would reset it |
607 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
608 |
- into "${dest}" |
609 |
- case "$sapi" in |
610 |
- cli) |
611 |
- source="sapi/cli/php" |
612 |
- ;; |
613 |
- cgi) |
614 |
- source="sapi/cgi/php-cgi" |
615 |
- ;; |
616 |
- fpm) |
617 |
- source="sapi/fpm/php-fpm" |
618 |
- ;; |
619 |
- embed) |
620 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
621 |
- ;; |
622 |
- *) |
623 |
- die "unhandled sapi in src_install" |
624 |
- ;; |
625 |
- esac |
626 |
- |
627 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
628 |
- dolib.so "${source}" |
629 |
- else |
630 |
- dobin "${source}" |
631 |
- local name="$(basename ${source})" |
632 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
633 |
- fi |
634 |
- fi |
635 |
- |
636 |
- php_install_ini "${sapi}" |
637 |
- |
638 |
- # construct correct SAPI string for php-config |
639 |
- # thanks to ferringb for the bash voodoo |
640 |
- if [[ "${sapi}" == "apache2" ]]; then |
641 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
642 |
- else |
643 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
644 |
- fi |
645 |
- fi |
646 |
- done |
647 |
- |
648 |
- # Installing opcache module |
649 |
- if use opcache ; then |
650 |
- into "${PHP_DESTDIR#${EPREFIX}}" |
651 |
- dolib.so "modules/opcache$(get_libname)" |
652 |
- fi |
653 |
- |
654 |
- # Install env.d files |
655 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
656 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
657 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
658 |
- |
659 |
- # set php-config variable correctly (bug #278439) |
660 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
661 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
662 |
- |
663 |
- if use fpm ; then |
664 |
- if use systemd; then |
665 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
666 |
- "php-fpm@${SLOT}.service" |
667 |
- else |
668 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
669 |
- "php-fpm@${SLOT}.service" |
670 |
- fi |
671 |
- fi |
672 |
-} |
673 |
- |
674 |
-src_test() { |
675 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
676 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
677 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
678 |
- ewarn "Test phase requires USE=cli, skipping" |
679 |
- return |
680 |
- else |
681 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
682 |
- fi |
683 |
- |
684 |
- if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
685 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
686 |
- fi |
687 |
- |
688 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
689 |
- "session.save_path=${T}" \ |
690 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
691 |
- "session.save_path=${T}" |
692 |
- |
693 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
694 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
695 |
- done |
696 |
- |
697 |
- local failed="$(find -name '*.out')" |
698 |
- if [[ ${failed} != "" ]] ; then |
699 |
- ewarn "The following test cases failed unexpectedly:" |
700 |
- for name in ${failed}; do |
701 |
- ewarn " ${name/.out/}" |
702 |
- done |
703 |
- else |
704 |
- einfo "No unexpected test failures, all fine" |
705 |
- fi |
706 |
- |
707 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
708 |
- local passed="" |
709 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
710 |
- [[ -f "${name}.diff" ]] && continue |
711 |
- passed="${passed} ${name}" |
712 |
- done |
713 |
- if [[ ${passed} != "" ]] ; then |
714 |
- einfo "The following test cases passed unexpectedly:" |
715 |
- for name in ${passed}; do |
716 |
- ewarn " ${passed}" |
717 |
- done |
718 |
- else |
719 |
- einfo "None of the known-to-fail tests passed, all fine" |
720 |
- fi |
721 |
- fi |
722 |
-} |
723 |
- |
724 |
-pkg_postinst() { |
725 |
- # Output some general info to the user |
726 |
- if use apache2 ; then |
727 |
- elog |
728 |
- elog "To enable PHP in apache, you will need to add \"-D PHP\" to" |
729 |
- elog "your apache2 command. OpenRC users can append that string to" |
730 |
- elog "APACHE2_OPTS in /etc/conf.d/apache2." |
731 |
- elog |
732 |
- elog "The apache module configuration file 70_mod_php.conf is" |
733 |
- elog "provided (and maintained) by eselect-php." |
734 |
- elog |
735 |
- fi |
736 |
- |
737 |
- # Create the symlinks for php |
738 |
- for m in ${SAPIS}; do |
739 |
- [[ ${m} == 'embed' ]] && continue; |
740 |
- if use $m ; then |
741 |
- local ci=$(eselect php show $m) |
742 |
- if [[ -z $ci ]]; then |
743 |
- eselect php set $m php${SLOT} || die |
744 |
- einfo "Switched ${m} to use php:${SLOT}" |
745 |
- einfo |
746 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
747 |
- elog "To switch $m to use php:${SLOT}, run" |
748 |
- elog " eselect php set $m php${SLOT}" |
749 |
- elog |
750 |
- fi |
751 |
- fi |
752 |
- done |
753 |
- |
754 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
755 |
- # example, if the user has the cgi SAPI enabled, then he has an |
756 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
757 |
- # USE="-cgi", that symlink will break. This call to eselect is |
758 |
- # supposed to remove that dead link per bug 572436. |
759 |
- eselect php cleanup || die |
760 |
- |
761 |
- if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then |
762 |
- elog "To build extensions for this version of PHP, you will need to" |
763 |
- elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." |
764 |
- elog |
765 |
- fi |
766 |
- |
767 |
- # Only mention PHP_INI_VERSION if the user doesn't have it set. |
768 |
- case "${PHP_INI_VERSION}" in |
769 |
- production|development) |
770 |
- ;; |
771 |
- *) |
772 |
- elog "This ebuild installed a version of php.ini based on" |
773 |
- elog "${PHP_INI_UPSTREAM}. You can choose which version of" |
774 |
- elog "php.ini to install by default by setting PHP_INI_VERSION" |
775 |
- elog "to either 'production' or 'development' in your make.conf." |
776 |
- elog "Both versions of php.ini can be found with the PHP docs in" |
777 |
- elog "${EPREFIX}/usr/share/doc/${PF}" |
778 |
- elog |
779 |
- ;; |
780 |
- esac |
781 |
- |
782 |
- elog "For details on how version slotting works, please see" |
783 |
- elog "the wiki:" |
784 |
- elog |
785 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
786 |
- elog |
787 |
-} |
788 |
- |
789 |
-pkg_postrm() { |
790 |
- # This serves two purposes. First, if we have just removed the last |
791 |
- # installed version of PHP, then this will remove any dead symlinks |
792 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
793 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
794 |
- # his existing symlinks to point to the new 7.0 installation. The |
795 |
- # latter is bug 432962. |
796 |
- # |
797 |
- # Note: the eselect-php package may not be installed at this point, |
798 |
- # so we can't die() if this command fails. |
799 |
- eselect php cleanup |
800 |
-} |
801 |
|
802 |
diff --git a/dev-lang/php/php-5.6.27.ebuild b/dev-lang/php/php-5.6.27.ebuild |
803 |
deleted file mode 100644 |
804 |
index 7d2332d..00000000 |
805 |
--- a/dev-lang/php/php-5.6.27.ebuild |
806 |
+++ /dev/null |
807 |
@@ -1,777 +0,0 @@ |
808 |
-# Copyright 1999-2016 Gentoo Foundation |
809 |
-# Distributed under the terms of the GNU General Public License v2 |
810 |
-# $Id$ |
811 |
- |
812 |
-EAPI=6 |
813 |
- |
814 |
-inherit autotools flag-o-matic versionator libtool systemd |
815 |
- |
816 |
-DESCRIPTION="The PHP language runtime engine" |
817 |
-HOMEPAGE="http://php.net/" |
818 |
-SRC_URI="http://php.net/distributions/${P}.tar.xz" |
819 |
- |
820 |
-LICENSE="PHP-3.01 |
821 |
- BSD |
822 |
- Zend-2.0 |
823 |
- bcmath? ( LGPL-2.1+ ) |
824 |
- fpm? ( BSD-2 ) |
825 |
- gd? ( gd ) |
826 |
- unicode? ( BSD-2 LGPL-2.1 )" |
827 |
- |
828 |
-SLOT="$(get_version_component_range 1-2)" |
829 |
-KEYWORDS="~alpha amd64 arm hppa ~ia64 ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" |
830 |
- |
831 |
-# We can build the following SAPIs in the given order |
832 |
-SAPIS="embed cli cgi fpm apache2" |
833 |
- |
834 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
835 |
-IUSE="${IUSE} |
836 |
- ${SAPIS/cli/+cli} |
837 |
- threads" |
838 |
- |
839 |
-IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk |
840 |
- crypt +ctype curl debug |
841 |
- enchant exif frontbase +fileinfo +filter firebird |
842 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
843 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl |
844 |
- mhash mssql mysql libmysqlclient mysqli nls |
845 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
846 |
- readline recode selinux +session sharedmem |
847 |
- +simplexml snmp soap sockets spell sqlite ssl |
848 |
- sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx |
849 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
850 |
- |
851 |
-# The supported (that is, autodetected) versions of BDB are listed in |
852 |
-# the ./configure script. Other versions *work*, but we need to stick to |
853 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
854 |
-COMMON_DEPEND=" |
855 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
856 |
- >=dev-libs/libpcre-8.32[unicode] |
857 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
858 |
- <www-servers/apache-2.4[threads=] ) ) |
859 |
- berkdb? ( || ( sys-libs/db:5.3 |
860 |
- sys-libs/db:5.1 |
861 |
- sys-libs/db:4.8 |
862 |
- sys-libs/db:4.7 |
863 |
- sys-libs/db:4.6 |
864 |
- sys-libs/db:4.5 ) ) |
865 |
- bzip2? ( app-arch/bzip2 ) |
866 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
867 |
- cjk? ( !gd? ( |
868 |
- virtual/jpeg:0 |
869 |
- media-libs/libpng:0= |
870 |
- sys-libs/zlib |
871 |
- ) ) |
872 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
873 |
- curl? ( >=net-misc/curl-7.10.5 ) |
874 |
- enchant? ( app-text/enchant ) |
875 |
- exif? ( !gd? ( |
876 |
- virtual/jpeg:0 |
877 |
- media-libs/libpng:0= |
878 |
- sys-libs/zlib |
879 |
- ) ) |
880 |
- firebird? ( dev-db/firebird ) |
881 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
882 |
- gdbm? ( >=sys-libs/gdbm-1.8.0 ) |
883 |
- gmp? ( dev-libs/gmp:0 ) |
884 |
- iconv? ( virtual/libiconv ) |
885 |
- imap? ( virtual/imap-c-client[ssl=] ) |
886 |
- intl? ( dev-libs/icu:= ) |
887 |
- iodbc? ( dev-db/libiodbc ) |
888 |
- kerberos? ( virtual/krb5 ) |
889 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
890 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
891 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
892 |
- mssql? ( dev-db/freetds[mssql] ) |
893 |
- libmysqlclient? ( |
894 |
- mysql? ( virtual/libmysqlclient:= ) |
895 |
- mysqli? ( virtual/libmysqlclient:= ) |
896 |
- ) |
897 |
- nls? ( sys-devel/gettext ) |
898 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
899 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
900 |
- postgres? ( dev-db/postgresql:* ) |
901 |
- qdbm? ( dev-db/qdbm ) |
902 |
- readline? ( sys-libs/readline:0= ) |
903 |
- recode? ( app-text/recode ) |
904 |
- sharedmem? ( dev-libs/mm ) |
905 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
906 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
907 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
908 |
- spell? ( >=app-text/aspell-0.50 ) |
909 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
910 |
- ssl? ( |
911 |
- !libressl? ( dev-libs/openssl:0= ) |
912 |
- libressl? ( dev-libs/libressl ) |
913 |
- ) |
914 |
- sybase-ct? ( dev-db/freetds ) |
915 |
- tidy? ( app-text/htmltidy ) |
916 |
- truetype? ( |
917 |
- =media-libs/freetype-2* |
918 |
- >=media-libs/t1lib-5.0.0 |
919 |
- !gd? ( |
920 |
- virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
921 |
- ) |
922 |
- unicode? ( dev-libs/oniguruma ) |
923 |
- vpx? ( media-libs/libvpx ) |
924 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
925 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
926 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
927 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
928 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
929 |
- xpm? ( |
930 |
- x11-libs/libXpm |
931 |
- virtual/jpeg:0 |
932 |
- media-libs/libpng:0= sys-libs/zlib |
933 |
- ) |
934 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
935 |
- zip? ( sys-libs/zlib ) |
936 |
- zlib? ( sys-libs/zlib ) |
937 |
-" |
938 |
- |
939 |
-RDEPEND="${COMMON_DEPEND} |
940 |
- virtual/mta |
941 |
- fpm? ( |
942 |
- selinux? ( sec-policy/selinux-phpfpm ) |
943 |
- systemd? ( sys-apps/systemd ) )" |
944 |
- |
945 |
-DEPEND="${COMMON_DEPEND} |
946 |
- app-arch/xz-utils |
947 |
- >=sys-devel/bison-3.0.1 |
948 |
- sys-devel/flex |
949 |
- >=sys-devel/m4-1.4.3 |
950 |
- >=sys-devel/libtool-1.5.18" |
951 |
- |
952 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
953 |
-REQUIRED_USE=" |
954 |
- cli? ( ^^ ( readline libedit ) ) |
955 |
- truetype? ( gd ) |
956 |
- vpx? ( gd ) |
957 |
- cjk? ( gd ) |
958 |
- exif? ( gd ) |
959 |
- |
960 |
- xpm? ( gd ) |
961 |
- gd? ( zlib ) |
962 |
- simplexml? ( xml ) |
963 |
- soap? ( xml ) |
964 |
- wddx? ( xml ) |
965 |
- xmlrpc? ( || ( xml iconv ) ) |
966 |
- xmlreader? ( xml ) |
967 |
- xslt? ( xml ) |
968 |
- ldap-sasl? ( ldap ) |
969 |
- mhash? ( hash ) |
970 |
- phar? ( hash ) |
971 |
- libmysqlclient? ( || ( |
972 |
- mysql |
973 |
- mysqli |
974 |
- pdo |
975 |
- ) ) |
976 |
- |
977 |
- qdbm? ( !gdbm ) |
978 |
- readline? ( !libedit ) |
979 |
- recode? ( !imap !mysql !mysqli ) |
980 |
- sharedmem? ( !threads ) |
981 |
- |
982 |
- !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" |
983 |
- |
984 |
-PHP_MV="$(get_major_version)" |
985 |
- |
986 |
-# Allow users to install production version if they want to |
987 |
-if [[ "${PHP_INI_VERSION}" == "production" ]]; then |
988 |
- PHP_INI_UPSTREAM="php.ini-production" |
989 |
-else |
990 |
- PHP_INI_UPSTREAM="php.ini-development" |
991 |
-fi |
992 |
- |
993 |
-php_install_ini() { |
994 |
- local phpsapi="${1}" |
995 |
- |
996 |
- # work out where we are installing the ini file |
997 |
- php_set_ini_dir "${phpsapi}" |
998 |
- |
999 |
- local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}" |
1000 |
- cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die |
1001 |
- |
1002 |
- # default to /tmp for save_path, bug #282768 |
1003 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
1004 |
- |
1005 |
- # Set the extension dir |
1006 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" || die |
1007 |
- |
1008 |
- # Set the include path to point to where we want to find PEAR packages |
1009 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
1010 |
- |
1011 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
1012 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
1013 |
- newins "${phpinisrc}" php.ini |
1014 |
- |
1015 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
1016 |
- elog |
1017 |
- |
1018 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
1019 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
1020 |
- |
1021 |
- if use opcache; then |
1022 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
1023 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
1024 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
1025 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \ |
1026 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
1027 |
- fi |
1028 |
- |
1029 |
- # SAPI-specific handling |
1030 |
- if [[ "${sapi}" == "fpm" ]] ; then |
1031 |
- einfo "Installing FPM config file php-fpm.conf" |
1032 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
1033 |
- doins sapi/fpm/php-fpm.conf |
1034 |
- fi |
1035 |
- |
1036 |
- dodoc php.ini-development |
1037 |
- dodoc php.ini-production |
1038 |
-} |
1039 |
- |
1040 |
-php_set_ini_dir() { |
1041 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
1042 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
1043 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
1044 |
-} |
1045 |
- |
1046 |
-src_prepare() { |
1047 |
- eapply "${FILESDIR}/php-${SLOT}-no-bison-warnings.patch" |
1048 |
- |
1049 |
- # Change PHP branding |
1050 |
- # Get the alpha/beta/rc version |
1051 |
- sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ |
1052 |
- -i configure.in || die "Unable to change PHP branding" |
1053 |
- |
1054 |
- # Patch PHP to show Gentoo as the server platform |
1055 |
- sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
1056 |
- -i configure.in || die "Failed to fix server platform name" |
1057 |
- |
1058 |
- # Prevent PHP from activating the Apache config, |
1059 |
- # as we will do that ourselves |
1060 |
- sed -i \ |
1061 |
- -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
1062 |
- -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
1063 |
- configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \ |
1064 |
- || die |
1065 |
- |
1066 |
- # Patch PHP to support heimdal instead of mit-krb5 |
1067 |
- if has_version "app-crypt/heimdal" ; then |
1068 |
- sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
1069 |
- || die "Failed to fix heimdal libname" |
1070 |
- sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
1071 |
- || die "Failed to fix heimdal crypt library reference" |
1072 |
- fi |
1073 |
- |
1074 |
- eapply_user |
1075 |
- |
1076 |
- # Force rebuilding aclocal.m4 |
1077 |
- rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare" |
1078 |
- eautoreconf |
1079 |
- |
1080 |
- if [[ ${CHOST} == *-darwin* ]] ; then |
1081 |
- # http://bugs.php.net/bug.php?id=48795, bug #343481 |
1082 |
- sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die |
1083 |
- fi |
1084 |
-} |
1085 |
- |
1086 |
-src_configure() { |
1087 |
- addpredict /usr/share/snmp/mibs/.index |
1088 |
- addpredict /var/lib/net-snmp/mib_indexes |
1089 |
- |
1090 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
1091 |
- |
1092 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
1093 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
1094 |
- local our_conf=( |
1095 |
- --prefix="${PHP_DESTDIR}" |
1096 |
- --mandir="${PHP_DESTDIR}/man" |
1097 |
- --infodir="${PHP_DESTDIR}/info" |
1098 |
- --libdir="${PHP_DESTDIR}/lib" |
1099 |
- --with-libdir="$(get_libdir)" |
1100 |
- --localstatedir="${EPREFIX}/var" |
1101 |
- --without-pear |
1102 |
- $(use_enable threads maintainer-zts) |
1103 |
- ) |
1104 |
- |
1105 |
- our_conf+=( |
1106 |
- $(use_enable bcmath bcmath) |
1107 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
1108 |
- $(use_enable calendar calendar) |
1109 |
- $(use_enable ctype ctype) |
1110 |
- $(use_with curl curl "${EPREFIX}/usr") |
1111 |
- $(use_enable xml dom) |
1112 |
- $(use_with enchant enchant "${EPREFIX}/usr") |
1113 |
- $(use_enable exif exif) |
1114 |
- $(use_enable fileinfo fileinfo) |
1115 |
- $(use_enable filter filter) |
1116 |
- $(use_enable ftp ftp) |
1117 |
- $(use_with nls gettext "${EPREFIX}/usr") |
1118 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
1119 |
- $(use_enable hash hash) |
1120 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
1121 |
- $(use_with iconv iconv \ |
1122 |
- $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr")) |
1123 |
- $(use_enable intl intl) |
1124 |
- $(use_enable ipv6 ipv6) |
1125 |
- $(use_enable json json) |
1126 |
- $(use_with kerberos kerberos "${EPREFIX}/usr") |
1127 |
- $(use_enable xml libxml) |
1128 |
- $(use_with xml libxml-dir "${EPREFIX}/usr") |
1129 |
- $(use_enable unicode mbstring) |
1130 |
- $(use_with crypt mcrypt "${EPREFIX}/usr") |
1131 |
- $(use_with mssql mssql "${EPREFIX}/usr") |
1132 |
- $(use_with unicode onig "${EPREFIX}/usr") |
1133 |
- $(use_with ssl openssl "${EPREFIX}/usr") |
1134 |
- $(use_with ssl openssl-dir "${EPREFIX}/usr") |
1135 |
- $(use_enable pcntl pcntl) |
1136 |
- $(use_enable phar phar) |
1137 |
- $(use_enable pdo pdo) |
1138 |
- $(use_enable opcache opcache) |
1139 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
1140 |
- $(use_enable posix posix) |
1141 |
- $(use_with spell pspell "${EPREFIX}/usr") |
1142 |
- $(use_with recode recode "${EPREFIX}/usr") |
1143 |
- $(use_enable simplexml simplexml) |
1144 |
- $(use_enable sharedmem shmop) |
1145 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
1146 |
- $(use_enable soap soap) |
1147 |
- $(use_enable sockets sockets) |
1148 |
- $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
1149 |
- $(use_with sybase-ct sybase-ct "${EPREFIX}/usr") |
1150 |
- $(use_enable sysvipc sysvmsg) |
1151 |
- $(use_enable sysvipc sysvsem) |
1152 |
- $(use_enable sysvipc sysvshm) |
1153 |
- $(use_with systemd fpm-systemd) |
1154 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
1155 |
- $(use_enable tokenizer tokenizer) |
1156 |
- $(use_enable wddx wddx) |
1157 |
- $(use_enable xml xml) |
1158 |
- $(use_enable xmlreader xmlreader) |
1159 |
- $(use_enable xmlwriter xmlwriter) |
1160 |
- $(use_with xmlrpc xmlrpc) |
1161 |
- $(use_with xslt xsl "${EPREFIX}/usr") |
1162 |
- $(use_enable zip zip) |
1163 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
1164 |
- $(use_enable debug debug) |
1165 |
- ) |
1166 |
- |
1167 |
- # DBA support |
1168 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
1169 |
- || use qdbm ; then |
1170 |
- our_conf+=( "--enable-dba${shared}" ) |
1171 |
- fi |
1172 |
- |
1173 |
- # DBA drivers support |
1174 |
- our_conf+=( |
1175 |
- $(use_with cdb cdb) |
1176 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
1177 |
- $(use_enable flatfile flatfile) |
1178 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
1179 |
- $(use_enable inifile inifile) |
1180 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
1181 |
- ) |
1182 |
- |
1183 |
- # Support for the GD graphics library |
1184 |
- our_conf+=( |
1185 |
- $(use_with truetype freetype-dir "${EPREFIX}/usr") |
1186 |
- $(use_with truetype t1lib "${EPREFIX}/usr") |
1187 |
- $(use_enable cjk gd-jis-conv) |
1188 |
- $(use_with gd jpeg-dir "${EPREFIX}/usr") |
1189 |
- $(use_with gd png-dir "${EPREFIX}/usr") |
1190 |
- $(use_with xpm xpm-dir "${EPREFIX}/usr") |
1191 |
- $(use_with vpx vpx-dir "${EPREFIX}/usr") |
1192 |
- ) |
1193 |
- # enable gd last, so configure can pick up the previous settings |
1194 |
- our_conf+=( $(use_with gd gd) ) |
1195 |
- |
1196 |
- # IMAP support |
1197 |
- if use imap ; then |
1198 |
- our_conf+=( |
1199 |
- $(use_with imap imap "${EPREFIX}/usr") |
1200 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
1201 |
- ) |
1202 |
- fi |
1203 |
- |
1204 |
- # Interbase/firebird support |
1205 |
- our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
1206 |
- |
1207 |
- # LDAP support |
1208 |
- if use ldap ; then |
1209 |
- our_conf+=( |
1210 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
1211 |
- $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
1212 |
- ) |
1213 |
- fi |
1214 |
- |
1215 |
- # MySQL support |
1216 |
- local mysqllib="mysqlnd" |
1217 |
- local mysqlilib="mysqlnd" |
1218 |
- use libmysqlclient && mysqllib="${EPREFIX}/usr" |
1219 |
- use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config" |
1220 |
- |
1221 |
- our_conf+=( $(use_with mysql mysql "${mysqllib}") ) |
1222 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
1223 |
- |
1224 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
1225 |
- if use mysql || use mysqli ; then |
1226 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
1227 |
- fi |
1228 |
- |
1229 |
- # ODBC support |
1230 |
- our_conf+=( |
1231 |
- $(use_with odbc unixODBC "${EPREFIX}/usr") |
1232 |
- $(use_with iodbc iodbc "${EPREFIX}/usr") |
1233 |
- ) |
1234 |
- |
1235 |
- # Oracle support |
1236 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
1237 |
- |
1238 |
- # PDO support |
1239 |
- if use pdo ; then |
1240 |
- our_conf+=( |
1241 |
- $(use_with mssql pdo-dblib) |
1242 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
1243 |
- $(use_with postgres pdo-pgsql) |
1244 |
- $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
1245 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
1246 |
- $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
1247 |
- $(use_with oci8-instant-client pdo-oci) |
1248 |
- ) |
1249 |
- fi |
1250 |
- |
1251 |
- # readline/libedit support |
1252 |
- our_conf+=( |
1253 |
- $(use_with readline readline "${EPREFIX}/usr") |
1254 |
- $(use_with libedit libedit "${EPREFIX}/usr") |
1255 |
- ) |
1256 |
- |
1257 |
- # Session support |
1258 |
- if use session ; then |
1259 |
- our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") ) |
1260 |
- else |
1261 |
- our_conf+=( $(use_enable session session) ) |
1262 |
- fi |
1263 |
- |
1264 |
- # Use pic for shared modules such as apache2's mod_php |
1265 |
- our_conf+=( --with-pic ) |
1266 |
- |
1267 |
- # we use the system copy of pcre |
1268 |
- # --with-pcre-regex affects ext/pcre |
1269 |
- # --with-pcre-dir affects ext/filter and ext/zip |
1270 |
- our_conf+=( |
1271 |
- --with-pcre-regex="${EPREFIX}/usr" |
1272 |
- --with-pcre-dir="${EPREFIX}/usr" |
1273 |
- ) |
1274 |
- |
1275 |
- # Catch CFLAGS problems |
1276 |
- # Fixes bug #14067. |
1277 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
1278 |
- replace-cpu-flags "k6*" "i586" |
1279 |
- |
1280 |
- # Support user-passed configuration parameters |
1281 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
1282 |
- |
1283 |
- # Support the Apache2 extras, they must be set globally for all |
1284 |
- # SAPIs to work correctly, especially for external PHP extensions |
1285 |
- |
1286 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
1287 |
- for one_sapi in $SAPIS ; do |
1288 |
- use "${one_sapi}" || continue |
1289 |
- php_set_ini_dir "${one_sapi}" |
1290 |
- |
1291 |
- # The BUILD_DIR variable is used to determine where to output |
1292 |
- # the files that autotools creates. This was all originally |
1293 |
- # based on the autotools-utils eclass. |
1294 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
1295 |
- cp -a "${S}" "${BUILD_DIR}" || die |
1296 |
- cd "${BUILD_DIR}" || die |
1297 |
- |
1298 |
- local sapi_conf=( |
1299 |
- --with-config-file-path="${PHP_INI_DIR}" |
1300 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
1301 |
- ) |
1302 |
- |
1303 |
- for sapi in $SAPIS ; do |
1304 |
- case "$sapi" in |
1305 |
- cli|cgi|embed|fpm) |
1306 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
1307 |
- sapi_conf+=( "--enable-${sapi}" ) |
1308 |
- else |
1309 |
- sapi_conf+=( "--disable-${sapi}" ) |
1310 |
- fi |
1311 |
- ;; |
1312 |
- |
1313 |
- apache2) |
1314 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
1315 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) |
1316 |
- else |
1317 |
- sapi_conf+=( --without-apxs2 ) |
1318 |
- fi |
1319 |
- ;; |
1320 |
- esac |
1321 |
- done |
1322 |
- |
1323 |
- # Construct the $myeconfargs array by concatenating $our_conf |
1324 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
1325 |
- local myeconfargs=( "${our_conf[@]}" ) |
1326 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
1327 |
- |
1328 |
- pushd "${BUILD_DIR}" > /dev/null || die |
1329 |
- econf "${myeconfargs[@]}" |
1330 |
- popd > /dev/null || die |
1331 |
- done |
1332 |
-} |
1333 |
- |
1334 |
-src_compile() { |
1335 |
- # snmp seems to run during src_compile, too (bug #324739) |
1336 |
- addpredict /usr/share/snmp/mibs/.index |
1337 |
- addpredict /var/lib/net-snmp/mib_indexes |
1338 |
- |
1339 |
- for sapi in ${SAPIS} ; do |
1340 |
- if use "${sapi}"; then |
1341 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
1342 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
1343 |
- emake |
1344 |
- fi |
1345 |
- done |
1346 |
-} |
1347 |
- |
1348 |
-src_install() { |
1349 |
- # see bug #324739 for what happens when we don't have that |
1350 |
- addpredict /usr/share/snmp/mibs/.index |
1351 |
- |
1352 |
- # grab the first SAPI that got built and install common files from there |
1353 |
- local first_sapi="" |
1354 |
- for sapi in $SAPIS ; do |
1355 |
- if use $sapi ; then |
1356 |
- first_sapi=$sapi |
1357 |
- break |
1358 |
- fi |
1359 |
- done |
1360 |
- |
1361 |
- # Makefile forgets to create this before trying to write to it... |
1362 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
1363 |
- |
1364 |
- # Install php environment (without any sapis) |
1365 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
1366 |
- emake INSTALL_ROOT="${D}" \ |
1367 |
- install-build install-headers install-programs |
1368 |
- |
1369 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
1370 |
- |
1371 |
- # Create the directory where we'll put version-specific php scripts |
1372 |
- keepdir "/usr/share/php${PHP_MV}" |
1373 |
- |
1374 |
- local sapi="", file="" |
1375 |
- local sapi_list="" |
1376 |
- |
1377 |
- for sapi in ${SAPIS}; do |
1378 |
- if use "${sapi}" ; then |
1379 |
- einfo "Installing SAPI: ${sapi}" |
1380 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
1381 |
- |
1382 |
- if [[ "${sapi}" == "apache2" ]] ; then |
1383 |
- # We're specifically not using emake install-sapi as libtool |
1384 |
- # may cause unnecessary relink failures (see bug #351266) |
1385 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
1386 |
- newins ".libs/libphp5$(get_libname)" \ |
1387 |
- "libphp${PHP_MV}$(get_libname)" |
1388 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
1389 |
- else |
1390 |
- # needed each time, php_install_ini would reset it |
1391 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
1392 |
- into "${dest}" |
1393 |
- case "$sapi" in |
1394 |
- cli) |
1395 |
- source="sapi/cli/php" |
1396 |
- ;; |
1397 |
- cgi) |
1398 |
- source="sapi/cgi/php-cgi" |
1399 |
- ;; |
1400 |
- fpm) |
1401 |
- source="sapi/fpm/php-fpm" |
1402 |
- ;; |
1403 |
- embed) |
1404 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
1405 |
- ;; |
1406 |
- *) |
1407 |
- die "unhandled sapi in src_install" |
1408 |
- ;; |
1409 |
- esac |
1410 |
- |
1411 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
1412 |
- dolib.so "${source}" |
1413 |
- else |
1414 |
- dobin "${source}" |
1415 |
- local name="$(basename ${source})" |
1416 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
1417 |
- fi |
1418 |
- fi |
1419 |
- |
1420 |
- php_install_ini "${sapi}" |
1421 |
- |
1422 |
- # construct correct SAPI string for php-config |
1423 |
- # thanks to ferringb for the bash voodoo |
1424 |
- if [[ "${sapi}" == "apache2" ]]; then |
1425 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
1426 |
- else |
1427 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
1428 |
- fi |
1429 |
- fi |
1430 |
- done |
1431 |
- |
1432 |
- # Installing opcache module |
1433 |
- if use opcache ; then |
1434 |
- into "${PHP_DESTDIR#${EPREFIX}}" |
1435 |
- dolib.so "modules/opcache$(get_libname)" |
1436 |
- fi |
1437 |
- |
1438 |
- # Install env.d files |
1439 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
1440 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
1441 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
1442 |
- |
1443 |
- # set php-config variable correctly (bug #278439) |
1444 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
1445 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
1446 |
- |
1447 |
- if use fpm ; then |
1448 |
- if use systemd; then |
1449 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
1450 |
- "php-fpm@${SLOT}.service" |
1451 |
- else |
1452 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
1453 |
- "php-fpm@${SLOT}.service" |
1454 |
- fi |
1455 |
- fi |
1456 |
-} |
1457 |
- |
1458 |
-src_test() { |
1459 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
1460 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
1461 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
1462 |
- ewarn "Test phase requires USE=cli, skipping" |
1463 |
- return |
1464 |
- else |
1465 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
1466 |
- fi |
1467 |
- |
1468 |
- if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
1469 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
1470 |
- fi |
1471 |
- |
1472 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
1473 |
- "session.save_path=${T}" \ |
1474 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
1475 |
- "session.save_path=${T}" |
1476 |
- |
1477 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
1478 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
1479 |
- done |
1480 |
- |
1481 |
- local failed="$(find -name '*.out')" |
1482 |
- if [[ ${failed} != "" ]] ; then |
1483 |
- ewarn "The following test cases failed unexpectedly:" |
1484 |
- for name in ${failed}; do |
1485 |
- ewarn " ${name/.out/}" |
1486 |
- done |
1487 |
- else |
1488 |
- einfo "No unexpected test failures, all fine" |
1489 |
- fi |
1490 |
- |
1491 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
1492 |
- local passed="" |
1493 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
1494 |
- [[ -f "${name}.diff" ]] && continue |
1495 |
- passed="${passed} ${name}" |
1496 |
- done |
1497 |
- if [[ ${passed} != "" ]] ; then |
1498 |
- einfo "The following test cases passed unexpectedly:" |
1499 |
- for name in ${passed}; do |
1500 |
- ewarn " ${passed}" |
1501 |
- done |
1502 |
- else |
1503 |
- einfo "None of the known-to-fail tests passed, all fine" |
1504 |
- fi |
1505 |
- fi |
1506 |
-} |
1507 |
- |
1508 |
-pkg_postinst() { |
1509 |
- # Output some general info to the user |
1510 |
- if use apache2 ; then |
1511 |
- elog |
1512 |
- elog "To enable PHP in apache, you will need to add \"-D PHP\" to" |
1513 |
- elog "your apache2 command. OpenRC users can append that string to" |
1514 |
- elog "APACHE2_OPTS in /etc/conf.d/apache2." |
1515 |
- elog |
1516 |
- elog "The apache module configuration file 70_mod_php.conf is" |
1517 |
- elog "provided (and maintained) by eselect-php." |
1518 |
- elog |
1519 |
- fi |
1520 |
- |
1521 |
- # Create the symlinks for php |
1522 |
- for m in ${SAPIS}; do |
1523 |
- [[ ${m} == 'embed' ]] && continue; |
1524 |
- if use $m ; then |
1525 |
- local ci=$(eselect php show $m) |
1526 |
- if [[ -z $ci ]]; then |
1527 |
- eselect php set $m php${SLOT} || die |
1528 |
- einfo "Switched ${m} to use php:${SLOT}" |
1529 |
- einfo |
1530 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
1531 |
- elog "To switch $m to use php:${SLOT}, run" |
1532 |
- elog " eselect php set $m php${SLOT}" |
1533 |
- elog |
1534 |
- fi |
1535 |
- fi |
1536 |
- done |
1537 |
- |
1538 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
1539 |
- # example, if the user has the cgi SAPI enabled, then he has an |
1540 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
1541 |
- # USE="-cgi", that symlink will break. This call to eselect is |
1542 |
- # supposed to remove that dead link per bug 572436. |
1543 |
- eselect php cleanup || die |
1544 |
- |
1545 |
- if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then |
1546 |
- elog "To build extensions for this version of PHP, you will need to" |
1547 |
- elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." |
1548 |
- elog |
1549 |
- fi |
1550 |
- |
1551 |
- # Only mention PHP_INI_VERSION if the user doesn't have it set. |
1552 |
- case "${PHP_INI_VERSION}" in |
1553 |
- production|development) |
1554 |
- ;; |
1555 |
- *) |
1556 |
- elog "This ebuild installed a version of php.ini based on" |
1557 |
- elog "${PHP_INI_UPSTREAM}. You can choose which version of" |
1558 |
- elog "php.ini to install by default by setting PHP_INI_VERSION" |
1559 |
- elog "to either 'production' or 'development' in your make.conf." |
1560 |
- elog "Both versions of php.ini can be found with the PHP docs in" |
1561 |
- elog "${EPREFIX}/usr/share/doc/${PF}" |
1562 |
- elog |
1563 |
- ;; |
1564 |
- esac |
1565 |
- |
1566 |
- elog "For details on how version slotting works, please see" |
1567 |
- elog "the wiki:" |
1568 |
- elog |
1569 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
1570 |
- elog |
1571 |
-} |
1572 |
- |
1573 |
-pkg_postrm() { |
1574 |
- # This serves two purposes. First, if we have just removed the last |
1575 |
- # installed version of PHP, then this will remove any dead symlinks |
1576 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
1577 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
1578 |
- # his existing symlinks to point to the new 7.0 installation. The |
1579 |
- # latter is bug 432962. |
1580 |
- # |
1581 |
- # Note: the eselect-php package may not be installed at this point, |
1582 |
- # so we can't die() if this command fails. |
1583 |
- eselect php cleanup |
1584 |
-} |