1 |
commit: 31189ba8d3a627d1aa2964dde9410316a7e037d2 |
2 |
Author: Brian Evans <grknight <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 27 15:11:51 2018 +0000 |
4 |
Commit: Brian Evans <grknight <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 27 15:11:51 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=31189ba8 |
7 |
|
8 |
dev-lang/php: Clean up security vulnerable versions |
9 |
|
10 |
Bug: https://bugs.gentoo.org/652420 |
11 |
Package-Manager: Portage-2.3.40, Repoman-2.3.9 |
12 |
|
13 |
dev-lang/php/Manifest | 6 - |
14 |
dev-lang/php/php-5.6.33.ebuild | 771 ---------------------------------------- |
15 |
dev-lang/php/php-5.6.34.ebuild | 775 ----------------------------------------- |
16 |
dev-lang/php/php-7.0.27.ebuild | 741 --------------------------------------- |
17 |
dev-lang/php/php-7.0.28.ebuild | 745 --------------------------------------- |
18 |
dev-lang/php/php-7.1.13.ebuild | 723 -------------------------------------- |
19 |
dev-lang/php/php-7.1.15.ebuild | 727 -------------------------------------- |
20 |
7 files changed, 4488 deletions(-) |
21 |
|
22 |
diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest |
23 |
index 3db50e33cae..911f978a64c 100644 |
24 |
--- a/dev-lang/php/Manifest |
25 |
+++ b/dev-lang/php/Manifest |
26 |
@@ -1,13 +1,7 @@ |
27 |
-DIST php-5.6.33.tar.xz 12465256 BLAKE2B a33ce429c1565e6304031304168aa63ce82fa6c0968fc5ef09f5955e43c04ebe112db92475a999f39d997e2a3c9724ece60902ef0db84e2599d97d0e42ce57d2 SHA512 c494721594511f79a103ea3c73c5035aa0fcbca626710a0b85d2395693caf6762edefa3347cd0f8567b186f98c0df7f83cd4c698b158f0f72aa62aabbbb4e297 |
28 |
-DIST php-5.6.34.tar.xz 12465748 BLAKE2B 6b12f52a04d6b645d78f3d00617386a72fafffda24850e10f545464c9d0ca55321e91a292c3eb83409d0a303c4e37c2a686f547d86227c280ec78b428e73a92e SHA512 9aa02f943d6949a28ad96df5e75eec3ecab3731824400d0a0a8ccba9dee95b7af6421b38b86f352a45c778019ebfb1e6161a03256e4ef712341a9e0bad596ae7 |
29 |
DIST php-5.6.35.tar.xz 12466396 BLAKE2B 96757fc064c139f238329c51741538fdbdefd04abad59c37565e1882a5a7df7d3755cf496561336b25748a968fb18dbf9d542a54a672f553f4be5ead292141cc SHA512 dd7d891954aa7f8e83eecb265e1bb01dfd357092dad0cfc5a3f441bea069f7181cd79330653b178d4953ac1ee8570d7f4c21acc8fc67975dd7dc1413eaebf0af |
30 |
DIST php-5.6.36.tar.xz 12467560 BLAKE2B 8badaabc668ff3a4b1129f03605a1570729f8196d2e2539fe85bc42a628f2b24ea76c298b194e8466d9218ae98218243430c8d36d73fbd32b042dd6453510361 SHA512 807c68ab85b6685b19707bd18cfd46f3695b2dc67f9f17f85476634e4a80a036cb413ccae05ed5ba529eafe8df57ebf758dd664ed2942ec44f90a6e8b0172e5e |
31 |
-DIST php-7.0.27.tar.xz 11916824 BLAKE2B 9d2881a611435b3f9607e04d1f271ca497b8543792608f3690f00aa767fe8cc1f442822ae702076d21df0b56005d7b4e8e88b11ec6dd50d0bc198197b48cafda SHA512 1987ad5573fdcbd5c8d92fdbf5ba8dca6e9621d89d30f66a003338467e31f09f9e8ceb5cdcb2ddf24ec7aa5acf0c8e33c3774e586e7682667eb3ed148237d1bb |
32 |
-DIST php-7.0.28.tar.xz 11917836 BLAKE2B 8110b0486b0556abf2249d7cbdbd245249f32e230d8197e493edfdf8df38d8eac61b79b90983fa8a2918f67a5d80fefd9a213adff4c3eb760b3844e555614650 SHA512 054c765011d2ad5bb1ef2fd2d66df05f374032015869e69112b309a13b79f437de25e9692719110efbd79f33c677add36430dab21ae12231a7730207c9e877aa |
33 |
DIST php-7.0.29.tar.xz 12400192 BLAKE2B 0bd1bd9450b87437e539ec5131cb4f7e4dbf76d5fd5212bdf34c4f022dd8f2d357e9a845d83b485d89469e20675c031bcf382a8ca348161dfd082d7a389ffcb2 SHA512 ea5a2fbcfc875dd2621e3f67038c1e00f43b53bc7079ae2127fcefbf116db0f32e34d4435f8211305402a4eccdaa5dfd6b96cf9416e68700f2c1f438d74a0af8 |
34 |
DIST php-7.0.30.tar.xz 12030228 BLAKE2B cc4c50d108fca68ee98b70a3007893d912d2343dd255faf52e41c1de04f590f427d9edad7b637177ccf1d9c62212ee6060baca13931c0aa14532df548ef159aa SHA512 1f0914ebda79247aa65ace63f6c8c4fcd850b21a82704f7b6482760259239cc5fee4cfd5aa2ed590b56822b4d69330ac472f46537e7f25d59e73ba63a48827c5 |
35 |
-DIST php-7.1.13.tar.xz 12194780 BLAKE2B 0bac1cb3ec46cd4206d71b0d8ec3058fff455bc7e3febb33dcb8e14d5a8b16918d3e4679e0691b8ba29b95ab90be2a3dc3a73bade45c1ca4eaf692d6d3c2db3d SHA512 f5357ffcbcaab1ba03d70edc0f1329b530f9f9c7779ac57d6fd2bd0bb730162f8d107025e5ff66592077d1bf504ee6816ec0379f50ceb1fac36cea90b0fc4fa2 |
36 |
-DIST php-7.1.15.tar.xz 12201380 BLAKE2B 4387382daf3883962eb0e47d86c983a65c293e89aa71239977bb1c6fdaa99b3a76eacb71a30f134fcc47f4ca6fea95687f3e405c1ecc7a737c8cf40489e8e7a3 SHA512 2b23795ffcb9d741adafe8a1e01e6988bb86ce7c6380bdbe822f8f6485e217ed2e95a27daf5ba11f0bf10317f1e1f4e37068e40d0bf322de5625d38b430d37c2 |
37 |
DIST php-7.1.16.tar.xz 12211512 BLAKE2B bf242e2438b2dc363368a9ef4478349a291f483477ccedf988abd0fbb78a6f1b31e3b86dcb39ed9a9a8151674a8373ae77d8420e77efd6a2e05d5cfc778ed40f SHA512 98e96f06a4912cfa6926be2f292ce7120ca893c9b779b2efef4120c1df3580fa427cd58f5e4977edb01a0ae3b85660d6ca79b2bd79b6cd830cd77f6c6588b5ea |
38 |
DIST php-7.1.17.tar.xz 12213536 BLAKE2B bf358bc4920d38f74e4bdbc53f4744274071b4cea057452bfafbbc5760eb1ae0878f8cc92cf5337b883e17769cc6a490d0e64d3969aa1769cec92bf14f9101ea SHA512 2ac81b5ec898d366dc60f2dae4b07094457c6b8b110615e0fcc3af1e680708ed0e9c89728b95e453110eec41198cb8a0416b4aeadc017d4a2b6bf25ce624cac1 |
39 |
DIST php-7.2.5.tar.xz 12034928 BLAKE2B 36c9ec413b5332a1ef138a5724fd1718f5a8ffa8873dbe27ae7b6ca9a55ecfa0de7f7504a20581edb48605c2afcc799784eb3d94e08236222f6de2094d1921d0 SHA512 1d49fc6e47d2e86d4fd62396e558965502f44cc8f72459bb0d406e157298cac67703b219837952da11122722d9fa8cb4cda8ef66ddf063cb063859db34110f58 |
40 |
|
41 |
diff --git a/dev-lang/php/php-5.6.33.ebuild b/dev-lang/php/php-5.6.33.ebuild |
42 |
deleted file mode 100644 |
43 |
index 6fc74a0292a..00000000000 |
44 |
--- a/dev-lang/php/php-5.6.33.ebuild |
45 |
+++ /dev/null |
46 |
@@ -1,771 +0,0 @@ |
47 |
-# Copyright 1999-2018 Gentoo Foundation |
48 |
-# Distributed under the terms of the GNU General Public License v2 |
49 |
- |
50 |
-EAPI=6 |
51 |
- |
52 |
-inherit autotools flag-o-matic versionator systemd |
53 |
- |
54 |
-DESCRIPTION="The PHP language runtime engine" |
55 |
-HOMEPAGE="https://secure.php.net/" |
56 |
-SRC_URI="https://php.net/distributions/${P}.tar.xz" |
57 |
- |
58 |
-LICENSE="PHP-3.01 |
59 |
- BSD |
60 |
- Zend-2.0 |
61 |
- bcmath? ( LGPL-2.1+ ) |
62 |
- fpm? ( BSD-2 ) |
63 |
- gd? ( gd ) |
64 |
- unicode? ( BSD-2 LGPL-2.1 )" |
65 |
- |
66 |
-SLOT="$(get_version_component_range 1-2)" |
67 |
-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" |
68 |
- |
69 |
-# We can build the following SAPIs in the given order |
70 |
-SAPIS="embed cli cgi fpm apache2" |
71 |
- |
72 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
73 |
-IUSE="${IUSE} |
74 |
- ${SAPIS/cli/+cli} |
75 |
- threads" |
76 |
- |
77 |
-IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk |
78 |
- coverage crypt +ctype curl debug |
79 |
- enchant exif +fileinfo +filter firebird |
80 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
81 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl |
82 |
- mhash mssql mysql libmysqlclient mysqli nls |
83 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
84 |
- readline recode selinux +session sharedmem |
85 |
- +simplexml snmp soap sockets spell sqlite ssl |
86 |
- sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx |
87 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
88 |
- |
89 |
-# The supported (that is, autodetected) versions of BDB are listed in |
90 |
-# the ./configure script. Other versions *work*, but we need to stick to |
91 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
92 |
-COMMON_DEPEND=" |
93 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
94 |
- >=dev-libs/libpcre-8.32[unicode] |
95 |
- acl? ( sys-apps/acl ) |
96 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
97 |
- <www-servers/apache-2.4[threads=] ) ) |
98 |
- berkdb? ( || ( sys-libs/db:5.3 |
99 |
- sys-libs/db:5.1 |
100 |
- sys-libs/db:4.8 |
101 |
- sys-libs/db:4.7 |
102 |
- sys-libs/db:4.6 |
103 |
- sys-libs/db:4.5 ) ) |
104 |
- bzip2? ( app-arch/bzip2:0= ) |
105 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
106 |
- cjk? ( !gd? ( |
107 |
- virtual/jpeg:0 |
108 |
- media-libs/libpng:0= |
109 |
- sys-libs/zlib:0= |
110 |
- ) ) |
111 |
- coverage? ( dev-util/lcov ) |
112 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
113 |
- curl? ( >=net-misc/curl-7.10.5 ) |
114 |
- enchant? ( app-text/enchant ) |
115 |
- exif? ( !gd? ( |
116 |
- virtual/jpeg:0 |
117 |
- media-libs/libpng:0= |
118 |
- sys-libs/zlib:0= |
119 |
- ) ) |
120 |
- firebird? ( dev-db/firebird ) |
121 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= ) |
122 |
- gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) |
123 |
- gmp? ( dev-libs/gmp:0= ) |
124 |
- iconv? ( virtual/libiconv ) |
125 |
- imap? ( virtual/imap-c-client[kerberos=,ssl=] ) |
126 |
- intl? ( dev-libs/icu:= ) |
127 |
- iodbc? ( dev-db/libiodbc ) |
128 |
- kerberos? ( virtual/krb5 ) |
129 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
130 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
131 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
132 |
- mssql? ( dev-db/freetds[mssql] ) |
133 |
- libmysqlclient? ( |
134 |
- mysql? ( virtual/libmysqlclient:= ) |
135 |
- mysqli? ( virtual/libmysqlclient:= ) |
136 |
- ) |
137 |
- nls? ( sys-devel/gettext ) |
138 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
139 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
140 |
- postgres? ( dev-db/postgresql:* ) |
141 |
- qdbm? ( dev-db/qdbm ) |
142 |
- readline? ( sys-libs/readline:0= ) |
143 |
- recode? ( app-text/recode ) |
144 |
- sharedmem? ( dev-libs/mm ) |
145 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
146 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
147 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
148 |
- spell? ( >=app-text/aspell-0.50 ) |
149 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
150 |
- ssl? ( |
151 |
- !libressl? ( dev-libs/openssl:0= ) |
152 |
- libressl? ( dev-libs/libressl:0= ) |
153 |
- ) |
154 |
- sybase-ct? ( dev-db/freetds ) |
155 |
- tidy? ( app-text/htmltidy ) |
156 |
- truetype? ( |
157 |
- =media-libs/freetype-2* |
158 |
- >=media-libs/t1lib-5.0.0 |
159 |
- !gd? ( |
160 |
- virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= ) |
161 |
- ) |
162 |
- unicode? ( dev-libs/oniguruma:= ) |
163 |
- vpx? ( media-libs/libvpx:0= ) |
164 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
165 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
166 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
167 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
168 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
169 |
- xpm? ( |
170 |
- x11-libs/libXpm |
171 |
- virtual/jpeg:0 |
172 |
- media-libs/libpng:0= sys-libs/zlib:0= |
173 |
- ) |
174 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
175 |
- zip? ( sys-libs/zlib:0= ) |
176 |
- zlib? ( sys-libs/zlib:0= ) |
177 |
-" |
178 |
- |
179 |
-RDEPEND="${COMMON_DEPEND} |
180 |
- virtual/mta |
181 |
- fpm? ( |
182 |
- selinux? ( sec-policy/selinux-phpfpm ) |
183 |
- systemd? ( sys-apps/systemd ) )" |
184 |
- |
185 |
-DEPEND="${COMMON_DEPEND} |
186 |
- app-arch/xz-utils |
187 |
- >=sys-devel/bison-3.0.1 |
188 |
- sys-devel/flex |
189 |
- >=sys-devel/m4-1.4.3 |
190 |
- >=sys-devel/libtool-1.5.18" |
191 |
- |
192 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
193 |
-REQUIRED_USE=" |
194 |
- || ( cli cgi fpm apache2 embed ) |
195 |
- cli? ( ^^ ( readline libedit ) ) |
196 |
- truetype? ( gd ) |
197 |
- vpx? ( gd ) |
198 |
- cjk? ( gd ) |
199 |
- exif? ( gd ) |
200 |
- xpm? ( gd ) |
201 |
- gd? ( zlib ) |
202 |
- simplexml? ( xml ) |
203 |
- soap? ( xml ) |
204 |
- wddx? ( xml ) |
205 |
- xmlrpc? ( || ( xml iconv ) ) |
206 |
- xmlreader? ( xml ) |
207 |
- xslt? ( xml ) |
208 |
- ldap-sasl? ( ldap ) |
209 |
- mhash? ( hash ) |
210 |
- phar? ( hash ) |
211 |
- recode? ( !imap !mysql !mysqli !libmysqlclient ) |
212 |
- libmysqlclient? ( || ( |
213 |
- mysql |
214 |
- mysqli |
215 |
- pdo |
216 |
- ) ) |
217 |
- |
218 |
- qdbm? ( !gdbm ) |
219 |
- readline? ( !libedit ) |
220 |
- sharedmem? ( !threads ) |
221 |
-" |
222 |
- |
223 |
-PHP_MV="$(get_major_version)" |
224 |
- |
225 |
-php_install_ini() { |
226 |
- local phpsapi="${1}" |
227 |
- |
228 |
- # work out where we are installing the ini file |
229 |
- php_set_ini_dir "${phpsapi}" |
230 |
- |
231 |
- # Always install the production INI file, bug 611214. |
232 |
- local phpinisrc="php.ini-production-${phpsapi}" |
233 |
- cp php.ini-production "${phpinisrc}" || die |
234 |
- |
235 |
- # default to /tmp for save_path, bug #282768 |
236 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
237 |
- |
238 |
- # Set the extension dir |
239 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ |
240 |
- -i "${phpinisrc}" || die |
241 |
- |
242 |
- # Set the include path to point to where we want to find PEAR packages |
243 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
244 |
- |
245 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
246 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
247 |
- newins "${phpinisrc}" php.ini |
248 |
- |
249 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
250 |
- elog |
251 |
- |
252 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
253 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
254 |
- |
255 |
- if use opcache; then |
256 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
257 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
258 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
259 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \ |
260 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
261 |
- fi |
262 |
- |
263 |
- # SAPI-specific handling |
264 |
- if [[ "${sapi}" == "fpm" ]] ; then |
265 |
- einfo "Installing FPM config file php-fpm.conf" |
266 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
267 |
- doins sapi/fpm/php-fpm.conf |
268 |
- fi |
269 |
- |
270 |
- dodoc php.ini-{development,production} |
271 |
-} |
272 |
- |
273 |
-php_set_ini_dir() { |
274 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
275 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
276 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
277 |
-} |
278 |
- |
279 |
-src_prepare() { |
280 |
- eapply "${FILESDIR}/php-${SLOT}-no-bison-warnings.patch" |
281 |
- |
282 |
- # Change PHP branding |
283 |
- # Get the alpha/beta/rc version |
284 |
- sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ |
285 |
- -i configure.in || die "Unable to change PHP branding" |
286 |
- |
287 |
- # Patch PHP to show Gentoo as the server platform |
288 |
- sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
289 |
- -i configure.in || die "Failed to fix server platform name" |
290 |
- |
291 |
- # Prevent PHP from activating the Apache config, |
292 |
- # as we will do that ourselves |
293 |
- sed -i \ |
294 |
- -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
295 |
- -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
296 |
- configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \ |
297 |
- || die |
298 |
- |
299 |
- # Patch PHP to support heimdal instead of mit-krb5 |
300 |
- if has_version "app-crypt/heimdal" ; then |
301 |
- sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
302 |
- || die "Failed to fix heimdal libname" |
303 |
- sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
304 |
- || die "Failed to fix heimdal crypt library reference" |
305 |
- fi |
306 |
- |
307 |
- eapply_user |
308 |
- |
309 |
- # Force rebuilding aclocal.m4 |
310 |
- rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare" |
311 |
- eautoreconf |
312 |
- |
313 |
- if [[ ${CHOST} == *-darwin* ]] ; then |
314 |
- # http://bugs.php.net/bug.php?id=48795, bug #343481 |
315 |
- sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die |
316 |
- fi |
317 |
-} |
318 |
- |
319 |
-src_configure() { |
320 |
- addpredict /usr/share/snmp/mibs/.index |
321 |
- addpredict /var/lib/net-snmp/mib_indexes |
322 |
- |
323 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
324 |
- |
325 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
326 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
327 |
- local our_conf=( |
328 |
- --prefix="${PHP_DESTDIR}" |
329 |
- --mandir="${PHP_DESTDIR}/man" |
330 |
- --infodir="${PHP_DESTDIR}/info" |
331 |
- --libdir="${PHP_DESTDIR}/lib" |
332 |
- --with-libdir="$(get_libdir)" |
333 |
- --localstatedir="${EPREFIX}/var" |
334 |
- --without-pear |
335 |
- $(use_enable threads maintainer-zts) |
336 |
- ) |
337 |
- |
338 |
- our_conf+=( |
339 |
- $(use_with acl fpm-acl) |
340 |
- $(use_enable bcmath bcmath) |
341 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
342 |
- $(use_enable calendar calendar) |
343 |
- $(use_enable coverage gcov) |
344 |
- $(use_enable ctype ctype) |
345 |
- $(use_with curl curl "${EPREFIX}/usr") |
346 |
- $(use_enable xml dom) |
347 |
- $(use_with enchant enchant "${EPREFIX}/usr") |
348 |
- $(use_enable exif exif) |
349 |
- $(use_enable fileinfo fileinfo) |
350 |
- $(use_enable filter filter) |
351 |
- $(use_enable ftp ftp) |
352 |
- $(use_with nls gettext "${EPREFIX}/usr") |
353 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
354 |
- $(use_enable hash hash) |
355 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
356 |
- $(use_with iconv iconv \ |
357 |
- $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr")) |
358 |
- $(use_enable intl intl) |
359 |
- $(use_enable ipv6 ipv6) |
360 |
- $(use_enable json json) |
361 |
- $(use_with kerberos kerberos "${EPREFIX}/usr") |
362 |
- $(use_enable xml libxml) |
363 |
- $(use_with xml libxml-dir "${EPREFIX}/usr") |
364 |
- $(use_enable unicode mbstring) |
365 |
- $(use_with crypt mcrypt "${EPREFIX}/usr") |
366 |
- $(use_with mssql mssql "${EPREFIX}/usr") |
367 |
- $(use_with unicode onig "${EPREFIX}/usr") |
368 |
- $(use_with ssl openssl "${EPREFIX}/usr") |
369 |
- $(use_with ssl openssl-dir "${EPREFIX}/usr") |
370 |
- $(use_enable pcntl pcntl) |
371 |
- $(use_enable phar phar) |
372 |
- $(use_enable pdo pdo) |
373 |
- $(use_enable opcache opcache) |
374 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
375 |
- $(use_enable posix posix) |
376 |
- $(use_with spell pspell "${EPREFIX}/usr") |
377 |
- $(use_with recode recode "${EPREFIX}/usr") |
378 |
- $(use_enable simplexml simplexml) |
379 |
- $(use_enable sharedmem shmop) |
380 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
381 |
- $(use_enable soap soap) |
382 |
- $(use_enable sockets sockets) |
383 |
- $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
384 |
- $(use_with sybase-ct sybase-ct "${EPREFIX}/usr") |
385 |
- $(use_enable sysvipc sysvmsg) |
386 |
- $(use_enable sysvipc sysvsem) |
387 |
- $(use_enable sysvipc sysvshm) |
388 |
- $(use_with systemd fpm-systemd) |
389 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
390 |
- $(use_enable tokenizer tokenizer) |
391 |
- $(use_enable wddx wddx) |
392 |
- $(use_enable xml xml) |
393 |
- $(use_enable xmlreader xmlreader) |
394 |
- $(use_enable xmlwriter xmlwriter) |
395 |
- $(use_with xmlrpc xmlrpc) |
396 |
- $(use_with xslt xsl "${EPREFIX}/usr") |
397 |
- $(use_enable zip zip) |
398 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
399 |
- $(use_enable debug debug) |
400 |
- ) |
401 |
- |
402 |
- # DBA support |
403 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
404 |
- || use qdbm ; then |
405 |
- our_conf+=( "--enable-dba${shared}" ) |
406 |
- fi |
407 |
- |
408 |
- # DBA drivers support |
409 |
- our_conf+=( |
410 |
- $(use_with cdb cdb) |
411 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
412 |
- $(use_enable flatfile flatfile) |
413 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
414 |
- $(use_enable inifile inifile) |
415 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
416 |
- ) |
417 |
- |
418 |
- # Support for the GD graphics library |
419 |
- our_conf+=( |
420 |
- $(use_with truetype freetype-dir "${EPREFIX}/usr") |
421 |
- $(use_with truetype t1lib "${EPREFIX}/usr") |
422 |
- $(use_enable cjk gd-jis-conv) |
423 |
- $(use_with gd jpeg-dir "${EPREFIX}/usr") |
424 |
- $(use_with gd png-dir "${EPREFIX}/usr") |
425 |
- $(use_with xpm xpm-dir "${EPREFIX}/usr") |
426 |
- $(use_with vpx vpx-dir "${EPREFIX}/usr") |
427 |
- ) |
428 |
- # enable gd last, so configure can pick up the previous settings |
429 |
- our_conf+=( $(use_with gd gd) ) |
430 |
- |
431 |
- # IMAP support |
432 |
- if use imap ; then |
433 |
- our_conf+=( |
434 |
- $(use_with imap imap "${EPREFIX}/usr") |
435 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
436 |
- ) |
437 |
- fi |
438 |
- |
439 |
- # Interbase/firebird support |
440 |
- our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
441 |
- |
442 |
- # LDAP support |
443 |
- if use ldap ; then |
444 |
- our_conf+=( |
445 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
446 |
- $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
447 |
- ) |
448 |
- fi |
449 |
- |
450 |
- # MySQL support |
451 |
- local mysqllib="mysqlnd" |
452 |
- local mysqlilib="mysqlnd" |
453 |
- use libmysqlclient && mysqllib="${EPREFIX}/usr" |
454 |
- use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config" |
455 |
- |
456 |
- our_conf+=( $(use_with mysql mysql "${mysqllib}") ) |
457 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
458 |
- |
459 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
460 |
- if use mysql || use mysqli ; then |
461 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
462 |
- fi |
463 |
- |
464 |
- # ODBC support |
465 |
- our_conf+=( |
466 |
- $(use_with odbc unixODBC "${EPREFIX}/usr") |
467 |
- $(use_with iodbc iodbc "${EPREFIX}/usr") |
468 |
- ) |
469 |
- |
470 |
- # Oracle support |
471 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
472 |
- |
473 |
- # PDO support |
474 |
- if use pdo ; then |
475 |
- our_conf+=( |
476 |
- $(use_with mssql pdo-dblib) |
477 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
478 |
- $(use_with postgres pdo-pgsql) |
479 |
- $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
480 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
481 |
- $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
482 |
- $(use_with oci8-instant-client pdo-oci) |
483 |
- ) |
484 |
- fi |
485 |
- |
486 |
- # readline/libedit support |
487 |
- our_conf+=( |
488 |
- $(use_with readline readline "${EPREFIX}/usr") |
489 |
- $(use_with libedit libedit "${EPREFIX}/usr") |
490 |
- ) |
491 |
- |
492 |
- # Session support |
493 |
- if use session ; then |
494 |
- our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") ) |
495 |
- else |
496 |
- our_conf+=( $(use_enable session session) ) |
497 |
- fi |
498 |
- |
499 |
- # Use pic for shared modules such as apache2's mod_php |
500 |
- our_conf+=( --with-pic ) |
501 |
- |
502 |
- # we use the system copy of pcre |
503 |
- # --with-pcre-regex affects ext/pcre |
504 |
- # --with-pcre-dir affects ext/filter and ext/zip |
505 |
- our_conf+=( |
506 |
- --with-pcre-regex="${EPREFIX}/usr" |
507 |
- --with-pcre-dir="${EPREFIX}/usr" |
508 |
- ) |
509 |
- |
510 |
- # Catch CFLAGS problems |
511 |
- # Fixes bug #14067. |
512 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
513 |
- replace-cpu-flags "k6*" "i586" |
514 |
- |
515 |
- # Cache the ./configure test results between SAPIs. |
516 |
- our_conf+=( --cache-file="${T}/config.cache" ) |
517 |
- |
518 |
- # Support user-passed configuration parameters |
519 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
520 |
- |
521 |
- # Support the Apache2 extras, they must be set globally for all |
522 |
- # SAPIs to work correctly, especially for external PHP extensions |
523 |
- |
524 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
525 |
- for one_sapi in $SAPIS ; do |
526 |
- use "${one_sapi}" || continue |
527 |
- php_set_ini_dir "${one_sapi}" |
528 |
- |
529 |
- # The BUILD_DIR variable is used to determine where to output |
530 |
- # the files that autotools creates. This was all originally |
531 |
- # based on the autotools-utils eclass. |
532 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
533 |
- cp -a "${S}" "${BUILD_DIR}" || die |
534 |
- cd "${BUILD_DIR}" || die |
535 |
- |
536 |
- local sapi_conf=( |
537 |
- --with-config-file-path="${PHP_INI_DIR}" |
538 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
539 |
- ) |
540 |
- |
541 |
- for sapi in $SAPIS ; do |
542 |
- case "$sapi" in |
543 |
- cli|cgi|embed|fpm) |
544 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
545 |
- sapi_conf+=( "--enable-${sapi}" ) |
546 |
- else |
547 |
- sapi_conf+=( "--disable-${sapi}" ) |
548 |
- fi |
549 |
- ;; |
550 |
- |
551 |
- apache2) |
552 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
553 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) |
554 |
- else |
555 |
- sapi_conf+=( --without-apxs2 ) |
556 |
- fi |
557 |
- ;; |
558 |
- esac |
559 |
- done |
560 |
- |
561 |
- # Construct the $myeconfargs array by concatenating $our_conf |
562 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
563 |
- local myeconfargs=( "${our_conf[@]}" ) |
564 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
565 |
- |
566 |
- pushd "${BUILD_DIR}" > /dev/null || die |
567 |
- econf "${myeconfargs[@]}" |
568 |
- popd > /dev/null || die |
569 |
- done |
570 |
-} |
571 |
- |
572 |
-src_compile() { |
573 |
- # snmp seems to run during src_compile, too (bug #324739) |
574 |
- addpredict /usr/share/snmp/mibs/.index |
575 |
- addpredict /var/lib/net-snmp/mib_indexes |
576 |
- |
577 |
- for sapi in ${SAPIS} ; do |
578 |
- if use "${sapi}"; then |
579 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
580 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
581 |
- emake |
582 |
- fi |
583 |
- done |
584 |
-} |
585 |
- |
586 |
-src_install() { |
587 |
- # see bug #324739 for what happens when we don't have that |
588 |
- addpredict /usr/share/snmp/mibs/.index |
589 |
- |
590 |
- # grab the first SAPI that got built and install common files from there |
591 |
- local first_sapi="" |
592 |
- for sapi in $SAPIS ; do |
593 |
- if use $sapi ; then |
594 |
- first_sapi=$sapi |
595 |
- break |
596 |
- fi |
597 |
- done |
598 |
- |
599 |
- # Makefile forgets to create this before trying to write to it... |
600 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
601 |
- |
602 |
- # Install php environment (without any sapis) |
603 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
604 |
- emake INSTALL_ROOT="${D}" \ |
605 |
- install-build install-headers install-programs |
606 |
- |
607 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
608 |
- |
609 |
- # Create the directory where we'll put version-specific php scripts |
610 |
- keepdir "/usr/share/php${PHP_MV}" |
611 |
- |
612 |
- local sapi="", file="" |
613 |
- local sapi_list="" |
614 |
- |
615 |
- for sapi in ${SAPIS}; do |
616 |
- if use "${sapi}" ; then |
617 |
- einfo "Installing SAPI: ${sapi}" |
618 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
619 |
- |
620 |
- if [[ "${sapi}" == "apache2" ]] ; then |
621 |
- # We're specifically not using emake install-sapi as libtool |
622 |
- # may cause unnecessary relink failures (see bug #351266) |
623 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
624 |
- newins ".libs/libphp5$(get_libname)" \ |
625 |
- "libphp${PHP_MV}$(get_libname)" |
626 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
627 |
- else |
628 |
- # needed each time, php_install_ini would reset it |
629 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
630 |
- into "${dest}" |
631 |
- case "$sapi" in |
632 |
- cli) |
633 |
- source="sapi/cli/php" |
634 |
- ;; |
635 |
- cgi) |
636 |
- source="sapi/cgi/php-cgi" |
637 |
- ;; |
638 |
- fpm) |
639 |
- source="sapi/fpm/php-fpm" |
640 |
- ;; |
641 |
- embed) |
642 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
643 |
- ;; |
644 |
- *) |
645 |
- die "unhandled sapi in src_install" |
646 |
- ;; |
647 |
- esac |
648 |
- |
649 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
650 |
- dolib.so "${source}" |
651 |
- else |
652 |
- dobin "${source}" |
653 |
- local name="$(basename ${source})" |
654 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
655 |
- fi |
656 |
- fi |
657 |
- |
658 |
- php_install_ini "${sapi}" |
659 |
- |
660 |
- # construct correct SAPI string for php-config |
661 |
- # thanks to ferringb for the bash voodoo |
662 |
- if [[ "${sapi}" == "apache2" ]]; then |
663 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
664 |
- else |
665 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
666 |
- fi |
667 |
- fi |
668 |
- done |
669 |
- |
670 |
- # Installing opcache module |
671 |
- if use opcache ; then |
672 |
- into "${PHP_DESTDIR#${EPREFIX}}" |
673 |
- dolib.so "modules/opcache$(get_libname)" |
674 |
- fi |
675 |
- |
676 |
- # Install env.d files |
677 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
678 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
679 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
680 |
- |
681 |
- # set php-config variable correctly (bug #278439) |
682 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
683 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
684 |
- |
685 |
- if use fpm ; then |
686 |
- if use systemd; then |
687 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
688 |
- "php-fpm@${SLOT}.service" |
689 |
- else |
690 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
691 |
- "php-fpm@${SLOT}.service" |
692 |
- fi |
693 |
- fi |
694 |
-} |
695 |
- |
696 |
-src_test() { |
697 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
698 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
699 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
700 |
- ewarn "Test phase requires USE=cli, skipping" |
701 |
- return |
702 |
- else |
703 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
704 |
- fi |
705 |
- |
706 |
- if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
707 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
708 |
- fi |
709 |
- |
710 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
711 |
- "session.save_path=${T}" \ |
712 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
713 |
- "session.save_path=${T}" |
714 |
- |
715 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
716 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
717 |
- done |
718 |
- |
719 |
- local failed="$(find -name '*.out')" |
720 |
- if [[ ${failed} != "" ]] ; then |
721 |
- ewarn "The following test cases failed unexpectedly:" |
722 |
- for name in ${failed}; do |
723 |
- ewarn " ${name/.out/}" |
724 |
- done |
725 |
- else |
726 |
- einfo "No unexpected test failures, all fine" |
727 |
- fi |
728 |
- |
729 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
730 |
- local passed="" |
731 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
732 |
- [[ -f "${name}.diff" ]] && continue |
733 |
- passed="${passed} ${name}" |
734 |
- done |
735 |
- if [[ ${passed} != "" ]] ; then |
736 |
- einfo "The following test cases passed unexpectedly:" |
737 |
- for name in ${passed}; do |
738 |
- ewarn " ${passed}" |
739 |
- done |
740 |
- else |
741 |
- einfo "None of the known-to-fail tests passed, all fine" |
742 |
- fi |
743 |
- fi |
744 |
-} |
745 |
- |
746 |
-pkg_postinst() { |
747 |
- # Output some general info to the user |
748 |
- if use apache2 ; then |
749 |
- elog |
750 |
- elog "To enable PHP in apache, you will need to add \"-D PHP\" to" |
751 |
- elog "your apache2 command. OpenRC users can append that string to" |
752 |
- elog "APACHE2_OPTS in /etc/conf.d/apache2." |
753 |
- elog |
754 |
- elog "The apache module configuration file 70_mod_php.conf is" |
755 |
- elog "provided (and maintained) by eselect-php." |
756 |
- elog |
757 |
- fi |
758 |
- |
759 |
- # Create the symlinks for php |
760 |
- for m in ${SAPIS}; do |
761 |
- [[ ${m} == 'embed' ]] && continue; |
762 |
- if use $m ; then |
763 |
- local ci=$(eselect php show $m) |
764 |
- if [[ -z $ci ]]; then |
765 |
- eselect php set $m php${SLOT} || die |
766 |
- einfo "Switched ${m} to use php:${SLOT}" |
767 |
- einfo |
768 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
769 |
- elog "To switch $m to use php:${SLOT}, run" |
770 |
- elog " eselect php set $m php${SLOT}" |
771 |
- elog |
772 |
- fi |
773 |
- fi |
774 |
- done |
775 |
- |
776 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
777 |
- # example, if the user has the cgi SAPI enabled, then he has an |
778 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
779 |
- # USE="-cgi", that symlink will break. This call to eselect is |
780 |
- # supposed to remove that dead link per bug 572436. |
781 |
- eselect php cleanup || die |
782 |
- |
783 |
- if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then |
784 |
- elog "To build extensions for this version of PHP, you will need to" |
785 |
- elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." |
786 |
- elog |
787 |
- fi |
788 |
- |
789 |
- # Warn about the removal of PHP_INI_VERSION if the user has it set. |
790 |
- if [[ -n "${PHP_INI_VERSION}" ]]; then |
791 |
- ewarn 'The PHP_INI_VERSION variable has been phased out. You may' |
792 |
- ewarn 'remove it from your configuration at your convenience. See' |
793 |
- ewarn |
794 |
- ewarn ' https://bugs.gentoo.org/611214' |
795 |
- ewarn |
796 |
- ewarn 'for more information.' |
797 |
- fi |
798 |
- |
799 |
- elog "For details on how version slotting works, please see" |
800 |
- elog "the wiki:" |
801 |
- elog |
802 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
803 |
- elog |
804 |
-} |
805 |
- |
806 |
-pkg_postrm() { |
807 |
- # This serves two purposes. First, if we have just removed the last |
808 |
- # installed version of PHP, then this will remove any dead symlinks |
809 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
810 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
811 |
- # his existing symlinks to point to the new 7.0 installation. The |
812 |
- # latter is bug 432962. |
813 |
- # |
814 |
- # Note: the eselect-php package may not be installed at this point, |
815 |
- # so we can't die() if this command fails. |
816 |
- eselect php cleanup |
817 |
-} |
818 |
|
819 |
diff --git a/dev-lang/php/php-5.6.34.ebuild b/dev-lang/php/php-5.6.34.ebuild |
820 |
deleted file mode 100644 |
821 |
index dfd04fb8e1d..00000000000 |
822 |
--- a/dev-lang/php/php-5.6.34.ebuild |
823 |
+++ /dev/null |
824 |
@@ -1,775 +0,0 @@ |
825 |
-# Copyright 1999-2018 Gentoo Foundation |
826 |
-# Distributed under the terms of the GNU General Public License v2 |
827 |
- |
828 |
-EAPI=6 |
829 |
- |
830 |
-inherit autotools flag-o-matic versionator systemd |
831 |
- |
832 |
-DESCRIPTION="The PHP language runtime engine" |
833 |
-HOMEPAGE="https://secure.php.net/" |
834 |
-SRC_URI="https://php.net/distributions/${P}.tar.xz" |
835 |
- |
836 |
-LICENSE="PHP-3.01 |
837 |
- BSD |
838 |
- Zend-2.0 |
839 |
- bcmath? ( LGPL-2.1+ ) |
840 |
- fpm? ( BSD-2 ) |
841 |
- gd? ( gd ) |
842 |
- unicode? ( BSD-2 LGPL-2.1 )" |
843 |
- |
844 |
-SLOT="$(get_version_component_range 1-2)" |
845 |
-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" |
846 |
- |
847 |
-# We can build the following SAPIs in the given order |
848 |
-SAPIS="embed cli cgi fpm apache2" |
849 |
- |
850 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
851 |
-IUSE="${IUSE} |
852 |
- ${SAPIS/cli/+cli} |
853 |
- threads" |
854 |
- |
855 |
-IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk |
856 |
- coverage crypt +ctype curl debug |
857 |
- enchant exif +fileinfo +filter firebird |
858 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
859 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl |
860 |
- mhash mssql mysql libmysqlclient mysqli nls |
861 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
862 |
- readline recode selinux +session sharedmem |
863 |
- +simplexml snmp soap sockets spell sqlite ssl |
864 |
- sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx |
865 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
866 |
- |
867 |
-# The supported (that is, autodetected) versions of BDB are listed in |
868 |
-# the ./configure script. Other versions *work*, but we need to stick to |
869 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
870 |
-COMMON_DEPEND=" |
871 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
872 |
- >=dev-libs/libpcre-8.32[unicode] |
873 |
- fpm? ( acl? ( sys-apps/acl ) ) |
874 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
875 |
- <www-servers/apache-2.4[threads=] ) ) |
876 |
- berkdb? ( || ( sys-libs/db:5.3 |
877 |
- sys-libs/db:5.1 |
878 |
- sys-libs/db:4.8 |
879 |
- sys-libs/db:4.7 |
880 |
- sys-libs/db:4.6 |
881 |
- sys-libs/db:4.5 ) ) |
882 |
- bzip2? ( app-arch/bzip2:0= ) |
883 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
884 |
- cjk? ( !gd? ( |
885 |
- virtual/jpeg:0 |
886 |
- media-libs/libpng:0= |
887 |
- sys-libs/zlib:0= |
888 |
- ) ) |
889 |
- coverage? ( dev-util/lcov ) |
890 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
891 |
- curl? ( >=net-misc/curl-7.10.5 ) |
892 |
- enchant? ( app-text/enchant ) |
893 |
- exif? ( !gd? ( |
894 |
- virtual/jpeg:0 |
895 |
- media-libs/libpng:0= |
896 |
- sys-libs/zlib:0= |
897 |
- ) ) |
898 |
- firebird? ( dev-db/firebird ) |
899 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= ) |
900 |
- gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) |
901 |
- gmp? ( dev-libs/gmp:0= ) |
902 |
- iconv? ( virtual/libiconv ) |
903 |
- imap? ( virtual/imap-c-client[kerberos=,ssl=] ) |
904 |
- intl? ( dev-libs/icu:= ) |
905 |
- iodbc? ( dev-db/libiodbc ) |
906 |
- kerberos? ( virtual/krb5 ) |
907 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
908 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
909 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
910 |
- mssql? ( dev-db/freetds[mssql] ) |
911 |
- libmysqlclient? ( |
912 |
- mysql? ( virtual/libmysqlclient:= ) |
913 |
- mysqli? ( virtual/libmysqlclient:= ) |
914 |
- ) |
915 |
- nls? ( sys-devel/gettext ) |
916 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
917 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
918 |
- postgres? ( dev-db/postgresql:* ) |
919 |
- qdbm? ( dev-db/qdbm ) |
920 |
- readline? ( sys-libs/readline:0= ) |
921 |
- recode? ( app-text/recode ) |
922 |
- sharedmem? ( dev-libs/mm ) |
923 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
924 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
925 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
926 |
- spell? ( >=app-text/aspell-0.50 ) |
927 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
928 |
- ssl? ( |
929 |
- !libressl? ( dev-libs/openssl:0= ) |
930 |
- libressl? ( dev-libs/libressl:0= ) |
931 |
- ) |
932 |
- sybase-ct? ( dev-db/freetds ) |
933 |
- tidy? ( app-text/htmltidy ) |
934 |
- truetype? ( |
935 |
- =media-libs/freetype-2* |
936 |
- >=media-libs/t1lib-5.0.0 |
937 |
- !gd? ( |
938 |
- virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= ) |
939 |
- ) |
940 |
- unicode? ( dev-libs/oniguruma:= ) |
941 |
- vpx? ( media-libs/libvpx:0= ) |
942 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
943 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
944 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
945 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
946 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
947 |
- xpm? ( |
948 |
- x11-libs/libXpm |
949 |
- virtual/jpeg:0 |
950 |
- media-libs/libpng:0= sys-libs/zlib:0= |
951 |
- ) |
952 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
953 |
- zip? ( sys-libs/zlib:0= ) |
954 |
- zlib? ( sys-libs/zlib:0= ) |
955 |
-" |
956 |
- |
957 |
-RDEPEND="${COMMON_DEPEND} |
958 |
- virtual/mta |
959 |
- fpm? ( |
960 |
- selinux? ( sec-policy/selinux-phpfpm ) |
961 |
- systemd? ( sys-apps/systemd ) )" |
962 |
- |
963 |
-DEPEND="${COMMON_DEPEND} |
964 |
- app-arch/xz-utils |
965 |
- >=sys-devel/bison-3.0.1 |
966 |
- sys-devel/flex |
967 |
- >=sys-devel/m4-1.4.3 |
968 |
- >=sys-devel/libtool-1.5.18" |
969 |
- |
970 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
971 |
-REQUIRED_USE=" |
972 |
- || ( cli cgi fpm apache2 embed ) |
973 |
- cli? ( ^^ ( readline libedit ) ) |
974 |
- truetype? ( gd ) |
975 |
- vpx? ( gd ) |
976 |
- cjk? ( gd ) |
977 |
- exif? ( gd ) |
978 |
- xpm? ( gd ) |
979 |
- gd? ( zlib ) |
980 |
- simplexml? ( xml ) |
981 |
- soap? ( xml ) |
982 |
- wddx? ( xml ) |
983 |
- xmlrpc? ( || ( xml iconv ) ) |
984 |
- xmlreader? ( xml ) |
985 |
- xslt? ( xml ) |
986 |
- ldap-sasl? ( ldap ) |
987 |
- mhash? ( hash ) |
988 |
- phar? ( hash ) |
989 |
- recode? ( !imap !mysql !mysqli !libmysqlclient ) |
990 |
- libmysqlclient? ( || ( |
991 |
- mysql |
992 |
- mysqli |
993 |
- pdo |
994 |
- ) ) |
995 |
- |
996 |
- qdbm? ( !gdbm ) |
997 |
- readline? ( !libedit ) |
998 |
- sharedmem? ( !threads ) |
999 |
-" |
1000 |
- |
1001 |
-PHP_MV="$(get_major_version)" |
1002 |
- |
1003 |
-php_install_ini() { |
1004 |
- local phpsapi="${1}" |
1005 |
- |
1006 |
- # work out where we are installing the ini file |
1007 |
- php_set_ini_dir "${phpsapi}" |
1008 |
- |
1009 |
- # Always install the production INI file, bug 611214. |
1010 |
- local phpinisrc="php.ini-production-${phpsapi}" |
1011 |
- cp php.ini-production "${phpinisrc}" || die |
1012 |
- |
1013 |
- # default to /tmp for save_path, bug #282768 |
1014 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
1015 |
- |
1016 |
- # Set the extension dir |
1017 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ |
1018 |
- -i "${phpinisrc}" || die |
1019 |
- |
1020 |
- # Set the include path to point to where we want to find PEAR packages |
1021 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
1022 |
- |
1023 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
1024 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
1025 |
- newins "${phpinisrc}" php.ini |
1026 |
- |
1027 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
1028 |
- elog |
1029 |
- |
1030 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
1031 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
1032 |
- |
1033 |
- if use opcache; then |
1034 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
1035 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
1036 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
1037 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \ |
1038 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
1039 |
- fi |
1040 |
- |
1041 |
- # SAPI-specific handling |
1042 |
- if [[ "${sapi}" == "fpm" ]] ; then |
1043 |
- einfo "Installing FPM config file php-fpm.conf" |
1044 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
1045 |
- doins sapi/fpm/php-fpm.conf |
1046 |
- fi |
1047 |
- |
1048 |
- dodoc php.ini-{development,production} |
1049 |
-} |
1050 |
- |
1051 |
-php_set_ini_dir() { |
1052 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
1053 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
1054 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
1055 |
-} |
1056 |
- |
1057 |
-src_prepare() { |
1058 |
- eapply "${FILESDIR}/php-${SLOT}-no-bison-warnings.patch" |
1059 |
- |
1060 |
- # Change PHP branding |
1061 |
- # Get the alpha/beta/rc version |
1062 |
- sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ |
1063 |
- -i configure.in || die "Unable to change PHP branding" |
1064 |
- |
1065 |
- # Patch PHP to show Gentoo as the server platform |
1066 |
- sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
1067 |
- -i configure.in || die "Failed to fix server platform name" |
1068 |
- |
1069 |
- # Prevent PHP from activating the Apache config, |
1070 |
- # as we will do that ourselves |
1071 |
- sed -i \ |
1072 |
- -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
1073 |
- -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
1074 |
- configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \ |
1075 |
- || die |
1076 |
- |
1077 |
- # Patch PHP to support heimdal instead of mit-krb5 |
1078 |
- if has_version "app-crypt/heimdal" ; then |
1079 |
- sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
1080 |
- || die "Failed to fix heimdal libname" |
1081 |
- sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
1082 |
- || die "Failed to fix heimdal crypt library reference" |
1083 |
- fi |
1084 |
- |
1085 |
- eapply_user |
1086 |
- |
1087 |
- # Force rebuilding aclocal.m4 |
1088 |
- rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare" |
1089 |
- eautoreconf |
1090 |
- |
1091 |
- if [[ ${CHOST} == *-darwin* ]] ; then |
1092 |
- # http://bugs.php.net/bug.php?id=48795, bug #343481 |
1093 |
- sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die |
1094 |
- fi |
1095 |
-} |
1096 |
- |
1097 |
-src_configure() { |
1098 |
- addpredict /usr/share/snmp/mibs/.index |
1099 |
- addpredict /var/lib/net-snmp/mib_indexes |
1100 |
- |
1101 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
1102 |
- |
1103 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
1104 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
1105 |
- local our_conf=( |
1106 |
- --prefix="${PHP_DESTDIR}" |
1107 |
- --mandir="${PHP_DESTDIR}/man" |
1108 |
- --infodir="${PHP_DESTDIR}/info" |
1109 |
- --libdir="${PHP_DESTDIR}/lib" |
1110 |
- --with-libdir="$(get_libdir)" |
1111 |
- --localstatedir="${EPREFIX}/var" |
1112 |
- --without-pear |
1113 |
- $(use_enable threads maintainer-zts) |
1114 |
- ) |
1115 |
- |
1116 |
- our_conf+=( |
1117 |
- $(use_enable bcmath bcmath) |
1118 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
1119 |
- $(use_enable calendar calendar) |
1120 |
- $(use_enable coverage gcov) |
1121 |
- $(use_enable ctype ctype) |
1122 |
- $(use_with curl curl "${EPREFIX}/usr") |
1123 |
- $(use_enable xml dom) |
1124 |
- $(use_with enchant enchant "${EPREFIX}/usr") |
1125 |
- $(use_enable exif exif) |
1126 |
- $(use_enable fileinfo fileinfo) |
1127 |
- $(use_enable filter filter) |
1128 |
- $(use_enable ftp ftp) |
1129 |
- $(use_with nls gettext "${EPREFIX}/usr") |
1130 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
1131 |
- $(use_enable hash hash) |
1132 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
1133 |
- $(use_with iconv iconv \ |
1134 |
- $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr")) |
1135 |
- $(use_enable intl intl) |
1136 |
- $(use_enable ipv6 ipv6) |
1137 |
- $(use_enable json json) |
1138 |
- $(use_with kerberos kerberos "${EPREFIX}/usr") |
1139 |
- $(use_enable xml libxml) |
1140 |
- $(use_with xml libxml-dir "${EPREFIX}/usr") |
1141 |
- $(use_enable unicode mbstring) |
1142 |
- $(use_with crypt mcrypt "${EPREFIX}/usr") |
1143 |
- $(use_with mssql mssql "${EPREFIX}/usr") |
1144 |
- $(use_with unicode onig "${EPREFIX}/usr") |
1145 |
- $(use_with ssl openssl "${EPREFIX}/usr") |
1146 |
- $(use_with ssl openssl-dir "${EPREFIX}/usr") |
1147 |
- $(use_enable pcntl pcntl) |
1148 |
- $(use_enable phar phar) |
1149 |
- $(use_enable pdo pdo) |
1150 |
- $(use_enable opcache opcache) |
1151 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
1152 |
- $(use_enable posix posix) |
1153 |
- $(use_with spell pspell "${EPREFIX}/usr") |
1154 |
- $(use_with recode recode "${EPREFIX}/usr") |
1155 |
- $(use_enable simplexml simplexml) |
1156 |
- $(use_enable sharedmem shmop) |
1157 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
1158 |
- $(use_enable soap soap) |
1159 |
- $(use_enable sockets sockets) |
1160 |
- $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
1161 |
- $(use_with sybase-ct sybase-ct "${EPREFIX}/usr") |
1162 |
- $(use_enable sysvipc sysvmsg) |
1163 |
- $(use_enable sysvipc sysvsem) |
1164 |
- $(use_enable sysvipc sysvshm) |
1165 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
1166 |
- $(use_enable tokenizer tokenizer) |
1167 |
- $(use_enable wddx wddx) |
1168 |
- $(use_enable xml xml) |
1169 |
- $(use_enable xmlreader xmlreader) |
1170 |
- $(use_enable xmlwriter xmlwriter) |
1171 |
- $(use_with xmlrpc xmlrpc) |
1172 |
- $(use_with xslt xsl "${EPREFIX}/usr") |
1173 |
- $(use_enable zip zip) |
1174 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
1175 |
- $(use_enable debug debug) |
1176 |
- ) |
1177 |
- |
1178 |
- # DBA support |
1179 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
1180 |
- || use qdbm ; then |
1181 |
- our_conf+=( "--enable-dba${shared}" ) |
1182 |
- fi |
1183 |
- |
1184 |
- # DBA drivers support |
1185 |
- our_conf+=( |
1186 |
- $(use_with cdb cdb) |
1187 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
1188 |
- $(use_enable flatfile flatfile) |
1189 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
1190 |
- $(use_enable inifile inifile) |
1191 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
1192 |
- ) |
1193 |
- |
1194 |
- # Support for the GD graphics library |
1195 |
- our_conf+=( |
1196 |
- $(use_with truetype freetype-dir "${EPREFIX}/usr") |
1197 |
- $(use_with truetype t1lib "${EPREFIX}/usr") |
1198 |
- $(use_enable cjk gd-jis-conv) |
1199 |
- $(use_with gd jpeg-dir "${EPREFIX}/usr") |
1200 |
- $(use_with gd png-dir "${EPREFIX}/usr") |
1201 |
- $(use_with xpm xpm-dir "${EPREFIX}/usr") |
1202 |
- $(use_with vpx vpx-dir "${EPREFIX}/usr") |
1203 |
- ) |
1204 |
- # enable gd last, so configure can pick up the previous settings |
1205 |
- our_conf+=( $(use_with gd gd) ) |
1206 |
- |
1207 |
- # IMAP support |
1208 |
- if use imap ; then |
1209 |
- our_conf+=( |
1210 |
- $(use_with imap imap "${EPREFIX}/usr") |
1211 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
1212 |
- ) |
1213 |
- fi |
1214 |
- |
1215 |
- # Interbase/firebird support |
1216 |
- our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
1217 |
- |
1218 |
- # LDAP support |
1219 |
- if use ldap ; then |
1220 |
- our_conf+=( |
1221 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
1222 |
- $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
1223 |
- ) |
1224 |
- fi |
1225 |
- |
1226 |
- # MySQL support |
1227 |
- local mysqllib="mysqlnd" |
1228 |
- local mysqlilib="mysqlnd" |
1229 |
- use libmysqlclient && mysqllib="${EPREFIX}/usr" |
1230 |
- use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config" |
1231 |
- |
1232 |
- our_conf+=( $(use_with mysql mysql "${mysqllib}") ) |
1233 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
1234 |
- |
1235 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
1236 |
- if use mysql || use mysqli ; then |
1237 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
1238 |
- fi |
1239 |
- |
1240 |
- # ODBC support |
1241 |
- our_conf+=( |
1242 |
- $(use_with odbc unixODBC "${EPREFIX}/usr") |
1243 |
- $(use_with iodbc iodbc "${EPREFIX}/usr") |
1244 |
- ) |
1245 |
- |
1246 |
- # Oracle support |
1247 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
1248 |
- |
1249 |
- # PDO support |
1250 |
- if use pdo ; then |
1251 |
- our_conf+=( |
1252 |
- $(use_with mssql pdo-dblib) |
1253 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
1254 |
- $(use_with postgres pdo-pgsql) |
1255 |
- $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
1256 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
1257 |
- $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
1258 |
- $(use_with oci8-instant-client pdo-oci) |
1259 |
- ) |
1260 |
- fi |
1261 |
- |
1262 |
- # readline/libedit support |
1263 |
- our_conf+=( |
1264 |
- $(use_with readline readline "${EPREFIX}/usr") |
1265 |
- $(use_with libedit libedit "${EPREFIX}/usr") |
1266 |
- ) |
1267 |
- |
1268 |
- # Session support |
1269 |
- if use session ; then |
1270 |
- our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") ) |
1271 |
- else |
1272 |
- our_conf+=( $(use_enable session session) ) |
1273 |
- fi |
1274 |
- |
1275 |
- # Use pic for shared modules such as apache2's mod_php |
1276 |
- our_conf+=( --with-pic ) |
1277 |
- |
1278 |
- # we use the system copy of pcre |
1279 |
- # --with-pcre-regex affects ext/pcre |
1280 |
- # --with-pcre-dir affects ext/filter and ext/zip |
1281 |
- our_conf+=( |
1282 |
- --with-pcre-regex="${EPREFIX}/usr" |
1283 |
- --with-pcre-dir="${EPREFIX}/usr" |
1284 |
- ) |
1285 |
- |
1286 |
- # Catch CFLAGS problems |
1287 |
- # Fixes bug #14067. |
1288 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
1289 |
- replace-cpu-flags "k6*" "i586" |
1290 |
- |
1291 |
- # Cache the ./configure test results between SAPIs. |
1292 |
- our_conf+=( --cache-file="${T}/config.cache" ) |
1293 |
- |
1294 |
- # Support user-passed configuration parameters |
1295 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
1296 |
- |
1297 |
- # Support the Apache2 extras, they must be set globally for all |
1298 |
- # SAPIs to work correctly, especially for external PHP extensions |
1299 |
- |
1300 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
1301 |
- for one_sapi in $SAPIS ; do |
1302 |
- use "${one_sapi}" || continue |
1303 |
- php_set_ini_dir "${one_sapi}" |
1304 |
- |
1305 |
- # The BUILD_DIR variable is used to determine where to output |
1306 |
- # the files that autotools creates. This was all originally |
1307 |
- # based on the autotools-utils eclass. |
1308 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
1309 |
- cp -a "${S}" "${BUILD_DIR}" || die |
1310 |
- cd "${BUILD_DIR}" || die |
1311 |
- |
1312 |
- local sapi_conf=( |
1313 |
- --with-config-file-path="${PHP_INI_DIR}" |
1314 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
1315 |
- ) |
1316 |
- |
1317 |
- for sapi in $SAPIS ; do |
1318 |
- case "$sapi" in |
1319 |
- cli|cgi|embed|fpm) |
1320 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
1321 |
- sapi_conf+=( "--enable-${sapi}" ) |
1322 |
- if [[ "fpm" == "${sapi}" ]] ; then |
1323 |
- sapi_conf+=( |
1324 |
- $(use_with acl fpm-acl) |
1325 |
- $(use_with systemd fpm-systemd) |
1326 |
- ) |
1327 |
- fi |
1328 |
- else |
1329 |
- sapi_conf+=( "--disable-${sapi}" ) |
1330 |
- fi |
1331 |
- ;; |
1332 |
- |
1333 |
- apache2) |
1334 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
1335 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) |
1336 |
- else |
1337 |
- sapi_conf+=( --without-apxs2 ) |
1338 |
- fi |
1339 |
- ;; |
1340 |
- esac |
1341 |
- done |
1342 |
- |
1343 |
- # Construct the $myeconfargs array by concatenating $our_conf |
1344 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
1345 |
- local myeconfargs=( "${our_conf[@]}" ) |
1346 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
1347 |
- |
1348 |
- pushd "${BUILD_DIR}" > /dev/null || die |
1349 |
- econf "${myeconfargs[@]}" |
1350 |
- popd > /dev/null || die |
1351 |
- done |
1352 |
-} |
1353 |
- |
1354 |
-src_compile() { |
1355 |
- # snmp seems to run during src_compile, too (bug #324739) |
1356 |
- addpredict /usr/share/snmp/mibs/.index |
1357 |
- addpredict /var/lib/net-snmp/mib_indexes |
1358 |
- |
1359 |
- for sapi in ${SAPIS} ; do |
1360 |
- if use "${sapi}"; then |
1361 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
1362 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
1363 |
- emake |
1364 |
- fi |
1365 |
- done |
1366 |
-} |
1367 |
- |
1368 |
-src_install() { |
1369 |
- # see bug #324739 for what happens when we don't have that |
1370 |
- addpredict /usr/share/snmp/mibs/.index |
1371 |
- |
1372 |
- # grab the first SAPI that got built and install common files from there |
1373 |
- local first_sapi="" |
1374 |
- for sapi in $SAPIS ; do |
1375 |
- if use $sapi ; then |
1376 |
- first_sapi=$sapi |
1377 |
- break |
1378 |
- fi |
1379 |
- done |
1380 |
- |
1381 |
- # Makefile forgets to create this before trying to write to it... |
1382 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
1383 |
- |
1384 |
- # Install php environment (without any sapis) |
1385 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
1386 |
- emake INSTALL_ROOT="${D}" \ |
1387 |
- install-build install-headers install-programs |
1388 |
- |
1389 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
1390 |
- |
1391 |
- # Create the directory where we'll put version-specific php scripts |
1392 |
- keepdir "/usr/share/php${PHP_MV}" |
1393 |
- |
1394 |
- local sapi="", file="" |
1395 |
- local sapi_list="" |
1396 |
- |
1397 |
- for sapi in ${SAPIS}; do |
1398 |
- if use "${sapi}" ; then |
1399 |
- einfo "Installing SAPI: ${sapi}" |
1400 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
1401 |
- |
1402 |
- if [[ "${sapi}" == "apache2" ]] ; then |
1403 |
- # We're specifically not using emake install-sapi as libtool |
1404 |
- # may cause unnecessary relink failures (see bug #351266) |
1405 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
1406 |
- newins ".libs/libphp5$(get_libname)" \ |
1407 |
- "libphp${PHP_MV}$(get_libname)" |
1408 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
1409 |
- else |
1410 |
- # needed each time, php_install_ini would reset it |
1411 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
1412 |
- into "${dest}" |
1413 |
- case "$sapi" in |
1414 |
- cli) |
1415 |
- source="sapi/cli/php" |
1416 |
- ;; |
1417 |
- cgi) |
1418 |
- source="sapi/cgi/php-cgi" |
1419 |
- ;; |
1420 |
- fpm) |
1421 |
- source="sapi/fpm/php-fpm" |
1422 |
- ;; |
1423 |
- embed) |
1424 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
1425 |
- ;; |
1426 |
- *) |
1427 |
- die "unhandled sapi in src_install" |
1428 |
- ;; |
1429 |
- esac |
1430 |
- |
1431 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
1432 |
- dolib.so "${source}" |
1433 |
- else |
1434 |
- dobin "${source}" |
1435 |
- local name="$(basename ${source})" |
1436 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
1437 |
- fi |
1438 |
- fi |
1439 |
- |
1440 |
- php_install_ini "${sapi}" |
1441 |
- |
1442 |
- # construct correct SAPI string for php-config |
1443 |
- # thanks to ferringb for the bash voodoo |
1444 |
- if [[ "${sapi}" == "apache2" ]]; then |
1445 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
1446 |
- else |
1447 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
1448 |
- fi |
1449 |
- fi |
1450 |
- done |
1451 |
- |
1452 |
- # Installing opcache module |
1453 |
- if use opcache ; then |
1454 |
- into "${PHP_DESTDIR#${EPREFIX}}" |
1455 |
- dolib.so "modules/opcache$(get_libname)" |
1456 |
- fi |
1457 |
- |
1458 |
- # Install env.d files |
1459 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
1460 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
1461 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
1462 |
- |
1463 |
- # set php-config variable correctly (bug #278439) |
1464 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
1465 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
1466 |
- |
1467 |
- if use fpm ; then |
1468 |
- if use systemd; then |
1469 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
1470 |
- "php-fpm@${SLOT}.service" |
1471 |
- else |
1472 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
1473 |
- "php-fpm@${SLOT}.service" |
1474 |
- fi |
1475 |
- fi |
1476 |
-} |
1477 |
- |
1478 |
-src_test() { |
1479 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
1480 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
1481 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
1482 |
- ewarn "Test phase requires USE=cli, skipping" |
1483 |
- return |
1484 |
- else |
1485 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
1486 |
- fi |
1487 |
- |
1488 |
- if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
1489 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
1490 |
- fi |
1491 |
- |
1492 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
1493 |
- "session.save_path=${T}" \ |
1494 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
1495 |
- "session.save_path=${T}" |
1496 |
- |
1497 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
1498 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
1499 |
- done |
1500 |
- |
1501 |
- local failed="$(find -name '*.out')" |
1502 |
- if [[ ${failed} != "" ]] ; then |
1503 |
- ewarn "The following test cases failed unexpectedly:" |
1504 |
- for name in ${failed}; do |
1505 |
- ewarn " ${name/.out/}" |
1506 |
- done |
1507 |
- else |
1508 |
- einfo "No unexpected test failures, all fine" |
1509 |
- fi |
1510 |
- |
1511 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
1512 |
- local passed="" |
1513 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
1514 |
- [[ -f "${name}.diff" ]] && continue |
1515 |
- passed="${passed} ${name}" |
1516 |
- done |
1517 |
- if [[ ${passed} != "" ]] ; then |
1518 |
- einfo "The following test cases passed unexpectedly:" |
1519 |
- for name in ${passed}; do |
1520 |
- ewarn " ${passed}" |
1521 |
- done |
1522 |
- else |
1523 |
- einfo "None of the known-to-fail tests passed, all fine" |
1524 |
- fi |
1525 |
- fi |
1526 |
-} |
1527 |
- |
1528 |
-pkg_postinst() { |
1529 |
- # Output some general info to the user |
1530 |
- if use apache2 ; then |
1531 |
- elog |
1532 |
- elog "To enable PHP in apache, you will need to add \"-D PHP\" to" |
1533 |
- elog "your apache2 command. OpenRC users can append that string to" |
1534 |
- elog "APACHE2_OPTS in /etc/conf.d/apache2." |
1535 |
- elog |
1536 |
- elog "The apache module configuration file 70_mod_php.conf is" |
1537 |
- elog "provided (and maintained) by eselect-php." |
1538 |
- elog |
1539 |
- fi |
1540 |
- |
1541 |
- # Create the symlinks for php |
1542 |
- for m in ${SAPIS}; do |
1543 |
- [[ ${m} == 'embed' ]] && continue; |
1544 |
- if use $m ; then |
1545 |
- local ci=$(eselect php show $m) |
1546 |
- if [[ -z $ci ]]; then |
1547 |
- eselect php set $m php${SLOT} || die |
1548 |
- einfo "Switched ${m} to use php:${SLOT}" |
1549 |
- einfo |
1550 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
1551 |
- elog "To switch $m to use php:${SLOT}, run" |
1552 |
- elog " eselect php set $m php${SLOT}" |
1553 |
- elog |
1554 |
- fi |
1555 |
- fi |
1556 |
- done |
1557 |
- |
1558 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
1559 |
- # example, if the user has the cgi SAPI enabled, then he has an |
1560 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
1561 |
- # USE="-cgi", that symlink will break. This call to eselect is |
1562 |
- # supposed to remove that dead link per bug 572436. |
1563 |
- eselect php cleanup || die |
1564 |
- |
1565 |
- if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then |
1566 |
- elog "To build extensions for this version of PHP, you will need to" |
1567 |
- elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." |
1568 |
- elog |
1569 |
- fi |
1570 |
- |
1571 |
- # Warn about the removal of PHP_INI_VERSION if the user has it set. |
1572 |
- if [[ -n "${PHP_INI_VERSION}" ]]; then |
1573 |
- ewarn 'The PHP_INI_VERSION variable has been phased out. You may' |
1574 |
- ewarn 'remove it from your configuration at your convenience. See' |
1575 |
- ewarn |
1576 |
- ewarn ' https://bugs.gentoo.org/611214' |
1577 |
- ewarn |
1578 |
- ewarn 'for more information.' |
1579 |
- fi |
1580 |
- |
1581 |
- elog "For details on how version slotting works, please see" |
1582 |
- elog "the wiki:" |
1583 |
- elog |
1584 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
1585 |
- elog |
1586 |
-} |
1587 |
- |
1588 |
-pkg_postrm() { |
1589 |
- # This serves two purposes. First, if we have just removed the last |
1590 |
- # installed version of PHP, then this will remove any dead symlinks |
1591 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
1592 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
1593 |
- # his existing symlinks to point to the new 7.0 installation. The |
1594 |
- # latter is bug 432962. |
1595 |
- # |
1596 |
- # Note: the eselect-php package may not be installed at this point, |
1597 |
- # so we can't die() if this command fails. |
1598 |
- eselect php cleanup |
1599 |
-} |
1600 |
|
1601 |
diff --git a/dev-lang/php/php-7.0.27.ebuild b/dev-lang/php/php-7.0.27.ebuild |
1602 |
deleted file mode 100644 |
1603 |
index 88d8e93bc68..00000000000 |
1604 |
--- a/dev-lang/php/php-7.0.27.ebuild |
1605 |
+++ /dev/null |
1606 |
@@ -1,741 +0,0 @@ |
1607 |
-# Copyright 1999-2018 Gentoo Foundation |
1608 |
-# Distributed under the terms of the GNU General Public License v2 |
1609 |
- |
1610 |
-EAPI=6 |
1611 |
- |
1612 |
-inherit flag-o-matic versionator systemd |
1613 |
- |
1614 |
-DESCRIPTION="The PHP language runtime engine" |
1615 |
-HOMEPAGE="https://secure.php.net/" |
1616 |
-SRC_URI="https://secure.php.net/distributions/${P}.tar.xz" |
1617 |
- |
1618 |
-LICENSE="PHP-3.01 |
1619 |
- BSD |
1620 |
- Zend-2.0 |
1621 |
- bcmath? ( LGPL-2.1+ ) |
1622 |
- fpm? ( BSD-2 ) |
1623 |
- gd? ( gd ) |
1624 |
- unicode? ( BSD-2 LGPL-2.1 )" |
1625 |
- |
1626 |
-SLOT="$(get_version_component_range 1-2)" |
1627 |
-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" |
1628 |
- |
1629 |
-# We can build the following SAPIs in the given order |
1630 |
-SAPIS="embed cli cgi fpm apache2 phpdbg" |
1631 |
- |
1632 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
1633 |
-IUSE="${IUSE} |
1634 |
- ${SAPIS/cli/+cli} |
1635 |
- threads" |
1636 |
- |
1637 |
-IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk |
1638 |
- coverage crypt +ctype curl debug |
1639 |
- enchant exif +fileinfo +filter firebird |
1640 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
1641 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl |
1642 |
- mhash mssql mysql mysqli nls |
1643 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
1644 |
- readline recode selinux +session sharedmem |
1645 |
- +simplexml snmp soap sockets spell sqlite ssl |
1646 |
- sysvipc systemd tidy +tokenizer truetype unicode wddx webp |
1647 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
1648 |
- |
1649 |
-# The supported (that is, autodetected) versions of BDB are listed in |
1650 |
-# the ./configure script. Other versions *work*, but we need to stick to |
1651 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
1652 |
-COMMON_DEPEND=" |
1653 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
1654 |
- >=dev-libs/libpcre-8.32[unicode] |
1655 |
- acl? ( sys-apps/acl ) |
1656 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
1657 |
- <www-servers/apache-2.4[threads=] ) ) |
1658 |
- berkdb? ( || ( sys-libs/db:5.3 |
1659 |
- sys-libs/db:5.1 |
1660 |
- sys-libs/db:4.8 |
1661 |
- sys-libs/db:4.7 |
1662 |
- sys-libs/db:4.6 |
1663 |
- sys-libs/db:4.5 ) ) |
1664 |
- bzip2? ( app-arch/bzip2:0= ) |
1665 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
1666 |
- cjk? ( !gd? ( |
1667 |
- virtual/jpeg:0 |
1668 |
- media-libs/libpng:0= |
1669 |
- sys-libs/zlib:0= |
1670 |
- ) ) |
1671 |
- coverage? ( dev-util/lcov ) |
1672 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
1673 |
- curl? ( >=net-misc/curl-7.10.5 ) |
1674 |
- enchant? ( app-text/enchant ) |
1675 |
- exif? ( !gd? ( |
1676 |
- virtual/jpeg:0 |
1677 |
- media-libs/libpng:0= |
1678 |
- sys-libs/zlib:0= |
1679 |
- ) ) |
1680 |
- firebird? ( dev-db/firebird ) |
1681 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= ) |
1682 |
- gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) |
1683 |
- gmp? ( dev-libs/gmp:0= ) |
1684 |
- iconv? ( virtual/libiconv ) |
1685 |
- imap? ( virtual/imap-c-client[kerberos=,ssl=] ) |
1686 |
- intl? ( dev-libs/icu:= ) |
1687 |
- iodbc? ( dev-db/libiodbc ) |
1688 |
- kerberos? ( virtual/krb5 ) |
1689 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
1690 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
1691 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
1692 |
- mssql? ( dev-db/freetds[mssql] ) |
1693 |
- nls? ( sys-devel/gettext ) |
1694 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
1695 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
1696 |
- postgres? ( dev-db/postgresql:* ) |
1697 |
- qdbm? ( dev-db/qdbm ) |
1698 |
- readline? ( sys-libs/readline:0= ) |
1699 |
- recode? ( app-text/recode ) |
1700 |
- sharedmem? ( dev-libs/mm ) |
1701 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
1702 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
1703 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
1704 |
- spell? ( >=app-text/aspell-0.50 ) |
1705 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
1706 |
- ssl? ( |
1707 |
- !libressl? ( dev-libs/openssl:0= ) |
1708 |
- libressl? ( dev-libs/libressl:0= ) |
1709 |
- ) |
1710 |
- tidy? ( app-text/htmltidy ) |
1711 |
- truetype? ( |
1712 |
- =media-libs/freetype-2* |
1713 |
- !gd? ( |
1714 |
- virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= ) |
1715 |
- ) |
1716 |
- unicode? ( dev-libs/oniguruma:= ) |
1717 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
1718 |
- webp? ( media-libs/libwebp:0= ) |
1719 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
1720 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
1721 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
1722 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
1723 |
- xpm? ( |
1724 |
- x11-libs/libXpm |
1725 |
- virtual/jpeg:0 |
1726 |
- media-libs/libpng:0= sys-libs/zlib:0= |
1727 |
- ) |
1728 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
1729 |
- zip? ( sys-libs/zlib:0= ) |
1730 |
- zlib? ( sys-libs/zlib:0= ) |
1731 |
-" |
1732 |
- |
1733 |
-RDEPEND="${COMMON_DEPEND} |
1734 |
- virtual/mta |
1735 |
- fpm? ( |
1736 |
- selinux? ( sec-policy/selinux-phpfpm ) |
1737 |
- systemd? ( sys-apps/systemd ) )" |
1738 |
- |
1739 |
-DEPEND="${COMMON_DEPEND} |
1740 |
- app-arch/xz-utils |
1741 |
- >=sys-devel/bison-3.0.1 |
1742 |
- sys-devel/flex |
1743 |
- >=sys-devel/m4-1.4.3 |
1744 |
- >=sys-devel/libtool-1.5.18" |
1745 |
- |
1746 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
1747 |
-REQUIRED_USE=" |
1748 |
- || ( cli cgi fpm apache2 embed phpdbg ) |
1749 |
- cli? ( ^^ ( readline libedit ) ) |
1750 |
- truetype? ( gd ) |
1751 |
- webp? ( gd ) |
1752 |
- cjk? ( gd ) |
1753 |
- exif? ( gd ) |
1754 |
- xpm? ( gd ) |
1755 |
- gd? ( zlib ) |
1756 |
- simplexml? ( xml ) |
1757 |
- soap? ( xml ) |
1758 |
- wddx? ( xml ) |
1759 |
- xmlrpc? ( || ( xml iconv ) ) |
1760 |
- xmlreader? ( xml ) |
1761 |
- xslt? ( xml ) |
1762 |
- ldap-sasl? ( ldap ) |
1763 |
- mhash? ( hash ) |
1764 |
- phar? ( hash ) |
1765 |
- qdbm? ( !gdbm ) |
1766 |
- readline? ( !libedit ) |
1767 |
- recode? ( !imap !mysqli !mysql ) |
1768 |
- sharedmem? ( !threads ) |
1769 |
- mysql? ( || ( mysqli pdo ) ) |
1770 |
-" |
1771 |
- |
1772 |
-PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" ) |
1773 |
- |
1774 |
-PHP_MV="$(get_major_version)" |
1775 |
- |
1776 |
-php_install_ini() { |
1777 |
- local phpsapi="${1}" |
1778 |
- |
1779 |
- # work out where we are installing the ini file |
1780 |
- php_set_ini_dir "${phpsapi}" |
1781 |
- |
1782 |
- # Always install the production INI file, bug 611214. |
1783 |
- local phpinisrc="php.ini-production-${phpsapi}" |
1784 |
- cp php.ini-production "${phpinisrc}" || die |
1785 |
- |
1786 |
- # default to /tmp for save_path, bug #282768 |
1787 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
1788 |
- |
1789 |
- # Set the extension dir |
1790 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ |
1791 |
- -i "${phpinisrc}" || die |
1792 |
- |
1793 |
- # Set the include path to point to where we want to find PEAR packages |
1794 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
1795 |
- |
1796 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
1797 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
1798 |
- newins "${phpinisrc}" php.ini |
1799 |
- |
1800 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
1801 |
- elog |
1802 |
- |
1803 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
1804 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
1805 |
- |
1806 |
- if use opcache; then |
1807 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
1808 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
1809 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
1810 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \ |
1811 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
1812 |
- fi |
1813 |
- |
1814 |
- # SAPI-specific handling |
1815 |
- if [[ "${sapi}" == "fpm" ]] ; then |
1816 |
- einfo "Installing FPM config files php-fpm.conf and www.conf" |
1817 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
1818 |
- doins sapi/fpm/php-fpm.conf |
1819 |
- insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" |
1820 |
- doins sapi/fpm/www.conf |
1821 |
- fi |
1822 |
- |
1823 |
- dodoc php.ini-{development,production} |
1824 |
-} |
1825 |
- |
1826 |
-php_set_ini_dir() { |
1827 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
1828 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
1829 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
1830 |
-} |
1831 |
- |
1832 |
-src_prepare() { |
1833 |
- default |
1834 |
- |
1835 |
- # In php-7.x, the FPM pool configuration files have been split off |
1836 |
- # of the main config. By default the pool config files go in |
1837 |
- # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the |
1838 |
- # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later |
1839 |
- # we'll install the pool configuration file "www.conf" there. |
1840 |
- php_set_ini_dir fpm |
1841 |
- sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ |
1842 |
- sapi/fpm/php-fpm.conf.in \ |
1843 |
- || die 'failed to move the include directory in php-fpm.conf' |
1844 |
-} |
1845 |
- |
1846 |
-src_configure() { |
1847 |
- addpredict /usr/share/snmp/mibs/.index |
1848 |
- addpredict /var/lib/net-snmp/mib_indexes |
1849 |
- |
1850 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
1851 |
- |
1852 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
1853 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
1854 |
- local our_conf=( |
1855 |
- --prefix="${PHP_DESTDIR}" |
1856 |
- --mandir="${PHP_DESTDIR}/man" |
1857 |
- --infodir="${PHP_DESTDIR}/info" |
1858 |
- --libdir="${PHP_DESTDIR}/lib" |
1859 |
- --with-libdir="$(get_libdir)" |
1860 |
- --localstatedir="${EPREFIX}/var" |
1861 |
- --without-pear |
1862 |
- $(use_enable threads maintainer-zts) |
1863 |
- ) |
1864 |
- |
1865 |
- our_conf+=( |
1866 |
- $(use_with acl fpm-acl) |
1867 |
- $(use_enable bcmath bcmath) |
1868 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
1869 |
- $(use_enable calendar calendar) |
1870 |
- $(use_enable coverage gcov) |
1871 |
- $(use_enable ctype ctype) |
1872 |
- $(use_with curl curl "${EPREFIX}/usr") |
1873 |
- $(use_enable xml dom) |
1874 |
- $(use_with enchant enchant "${EPREFIX}/usr") |
1875 |
- $(use_enable exif exif) |
1876 |
- $(use_enable fileinfo fileinfo) |
1877 |
- $(use_enable filter filter) |
1878 |
- $(use_enable ftp ftp) |
1879 |
- $(use_with nls gettext "${EPREFIX}/usr") |
1880 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
1881 |
- $(use_enable hash hash) |
1882 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
1883 |
- $(use_with iconv iconv \ |
1884 |
- $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr")) |
1885 |
- $(use_enable intl intl) |
1886 |
- $(use_enable ipv6 ipv6) |
1887 |
- $(use_enable json json) |
1888 |
- $(use_with kerberos kerberos "${EPREFIX}/usr") |
1889 |
- $(use_enable xml libxml) |
1890 |
- $(use_with xml libxml-dir "${EPREFIX}/usr") |
1891 |
- $(use_enable unicode mbstring) |
1892 |
- $(use_with crypt mcrypt "${EPREFIX}/usr") |
1893 |
- $(use_with unicode onig "${EPREFIX}/usr") |
1894 |
- $(use_with ssl openssl "${EPREFIX}/usr") |
1895 |
- $(use_with ssl openssl-dir "${EPREFIX}/usr") |
1896 |
- $(use_enable pcntl pcntl) |
1897 |
- $(use_enable phar phar) |
1898 |
- $(use_enable pdo pdo) |
1899 |
- $(use_enable opcache opcache) |
1900 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
1901 |
- $(use_enable posix posix) |
1902 |
- $(use_with spell pspell "${EPREFIX}/usr") |
1903 |
- $(use_with recode recode "${EPREFIX}/usr") |
1904 |
- $(use_enable simplexml simplexml) |
1905 |
- $(use_enable sharedmem shmop) |
1906 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
1907 |
- $(use_enable soap soap) |
1908 |
- $(use_enable sockets sockets) |
1909 |
- $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
1910 |
- $(use_enable sysvipc sysvmsg) |
1911 |
- $(use_enable sysvipc sysvsem) |
1912 |
- $(use_enable sysvipc sysvshm) |
1913 |
- $(use_with systemd fpm-systemd) |
1914 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
1915 |
- $(use_enable tokenizer tokenizer) |
1916 |
- $(use_enable wddx wddx) |
1917 |
- $(use_enable xml xml) |
1918 |
- $(use_enable xmlreader xmlreader) |
1919 |
- $(use_enable xmlwriter xmlwriter) |
1920 |
- $(use_with xmlrpc xmlrpc) |
1921 |
- $(use_with xslt xsl "${EPREFIX}/usr") |
1922 |
- $(use_enable zip zip) |
1923 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
1924 |
- $(use_enable debug debug) |
1925 |
- ) |
1926 |
- |
1927 |
- # DBA support |
1928 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
1929 |
- || use qdbm ; then |
1930 |
- our_conf+=( "--enable-dba${shared}" ) |
1931 |
- fi |
1932 |
- |
1933 |
- # DBA drivers support |
1934 |
- our_conf+=( |
1935 |
- $(use_with cdb cdb) |
1936 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
1937 |
- $(use_enable flatfile flatfile) |
1938 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
1939 |
- $(use_enable inifile inifile) |
1940 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
1941 |
- ) |
1942 |
- |
1943 |
- # Support for the GD graphics library |
1944 |
- our_conf+=( |
1945 |
- $(use_with truetype freetype-dir "${EPREFIX}/usr") |
1946 |
- $(use_enable cjk gd-jis-conv) |
1947 |
- $(use_with gd jpeg-dir "${EPREFIX}/usr") |
1948 |
- $(use_with gd png-dir "${EPREFIX}/usr") |
1949 |
- $(use_with xpm xpm-dir "${EPREFIX}/usr") |
1950 |
- ) |
1951 |
- if use webp; then |
1952 |
- our_conf+=( --with-webp-dir="${EPREFIX}/usr" ) |
1953 |
- fi |
1954 |
- # enable gd last, so configure can pick up the previous settings |
1955 |
- our_conf+=( $(use_with gd gd) ) |
1956 |
- |
1957 |
- # IMAP support |
1958 |
- if use imap ; then |
1959 |
- our_conf+=( |
1960 |
- $(use_with imap imap "${EPREFIX}/usr") |
1961 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
1962 |
- ) |
1963 |
- fi |
1964 |
- |
1965 |
- # Interbase/firebird support |
1966 |
- our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
1967 |
- |
1968 |
- # LDAP support |
1969 |
- if use ldap ; then |
1970 |
- our_conf+=( |
1971 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
1972 |
- $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
1973 |
- ) |
1974 |
- fi |
1975 |
- |
1976 |
- # MySQL support |
1977 |
- local mysqllib="mysqlnd" |
1978 |
- local mysqlilib="mysqlnd" |
1979 |
- |
1980 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
1981 |
- |
1982 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
1983 |
- if use mysql || use mysqli ; then |
1984 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
1985 |
- fi |
1986 |
- |
1987 |
- # ODBC support |
1988 |
- our_conf+=( |
1989 |
- $(use_with odbc unixODBC "${EPREFIX}/usr") |
1990 |
- $(use_with iodbc iodbc "${EPREFIX}/usr") |
1991 |
- ) |
1992 |
- |
1993 |
- # Oracle support |
1994 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
1995 |
- |
1996 |
- # PDO support |
1997 |
- if use pdo ; then |
1998 |
- our_conf+=( |
1999 |
- $(use_with mssql pdo-dblib "${EPREFIX}/usr") |
2000 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
2001 |
- $(use_with postgres pdo-pgsql) |
2002 |
- $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
2003 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
2004 |
- $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
2005 |
- $(use_with oci8-instant-client pdo-oci) |
2006 |
- ) |
2007 |
- fi |
2008 |
- |
2009 |
- # readline/libedit support |
2010 |
- our_conf+=( |
2011 |
- $(use_with readline readline "${EPREFIX}/usr") |
2012 |
- $(use_with libedit libedit "${EPREFIX}/usr") |
2013 |
- ) |
2014 |
- |
2015 |
- # Session support |
2016 |
- if use session ; then |
2017 |
- our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") ) |
2018 |
- else |
2019 |
- our_conf+=( $(use_enable session session) ) |
2020 |
- fi |
2021 |
- |
2022 |
- # Use pic for shared modules such as apache2's mod_php |
2023 |
- our_conf+=( --with-pic ) |
2024 |
- |
2025 |
- # we use the system copy of pcre |
2026 |
- # --with-pcre-regex affects ext/pcre |
2027 |
- # --with-pcre-dir affects ext/filter and ext/zip |
2028 |
- our_conf+=( |
2029 |
- --with-pcre-regex="${EPREFIX}/usr" |
2030 |
- --with-pcre-dir="${EPREFIX}/usr" |
2031 |
- ) |
2032 |
- |
2033 |
- # Catch CFLAGS problems |
2034 |
- # Fixes bug #14067. |
2035 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
2036 |
- replace-cpu-flags "k6*" "i586" |
2037 |
- |
2038 |
- # Cache the ./configure test results between SAPIs. |
2039 |
- our_conf+=( --cache-file="${T}/config.cache" ) |
2040 |
- |
2041 |
- # Support user-passed configuration parameters |
2042 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
2043 |
- |
2044 |
- # Support the Apache2 extras, they must be set globally for all |
2045 |
- # SAPIs to work correctly, especially for external PHP extensions |
2046 |
- |
2047 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
2048 |
- for one_sapi in $SAPIS ; do |
2049 |
- use "${one_sapi}" || continue |
2050 |
- php_set_ini_dir "${one_sapi}" |
2051 |
- |
2052 |
- # The BUILD_DIR variable is used to determine where to output |
2053 |
- # the files that autotools creates. This was all originally |
2054 |
- # based on the autotools-utils eclass. |
2055 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
2056 |
- cp -a "${S}" "${BUILD_DIR}" || die |
2057 |
- cd "${BUILD_DIR}" || die |
2058 |
- |
2059 |
- local sapi_conf=( |
2060 |
- --with-config-file-path="${PHP_INI_DIR}" |
2061 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
2062 |
- ) |
2063 |
- |
2064 |
- for sapi in $SAPIS ; do |
2065 |
- case "$sapi" in |
2066 |
- cli|cgi|embed|fpm|phpdbg) |
2067 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
2068 |
- sapi_conf+=( "--enable-${sapi}" ) |
2069 |
- else |
2070 |
- sapi_conf+=( "--disable-${sapi}" ) |
2071 |
- fi |
2072 |
- ;; |
2073 |
- |
2074 |
- apache2) |
2075 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
2076 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) |
2077 |
- else |
2078 |
- sapi_conf+=( --without-apxs2 ) |
2079 |
- fi |
2080 |
- ;; |
2081 |
- esac |
2082 |
- done |
2083 |
- |
2084 |
- # Construct the $myeconfargs array by concatenating $our_conf |
2085 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
2086 |
- local myeconfargs=( "${our_conf[@]}" ) |
2087 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
2088 |
- |
2089 |
- pushd "${BUILD_DIR}" > /dev/null || die |
2090 |
- econf "${myeconfargs[@]}" |
2091 |
- popd > /dev/null || die |
2092 |
- done |
2093 |
-} |
2094 |
- |
2095 |
-src_compile() { |
2096 |
- # snmp seems to run during src_compile, too (bug #324739) |
2097 |
- addpredict /usr/share/snmp/mibs/.index |
2098 |
- addpredict /var/lib/net-snmp/mib_indexes |
2099 |
- |
2100 |
- for sapi in ${SAPIS} ; do |
2101 |
- if use "${sapi}"; then |
2102 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
2103 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
2104 |
- emake |
2105 |
- fi |
2106 |
- done |
2107 |
-} |
2108 |
- |
2109 |
-src_install() { |
2110 |
- # see bug #324739 for what happens when we don't have that |
2111 |
- addpredict /usr/share/snmp/mibs/.index |
2112 |
- |
2113 |
- # grab the first SAPI that got built and install common files from there |
2114 |
- local first_sapi="" |
2115 |
- for sapi in $SAPIS ; do |
2116 |
- if use $sapi ; then |
2117 |
- first_sapi=$sapi |
2118 |
- break |
2119 |
- fi |
2120 |
- done |
2121 |
- |
2122 |
- # Makefile forgets to create this before trying to write to it... |
2123 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
2124 |
- |
2125 |
- # Install php environment (without any sapis) |
2126 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
2127 |
- emake INSTALL_ROOT="${D}" \ |
2128 |
- install-build install-headers install-programs |
2129 |
- |
2130 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
2131 |
- |
2132 |
- # Create the directory where we'll put version-specific php scripts |
2133 |
- keepdir "/usr/share/php${PHP_MV}" |
2134 |
- |
2135 |
- local sapi="", file="" |
2136 |
- local sapi_list="" |
2137 |
- |
2138 |
- for sapi in ${SAPIS}; do |
2139 |
- if use "${sapi}" ; then |
2140 |
- einfo "Installing SAPI: ${sapi}" |
2141 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
2142 |
- |
2143 |
- if [[ "${sapi}" == "apache2" ]] ; then |
2144 |
- # We're specifically not using emake install-sapi as libtool |
2145 |
- # may cause unnecessary relink failures (see bug #351266) |
2146 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
2147 |
- newins ".libs/libphp${PHP_MV}$(get_libname)" \ |
2148 |
- "libphp${PHP_MV}$(get_libname)" |
2149 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
2150 |
- else |
2151 |
- # needed each time, php_install_ini would reset it |
2152 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
2153 |
- into "${dest}" |
2154 |
- case "$sapi" in |
2155 |
- cli) |
2156 |
- source="sapi/cli/php" |
2157 |
- ;; |
2158 |
- cgi) |
2159 |
- source="sapi/cgi/php-cgi" |
2160 |
- ;; |
2161 |
- fpm) |
2162 |
- source="sapi/fpm/php-fpm" |
2163 |
- ;; |
2164 |
- embed) |
2165 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
2166 |
- ;; |
2167 |
- phpdbg) |
2168 |
- source="sapi/phpdbg/phpdbg" |
2169 |
- ;; |
2170 |
- *) |
2171 |
- die "unhandled sapi in src_install" |
2172 |
- ;; |
2173 |
- esac |
2174 |
- |
2175 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
2176 |
- dolib.so "${source}" |
2177 |
- else |
2178 |
- dobin "${source}" |
2179 |
- local name="$(basename ${source})" |
2180 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
2181 |
- fi |
2182 |
- fi |
2183 |
- |
2184 |
- php_install_ini "${sapi}" |
2185 |
- |
2186 |
- # construct correct SAPI string for php-config |
2187 |
- # thanks to ferringb for the bash voodoo |
2188 |
- if [[ "${sapi}" == "apache2" ]]; then |
2189 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
2190 |
- else |
2191 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
2192 |
- fi |
2193 |
- fi |
2194 |
- done |
2195 |
- |
2196 |
- # Installing opcache module |
2197 |
- if use opcache ; then |
2198 |
- into "${PHP_DESTDIR#${EPREFIX}}" |
2199 |
- dolib.so "modules/opcache$(get_libname)" |
2200 |
- fi |
2201 |
- |
2202 |
- # Install env.d files |
2203 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
2204 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
2205 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
2206 |
- |
2207 |
- # set php-config variable correctly (bug #278439) |
2208 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
2209 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
2210 |
- |
2211 |
- if use fpm ; then |
2212 |
- if use systemd; then |
2213 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
2214 |
- "php-fpm@${SLOT}.service" |
2215 |
- else |
2216 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
2217 |
- "php-fpm@${SLOT}.service" |
2218 |
- fi |
2219 |
- fi |
2220 |
-} |
2221 |
- |
2222 |
-src_test() { |
2223 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
2224 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
2225 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
2226 |
- ewarn "Test phase requires USE=cli, skipping" |
2227 |
- return |
2228 |
- else |
2229 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
2230 |
- fi |
2231 |
- |
2232 |
- if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then |
2233 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" |
2234 |
- fi |
2235 |
- |
2236 |
- if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then |
2237 |
- export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" |
2238 |
- fi |
2239 |
- |
2240 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
2241 |
- "session.save_path=${T}" \ |
2242 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
2243 |
- "session.save_path=${T}" |
2244 |
- |
2245 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
2246 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
2247 |
- done |
2248 |
- |
2249 |
- local failed="$(find -name '*.out')" |
2250 |
- if [[ ${failed} != "" ]] ; then |
2251 |
- ewarn "The following test cases failed unexpectedly:" |
2252 |
- for name in ${failed}; do |
2253 |
- ewarn " ${name/.out/}" |
2254 |
- done |
2255 |
- else |
2256 |
- einfo "No unexpected test failures, all fine" |
2257 |
- fi |
2258 |
- |
2259 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
2260 |
- local passed="" |
2261 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
2262 |
- [[ -f "${name}.diff" ]] && continue |
2263 |
- passed="${passed} ${name}" |
2264 |
- done |
2265 |
- if [[ ${passed} != "" ]] ; then |
2266 |
- einfo "The following test cases passed unexpectedly:" |
2267 |
- for name in ${passed}; do |
2268 |
- ewarn " ${passed}" |
2269 |
- done |
2270 |
- else |
2271 |
- einfo "None of the known-to-fail tests passed, all fine" |
2272 |
- fi |
2273 |
- fi |
2274 |
-} |
2275 |
- |
2276 |
-pkg_postinst() { |
2277 |
- # Output some general info to the user |
2278 |
- if use apache2 ; then |
2279 |
- elog |
2280 |
- elog "To enable PHP in apache, you will need to add \"-D PHP\" to" |
2281 |
- elog "your apache2 command. OpenRC users can append that string to" |
2282 |
- elog "APACHE2_OPTS in /etc/conf.d/apache2." |
2283 |
- elog |
2284 |
- elog "The apache module configuration file 70_mod_php.conf is" |
2285 |
- elog "provided (and maintained) by eselect-php." |
2286 |
- elog |
2287 |
- fi |
2288 |
- |
2289 |
- # Create the symlinks for php |
2290 |
- for m in ${SAPIS}; do |
2291 |
- [[ ${m} == 'embed' ]] && continue; |
2292 |
- if use $m ; then |
2293 |
- local ci=$(eselect php show $m) |
2294 |
- if [[ -z $ci ]]; then |
2295 |
- eselect php set $m php${SLOT} || die |
2296 |
- einfo "Switched ${m} to use php:${SLOT}" |
2297 |
- einfo |
2298 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
2299 |
- elog "To switch $m to use php:${SLOT}, run" |
2300 |
- elog " eselect php set $m php${SLOT}" |
2301 |
- elog |
2302 |
- fi |
2303 |
- fi |
2304 |
- done |
2305 |
- |
2306 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
2307 |
- # example, if the user has the cgi SAPI enabled, then he has an |
2308 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
2309 |
- # USE="-cgi", that symlink will break. This call to eselect is |
2310 |
- # supposed to remove that dead link per bug 572436. |
2311 |
- eselect php cleanup || die |
2312 |
- |
2313 |
- if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then |
2314 |
- elog "To build extensions for this version of PHP, you will need to" |
2315 |
- elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." |
2316 |
- elog |
2317 |
- fi |
2318 |
- |
2319 |
- # Warn about the removal of PHP_INI_VERSION if the user has it set. |
2320 |
- if [[ -n "${PHP_INI_VERSION}" ]]; then |
2321 |
- ewarn 'The PHP_INI_VERSION variable has been phased out. You may' |
2322 |
- ewarn 'remove it from your configuration at your convenience. See' |
2323 |
- ewarn |
2324 |
- ewarn ' https://bugs.gentoo.org/611214' |
2325 |
- ewarn |
2326 |
- ewarn 'for more information.' |
2327 |
- fi |
2328 |
- |
2329 |
- elog "For details on how version slotting works, please see" |
2330 |
- elog "the wiki:" |
2331 |
- elog |
2332 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
2333 |
- elog |
2334 |
-} |
2335 |
- |
2336 |
-pkg_postrm() { |
2337 |
- # This serves two purposes. First, if we have just removed the last |
2338 |
- # installed version of PHP, then this will remove any dead symlinks |
2339 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
2340 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
2341 |
- # his existing symlinks to point to the new 7.0 installation. The |
2342 |
- # latter is bug 432962. |
2343 |
- # |
2344 |
- # Note: the eselect-php package may not be installed at this point, |
2345 |
- # so we can't die() if this command fails. |
2346 |
- eselect php cleanup |
2347 |
-} |
2348 |
|
2349 |
diff --git a/dev-lang/php/php-7.0.28.ebuild b/dev-lang/php/php-7.0.28.ebuild |
2350 |
deleted file mode 100644 |
2351 |
index 56df1d36905..00000000000 |
2352 |
--- a/dev-lang/php/php-7.0.28.ebuild |
2353 |
+++ /dev/null |
2354 |
@@ -1,745 +0,0 @@ |
2355 |
-# Copyright 1999-2018 Gentoo Foundation |
2356 |
-# Distributed under the terms of the GNU General Public License v2 |
2357 |
- |
2358 |
-EAPI=6 |
2359 |
- |
2360 |
-inherit flag-o-matic versionator systemd |
2361 |
- |
2362 |
-DESCRIPTION="The PHP language runtime engine" |
2363 |
-HOMEPAGE="https://secure.php.net/" |
2364 |
-SRC_URI="https://secure.php.net/distributions/${P}.tar.xz" |
2365 |
- |
2366 |
-LICENSE="PHP-3.01 |
2367 |
- BSD |
2368 |
- Zend-2.0 |
2369 |
- bcmath? ( LGPL-2.1+ ) |
2370 |
- fpm? ( BSD-2 ) |
2371 |
- gd? ( gd ) |
2372 |
- unicode? ( BSD-2 LGPL-2.1 )" |
2373 |
- |
2374 |
-SLOT="$(get_version_component_range 1-2)" |
2375 |
-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" |
2376 |
- |
2377 |
-# We can build the following SAPIs in the given order |
2378 |
-SAPIS="embed cli cgi fpm apache2 phpdbg" |
2379 |
- |
2380 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
2381 |
-IUSE="${IUSE} |
2382 |
- ${SAPIS/cli/+cli} |
2383 |
- threads" |
2384 |
- |
2385 |
-IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk |
2386 |
- coverage crypt +ctype curl debug |
2387 |
- enchant exif +fileinfo +filter firebird |
2388 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
2389 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl |
2390 |
- mhash mssql mysql mysqli nls |
2391 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
2392 |
- readline recode selinux +session sharedmem |
2393 |
- +simplexml snmp soap sockets spell sqlite ssl |
2394 |
- sysvipc systemd tidy +tokenizer truetype unicode wddx webp |
2395 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
2396 |
- |
2397 |
-# The supported (that is, autodetected) versions of BDB are listed in |
2398 |
-# the ./configure script. Other versions *work*, but we need to stick to |
2399 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
2400 |
-COMMON_DEPEND=" |
2401 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
2402 |
- >=dev-libs/libpcre-8.32[unicode] |
2403 |
- fpm? ( acl? ( sys-apps/acl ) ) |
2404 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
2405 |
- <www-servers/apache-2.4[threads=] ) ) |
2406 |
- berkdb? ( || ( sys-libs/db:5.3 |
2407 |
- sys-libs/db:5.1 |
2408 |
- sys-libs/db:4.8 |
2409 |
- sys-libs/db:4.7 |
2410 |
- sys-libs/db:4.6 |
2411 |
- sys-libs/db:4.5 ) ) |
2412 |
- bzip2? ( app-arch/bzip2:0= ) |
2413 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
2414 |
- cjk? ( !gd? ( |
2415 |
- virtual/jpeg:0 |
2416 |
- media-libs/libpng:0= |
2417 |
- sys-libs/zlib:0= |
2418 |
- ) ) |
2419 |
- coverage? ( dev-util/lcov ) |
2420 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
2421 |
- curl? ( >=net-misc/curl-7.10.5 ) |
2422 |
- enchant? ( app-text/enchant ) |
2423 |
- exif? ( !gd? ( |
2424 |
- virtual/jpeg:0 |
2425 |
- media-libs/libpng:0= |
2426 |
- sys-libs/zlib:0= |
2427 |
- ) ) |
2428 |
- firebird? ( dev-db/firebird ) |
2429 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= ) |
2430 |
- gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) |
2431 |
- gmp? ( dev-libs/gmp:0= ) |
2432 |
- iconv? ( virtual/libiconv ) |
2433 |
- imap? ( virtual/imap-c-client[kerberos=,ssl=] ) |
2434 |
- intl? ( dev-libs/icu:= ) |
2435 |
- iodbc? ( dev-db/libiodbc ) |
2436 |
- kerberos? ( virtual/krb5 ) |
2437 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
2438 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
2439 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
2440 |
- mssql? ( dev-db/freetds[mssql] ) |
2441 |
- nls? ( sys-devel/gettext ) |
2442 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
2443 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
2444 |
- postgres? ( dev-db/postgresql:* ) |
2445 |
- qdbm? ( dev-db/qdbm ) |
2446 |
- readline? ( sys-libs/readline:0= ) |
2447 |
- recode? ( app-text/recode ) |
2448 |
- sharedmem? ( dev-libs/mm ) |
2449 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
2450 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
2451 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
2452 |
- spell? ( >=app-text/aspell-0.50 ) |
2453 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
2454 |
- ssl? ( |
2455 |
- !libressl? ( dev-libs/openssl:0= ) |
2456 |
- libressl? ( dev-libs/libressl:0= ) |
2457 |
- ) |
2458 |
- tidy? ( app-text/htmltidy ) |
2459 |
- truetype? ( |
2460 |
- =media-libs/freetype-2* |
2461 |
- !gd? ( |
2462 |
- virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib:0= ) |
2463 |
- ) |
2464 |
- unicode? ( dev-libs/oniguruma:= ) |
2465 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
2466 |
- webp? ( media-libs/libwebp:0= ) |
2467 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
2468 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
2469 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
2470 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
2471 |
- xpm? ( |
2472 |
- x11-libs/libXpm |
2473 |
- virtual/jpeg:0 |
2474 |
- media-libs/libpng:0= sys-libs/zlib:0= |
2475 |
- ) |
2476 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
2477 |
- zip? ( sys-libs/zlib:0= ) |
2478 |
- zlib? ( sys-libs/zlib:0= ) |
2479 |
-" |
2480 |
- |
2481 |
-RDEPEND="${COMMON_DEPEND} |
2482 |
- virtual/mta |
2483 |
- fpm? ( |
2484 |
- selinux? ( sec-policy/selinux-phpfpm ) |
2485 |
- systemd? ( sys-apps/systemd ) )" |
2486 |
- |
2487 |
-DEPEND="${COMMON_DEPEND} |
2488 |
- app-arch/xz-utils |
2489 |
- >=sys-devel/bison-3.0.1 |
2490 |
- sys-devel/flex |
2491 |
- >=sys-devel/m4-1.4.3 |
2492 |
- >=sys-devel/libtool-1.5.18" |
2493 |
- |
2494 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
2495 |
-REQUIRED_USE=" |
2496 |
- || ( cli cgi fpm apache2 embed phpdbg ) |
2497 |
- cli? ( ^^ ( readline libedit ) ) |
2498 |
- truetype? ( gd ) |
2499 |
- webp? ( gd ) |
2500 |
- cjk? ( gd ) |
2501 |
- exif? ( gd ) |
2502 |
- xpm? ( gd ) |
2503 |
- gd? ( zlib ) |
2504 |
- simplexml? ( xml ) |
2505 |
- soap? ( xml ) |
2506 |
- wddx? ( xml ) |
2507 |
- xmlrpc? ( || ( xml iconv ) ) |
2508 |
- xmlreader? ( xml ) |
2509 |
- xslt? ( xml ) |
2510 |
- ldap-sasl? ( ldap ) |
2511 |
- mhash? ( hash ) |
2512 |
- phar? ( hash ) |
2513 |
- qdbm? ( !gdbm ) |
2514 |
- readline? ( !libedit ) |
2515 |
- recode? ( !imap !mysqli !mysql ) |
2516 |
- sharedmem? ( !threads ) |
2517 |
- mysql? ( || ( mysqli pdo ) ) |
2518 |
-" |
2519 |
- |
2520 |
-PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" ) |
2521 |
- |
2522 |
-PHP_MV="$(get_major_version)" |
2523 |
- |
2524 |
-php_install_ini() { |
2525 |
- local phpsapi="${1}" |
2526 |
- |
2527 |
- # work out where we are installing the ini file |
2528 |
- php_set_ini_dir "${phpsapi}" |
2529 |
- |
2530 |
- # Always install the production INI file, bug 611214. |
2531 |
- local phpinisrc="php.ini-production-${phpsapi}" |
2532 |
- cp php.ini-production "${phpinisrc}" || die |
2533 |
- |
2534 |
- # default to /tmp for save_path, bug #282768 |
2535 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
2536 |
- |
2537 |
- # Set the extension dir |
2538 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ |
2539 |
- -i "${phpinisrc}" || die |
2540 |
- |
2541 |
- # Set the include path to point to where we want to find PEAR packages |
2542 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
2543 |
- |
2544 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
2545 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
2546 |
- newins "${phpinisrc}" php.ini |
2547 |
- |
2548 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
2549 |
- elog |
2550 |
- |
2551 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
2552 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
2553 |
- |
2554 |
- if use opcache; then |
2555 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
2556 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
2557 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
2558 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \ |
2559 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
2560 |
- fi |
2561 |
- |
2562 |
- # SAPI-specific handling |
2563 |
- if [[ "${sapi}" == "fpm" ]] ; then |
2564 |
- einfo "Installing FPM config files php-fpm.conf and www.conf" |
2565 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
2566 |
- doins sapi/fpm/php-fpm.conf |
2567 |
- insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" |
2568 |
- doins sapi/fpm/www.conf |
2569 |
- fi |
2570 |
- |
2571 |
- dodoc php.ini-{development,production} |
2572 |
-} |
2573 |
- |
2574 |
-php_set_ini_dir() { |
2575 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
2576 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
2577 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
2578 |
-} |
2579 |
- |
2580 |
-src_prepare() { |
2581 |
- default |
2582 |
- |
2583 |
- # In php-7.x, the FPM pool configuration files have been split off |
2584 |
- # of the main config. By default the pool config files go in |
2585 |
- # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the |
2586 |
- # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later |
2587 |
- # we'll install the pool configuration file "www.conf" there. |
2588 |
- php_set_ini_dir fpm |
2589 |
- sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ |
2590 |
- sapi/fpm/php-fpm.conf.in \ |
2591 |
- || die 'failed to move the include directory in php-fpm.conf' |
2592 |
-} |
2593 |
- |
2594 |
-src_configure() { |
2595 |
- addpredict /usr/share/snmp/mibs/.index |
2596 |
- addpredict /var/lib/net-snmp/mib_indexes |
2597 |
- |
2598 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
2599 |
- |
2600 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
2601 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
2602 |
- local our_conf=( |
2603 |
- --prefix="${PHP_DESTDIR}" |
2604 |
- --mandir="${PHP_DESTDIR}/man" |
2605 |
- --infodir="${PHP_DESTDIR}/info" |
2606 |
- --libdir="${PHP_DESTDIR}/lib" |
2607 |
- --with-libdir="$(get_libdir)" |
2608 |
- --localstatedir="${EPREFIX}/var" |
2609 |
- --without-pear |
2610 |
- $(use_enable threads maintainer-zts) |
2611 |
- ) |
2612 |
- |
2613 |
- our_conf+=( |
2614 |
- $(use_enable bcmath bcmath) |
2615 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
2616 |
- $(use_enable calendar calendar) |
2617 |
- $(use_enable coverage gcov) |
2618 |
- $(use_enable ctype ctype) |
2619 |
- $(use_with curl curl "${EPREFIX}/usr") |
2620 |
- $(use_enable xml dom) |
2621 |
- $(use_with enchant enchant "${EPREFIX}/usr") |
2622 |
- $(use_enable exif exif) |
2623 |
- $(use_enable fileinfo fileinfo) |
2624 |
- $(use_enable filter filter) |
2625 |
- $(use_enable ftp ftp) |
2626 |
- $(use_with nls gettext "${EPREFIX}/usr") |
2627 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
2628 |
- $(use_enable hash hash) |
2629 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
2630 |
- $(use_with iconv iconv \ |
2631 |
- $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr")) |
2632 |
- $(use_enable intl intl) |
2633 |
- $(use_enable ipv6 ipv6) |
2634 |
- $(use_enable json json) |
2635 |
- $(use_with kerberos kerberos "${EPREFIX}/usr") |
2636 |
- $(use_enable xml libxml) |
2637 |
- $(use_with xml libxml-dir "${EPREFIX}/usr") |
2638 |
- $(use_enable unicode mbstring) |
2639 |
- $(use_with crypt mcrypt "${EPREFIX}/usr") |
2640 |
- $(use_with unicode onig "${EPREFIX}/usr") |
2641 |
- $(use_with ssl openssl "${EPREFIX}/usr") |
2642 |
- $(use_with ssl openssl-dir "${EPREFIX}/usr") |
2643 |
- $(use_enable pcntl pcntl) |
2644 |
- $(use_enable phar phar) |
2645 |
- $(use_enable pdo pdo) |
2646 |
- $(use_enable opcache opcache) |
2647 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
2648 |
- $(use_enable posix posix) |
2649 |
- $(use_with spell pspell "${EPREFIX}/usr") |
2650 |
- $(use_with recode recode "${EPREFIX}/usr") |
2651 |
- $(use_enable simplexml simplexml) |
2652 |
- $(use_enable sharedmem shmop) |
2653 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
2654 |
- $(use_enable soap soap) |
2655 |
- $(use_enable sockets sockets) |
2656 |
- $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
2657 |
- $(use_enable sysvipc sysvmsg) |
2658 |
- $(use_enable sysvipc sysvsem) |
2659 |
- $(use_enable sysvipc sysvshm) |
2660 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
2661 |
- $(use_enable tokenizer tokenizer) |
2662 |
- $(use_enable wddx wddx) |
2663 |
- $(use_enable xml xml) |
2664 |
- $(use_enable xmlreader xmlreader) |
2665 |
- $(use_enable xmlwriter xmlwriter) |
2666 |
- $(use_with xmlrpc xmlrpc) |
2667 |
- $(use_with xslt xsl "${EPREFIX}/usr") |
2668 |
- $(use_enable zip zip) |
2669 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
2670 |
- $(use_enable debug debug) |
2671 |
- ) |
2672 |
- |
2673 |
- # DBA support |
2674 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
2675 |
- || use qdbm ; then |
2676 |
- our_conf+=( "--enable-dba${shared}" ) |
2677 |
- fi |
2678 |
- |
2679 |
- # DBA drivers support |
2680 |
- our_conf+=( |
2681 |
- $(use_with cdb cdb) |
2682 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
2683 |
- $(use_enable flatfile flatfile) |
2684 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
2685 |
- $(use_enable inifile inifile) |
2686 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
2687 |
- ) |
2688 |
- |
2689 |
- # Support for the GD graphics library |
2690 |
- our_conf+=( |
2691 |
- $(use_with truetype freetype-dir "${EPREFIX}/usr") |
2692 |
- $(use_enable cjk gd-jis-conv) |
2693 |
- $(use_with gd jpeg-dir "${EPREFIX}/usr") |
2694 |
- $(use_with gd png-dir "${EPREFIX}/usr") |
2695 |
- $(use_with xpm xpm-dir "${EPREFIX}/usr") |
2696 |
- ) |
2697 |
- if use webp; then |
2698 |
- our_conf+=( --with-webp-dir="${EPREFIX}/usr" ) |
2699 |
- fi |
2700 |
- # enable gd last, so configure can pick up the previous settings |
2701 |
- our_conf+=( $(use_with gd gd) ) |
2702 |
- |
2703 |
- # IMAP support |
2704 |
- if use imap ; then |
2705 |
- our_conf+=( |
2706 |
- $(use_with imap imap "${EPREFIX}/usr") |
2707 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
2708 |
- ) |
2709 |
- fi |
2710 |
- |
2711 |
- # Interbase/firebird support |
2712 |
- our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
2713 |
- |
2714 |
- # LDAP support |
2715 |
- if use ldap ; then |
2716 |
- our_conf+=( |
2717 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
2718 |
- $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
2719 |
- ) |
2720 |
- fi |
2721 |
- |
2722 |
- # MySQL support |
2723 |
- local mysqllib="mysqlnd" |
2724 |
- local mysqlilib="mysqlnd" |
2725 |
- |
2726 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
2727 |
- |
2728 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
2729 |
- if use mysql || use mysqli ; then |
2730 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
2731 |
- fi |
2732 |
- |
2733 |
- # ODBC support |
2734 |
- our_conf+=( |
2735 |
- $(use_with odbc unixODBC "${EPREFIX}/usr") |
2736 |
- $(use_with iodbc iodbc "${EPREFIX}/usr") |
2737 |
- ) |
2738 |
- |
2739 |
- # Oracle support |
2740 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
2741 |
- |
2742 |
- # PDO support |
2743 |
- if use pdo ; then |
2744 |
- our_conf+=( |
2745 |
- $(use_with mssql pdo-dblib "${EPREFIX}/usr") |
2746 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
2747 |
- $(use_with postgres pdo-pgsql) |
2748 |
- $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
2749 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
2750 |
- $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
2751 |
- $(use_with oci8-instant-client pdo-oci) |
2752 |
- ) |
2753 |
- fi |
2754 |
- |
2755 |
- # readline/libedit support |
2756 |
- our_conf+=( |
2757 |
- $(use_with readline readline "${EPREFIX}/usr") |
2758 |
- $(use_with libedit libedit "${EPREFIX}/usr") |
2759 |
- ) |
2760 |
- |
2761 |
- # Session support |
2762 |
- if use session ; then |
2763 |
- our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") ) |
2764 |
- else |
2765 |
- our_conf+=( $(use_enable session session) ) |
2766 |
- fi |
2767 |
- |
2768 |
- # Use pic for shared modules such as apache2's mod_php |
2769 |
- our_conf+=( --with-pic ) |
2770 |
- |
2771 |
- # we use the system copy of pcre |
2772 |
- # --with-pcre-regex affects ext/pcre |
2773 |
- # --with-pcre-dir affects ext/filter and ext/zip |
2774 |
- our_conf+=( |
2775 |
- --with-pcre-regex="${EPREFIX}/usr" |
2776 |
- --with-pcre-dir="${EPREFIX}/usr" |
2777 |
- ) |
2778 |
- |
2779 |
- # Catch CFLAGS problems |
2780 |
- # Fixes bug #14067. |
2781 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
2782 |
- replace-cpu-flags "k6*" "i586" |
2783 |
- |
2784 |
- # Cache the ./configure test results between SAPIs. |
2785 |
- our_conf+=( --cache-file="${T}/config.cache" ) |
2786 |
- |
2787 |
- # Support user-passed configuration parameters |
2788 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
2789 |
- |
2790 |
- # Support the Apache2 extras, they must be set globally for all |
2791 |
- # SAPIs to work correctly, especially for external PHP extensions |
2792 |
- |
2793 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
2794 |
- for one_sapi in $SAPIS ; do |
2795 |
- use "${one_sapi}" || continue |
2796 |
- php_set_ini_dir "${one_sapi}" |
2797 |
- |
2798 |
- # The BUILD_DIR variable is used to determine where to output |
2799 |
- # the files that autotools creates. This was all originally |
2800 |
- # based on the autotools-utils eclass. |
2801 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
2802 |
- cp -a "${S}" "${BUILD_DIR}" || die |
2803 |
- cd "${BUILD_DIR}" || die |
2804 |
- |
2805 |
- local sapi_conf=( |
2806 |
- --with-config-file-path="${PHP_INI_DIR}" |
2807 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
2808 |
- ) |
2809 |
- |
2810 |
- for sapi in $SAPIS ; do |
2811 |
- case "$sapi" in |
2812 |
- cli|cgi|embed|fpm|phpdbg) |
2813 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
2814 |
- sapi_conf+=( "--enable-${sapi}" ) |
2815 |
- if [[ "fpm" == "${sapi}" ]] ; then |
2816 |
- sapi_conf+=( |
2817 |
- $(use_with acl fpm-acl) |
2818 |
- $(use_with systemd fpm-systemd) |
2819 |
- ) |
2820 |
- fi |
2821 |
- else |
2822 |
- sapi_conf+=( "--disable-${sapi}" ) |
2823 |
- fi |
2824 |
- ;; |
2825 |
- |
2826 |
- apache2) |
2827 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
2828 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) |
2829 |
- else |
2830 |
- sapi_conf+=( --without-apxs2 ) |
2831 |
- fi |
2832 |
- ;; |
2833 |
- esac |
2834 |
- done |
2835 |
- |
2836 |
- # Construct the $myeconfargs array by concatenating $our_conf |
2837 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
2838 |
- local myeconfargs=( "${our_conf[@]}" ) |
2839 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
2840 |
- |
2841 |
- pushd "${BUILD_DIR}" > /dev/null || die |
2842 |
- econf "${myeconfargs[@]}" |
2843 |
- popd > /dev/null || die |
2844 |
- done |
2845 |
-} |
2846 |
- |
2847 |
-src_compile() { |
2848 |
- # snmp seems to run during src_compile, too (bug #324739) |
2849 |
- addpredict /usr/share/snmp/mibs/.index |
2850 |
- addpredict /var/lib/net-snmp/mib_indexes |
2851 |
- |
2852 |
- for sapi in ${SAPIS} ; do |
2853 |
- if use "${sapi}"; then |
2854 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
2855 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
2856 |
- emake |
2857 |
- fi |
2858 |
- done |
2859 |
-} |
2860 |
- |
2861 |
-src_install() { |
2862 |
- # see bug #324739 for what happens when we don't have that |
2863 |
- addpredict /usr/share/snmp/mibs/.index |
2864 |
- |
2865 |
- # grab the first SAPI that got built and install common files from there |
2866 |
- local first_sapi="" |
2867 |
- for sapi in $SAPIS ; do |
2868 |
- if use $sapi ; then |
2869 |
- first_sapi=$sapi |
2870 |
- break |
2871 |
- fi |
2872 |
- done |
2873 |
- |
2874 |
- # Makefile forgets to create this before trying to write to it... |
2875 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
2876 |
- |
2877 |
- # Install php environment (without any sapis) |
2878 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
2879 |
- emake INSTALL_ROOT="${D}" \ |
2880 |
- install-build install-headers install-programs |
2881 |
- |
2882 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
2883 |
- |
2884 |
- # Create the directory where we'll put version-specific php scripts |
2885 |
- keepdir "/usr/share/php${PHP_MV}" |
2886 |
- |
2887 |
- local sapi="", file="" |
2888 |
- local sapi_list="" |
2889 |
- |
2890 |
- for sapi in ${SAPIS}; do |
2891 |
- if use "${sapi}" ; then |
2892 |
- einfo "Installing SAPI: ${sapi}" |
2893 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
2894 |
- |
2895 |
- if [[ "${sapi}" == "apache2" ]] ; then |
2896 |
- # We're specifically not using emake install-sapi as libtool |
2897 |
- # may cause unnecessary relink failures (see bug #351266) |
2898 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
2899 |
- newins ".libs/libphp${PHP_MV}$(get_libname)" \ |
2900 |
- "libphp${PHP_MV}$(get_libname)" |
2901 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
2902 |
- else |
2903 |
- # needed each time, php_install_ini would reset it |
2904 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
2905 |
- into "${dest}" |
2906 |
- case "$sapi" in |
2907 |
- cli) |
2908 |
- source="sapi/cli/php" |
2909 |
- ;; |
2910 |
- cgi) |
2911 |
- source="sapi/cgi/php-cgi" |
2912 |
- ;; |
2913 |
- fpm) |
2914 |
- source="sapi/fpm/php-fpm" |
2915 |
- ;; |
2916 |
- embed) |
2917 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
2918 |
- ;; |
2919 |
- phpdbg) |
2920 |
- source="sapi/phpdbg/phpdbg" |
2921 |
- ;; |
2922 |
- *) |
2923 |
- die "unhandled sapi in src_install" |
2924 |
- ;; |
2925 |
- esac |
2926 |
- |
2927 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
2928 |
- dolib.so "${source}" |
2929 |
- else |
2930 |
- dobin "${source}" |
2931 |
- local name="$(basename ${source})" |
2932 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
2933 |
- fi |
2934 |
- fi |
2935 |
- |
2936 |
- php_install_ini "${sapi}" |
2937 |
- |
2938 |
- # construct correct SAPI string for php-config |
2939 |
- # thanks to ferringb for the bash voodoo |
2940 |
- if [[ "${sapi}" == "apache2" ]]; then |
2941 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
2942 |
- else |
2943 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
2944 |
- fi |
2945 |
- fi |
2946 |
- done |
2947 |
- |
2948 |
- # Installing opcache module |
2949 |
- if use opcache ; then |
2950 |
- into "${PHP_DESTDIR#${EPREFIX}}" |
2951 |
- dolib.so "modules/opcache$(get_libname)" |
2952 |
- fi |
2953 |
- |
2954 |
- # Install env.d files |
2955 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
2956 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
2957 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
2958 |
- |
2959 |
- # set php-config variable correctly (bug #278439) |
2960 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
2961 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
2962 |
- |
2963 |
- if use fpm ; then |
2964 |
- if use systemd; then |
2965 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
2966 |
- "php-fpm@${SLOT}.service" |
2967 |
- else |
2968 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
2969 |
- "php-fpm@${SLOT}.service" |
2970 |
- fi |
2971 |
- fi |
2972 |
-} |
2973 |
- |
2974 |
-src_test() { |
2975 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
2976 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
2977 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
2978 |
- ewarn "Test phase requires USE=cli, skipping" |
2979 |
- return |
2980 |
- else |
2981 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
2982 |
- fi |
2983 |
- |
2984 |
- if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then |
2985 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" |
2986 |
- fi |
2987 |
- |
2988 |
- if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then |
2989 |
- export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" |
2990 |
- fi |
2991 |
- |
2992 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
2993 |
- "session.save_path=${T}" \ |
2994 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
2995 |
- "session.save_path=${T}" |
2996 |
- |
2997 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
2998 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
2999 |
- done |
3000 |
- |
3001 |
- local failed="$(find -name '*.out')" |
3002 |
- if [[ ${failed} != "" ]] ; then |
3003 |
- ewarn "The following test cases failed unexpectedly:" |
3004 |
- for name in ${failed}; do |
3005 |
- ewarn " ${name/.out/}" |
3006 |
- done |
3007 |
- else |
3008 |
- einfo "No unexpected test failures, all fine" |
3009 |
- fi |
3010 |
- |
3011 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
3012 |
- local passed="" |
3013 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
3014 |
- [[ -f "${name}.diff" ]] && continue |
3015 |
- passed="${passed} ${name}" |
3016 |
- done |
3017 |
- if [[ ${passed} != "" ]] ; then |
3018 |
- einfo "The following test cases passed unexpectedly:" |
3019 |
- for name in ${passed}; do |
3020 |
- ewarn " ${passed}" |
3021 |
- done |
3022 |
- else |
3023 |
- einfo "None of the known-to-fail tests passed, all fine" |
3024 |
- fi |
3025 |
- fi |
3026 |
-} |
3027 |
- |
3028 |
-pkg_postinst() { |
3029 |
- # Output some general info to the user |
3030 |
- if use apache2 ; then |
3031 |
- elog |
3032 |
- elog "To enable PHP in apache, you will need to add \"-D PHP\" to" |
3033 |
- elog "your apache2 command. OpenRC users can append that string to" |
3034 |
- elog "APACHE2_OPTS in /etc/conf.d/apache2." |
3035 |
- elog |
3036 |
- elog "The apache module configuration file 70_mod_php.conf is" |
3037 |
- elog "provided (and maintained) by eselect-php." |
3038 |
- elog |
3039 |
- fi |
3040 |
- |
3041 |
- # Create the symlinks for php |
3042 |
- for m in ${SAPIS}; do |
3043 |
- [[ ${m} == 'embed' ]] && continue; |
3044 |
- if use $m ; then |
3045 |
- local ci=$(eselect php show $m) |
3046 |
- if [[ -z $ci ]]; then |
3047 |
- eselect php set $m php${SLOT} || die |
3048 |
- einfo "Switched ${m} to use php:${SLOT}" |
3049 |
- einfo |
3050 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
3051 |
- elog "To switch $m to use php:${SLOT}, run" |
3052 |
- elog " eselect php set $m php${SLOT}" |
3053 |
- elog |
3054 |
- fi |
3055 |
- fi |
3056 |
- done |
3057 |
- |
3058 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
3059 |
- # example, if the user has the cgi SAPI enabled, then he has an |
3060 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
3061 |
- # USE="-cgi", that symlink will break. This call to eselect is |
3062 |
- # supposed to remove that dead link per bug 572436. |
3063 |
- eselect php cleanup || die |
3064 |
- |
3065 |
- if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then |
3066 |
- elog "To build extensions for this version of PHP, you will need to" |
3067 |
- elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." |
3068 |
- elog |
3069 |
- fi |
3070 |
- |
3071 |
- # Warn about the removal of PHP_INI_VERSION if the user has it set. |
3072 |
- if [[ -n "${PHP_INI_VERSION}" ]]; then |
3073 |
- ewarn 'The PHP_INI_VERSION variable has been phased out. You may' |
3074 |
- ewarn 'remove it from your configuration at your convenience. See' |
3075 |
- ewarn |
3076 |
- ewarn ' https://bugs.gentoo.org/611214' |
3077 |
- ewarn |
3078 |
- ewarn 'for more information.' |
3079 |
- fi |
3080 |
- |
3081 |
- elog "For details on how version slotting works, please see" |
3082 |
- elog "the wiki:" |
3083 |
- elog |
3084 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
3085 |
- elog |
3086 |
-} |
3087 |
- |
3088 |
-pkg_postrm() { |
3089 |
- # This serves two purposes. First, if we have just removed the last |
3090 |
- # installed version of PHP, then this will remove any dead symlinks |
3091 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
3092 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
3093 |
- # his existing symlinks to point to the new 7.0 installation. The |
3094 |
- # latter is bug 432962. |
3095 |
- # |
3096 |
- # Note: the eselect-php package may not be installed at this point, |
3097 |
- # so we can't die() if this command fails. |
3098 |
- eselect php cleanup |
3099 |
-} |
3100 |
|
3101 |
diff --git a/dev-lang/php/php-7.1.13.ebuild b/dev-lang/php/php-7.1.13.ebuild |
3102 |
deleted file mode 100644 |
3103 |
index 65425f9dc6a..00000000000 |
3104 |
--- a/dev-lang/php/php-7.1.13.ebuild |
3105 |
+++ /dev/null |
3106 |
@@ -1,723 +0,0 @@ |
3107 |
-# Copyright 1999-2018 Gentoo Foundation |
3108 |
-# Distributed under the terms of the GNU General Public License v2 |
3109 |
- |
3110 |
-EAPI=6 |
3111 |
- |
3112 |
-inherit flag-o-matic versionator systemd |
3113 |
- |
3114 |
-DESCRIPTION="The PHP language runtime engine" |
3115 |
-HOMEPAGE="https://secure.php.net/" |
3116 |
-SRC_URI="https://secure.php.net/distributions/${P}.tar.xz" |
3117 |
- |
3118 |
-LICENSE="PHP-3.01 |
3119 |
- BSD |
3120 |
- Zend-2.0 |
3121 |
- bcmath? ( LGPL-2.1+ ) |
3122 |
- fpm? ( BSD-2 ) |
3123 |
- gd? ( gd ) |
3124 |
- unicode? ( BSD-2 LGPL-2.1 )" |
3125 |
- |
3126 |
-SLOT="$(get_version_component_range 1-2)" |
3127 |
-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" |
3128 |
- |
3129 |
-# We can build the following SAPIs in the given order |
3130 |
-SAPIS="embed cli cgi fpm apache2 phpdbg" |
3131 |
- |
3132 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
3133 |
-IUSE="${IUSE} |
3134 |
- ${SAPIS/cli/+cli} |
3135 |
- threads" |
3136 |
- |
3137 |
-IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk |
3138 |
- coverage crypt +ctype curl debug |
3139 |
- enchant exif +fileinfo +filter firebird |
3140 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
3141 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl |
3142 |
- mhash mssql mysql mysqli nls |
3143 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
3144 |
- readline recode selinux +session sharedmem |
3145 |
- +simplexml snmp soap sockets spell sqlite ssl |
3146 |
- sysvipc systemd test tidy +tokenizer truetype unicode wddx webp |
3147 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
3148 |
- |
3149 |
-# The supported (that is, autodetected) versions of BDB are listed in |
3150 |
-# the ./configure script. Other versions *work*, but we need to stick to |
3151 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
3152 |
-COMMON_DEPEND=" |
3153 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
3154 |
- >=dev-libs/libpcre-8.32[unicode] |
3155 |
- acl? ( sys-apps/acl ) |
3156 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
3157 |
- <www-servers/apache-2.4[threads=] ) ) |
3158 |
- berkdb? ( || ( sys-libs/db:5.3 |
3159 |
- sys-libs/db:5.1 |
3160 |
- sys-libs/db:4.8 |
3161 |
- sys-libs/db:4.7 |
3162 |
- sys-libs/db:4.6 |
3163 |
- sys-libs/db:4.5 ) ) |
3164 |
- bzip2? ( app-arch/bzip2:0= ) |
3165 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
3166 |
- coverage? ( dev-util/lcov ) |
3167 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
3168 |
- curl? ( >=net-misc/curl-7.10.5 ) |
3169 |
- enchant? ( app-text/enchant ) |
3170 |
- firebird? ( dev-db/firebird ) |
3171 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
3172 |
- gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) |
3173 |
- gmp? ( dev-libs/gmp:0= ) |
3174 |
- iconv? ( virtual/libiconv ) |
3175 |
- imap? ( virtual/imap-c-client[kerberos=,ssl=] ) |
3176 |
- intl? ( dev-libs/icu:= ) |
3177 |
- iodbc? ( dev-db/libiodbc ) |
3178 |
- kerberos? ( virtual/krb5 ) |
3179 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
3180 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
3181 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
3182 |
- mssql? ( dev-db/freetds[mssql] ) |
3183 |
- nls? ( sys-devel/gettext ) |
3184 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
3185 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
3186 |
- postgres? ( dev-db/postgresql:* ) |
3187 |
- qdbm? ( dev-db/qdbm ) |
3188 |
- readline? ( sys-libs/readline:0= ) |
3189 |
- recode? ( app-text/recode ) |
3190 |
- sharedmem? ( dev-libs/mm ) |
3191 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
3192 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
3193 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
3194 |
- spell? ( >=app-text/aspell-0.50 ) |
3195 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
3196 |
- ssl? ( |
3197 |
- !libressl? ( dev-libs/openssl:0= ) |
3198 |
- libressl? ( dev-libs/libressl:0= ) |
3199 |
- ) |
3200 |
- tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) ) |
3201 |
- truetype? ( =media-libs/freetype-2* ) |
3202 |
- unicode? ( dev-libs/oniguruma:= ) |
3203 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
3204 |
- webp? ( media-libs/libwebp:0= ) |
3205 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
3206 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
3207 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
3208 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
3209 |
- xpm? ( x11-libs/libXpm ) |
3210 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
3211 |
- zip? ( sys-libs/zlib:0= ) |
3212 |
- zlib? ( sys-libs/zlib:0= ) |
3213 |
-" |
3214 |
- |
3215 |
-RDEPEND="${COMMON_DEPEND} |
3216 |
- virtual/mta |
3217 |
- fpm? ( |
3218 |
- selinux? ( sec-policy/selinux-phpfpm ) |
3219 |
- systemd? ( sys-apps/systemd ) )" |
3220 |
- |
3221 |
-# Bison isn't actually needed when building from a release tarball |
3222 |
-# However, the configure script will warn if it's absent or if you |
3223 |
-# have an incompatible version installed. See bug 593278. |
3224 |
-DEPEND="${COMMON_DEPEND} |
3225 |
- app-arch/xz-utils |
3226 |
- >=sys-devel/bison-3.0.1" |
3227 |
- |
3228 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
3229 |
-REQUIRED_USE=" |
3230 |
- || ( cli cgi fpm apache2 embed phpdbg ) |
3231 |
- cli? ( ^^ ( readline libedit ) ) |
3232 |
- truetype? ( gd ) |
3233 |
- webp? ( gd ) |
3234 |
- cjk? ( gd ) |
3235 |
- exif? ( gd ) |
3236 |
- xpm? ( gd ) |
3237 |
- gd? ( zlib ) |
3238 |
- simplexml? ( xml ) |
3239 |
- soap? ( xml ) |
3240 |
- wddx? ( xml ) |
3241 |
- xmlrpc? ( || ( xml iconv ) ) |
3242 |
- xmlreader? ( xml ) |
3243 |
- xslt? ( xml ) |
3244 |
- ldap-sasl? ( ldap ) |
3245 |
- mhash? ( hash ) |
3246 |
- phar? ( hash ) |
3247 |
- qdbm? ( !gdbm ) |
3248 |
- readline? ( !libedit ) |
3249 |
- recode? ( !imap !mysqli !mysql ) |
3250 |
- sharedmem? ( !threads ) |
3251 |
- mysql? ( || ( mysqli pdo ) ) |
3252 |
-" |
3253 |
- |
3254 |
-PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" ) |
3255 |
- |
3256 |
-PHP_MV="$(get_major_version)" |
3257 |
- |
3258 |
-php_install_ini() { |
3259 |
- local phpsapi="${1}" |
3260 |
- |
3261 |
- # work out where we are installing the ini file |
3262 |
- php_set_ini_dir "${phpsapi}" |
3263 |
- |
3264 |
- # Always install the production INI file, bug 611214. |
3265 |
- local phpinisrc="php.ini-production-${phpsapi}" |
3266 |
- cp php.ini-production "${phpinisrc}" || die |
3267 |
- |
3268 |
- # default to /tmp for save_path, bug #282768 |
3269 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
3270 |
- |
3271 |
- # Set the extension dir |
3272 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ |
3273 |
- -i "${phpinisrc}" || die |
3274 |
- |
3275 |
- # Set the include path to point to where we want to find PEAR packages |
3276 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
3277 |
- |
3278 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
3279 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
3280 |
- newins "${phpinisrc}" php.ini |
3281 |
- |
3282 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
3283 |
- elog |
3284 |
- |
3285 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
3286 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
3287 |
- |
3288 |
- if use opcache; then |
3289 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
3290 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
3291 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
3292 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \ |
3293 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
3294 |
- fi |
3295 |
- |
3296 |
- # SAPI-specific handling |
3297 |
- if [[ "${sapi}" == "fpm" ]] ; then |
3298 |
- einfo "Installing FPM config files php-fpm.conf and www.conf" |
3299 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
3300 |
- doins sapi/fpm/php-fpm.conf |
3301 |
- insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" |
3302 |
- doins sapi/fpm/www.conf |
3303 |
- fi |
3304 |
- |
3305 |
- dodoc php.ini-{development,production} |
3306 |
-} |
3307 |
- |
3308 |
-php_set_ini_dir() { |
3309 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
3310 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
3311 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
3312 |
-} |
3313 |
- |
3314 |
-src_prepare() { |
3315 |
- default |
3316 |
- |
3317 |
- # In php-7.x, the FPM pool configuration files have been split off |
3318 |
- # of the main config. By default the pool config files go in |
3319 |
- # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the |
3320 |
- # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later |
3321 |
- # we'll install the pool configuration file "www.conf" there. |
3322 |
- php_set_ini_dir fpm |
3323 |
- sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ |
3324 |
- sapi/fpm/php-fpm.conf.in \ |
3325 |
- || die 'failed to move the include directory in php-fpm.conf' |
3326 |
-} |
3327 |
- |
3328 |
-src_configure() { |
3329 |
- addpredict /usr/share/snmp/mibs/.index |
3330 |
- addpredict /var/lib/net-snmp/mib_indexes |
3331 |
- |
3332 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
3333 |
- |
3334 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
3335 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
3336 |
- local our_conf=( |
3337 |
- --prefix="${PHP_DESTDIR}" |
3338 |
- --mandir="${PHP_DESTDIR}/man" |
3339 |
- --infodir="${PHP_DESTDIR}/info" |
3340 |
- --libdir="${PHP_DESTDIR}/lib" |
3341 |
- --with-libdir="$(get_libdir)" |
3342 |
- --localstatedir="${EPREFIX}/var" |
3343 |
- --without-pear |
3344 |
- $(use_enable threads maintainer-zts) |
3345 |
- ) |
3346 |
- |
3347 |
- our_conf+=( |
3348 |
- $(use_with acl fpm-acl) |
3349 |
- $(use_enable bcmath bcmath) |
3350 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
3351 |
- $(use_enable calendar calendar) |
3352 |
- $(use_enable coverage gcov) |
3353 |
- $(use_enable ctype ctype) |
3354 |
- $(use_with curl curl "${EPREFIX}/usr") |
3355 |
- $(use_enable xml dom) |
3356 |
- $(use_with enchant enchant "${EPREFIX}/usr") |
3357 |
- $(use_enable exif exif) |
3358 |
- $(use_enable fileinfo fileinfo) |
3359 |
- $(use_enable filter filter) |
3360 |
- $(use_enable ftp ftp) |
3361 |
- $(use_with nls gettext "${EPREFIX}/usr") |
3362 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
3363 |
- $(use_enable hash hash) |
3364 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
3365 |
- $(use_with iconv iconv \ |
3366 |
- $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr")) |
3367 |
- $(use_enable intl intl) |
3368 |
- $(use_enable ipv6 ipv6) |
3369 |
- $(use_enable json json) |
3370 |
- $(use_with kerberos kerberos "${EPREFIX}/usr") |
3371 |
- $(use_enable xml libxml) |
3372 |
- $(use_with xml libxml-dir "${EPREFIX}/usr") |
3373 |
- $(use_enable unicode mbstring) |
3374 |
- $(use_with crypt mcrypt "${EPREFIX}/usr") |
3375 |
- $(use_with unicode onig "${EPREFIX}/usr") |
3376 |
- $(use_with ssl openssl "${EPREFIX}/usr") |
3377 |
- $(use_with ssl openssl-dir "${EPREFIX}/usr") |
3378 |
- $(use_enable pcntl pcntl) |
3379 |
- $(use_enable phar phar) |
3380 |
- $(use_enable pdo pdo) |
3381 |
- $(use_enable opcache opcache) |
3382 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
3383 |
- $(use_enable posix posix) |
3384 |
- $(use_with spell pspell "${EPREFIX}/usr") |
3385 |
- $(use_with recode recode "${EPREFIX}/usr") |
3386 |
- $(use_enable simplexml simplexml) |
3387 |
- $(use_enable sharedmem shmop) |
3388 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
3389 |
- $(use_enable soap soap) |
3390 |
- $(use_enable sockets sockets) |
3391 |
- $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
3392 |
- $(use_enable sysvipc sysvmsg) |
3393 |
- $(use_enable sysvipc sysvsem) |
3394 |
- $(use_enable sysvipc sysvshm) |
3395 |
- $(use_with systemd fpm-systemd) |
3396 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
3397 |
- $(use_enable tokenizer tokenizer) |
3398 |
- $(use_enable wddx wddx) |
3399 |
- $(use_enable xml xml) |
3400 |
- $(use_enable xmlreader xmlreader) |
3401 |
- $(use_enable xmlwriter xmlwriter) |
3402 |
- $(use_with xmlrpc xmlrpc) |
3403 |
- $(use_with xslt xsl "${EPREFIX}/usr") |
3404 |
- $(use_enable zip zip) |
3405 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
3406 |
- $(use_enable debug debug) |
3407 |
- ) |
3408 |
- |
3409 |
- # DBA support |
3410 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
3411 |
- || use qdbm ; then |
3412 |
- our_conf+=( "--enable-dba${shared}" ) |
3413 |
- fi |
3414 |
- |
3415 |
- # DBA drivers support |
3416 |
- our_conf+=( |
3417 |
- $(use_with cdb cdb) |
3418 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
3419 |
- $(use_enable flatfile flatfile) |
3420 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
3421 |
- $(use_enable inifile inifile) |
3422 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
3423 |
- ) |
3424 |
- |
3425 |
- # Support for the GD graphics library |
3426 |
- our_conf+=( |
3427 |
- $(use_with truetype freetype-dir "${EPREFIX}/usr") |
3428 |
- $(use_enable cjk gd-jis-conv) |
3429 |
- $(use_with gd jpeg-dir "${EPREFIX}/usr") |
3430 |
- $(use_with gd png-dir "${EPREFIX}/usr") |
3431 |
- $(use_with xpm xpm-dir "${EPREFIX}/usr") |
3432 |
- ) |
3433 |
- if use webp; then |
3434 |
- our_conf+=( --with-webp-dir="${EPREFIX}/usr" ) |
3435 |
- fi |
3436 |
- # enable gd last, so configure can pick up the previous settings |
3437 |
- our_conf+=( $(use_with gd gd) ) |
3438 |
- |
3439 |
- # IMAP support |
3440 |
- if use imap ; then |
3441 |
- our_conf+=( |
3442 |
- $(use_with imap imap "${EPREFIX}/usr") |
3443 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
3444 |
- ) |
3445 |
- fi |
3446 |
- |
3447 |
- # Interbase/firebird support |
3448 |
- our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
3449 |
- |
3450 |
- # LDAP support |
3451 |
- if use ldap ; then |
3452 |
- our_conf+=( |
3453 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
3454 |
- $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
3455 |
- ) |
3456 |
- fi |
3457 |
- |
3458 |
- # MySQL support |
3459 |
- local mysqllib="mysqlnd" |
3460 |
- local mysqlilib="mysqlnd" |
3461 |
- |
3462 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
3463 |
- |
3464 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
3465 |
- if use mysql || use mysqli ; then |
3466 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
3467 |
- fi |
3468 |
- |
3469 |
- # ODBC support |
3470 |
- our_conf+=( |
3471 |
- $(use_with odbc unixODBC "${EPREFIX}/usr") |
3472 |
- $(use_with iodbc iodbc "${EPREFIX}/usr") |
3473 |
- ) |
3474 |
- |
3475 |
- # Oracle support |
3476 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
3477 |
- |
3478 |
- # PDO support |
3479 |
- if use pdo ; then |
3480 |
- our_conf+=( |
3481 |
- $(use_with mssql pdo-dblib "${EPREFIX}/usr") |
3482 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
3483 |
- $(use_with postgres pdo-pgsql) |
3484 |
- $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
3485 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
3486 |
- $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
3487 |
- $(use_with oci8-instant-client pdo-oci) |
3488 |
- ) |
3489 |
- fi |
3490 |
- |
3491 |
- # readline/libedit support |
3492 |
- our_conf+=( |
3493 |
- $(use_with readline readline "${EPREFIX}/usr") |
3494 |
- $(use_with libedit libedit "${EPREFIX}/usr") |
3495 |
- ) |
3496 |
- |
3497 |
- # Session support |
3498 |
- if use session ; then |
3499 |
- our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") ) |
3500 |
- else |
3501 |
- our_conf+=( $(use_enable session session) ) |
3502 |
- fi |
3503 |
- |
3504 |
- # Use pic for shared modules such as apache2's mod_php |
3505 |
- our_conf+=( --with-pic ) |
3506 |
- |
3507 |
- # we use the system copy of pcre |
3508 |
- # --with-pcre-regex affects ext/pcre |
3509 |
- # --with-pcre-dir affects ext/filter and ext/zip |
3510 |
- our_conf+=( |
3511 |
- --with-pcre-regex="${EPREFIX}/usr" |
3512 |
- --with-pcre-dir="${EPREFIX}/usr" |
3513 |
- ) |
3514 |
- |
3515 |
- # Catch CFLAGS problems |
3516 |
- # Fixes bug #14067. |
3517 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
3518 |
- replace-cpu-flags "k6*" "i586" |
3519 |
- |
3520 |
- # Cache the ./configure test results between SAPIs. |
3521 |
- our_conf+=( --cache-file="${T}/config.cache" ) |
3522 |
- |
3523 |
- # Support user-passed configuration parameters |
3524 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
3525 |
- |
3526 |
- # Support the Apache2 extras, they must be set globally for all |
3527 |
- # SAPIs to work correctly, especially for external PHP extensions |
3528 |
- |
3529 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
3530 |
- for one_sapi in $SAPIS ; do |
3531 |
- use "${one_sapi}" || continue |
3532 |
- php_set_ini_dir "${one_sapi}" |
3533 |
- |
3534 |
- # The BUILD_DIR variable is used to determine where to output |
3535 |
- # the files that autotools creates. This was all originally |
3536 |
- # based on the autotools-utils eclass. |
3537 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
3538 |
- cp -a "${S}" "${BUILD_DIR}" || die |
3539 |
- cd "${BUILD_DIR}" || die |
3540 |
- |
3541 |
- local sapi_conf=( |
3542 |
- --with-config-file-path="${PHP_INI_DIR}" |
3543 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
3544 |
- ) |
3545 |
- |
3546 |
- for sapi in $SAPIS ; do |
3547 |
- case "$sapi" in |
3548 |
- cli|cgi|embed|fpm|phpdbg) |
3549 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
3550 |
- sapi_conf+=( "--enable-${sapi}" ) |
3551 |
- else |
3552 |
- sapi_conf+=( "--disable-${sapi}" ) |
3553 |
- fi |
3554 |
- ;; |
3555 |
- |
3556 |
- apache2) |
3557 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
3558 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) |
3559 |
- else |
3560 |
- sapi_conf+=( --without-apxs2 ) |
3561 |
- fi |
3562 |
- ;; |
3563 |
- esac |
3564 |
- done |
3565 |
- |
3566 |
- # Construct the $myeconfargs array by concatenating $our_conf |
3567 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
3568 |
- local myeconfargs=( "${our_conf[@]}" ) |
3569 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
3570 |
- |
3571 |
- pushd "${BUILD_DIR}" > /dev/null || die |
3572 |
- econf "${myeconfargs[@]}" |
3573 |
- popd > /dev/null || die |
3574 |
- done |
3575 |
-} |
3576 |
- |
3577 |
-src_compile() { |
3578 |
- # snmp seems to run during src_compile, too (bug #324739) |
3579 |
- addpredict /usr/share/snmp/mibs/.index |
3580 |
- addpredict /var/lib/net-snmp/mib_indexes |
3581 |
- |
3582 |
- for sapi in ${SAPIS} ; do |
3583 |
- if use "${sapi}"; then |
3584 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
3585 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
3586 |
- emake |
3587 |
- fi |
3588 |
- done |
3589 |
-} |
3590 |
- |
3591 |
-src_install() { |
3592 |
- # see bug #324739 for what happens when we don't have that |
3593 |
- addpredict /usr/share/snmp/mibs/.index |
3594 |
- |
3595 |
- # grab the first SAPI that got built and install common files from there |
3596 |
- local first_sapi="" |
3597 |
- for sapi in $SAPIS ; do |
3598 |
- if use $sapi ; then |
3599 |
- first_sapi=$sapi |
3600 |
- break |
3601 |
- fi |
3602 |
- done |
3603 |
- |
3604 |
- # Makefile forgets to create this before trying to write to it... |
3605 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
3606 |
- |
3607 |
- # Install php environment (without any sapis) |
3608 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
3609 |
- emake INSTALL_ROOT="${D}" \ |
3610 |
- install-build install-headers install-programs |
3611 |
- |
3612 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
3613 |
- |
3614 |
- # Create the directory where we'll put version-specific php scripts |
3615 |
- keepdir "/usr/share/php${PHP_MV}" |
3616 |
- |
3617 |
- local sapi="", file="" |
3618 |
- local sapi_list="" |
3619 |
- |
3620 |
- for sapi in ${SAPIS}; do |
3621 |
- if use "${sapi}" ; then |
3622 |
- einfo "Installing SAPI: ${sapi}" |
3623 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
3624 |
- |
3625 |
- if [[ "${sapi}" == "apache2" ]] ; then |
3626 |
- # We're specifically not using emake install-sapi as libtool |
3627 |
- # may cause unnecessary relink failures (see bug #351266) |
3628 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
3629 |
- newins ".libs/libphp${PHP_MV}$(get_libname)" \ |
3630 |
- "libphp${PHP_MV}$(get_libname)" |
3631 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
3632 |
- else |
3633 |
- # needed each time, php_install_ini would reset it |
3634 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
3635 |
- into "${dest}" |
3636 |
- case "$sapi" in |
3637 |
- cli) |
3638 |
- source="sapi/cli/php" |
3639 |
- ;; |
3640 |
- cgi) |
3641 |
- source="sapi/cgi/php-cgi" |
3642 |
- ;; |
3643 |
- fpm) |
3644 |
- source="sapi/fpm/php-fpm" |
3645 |
- ;; |
3646 |
- embed) |
3647 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
3648 |
- ;; |
3649 |
- phpdbg) |
3650 |
- source="sapi/phpdbg/phpdbg" |
3651 |
- ;; |
3652 |
- *) |
3653 |
- die "unhandled sapi in src_install" |
3654 |
- ;; |
3655 |
- esac |
3656 |
- |
3657 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
3658 |
- dolib.so "${source}" |
3659 |
- else |
3660 |
- dobin "${source}" |
3661 |
- local name="$(basename ${source})" |
3662 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
3663 |
- fi |
3664 |
- fi |
3665 |
- |
3666 |
- php_install_ini "${sapi}" |
3667 |
- |
3668 |
- # construct correct SAPI string for php-config |
3669 |
- # thanks to ferringb for the bash voodoo |
3670 |
- if [[ "${sapi}" == "apache2" ]]; then |
3671 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
3672 |
- else |
3673 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
3674 |
- fi |
3675 |
- fi |
3676 |
- done |
3677 |
- |
3678 |
- # Installing opcache module |
3679 |
- if use opcache ; then |
3680 |
- into "${PHP_DESTDIR#${EPREFIX}}" |
3681 |
- dolib.so "modules/opcache$(get_libname)" |
3682 |
- fi |
3683 |
- |
3684 |
- # Install env.d files |
3685 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
3686 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
3687 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
3688 |
- |
3689 |
- # set php-config variable correctly (bug #278439) |
3690 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
3691 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
3692 |
- |
3693 |
- if use fpm ; then |
3694 |
- if use systemd; then |
3695 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
3696 |
- "php-fpm@${SLOT}.service" |
3697 |
- else |
3698 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
3699 |
- "php-fpm@${SLOT}.service" |
3700 |
- fi |
3701 |
- fi |
3702 |
-} |
3703 |
- |
3704 |
-src_test() { |
3705 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
3706 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
3707 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
3708 |
- ewarn "Test phase requires USE=cli, skipping" |
3709 |
- return |
3710 |
- else |
3711 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
3712 |
- fi |
3713 |
- |
3714 |
- if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then |
3715 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" |
3716 |
- fi |
3717 |
- |
3718 |
- if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then |
3719 |
- export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" |
3720 |
- fi |
3721 |
- |
3722 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
3723 |
- "session.save_path=${T}" \ |
3724 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
3725 |
- "session.save_path=${T}" |
3726 |
- |
3727 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
3728 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
3729 |
- done |
3730 |
- |
3731 |
- local failed="$(find -name '*.out')" |
3732 |
- if [[ ${failed} != "" ]] ; then |
3733 |
- ewarn "The following test cases failed unexpectedly:" |
3734 |
- for name in ${failed}; do |
3735 |
- ewarn " ${name/.out/}" |
3736 |
- done |
3737 |
- else |
3738 |
- einfo "No unexpected test failures, all fine" |
3739 |
- fi |
3740 |
- |
3741 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
3742 |
- local passed="" |
3743 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
3744 |
- [[ -f "${name}.diff" ]] && continue |
3745 |
- passed="${passed} ${name}" |
3746 |
- done |
3747 |
- if [[ ${passed} != "" ]] ; then |
3748 |
- einfo "The following test cases passed unexpectedly:" |
3749 |
- for name in ${passed}; do |
3750 |
- ewarn " ${passed}" |
3751 |
- done |
3752 |
- else |
3753 |
- einfo "None of the known-to-fail tests passed, all fine" |
3754 |
- fi |
3755 |
- fi |
3756 |
-} |
3757 |
- |
3758 |
-pkg_postinst() { |
3759 |
- # Output some general info to the user |
3760 |
- if use apache2 ; then |
3761 |
- elog |
3762 |
- elog "To enable PHP in apache, you will need to add \"-D PHP\" to" |
3763 |
- elog "your apache2 command. OpenRC users can append that string to" |
3764 |
- elog "APACHE2_OPTS in /etc/conf.d/apache2." |
3765 |
- elog |
3766 |
- elog "The apache module configuration file 70_mod_php.conf is" |
3767 |
- elog "provided (and maintained) by eselect-php." |
3768 |
- elog |
3769 |
- fi |
3770 |
- |
3771 |
- # Create the symlinks for php |
3772 |
- for m in ${SAPIS}; do |
3773 |
- [[ ${m} == 'embed' ]] && continue; |
3774 |
- if use $m ; then |
3775 |
- local ci=$(eselect php show $m) |
3776 |
- if [[ -z $ci ]]; then |
3777 |
- eselect php set $m php${SLOT} || die |
3778 |
- einfo "Switched ${m} to use php:${SLOT}" |
3779 |
- einfo |
3780 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
3781 |
- elog "To switch $m to use php:${SLOT}, run" |
3782 |
- elog " eselect php set $m php${SLOT}" |
3783 |
- elog |
3784 |
- fi |
3785 |
- fi |
3786 |
- done |
3787 |
- |
3788 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
3789 |
- # example, if the user has the cgi SAPI enabled, then he has an |
3790 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
3791 |
- # USE="-cgi", that symlink will break. This call to eselect is |
3792 |
- # supposed to remove that dead link per bug 572436. |
3793 |
- eselect php cleanup || die |
3794 |
- |
3795 |
- if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then |
3796 |
- elog "To build extensions for this version of PHP, you will need to" |
3797 |
- elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." |
3798 |
- elog |
3799 |
- fi |
3800 |
- |
3801 |
- # Warn about the removal of PHP_INI_VERSION if the user has it set. |
3802 |
- if [[ -n "${PHP_INI_VERSION}" ]]; then |
3803 |
- ewarn 'The PHP_INI_VERSION variable has been phased out. You may' |
3804 |
- ewarn 'remove it from your configuration at your convenience. See' |
3805 |
- ewarn |
3806 |
- ewarn ' https://bugs.gentoo.org/611214' |
3807 |
- ewarn |
3808 |
- ewarn 'for more information.' |
3809 |
- fi |
3810 |
- |
3811 |
- elog "For details on how version slotting works, please see" |
3812 |
- elog "the wiki:" |
3813 |
- elog |
3814 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
3815 |
- elog |
3816 |
-} |
3817 |
- |
3818 |
-pkg_postrm() { |
3819 |
- # This serves two purposes. First, if we have just removed the last |
3820 |
- # installed version of PHP, then this will remove any dead symlinks |
3821 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
3822 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
3823 |
- # his existing symlinks to point to the new 7.0 installation. The |
3824 |
- # latter is bug 432962. |
3825 |
- # |
3826 |
- # Note: the eselect-php package may not be installed at this point, |
3827 |
- # so we can't die() if this command fails. |
3828 |
- eselect php cleanup |
3829 |
-} |
3830 |
|
3831 |
diff --git a/dev-lang/php/php-7.1.15.ebuild b/dev-lang/php/php-7.1.15.ebuild |
3832 |
deleted file mode 100644 |
3833 |
index d5b4ffdd691..00000000000 |
3834 |
--- a/dev-lang/php/php-7.1.15.ebuild |
3835 |
+++ /dev/null |
3836 |
@@ -1,727 +0,0 @@ |
3837 |
-# Copyright 1999-2018 Gentoo Foundation |
3838 |
-# Distributed under the terms of the GNU General Public License v2 |
3839 |
- |
3840 |
-EAPI=6 |
3841 |
- |
3842 |
-inherit flag-o-matic versionator systemd |
3843 |
- |
3844 |
-DESCRIPTION="The PHP language runtime engine" |
3845 |
-HOMEPAGE="https://secure.php.net/" |
3846 |
-SRC_URI="https://secure.php.net/distributions/${P}.tar.xz" |
3847 |
- |
3848 |
-LICENSE="PHP-3.01 |
3849 |
- BSD |
3850 |
- Zend-2.0 |
3851 |
- bcmath? ( LGPL-2.1+ ) |
3852 |
- fpm? ( BSD-2 ) |
3853 |
- gd? ( gd ) |
3854 |
- unicode? ( BSD-2 LGPL-2.1 )" |
3855 |
- |
3856 |
-SLOT="$(get_version_component_range 1-2)" |
3857 |
-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" |
3858 |
- |
3859 |
-# We can build the following SAPIs in the given order |
3860 |
-SAPIS="embed cli cgi fpm apache2 phpdbg" |
3861 |
- |
3862 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
3863 |
-IUSE="${IUSE} |
3864 |
- ${SAPIS/cli/+cli} |
3865 |
- threads" |
3866 |
- |
3867 |
-IUSE="${IUSE} acl bcmath berkdb bzip2 calendar cdb cjk |
3868 |
- coverage crypt +ctype curl debug |
3869 |
- enchant exif +fileinfo +filter firebird |
3870 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
3871 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl |
3872 |
- mhash mssql mysql mysqli nls |
3873 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
3874 |
- readline recode selinux +session session-mm sharedmem |
3875 |
- +simplexml snmp soap sockets spell sqlite ssl |
3876 |
- sysvipc systemd test tidy +tokenizer truetype unicode wddx webp |
3877 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
3878 |
- |
3879 |
-# The supported (that is, autodetected) versions of BDB are listed in |
3880 |
-# the ./configure script. Other versions *work*, but we need to stick to |
3881 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
3882 |
-COMMON_DEPEND=" |
3883 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
3884 |
- >=dev-libs/libpcre-8.32[unicode] |
3885 |
- fpm? ( acl? ( sys-apps/acl ) ) |
3886 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
3887 |
- <www-servers/apache-2.4[threads=] ) ) |
3888 |
- berkdb? ( || ( sys-libs/db:5.3 |
3889 |
- sys-libs/db:5.1 |
3890 |
- sys-libs/db:4.8 |
3891 |
- sys-libs/db:4.7 |
3892 |
- sys-libs/db:4.6 |
3893 |
- sys-libs/db:4.5 ) ) |
3894 |
- bzip2? ( app-arch/bzip2:0= ) |
3895 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
3896 |
- coverage? ( dev-util/lcov ) |
3897 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
3898 |
- curl? ( >=net-misc/curl-7.10.5 ) |
3899 |
- enchant? ( app-text/enchant ) |
3900 |
- firebird? ( dev-db/firebird ) |
3901 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
3902 |
- gdbm? ( >=sys-libs/gdbm-1.8.0:0= ) |
3903 |
- gmp? ( dev-libs/gmp:0= ) |
3904 |
- iconv? ( virtual/libiconv ) |
3905 |
- imap? ( virtual/imap-c-client[kerberos=,ssl=] ) |
3906 |
- intl? ( dev-libs/icu:= ) |
3907 |
- iodbc? ( dev-db/libiodbc ) |
3908 |
- kerberos? ( virtual/krb5 ) |
3909 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
3910 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
3911 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
3912 |
- mssql? ( dev-db/freetds[mssql] ) |
3913 |
- nls? ( sys-devel/gettext ) |
3914 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
3915 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
3916 |
- postgres? ( dev-db/postgresql:* ) |
3917 |
- qdbm? ( dev-db/qdbm ) |
3918 |
- readline? ( sys-libs/readline:0= ) |
3919 |
- recode? ( app-text/recode ) |
3920 |
- session-mm? ( dev-libs/mm ) |
3921 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
3922 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
3923 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
3924 |
- spell? ( >=app-text/aspell-0.50 ) |
3925 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
3926 |
- ssl? ( |
3927 |
- !libressl? ( dev-libs/openssl:0= ) |
3928 |
- libressl? ( dev-libs/libressl:0= ) |
3929 |
- ) |
3930 |
- tidy? ( || ( app-text/tidy-html5 app-text/htmltidy ) ) |
3931 |
- truetype? ( =media-libs/freetype-2* ) |
3932 |
- unicode? ( dev-libs/oniguruma:= ) |
3933 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
3934 |
- webp? ( media-libs/libwebp:0= ) |
3935 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
3936 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
3937 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
3938 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
3939 |
- xpm? ( x11-libs/libXpm ) |
3940 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
3941 |
- zip? ( sys-libs/zlib:0= ) |
3942 |
- zlib? ( sys-libs/zlib:0= ) |
3943 |
-" |
3944 |
- |
3945 |
-RDEPEND="${COMMON_DEPEND} |
3946 |
- virtual/mta |
3947 |
- fpm? ( |
3948 |
- selinux? ( sec-policy/selinux-phpfpm ) |
3949 |
- systemd? ( sys-apps/systemd ) )" |
3950 |
- |
3951 |
-# Bison isn't actually needed when building from a release tarball |
3952 |
-# However, the configure script will warn if it's absent or if you |
3953 |
-# have an incompatible version installed. See bug 593278. |
3954 |
-DEPEND="${COMMON_DEPEND} |
3955 |
- app-arch/xz-utils |
3956 |
- >=sys-devel/bison-3.0.1" |
3957 |
- |
3958 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
3959 |
-REQUIRED_USE=" |
3960 |
- || ( cli cgi fpm apache2 embed phpdbg ) |
3961 |
- cli? ( ^^ ( readline libedit ) ) |
3962 |
- truetype? ( gd ) |
3963 |
- webp? ( gd ) |
3964 |
- cjk? ( gd ) |
3965 |
- exif? ( gd ) |
3966 |
- xpm? ( gd ) |
3967 |
- gd? ( zlib ) |
3968 |
- simplexml? ( xml ) |
3969 |
- soap? ( xml ) |
3970 |
- wddx? ( xml ) |
3971 |
- xmlrpc? ( || ( xml iconv ) ) |
3972 |
- xmlreader? ( xml ) |
3973 |
- xslt? ( xml ) |
3974 |
- ldap-sasl? ( ldap ) |
3975 |
- mhash? ( hash ) |
3976 |
- phar? ( hash ) |
3977 |
- qdbm? ( !gdbm ) |
3978 |
- readline? ( !libedit ) |
3979 |
- recode? ( !imap !mysqli !mysql ) |
3980 |
- session-mm? ( session !threads ) |
3981 |
- mysql? ( || ( mysqli pdo ) ) |
3982 |
-" |
3983 |
- |
3984 |
-PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" ) |
3985 |
- |
3986 |
-PHP_MV="$(get_major_version)" |
3987 |
- |
3988 |
-php_install_ini() { |
3989 |
- local phpsapi="${1}" |
3990 |
- |
3991 |
- # work out where we are installing the ini file |
3992 |
- php_set_ini_dir "${phpsapi}" |
3993 |
- |
3994 |
- # Always install the production INI file, bug 611214. |
3995 |
- local phpinisrc="php.ini-production-${phpsapi}" |
3996 |
- cp php.ini-production "${phpinisrc}" || die |
3997 |
- |
3998 |
- # default to /tmp for save_path, bug #282768 |
3999 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
4000 |
- |
4001 |
- # Set the extension dir |
4002 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" \ |
4003 |
- -i "${phpinisrc}" || die |
4004 |
- |
4005 |
- # Set the include path to point to where we want to find PEAR packages |
4006 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
4007 |
- |
4008 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
4009 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
4010 |
- newins "${phpinisrc}" php.ini |
4011 |
- |
4012 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
4013 |
- elog |
4014 |
- |
4015 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
4016 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
4017 |
- |
4018 |
- if use opcache; then |
4019 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
4020 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
4021 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
4022 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \ |
4023 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
4024 |
- fi |
4025 |
- |
4026 |
- # SAPI-specific handling |
4027 |
- if [[ "${sapi}" == "fpm" ]] ; then |
4028 |
- einfo "Installing FPM config files php-fpm.conf and www.conf" |
4029 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
4030 |
- doins sapi/fpm/php-fpm.conf |
4031 |
- insinto "${PHP_INI_DIR#${EPREFIX}}/fpm.d" |
4032 |
- doins sapi/fpm/www.conf |
4033 |
- fi |
4034 |
- |
4035 |
- dodoc php.ini-{development,production} |
4036 |
-} |
4037 |
- |
4038 |
-php_set_ini_dir() { |
4039 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
4040 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
4041 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
4042 |
-} |
4043 |
- |
4044 |
-src_prepare() { |
4045 |
- default |
4046 |
- |
4047 |
- # In php-7.x, the FPM pool configuration files have been split off |
4048 |
- # of the main config. By default the pool config files go in |
4049 |
- # e.g. /etc/php-fpm.d, which isn't slotted. So here we move the |
4050 |
- # include directory to a subdirectory "fpm.d" of $PHP_INI_DIR. Later |
4051 |
- # we'll install the pool configuration file "www.conf" there. |
4052 |
- php_set_ini_dir fpm |
4053 |
- sed -i "s~^include=.*$~include=${PHP_INI_DIR}/fpm.d/*.conf~" \ |
4054 |
- sapi/fpm/php-fpm.conf.in \ |
4055 |
- || die 'failed to move the include directory in php-fpm.conf' |
4056 |
-} |
4057 |
- |
4058 |
-src_configure() { |
4059 |
- addpredict /usr/share/snmp/mibs/.index |
4060 |
- addpredict /var/lib/net-snmp/mib_indexes |
4061 |
- |
4062 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
4063 |
- |
4064 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
4065 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
4066 |
- local our_conf=( |
4067 |
- --prefix="${PHP_DESTDIR}" |
4068 |
- --mandir="${PHP_DESTDIR}/man" |
4069 |
- --infodir="${PHP_DESTDIR}/info" |
4070 |
- --libdir="${PHP_DESTDIR}/lib" |
4071 |
- --with-libdir="$(get_libdir)" |
4072 |
- --localstatedir="${EPREFIX}/var" |
4073 |
- --without-pear |
4074 |
- $(use_enable threads maintainer-zts) |
4075 |
- ) |
4076 |
- |
4077 |
- our_conf+=( |
4078 |
- $(use_enable bcmath bcmath) |
4079 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
4080 |
- $(use_enable calendar calendar) |
4081 |
- $(use_enable coverage gcov) |
4082 |
- $(use_enable ctype ctype) |
4083 |
- $(use_with curl curl "${EPREFIX}/usr") |
4084 |
- $(use_enable xml dom) |
4085 |
- $(use_with enchant enchant "${EPREFIX}/usr") |
4086 |
- $(use_enable exif exif) |
4087 |
- $(use_enable fileinfo fileinfo) |
4088 |
- $(use_enable filter filter) |
4089 |
- $(use_enable ftp ftp) |
4090 |
- $(use_with nls gettext "${EPREFIX}/usr") |
4091 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
4092 |
- $(use_enable hash hash) |
4093 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
4094 |
- $(use_with iconv iconv \ |
4095 |
- $(use elibc_glibc || use elibc_musl || use elibc_FreeBSD || echo "${EPREFIX}/usr")) |
4096 |
- $(use_enable intl intl) |
4097 |
- $(use_enable ipv6 ipv6) |
4098 |
- $(use_enable json json) |
4099 |
- $(use_with kerberos kerberos "${EPREFIX}/usr") |
4100 |
- $(use_enable xml libxml) |
4101 |
- $(use_with xml libxml-dir "${EPREFIX}/usr") |
4102 |
- $(use_enable unicode mbstring) |
4103 |
- $(use_with crypt mcrypt "${EPREFIX}/usr") |
4104 |
- $(use_with unicode onig "${EPREFIX}/usr") |
4105 |
- $(use_with ssl openssl "${EPREFIX}/usr") |
4106 |
- $(use_with ssl openssl-dir "${EPREFIX}/usr") |
4107 |
- $(use_enable pcntl pcntl) |
4108 |
- $(use_enable phar phar) |
4109 |
- $(use_enable pdo pdo) |
4110 |
- $(use_enable opcache opcache) |
4111 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
4112 |
- $(use_enable posix posix) |
4113 |
- $(use_with spell pspell "${EPREFIX}/usr") |
4114 |
- $(use_with recode recode "${EPREFIX}/usr") |
4115 |
- $(use_enable simplexml simplexml) |
4116 |
- $(use_enable sharedmem shmop) |
4117 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
4118 |
- $(use_enable soap soap) |
4119 |
- $(use_enable sockets sockets) |
4120 |
- $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
4121 |
- $(use_enable sysvipc sysvmsg) |
4122 |
- $(use_enable sysvipc sysvsem) |
4123 |
- $(use_enable sysvipc sysvshm) |
4124 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
4125 |
- $(use_enable tokenizer tokenizer) |
4126 |
- $(use_enable wddx wddx) |
4127 |
- $(use_enable xml xml) |
4128 |
- $(use_enable xmlreader xmlreader) |
4129 |
- $(use_enable xmlwriter xmlwriter) |
4130 |
- $(use_with xmlrpc xmlrpc) |
4131 |
- $(use_with xslt xsl "${EPREFIX}/usr") |
4132 |
- $(use_enable zip zip) |
4133 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
4134 |
- $(use_enable debug debug) |
4135 |
- ) |
4136 |
- |
4137 |
- # DBA support |
4138 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
4139 |
- || use qdbm ; then |
4140 |
- our_conf+=( "--enable-dba${shared}" ) |
4141 |
- fi |
4142 |
- |
4143 |
- # DBA drivers support |
4144 |
- our_conf+=( |
4145 |
- $(use_with cdb cdb) |
4146 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
4147 |
- $(use_enable flatfile flatfile) |
4148 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
4149 |
- $(use_enable inifile inifile) |
4150 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
4151 |
- ) |
4152 |
- |
4153 |
- # Support for the GD graphics library |
4154 |
- our_conf+=( |
4155 |
- $(use_with truetype freetype-dir "${EPREFIX}/usr") |
4156 |
- $(use_enable cjk gd-jis-conv) |
4157 |
- $(use_with gd jpeg-dir "${EPREFIX}/usr") |
4158 |
- $(use_with gd png-dir "${EPREFIX}/usr") |
4159 |
- $(use_with xpm xpm-dir "${EPREFIX}/usr") |
4160 |
- ) |
4161 |
- if use webp; then |
4162 |
- our_conf+=( --with-webp-dir="${EPREFIX}/usr" ) |
4163 |
- fi |
4164 |
- # enable gd last, so configure can pick up the previous settings |
4165 |
- our_conf+=( $(use_with gd gd) ) |
4166 |
- |
4167 |
- # IMAP support |
4168 |
- if use imap ; then |
4169 |
- our_conf+=( |
4170 |
- $(use_with imap imap "${EPREFIX}/usr") |
4171 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
4172 |
- ) |
4173 |
- fi |
4174 |
- |
4175 |
- # Interbase/firebird support |
4176 |
- our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
4177 |
- |
4178 |
- # LDAP support |
4179 |
- if use ldap ; then |
4180 |
- our_conf+=( |
4181 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
4182 |
- $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
4183 |
- ) |
4184 |
- fi |
4185 |
- |
4186 |
- # MySQL support |
4187 |
- local mysqllib="mysqlnd" |
4188 |
- local mysqlilib="mysqlnd" |
4189 |
- |
4190 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
4191 |
- |
4192 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
4193 |
- if use mysql || use mysqli ; then |
4194 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
4195 |
- fi |
4196 |
- |
4197 |
- # ODBC support |
4198 |
- our_conf+=( |
4199 |
- $(use_with odbc unixODBC "${EPREFIX}/usr") |
4200 |
- $(use_with iodbc iodbc "${EPREFIX}/usr") |
4201 |
- ) |
4202 |
- |
4203 |
- # Oracle support |
4204 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
4205 |
- |
4206 |
- # PDO support |
4207 |
- if use pdo ; then |
4208 |
- our_conf+=( |
4209 |
- $(use_with mssql pdo-dblib "${EPREFIX}/usr") |
4210 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
4211 |
- $(use_with postgres pdo-pgsql) |
4212 |
- $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
4213 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
4214 |
- $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
4215 |
- $(use_with oci8-instant-client pdo-oci) |
4216 |
- ) |
4217 |
- fi |
4218 |
- |
4219 |
- # readline/libedit support |
4220 |
- our_conf+=( |
4221 |
- $(use_with readline readline "${EPREFIX}/usr") |
4222 |
- $(use_with libedit libedit "${EPREFIX}/usr") |
4223 |
- ) |
4224 |
- |
4225 |
- # Session support |
4226 |
- if use session ; then |
4227 |
- our_conf+=( $(use_with session-mm mm "${EPREFIX}/usr") ) |
4228 |
- else |
4229 |
- our_conf+=( $(use_enable session session) ) |
4230 |
- fi |
4231 |
- |
4232 |
- # Use pic for shared modules such as apache2's mod_php |
4233 |
- our_conf+=( --with-pic ) |
4234 |
- |
4235 |
- # we use the system copy of pcre |
4236 |
- # --with-pcre-regex affects ext/pcre |
4237 |
- # --with-pcre-dir affects ext/filter and ext/zip |
4238 |
- our_conf+=( |
4239 |
- --with-pcre-regex="${EPREFIX}/usr" |
4240 |
- --with-pcre-dir="${EPREFIX}/usr" |
4241 |
- ) |
4242 |
- |
4243 |
- # Catch CFLAGS problems |
4244 |
- # Fixes bug #14067. |
4245 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
4246 |
- replace-cpu-flags "k6*" "i586" |
4247 |
- |
4248 |
- # Cache the ./configure test results between SAPIs. |
4249 |
- our_conf+=( --cache-file="${T}/config.cache" ) |
4250 |
- |
4251 |
- # Support user-passed configuration parameters |
4252 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
4253 |
- |
4254 |
- # Support the Apache2 extras, they must be set globally for all |
4255 |
- # SAPIs to work correctly, especially for external PHP extensions |
4256 |
- |
4257 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
4258 |
- for one_sapi in $SAPIS ; do |
4259 |
- use "${one_sapi}" || continue |
4260 |
- php_set_ini_dir "${one_sapi}" |
4261 |
- |
4262 |
- # The BUILD_DIR variable is used to determine where to output |
4263 |
- # the files that autotools creates. This was all originally |
4264 |
- # based on the autotools-utils eclass. |
4265 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
4266 |
- cp -a "${S}" "${BUILD_DIR}" || die |
4267 |
- cd "${BUILD_DIR}" || die |
4268 |
- |
4269 |
- local sapi_conf=( |
4270 |
- --with-config-file-path="${PHP_INI_DIR}" |
4271 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
4272 |
- ) |
4273 |
- |
4274 |
- for sapi in $SAPIS ; do |
4275 |
- case "$sapi" in |
4276 |
- cli|cgi|embed|fpm|phpdbg) |
4277 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
4278 |
- sapi_conf+=( "--enable-${sapi}" ) |
4279 |
- if [[ "fpm" == "${sapi}" ]] ; then |
4280 |
- sapi_conf+=( |
4281 |
- $(use_with acl fpm-acl) |
4282 |
- $(use_with systemd fpm-systemd) |
4283 |
- ) |
4284 |
- fi |
4285 |
- else |
4286 |
- sapi_conf+=( "--disable-${sapi}" ) |
4287 |
- fi |
4288 |
- ;; |
4289 |
- |
4290 |
- apache2) |
4291 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
4292 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" ) |
4293 |
- else |
4294 |
- sapi_conf+=( --without-apxs2 ) |
4295 |
- fi |
4296 |
- ;; |
4297 |
- esac |
4298 |
- done |
4299 |
- |
4300 |
- # Construct the $myeconfargs array by concatenating $our_conf |
4301 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
4302 |
- local myeconfargs=( "${our_conf[@]}" ) |
4303 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
4304 |
- |
4305 |
- pushd "${BUILD_DIR}" > /dev/null || die |
4306 |
- econf "${myeconfargs[@]}" |
4307 |
- popd > /dev/null || die |
4308 |
- done |
4309 |
-} |
4310 |
- |
4311 |
-src_compile() { |
4312 |
- # snmp seems to run during src_compile, too (bug #324739) |
4313 |
- addpredict /usr/share/snmp/mibs/.index |
4314 |
- addpredict /var/lib/net-snmp/mib_indexes |
4315 |
- |
4316 |
- for sapi in ${SAPIS} ; do |
4317 |
- if use "${sapi}"; then |
4318 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
4319 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
4320 |
- emake |
4321 |
- fi |
4322 |
- done |
4323 |
-} |
4324 |
- |
4325 |
-src_install() { |
4326 |
- # see bug #324739 for what happens when we don't have that |
4327 |
- addpredict /usr/share/snmp/mibs/.index |
4328 |
- |
4329 |
- # grab the first SAPI that got built and install common files from there |
4330 |
- local first_sapi="" |
4331 |
- for sapi in $SAPIS ; do |
4332 |
- if use $sapi ; then |
4333 |
- first_sapi=$sapi |
4334 |
- break |
4335 |
- fi |
4336 |
- done |
4337 |
- |
4338 |
- # Makefile forgets to create this before trying to write to it... |
4339 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
4340 |
- |
4341 |
- # Install php environment (without any sapis) |
4342 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
4343 |
- emake INSTALL_ROOT="${D}" \ |
4344 |
- install-build install-headers install-programs |
4345 |
- |
4346 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
4347 |
- |
4348 |
- # Create the directory where we'll put version-specific php scripts |
4349 |
- keepdir "/usr/share/php${PHP_MV}" |
4350 |
- |
4351 |
- local sapi="", file="" |
4352 |
- local sapi_list="" |
4353 |
- |
4354 |
- for sapi in ${SAPIS}; do |
4355 |
- if use "${sapi}" ; then |
4356 |
- einfo "Installing SAPI: ${sapi}" |
4357 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
4358 |
- |
4359 |
- if [[ "${sapi}" == "apache2" ]] ; then |
4360 |
- # We're specifically not using emake install-sapi as libtool |
4361 |
- # may cause unnecessary relink failures (see bug #351266) |
4362 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
4363 |
- newins ".libs/libphp${PHP_MV}$(get_libname)" \ |
4364 |
- "libphp${PHP_MV}$(get_libname)" |
4365 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
4366 |
- else |
4367 |
- # needed each time, php_install_ini would reset it |
4368 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
4369 |
- into "${dest}" |
4370 |
- case "$sapi" in |
4371 |
- cli) |
4372 |
- source="sapi/cli/php" |
4373 |
- ;; |
4374 |
- cgi) |
4375 |
- source="sapi/cgi/php-cgi" |
4376 |
- ;; |
4377 |
- fpm) |
4378 |
- source="sapi/fpm/php-fpm" |
4379 |
- ;; |
4380 |
- embed) |
4381 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
4382 |
- ;; |
4383 |
- phpdbg) |
4384 |
- source="sapi/phpdbg/phpdbg" |
4385 |
- ;; |
4386 |
- *) |
4387 |
- die "unhandled sapi in src_install" |
4388 |
- ;; |
4389 |
- esac |
4390 |
- |
4391 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
4392 |
- dolib.so "${source}" |
4393 |
- else |
4394 |
- dobin "${source}" |
4395 |
- local name="$(basename ${source})" |
4396 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
4397 |
- fi |
4398 |
- fi |
4399 |
- |
4400 |
- php_install_ini "${sapi}" |
4401 |
- |
4402 |
- # construct correct SAPI string for php-config |
4403 |
- # thanks to ferringb for the bash voodoo |
4404 |
- if [[ "${sapi}" == "apache2" ]]; then |
4405 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
4406 |
- else |
4407 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
4408 |
- fi |
4409 |
- fi |
4410 |
- done |
4411 |
- |
4412 |
- # Installing opcache module |
4413 |
- if use opcache ; then |
4414 |
- into "${PHP_DESTDIR#${EPREFIX}}" |
4415 |
- dolib.so "modules/opcache$(get_libname)" |
4416 |
- fi |
4417 |
- |
4418 |
- # Install env.d files |
4419 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
4420 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
4421 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
4422 |
- |
4423 |
- # set php-config variable correctly (bug #278439) |
4424 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
4425 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
4426 |
- |
4427 |
- if use fpm ; then |
4428 |
- if use systemd; then |
4429 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
4430 |
- "php-fpm@${SLOT}.service" |
4431 |
- else |
4432 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
4433 |
- "php-fpm@${SLOT}.service" |
4434 |
- fi |
4435 |
- fi |
4436 |
-} |
4437 |
- |
4438 |
-src_test() { |
4439 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
4440 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
4441 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
4442 |
- ewarn "Test phase requires USE=cli, skipping" |
4443 |
- return |
4444 |
- else |
4445 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
4446 |
- fi |
4447 |
- |
4448 |
- if [[ -x "${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" ]] ; then |
4449 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis-build/cgi/sapi/cgi/php-cgi" |
4450 |
- fi |
4451 |
- |
4452 |
- if [[ -x "${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" ]] ; then |
4453 |
- export TEST_PHPDBG_EXECUTABLE="${WORKDIR}/sapis-build/phpdbg/sapi/phpdbg/phpdbg" |
4454 |
- fi |
4455 |
- |
4456 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
4457 |
- "session.save_path=${T}" \ |
4458 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
4459 |
- "session.save_path=${T}" |
4460 |
- |
4461 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
4462 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
4463 |
- done |
4464 |
- |
4465 |
- local failed="$(find -name '*.out')" |
4466 |
- if [[ ${failed} != "" ]] ; then |
4467 |
- ewarn "The following test cases failed unexpectedly:" |
4468 |
- for name in ${failed}; do |
4469 |
- ewarn " ${name/.out/}" |
4470 |
- done |
4471 |
- else |
4472 |
- einfo "No unexpected test failures, all fine" |
4473 |
- fi |
4474 |
- |
4475 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
4476 |
- local passed="" |
4477 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
4478 |
- [[ -f "${name}.diff" ]] && continue |
4479 |
- passed="${passed} ${name}" |
4480 |
- done |
4481 |
- if [[ ${passed} != "" ]] ; then |
4482 |
- einfo "The following test cases passed unexpectedly:" |
4483 |
- for name in ${passed}; do |
4484 |
- ewarn " ${passed}" |
4485 |
- done |
4486 |
- else |
4487 |
- einfo "None of the known-to-fail tests passed, all fine" |
4488 |
- fi |
4489 |
- fi |
4490 |
-} |
4491 |
- |
4492 |
-pkg_postinst() { |
4493 |
- # Output some general info to the user |
4494 |
- if use apache2 ; then |
4495 |
- elog |
4496 |
- elog "To enable PHP in apache, you will need to add \"-D PHP\" to" |
4497 |
- elog "your apache2 command. OpenRC users can append that string to" |
4498 |
- elog "APACHE2_OPTS in /etc/conf.d/apache2." |
4499 |
- elog |
4500 |
- elog "The apache module configuration file 70_mod_php.conf is" |
4501 |
- elog "provided (and maintained) by eselect-php." |
4502 |
- elog |
4503 |
- fi |
4504 |
- |
4505 |
- # Create the symlinks for php |
4506 |
- for m in ${SAPIS}; do |
4507 |
- [[ ${m} == 'embed' ]] && continue; |
4508 |
- if use $m ; then |
4509 |
- local ci=$(eselect php show $m) |
4510 |
- if [[ -z $ci ]]; then |
4511 |
- eselect php set $m php${SLOT} || die |
4512 |
- einfo "Switched ${m} to use php:${SLOT}" |
4513 |
- einfo |
4514 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
4515 |
- elog "To switch $m to use php:${SLOT}, run" |
4516 |
- elog " eselect php set $m php${SLOT}" |
4517 |
- elog |
4518 |
- fi |
4519 |
- fi |
4520 |
- done |
4521 |
- |
4522 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
4523 |
- # example, if the user has the cgi SAPI enabled, then he has an |
4524 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
4525 |
- # USE="-cgi", that symlink will break. This call to eselect is |
4526 |
- # supposed to remove that dead link per bug 572436. |
4527 |
- eselect php cleanup || die |
4528 |
- |
4529 |
- if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then |
4530 |
- elog "To build extensions for this version of PHP, you will need to" |
4531 |
- elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable." |
4532 |
- elog |
4533 |
- fi |
4534 |
- |
4535 |
- # Warn about the removal of PHP_INI_VERSION if the user has it set. |
4536 |
- if [[ -n "${PHP_INI_VERSION}" ]]; then |
4537 |
- ewarn 'The PHP_INI_VERSION variable has been phased out. You may' |
4538 |
- ewarn 'remove it from your configuration at your convenience. See' |
4539 |
- ewarn |
4540 |
- ewarn ' https://bugs.gentoo.org/611214' |
4541 |
- ewarn |
4542 |
- ewarn 'for more information.' |
4543 |
- fi |
4544 |
- |
4545 |
- elog "For details on how version slotting works, please see" |
4546 |
- elog "the wiki:" |
4547 |
- elog |
4548 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
4549 |
- elog |
4550 |
-} |
4551 |
- |
4552 |
-pkg_postrm() { |
4553 |
- # This serves two purposes. First, if we have just removed the last |
4554 |
- # installed version of PHP, then this will remove any dead symlinks |
4555 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
4556 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
4557 |
- # his existing symlinks to point to the new 7.0 installation. The |
4558 |
- # latter is bug 432962. |
4559 |
- # |
4560 |
- # Note: the eselect-php package may not be installed at this point, |
4561 |
- # so we can't die() if this command fails. |
4562 |
- eselect php cleanup |
4563 |
-} |