1 |
commit: 94e4793bd629845d3fb829defc4e276aae5b210d |
2 |
Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jul 9 14:17:50 2016 +0000 |
4 |
Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jul 9 14:18:51 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=94e4793b |
7 |
|
8 |
dev-lang/php: remove old versions with security issues. |
9 |
|
10 |
Gentoo-Bug: 578734 |
11 |
Gentoo-Bug: 581834 |
12 |
Gentoo-Bug: 584204 |
13 |
Gentoo-Bug: 587246 |
14 |
|
15 |
Package-Manager: portage-2.2.28 |
16 |
|
17 |
dev-lang/php/Manifest | 8 - |
18 |
dev-lang/php/php-5.5.33.ebuild | 784 --------------------------------------- |
19 |
dev-lang/php/php-5.5.34.ebuild | 784 --------------------------------------- |
20 |
dev-lang/php/php-5.5.35.ebuild | 784 --------------------------------------- |
21 |
dev-lang/php/php-5.5.36.ebuild | 784 --------------------------------------- |
22 |
dev-lang/php/php-5.6.19.ebuild | 807 ----------------------------------------- |
23 |
dev-lang/php/php-5.6.20.ebuild | 807 ----------------------------------------- |
24 |
dev-lang/php/php-5.6.21.ebuild | 807 ----------------------------------------- |
25 |
dev-lang/php/php-5.6.22.ebuild | 807 ----------------------------------------- |
26 |
9 files changed, 6372 deletions(-) |
27 |
|
28 |
diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest |
29 |
index 343ad13..4d3d129 100644 |
30 |
--- a/dev-lang/php/Manifest |
31 |
+++ b/dev-lang/php/Manifest |
32 |
@@ -1,11 +1,3 @@ |
33 |
-DIST php-5.5.33.tar.bz2 13686486 SHA256 c490b1ed4df596b48eb68f630d89ca512945e2650840e7dace1119cc7e600aa9 SHA512 a0ac57adcc4b0caec153265a8d1ded8d4d0f71b44f08158feb0add9c8fdd36826767882e85dd03399cf146800eddcb6b6cc1b21051d4fc4371e3f61b1169132b WHIRLPOOL 373c61677adb89506cc4621d1c7a0732f6454a8679a797807631f2286188bb990dfcaf34b4108edf7b1819424100fa0d7060f0f792a65dc5f1c130cfa00e6b45 |
34 |
-DIST php-5.5.34.tar.bz2 13686681 SHA256 af88884416a92619de842ad0fd23f7f7e8140efb0b9194f98a38a78781e5851c SHA512 c4269f79f5acaac64e9d2e20feef4bbd5aa7a84e69445dee64bf068197d611aa8ceb3697ae6461d8c96068be7839f22eeaff61f201f6e7a8749d284eaa68c0f8 WHIRLPOOL f4771f614176242a9a3e27185c98822493ca1b1982b5b11b3ee53d952534c69a73e0625b589723cc153da0978b27a8e55c7f9056b81b7a282dc385d22f4fdf02 |
35 |
-DIST php-5.5.35.tar.bz2 13690152 SHA256 2d648dd648e820fd64693ce72f9bf07064d147220e594e39fb9f6310238258d7 SHA512 cfa62f83cd79b678c55ffdb1325906962bb7dae23fdbe963d57c3b24d13223229448f4c45727df1ab042bbd2db85804051c66993c28c68c0c873481cfe7e6834 WHIRLPOOL e7b765b6d99e7f9c0e18cae64577d0e7e7eb136debf565f49ab02a962046437064f810d1a407546e2f83d69cfb3104244424ae5a34bc83c3778aaff95984a9f7 |
36 |
-DIST php-5.5.36.tar.bz2 13686345 SHA256 2484edfaa3de606d74f927b55c5206f51b1ae24ea8e428aa9fc15474c7bb71bb SHA512 5521ef8bec1720e3df49f5b002c93726d1b52a7b551acf414e32dfd8ca88f8d661b9f011408d7f9f451fb29b06385365d2975bb14ed6d3c10cdc5546543af485 WHIRLPOOL 687818ee021cb473a92ff7c5b67c6b110360227aaecbb6832f0f8383d0a4878f038d45c49518aa38e2b99d96e2eaa6e5de7f535c1fcce05f41024ca7423e2783 |
37 |
DIST php-5.5.37.tar.bz2 13699851 SHA256 d2380ebe46caf17f2c4cd055867d00a82e6702dc5f62dc29ce864a5742905d88 SHA512 d2da921f3efd858e1cb8004873e377ca9c5821d5269d5b8e7c9be830b183f4d18f737b14653f65a43c0957bdca994e09a476d77e3a29a11e357abc24618c4c0f WHIRLPOOL 8db12b1d090bc1bfb3f5b20c661ba05588b8f988484d1887a959f943dd6f1756cb62bac811c809af516e6c3582b64388443546a3b4a17f0527a69fcbafc0452c |
38 |
-DIST php-5.6.19.tar.bz2 14100438 SHA256 2a24a3f84971680ac0a4c71050067de4f76ee235aa4a041fae21bfa69975c168 SHA512 c8c2b3bdfc1a8abe834612c33123b4f103e841c230b53934fb7bafe11af7f1175f02ca54c92f33e8e603485e6283897bebb51acc55d1213b7433024684215c14 WHIRLPOOL f026e8779c531f887b1e292e5f1d6eafd0e3ae46f83ae8efb830ad8e0f91d86e5b002dda9e6a02987db6230557ff773d8c52dd2db423d792aed1aca292e5b92b |
39 |
-DIST php-5.6.20.tar.bz2 14162188 SHA256 5ac7bf7caec7a79b18cf458e786fd1609ad2da771224b80bc15cc6f01b22bf1f SHA512 9e26f2564ee7329ab50d4d8d27f029c4f88317ea761888138e60d13a3cf51e49676ded406a3ec18433be2ec5d2a49c904eaa9f32d473b99d11550025e026a61c WHIRLPOOL 679c8ee4b3ddf18d94598982969fd12d053493fbe70d4b9f8d3eda4ed9ab0bb6f83d912bb7f8ebd99264beea992cce7c1083d257576551fadf537b5655d23d57 |
40 |
-DIST php-5.6.21.tar.bz2 14165919 SHA256 b4ed7ab574b689fd6d6494fde954826c06efc85c505e017b8d776c7c7f479590 SHA512 028d62434e7932b4a07fa7d404b8ad938f0ca7968ae2b23386038f77482984d2b6145523e11f37b9e72621c8bf40f08e38a6db1d209493770ac99e13e2fac0d0 WHIRLPOOL e5e606f0a3df1af12c9c0148a29336de0d00a8d7cedbb42727a3e1b6a700e0dcda63c7086e59f175ec060cbf910c2b12815ae3c08bb73d43a84b4f3aaa5d2ed6 |
41 |
-DIST php-5.6.22.tar.bz2 14170522 SHA256 90da8a80cc52fa699cf2bfa4c6fa737c772df7c92b81ef483460aa3b1e9f88c6 SHA512 9d21104832a1053a350ff31196e2c41cef713a9dfe207491236219954cf2eea216049b2f40313fb2a8e9ef641aad0af3f69456bbcebdf8fee312b0dd4a7df320 WHIRLPOOL 2163f683c2e572ddd9a7368e070b172f6b2f2fcb0128ac7db0b8639e0b14b0b1fa7050cb6082b627006e700099c1ca4144b20a2c5cd637ecad697e99a125e284 |
42 |
DIST php-5.6.23.tar.bz2 14178077 SHA256 facd280896d277e6f7084b60839e693d4db68318bfc92085d3dc0251fd3558c7 SHA512 92be3685926f302223465e9673496971f0ee1b05c7b3a09682d4ef93a27b4c17e5c53c36acab15d26f38508f6d65bebe11a6f0f0fc98b27eafe95b02b4d9897d WHIRLPOOL 71375395742a83ec0f55bd7edf5eeff732e4db24f77f436f519ca81a2ceeb0bac65549ca1ffd34cb7b593771b5f4ccb984900841a20c1620a6121e4fa14ab086 |
43 |
DIST php-7.0.8.tar.bz2 14105805 SHA256 66dc7ba388490e07b1313fe3a06b1fa822e1310585fe29f4909995f131e27c8d SHA512 a1a119ff95ad3902264dbc267753af0cf82b5dddbfcf09a8fc2bc519e16021cbf4bc7f2b33c4fec46d7be7bed8db315371ee11390a6055adf908a3b28a6a6921 WHIRLPOOL 5907158c1974715cda7abca0dec6736fb265372cd643d2699b91936c964b72334468eef778e485125df8fc7d21064a394c735510e0731321360e7272aa83d41d |
44 |
|
45 |
diff --git a/dev-lang/php/php-5.5.33.ebuild b/dev-lang/php/php-5.5.33.ebuild |
46 |
deleted file mode 100644 |
47 |
index 6b9b1ff..0000000 |
48 |
--- a/dev-lang/php/php-5.5.33.ebuild |
49 |
+++ /dev/null |
50 |
@@ -1,784 +0,0 @@ |
51 |
-# Copyright 1999-2016 Gentoo Foundation |
52 |
-# Distributed under the terms of the GNU General Public License v2 |
53 |
-# $Id$ |
54 |
- |
55 |
-EAPI=5 |
56 |
- |
57 |
-inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool systemd |
58 |
- |
59 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" |
60 |
- |
61 |
-function php_get_uri () |
62 |
-{ |
63 |
- case "${1}" in |
64 |
- "php-pre") |
65 |
- echo "http://downloads.php.net/dsp/${2}" |
66 |
- ;; |
67 |
- "php") |
68 |
- echo "http://www.php.net/distributions/${2}" |
69 |
- ;; |
70 |
- "olemarkus") |
71 |
- echo "https://dev.gentoo.org/~olemarkus/php/${2}" |
72 |
- ;; |
73 |
- "gentoo") |
74 |
- echo "mirror://gentoo/${2}" |
75 |
- ;; |
76 |
- *) |
77 |
- die "unhandled case in php_get_uri" |
78 |
- ;; |
79 |
- esac |
80 |
-} |
81 |
- |
82 |
-PHP_MV="$(get_major_version)" |
83 |
-SLOT="$(get_version_component_range 1-2)" |
84 |
- |
85 |
-# alias, so we can handle different types of releases (finals, rcs, alphas, |
86 |
-# betas, ...) w/o changing the whole ebuild |
87 |
-PHP_PV="${PV/_rc/RC}" |
88 |
-PHP_PV="${PHP_PV/_alpha/alpha}" |
89 |
-PHP_PV="${PHP_PV/_beta/beta}" |
90 |
-PHP_RELEASE="php" |
91 |
-[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre" |
92 |
-[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre" |
93 |
-[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre" |
94 |
-PHP_P="${PN}-${PHP_PV}" |
95 |
- |
96 |
-PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")" |
97 |
- |
98 |
-PHP_FPM_CONF_VER="1" |
99 |
- |
100 |
-SRC_URI="${PHP_SRC_URI}" |
101 |
- |
102 |
-DESCRIPTION="The PHP language runtime engine" |
103 |
-HOMEPAGE="http://php.net/" |
104 |
-LICENSE="PHP-3" |
105 |
- |
106 |
-S="${WORKDIR}/${PHP_P}" |
107 |
- |
108 |
-# We can build the following SAPIs in the given order |
109 |
-SAPIS="embed cli cgi fpm apache2" |
110 |
- |
111 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
112 |
-IUSE="${IUSE} |
113 |
- ${SAPIS/cli/+cli} |
114 |
- threads" |
115 |
- |
116 |
-IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk |
117 |
- crypt +ctype curl debug |
118 |
- enchant exif frontbase +fileinfo +filter firebird |
119 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
120 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash |
121 |
- mssql mysql libmysqlclient mysqli nls |
122 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
123 |
- readline recode selinux +session sharedmem |
124 |
- +simplexml snmp soap sockets spell sqlite ssl |
125 |
- sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx |
126 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
127 |
- |
128 |
-DEPEND=" |
129 |
- >=app-eselect/eselect-php-0.7.1-r3[apache2?,fpm?] |
130 |
- >=dev-libs/libpcre-8.32[unicode] |
131 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
132 |
- <www-servers/apache-2.4[threads=] ) ) |
133 |
- berkdb? ( =sys-libs/db-4* ) |
134 |
- bzip2? ( app-arch/bzip2 ) |
135 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
136 |
- cjk? ( !gd? ( |
137 |
- virtual/jpeg:0 |
138 |
- media-libs/libpng:0= |
139 |
- sys-libs/zlib |
140 |
- ) ) |
141 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
142 |
- curl? ( >=net-misc/curl-7.10.5 ) |
143 |
- enchant? ( app-text/enchant ) |
144 |
- exif? ( !gd? ( |
145 |
- virtual/jpeg:0 |
146 |
- media-libs/libpng:0= |
147 |
- sys-libs/zlib |
148 |
- ) ) |
149 |
- firebird? ( dev-db/firebird ) |
150 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
151 |
- gdbm? ( >=sys-libs/gdbm-1.8.0 ) |
152 |
- gmp? ( >=dev-libs/gmp-4.1.2 ) |
153 |
- iconv? ( virtual/libiconv ) |
154 |
- imap? ( virtual/imap-c-client[ssl=] ) |
155 |
- intl? ( dev-libs/icu:= ) |
156 |
- iodbc? ( dev-db/libiodbc ) |
157 |
- kerberos? ( virtual/krb5 ) |
158 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
159 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
160 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
161 |
- mssql? ( dev-db/freetds[mssql] ) |
162 |
- libmysqlclient? ( |
163 |
- mysql? ( virtual/mysql ) |
164 |
- mysqli? ( >=virtual/mysql-4.1 ) |
165 |
- ) |
166 |
- nls? ( sys-devel/gettext ) |
167 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
168 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
169 |
- postgres? ( dev-db/postgresql ) |
170 |
- qdbm? ( dev-db/qdbm ) |
171 |
- readline? ( sys-libs/readline ) |
172 |
- recode? ( app-text/recode ) |
173 |
- sharedmem? ( dev-libs/mm ) |
174 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
175 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
176 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
177 |
- spell? ( >=app-text/aspell-0.50 ) |
178 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
179 |
- ssl? ( >=dev-libs/openssl-0.9.7 ) |
180 |
- sybase-ct? ( dev-db/freetds ) |
181 |
- tidy? ( app-text/htmltidy ) |
182 |
- truetype? ( |
183 |
- =media-libs/freetype-2* |
184 |
- >=media-libs/t1lib-5.0.0 |
185 |
- !gd? ( |
186 |
- virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
187 |
- ) |
188 |
- unicode? ( dev-libs/oniguruma ) |
189 |
- vpx? ( media-libs/libvpx ) |
190 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
191 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
192 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
193 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
194 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
195 |
- xpm? ( |
196 |
- x11-libs/libXpm |
197 |
- virtual/jpeg:0 |
198 |
- media-libs/libpng:0= sys-libs/zlib |
199 |
- ) |
200 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
201 |
- zip? ( sys-libs/zlib ) |
202 |
- zlib? ( sys-libs/zlib ) |
203 |
- virtual/mta |
204 |
-" |
205 |
- |
206 |
-php="=${CATEGORY}/${PF}" |
207 |
- |
208 |
-REQUIRED_USE=" |
209 |
- truetype? ( gd ) |
210 |
- vpx? ( gd ) |
211 |
- cjk? ( gd ) |
212 |
- exif? ( gd ) |
213 |
- |
214 |
- xpm? ( gd ) |
215 |
- gd? ( zlib ) |
216 |
- simplexml? ( xml ) |
217 |
- soap? ( xml ) |
218 |
- wddx? ( xml ) |
219 |
- xmlrpc? ( || ( xml iconv ) ) |
220 |
- xmlreader? ( xml ) |
221 |
- xslt? ( xml ) |
222 |
- ldap-sasl? ( ldap ) |
223 |
- mhash? ( hash ) |
224 |
- phar? ( hash ) |
225 |
- libmysqlclient? ( || ( |
226 |
- mysql |
227 |
- mysqli |
228 |
- pdo |
229 |
- ) ) |
230 |
- |
231 |
- qdbm? ( !gdbm ) |
232 |
- readline? ( !libedit ) |
233 |
- recode? ( !imap !mysql !mysqli ) |
234 |
- sharedmem? ( !threads ) |
235 |
- |
236 |
- !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" |
237 |
- |
238 |
-RDEPEND="${DEPEND}" |
239 |
- |
240 |
-RDEPEND="${RDEPEND} |
241 |
- fpm? ( |
242 |
- selinux? ( sec-policy/selinux-phpfpm ) |
243 |
- systemd? ( sys-apps/systemd ) )" |
244 |
- |
245 |
-DEPEND="${DEPEND} |
246 |
- sys-devel/flex |
247 |
- >=sys-devel/m4-1.4.3 |
248 |
- >=sys-devel/libtool-1.5.18" |
249 |
- |
250 |
-# Allow users to install production version if they want to |
251 |
- |
252 |
-case "${PHP_INI_VERSION}" in |
253 |
- production|development) |
254 |
- ;; |
255 |
- *) |
256 |
- PHP_INI_VERSION="development" |
257 |
- ;; |
258 |
-esac |
259 |
- |
260 |
-PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}" |
261 |
-PHP_INI_FILE="php.ini" |
262 |
- |
263 |
-want_apache |
264 |
- |
265 |
-pkg_setup() { |
266 |
- depend.apache_pkg_setup |
267 |
-} |
268 |
- |
269 |
-php_install_ini() { |
270 |
- local phpsapi="${1}" |
271 |
- |
272 |
- # work out where we are installing the ini file |
273 |
- php_set_ini_dir "${phpsapi}" |
274 |
- |
275 |
- local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}" |
276 |
- cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" |
277 |
- |
278 |
- # default to /tmp for save_path, bug #282768 |
279 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" |
280 |
- |
281 |
- # Set the extension dir |
282 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" |
283 |
- |
284 |
- # Set the include path to point to where we want to find PEAR packages |
285 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" |
286 |
- |
287 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
288 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
289 |
- newins "${phpinisrc}" "${PHP_INI_FILE}" |
290 |
- |
291 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
292 |
- elog |
293 |
- |
294 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
295 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
296 |
- |
297 |
- if use_if_iuse opcache; then |
298 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
299 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
300 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
301 |
- fi |
302 |
- |
303 |
- # SAPI-specific handling |
304 |
- |
305 |
- if [[ "${sapi}" == "fpm" ]] ; then |
306 |
- [[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0 |
307 |
- einfo "Installing FPM CGI config file php-fpm.conf" |
308 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
309 |
- newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" php-fpm.conf |
310 |
- |
311 |
- # Remove bogus /etc/php-fpm.conf.default (bug 359906) |
312 |
- [[ -f "${ED}/etc/php-fpm.conf.default" ]] && rm "${ED}/etc/php-fpm.conf.default" |
313 |
- fi |
314 |
- |
315 |
- # Install PHP ini files into /usr/share/php |
316 |
- |
317 |
- dodoc php.ini-development |
318 |
- dodoc php.ini-production |
319 |
- |
320 |
-} |
321 |
- |
322 |
-php_set_ini_dir() { |
323 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
324 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
325 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
326 |
-} |
327 |
- |
328 |
-src_prepare() { |
329 |
- # USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path |
330 |
- # ([empty session.save_path]/session_mm_[sapi][gid].sem) |
331 |
- # there is no easy way to circumvent that, all php calls during |
332 |
- # install use -n, so no php.ini file will be used. |
333 |
- # As such, this is the easiest way to get around |
334 |
- addpredict /session_mm_cli250.sem |
335 |
- addpredict /session_mm_cli0.sem |
336 |
- |
337 |
- # Change PHP branding |
338 |
- # Get the alpha/beta/rc version |
339 |
- sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ |
340 |
- -i configure.in || die "Unable to change PHP branding" |
341 |
- |
342 |
- # Patch PHP to show Gentoo as the server platform |
343 |
- sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
344 |
- -i configure.in || die "Failed to fix server platform name" |
345 |
- |
346 |
- # Prevent PHP from activating the Apache config, |
347 |
- # as we will do that ourselves |
348 |
- sed -i \ |
349 |
- -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
350 |
- -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
351 |
- configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 |
352 |
- |
353 |
- # Patch PHP to support heimdal instead of mit-krb5 |
354 |
- if has_version "app-crypt/heimdal" ; then |
355 |
- sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
356 |
- || die "Failed to fix heimdal libname" |
357 |
- sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
358 |
- || die "Failed to fix heimdal crypt library reference" |
359 |
- fi |
360 |
- |
361 |
- #Add user patches #357637 |
362 |
- epatch_user |
363 |
- |
364 |
- #force rebuilding aclocal.m4 |
365 |
- rm aclocal.m4 |
366 |
- eautoreconf |
367 |
- |
368 |
- if [[ ${CHOST} == *-darwin* ]] ; then |
369 |
- # http://bugs.php.net/bug.php?id=48795, bug #343481 |
370 |
- sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die |
371 |
- fi |
372 |
-} |
373 |
- |
374 |
-src_configure() { |
375 |
- addpredict /usr/share/snmp/mibs/.index |
376 |
- addpredict /var/lib/net-snmp/mib_indexes |
377 |
- |
378 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
379 |
- |
380 |
- # This is a global variable and should be in caps. It isn't because the |
381 |
- # phpconfutils eclass relies on exactly this name... |
382 |
- # for --with-libdir see bug #327025 |
383 |
- my_conf=" |
384 |
- --prefix="${PHP_DESTDIR}" |
385 |
- --mandir="${PHP_DESTDIR}"/man |
386 |
- --infodir="${PHP_DESTDIR}"/info |
387 |
- --libdir="${PHP_DESTDIR}"/lib |
388 |
- --with-libdir=$(get_libdir) |
389 |
- --without-pear |
390 |
- $(use_enable threads maintainer-zts)" |
391 |
- |
392 |
- # extension USE flag shared |
393 |
- my_conf+=" |
394 |
- $(use_enable bcmath bcmath ) |
395 |
- $(use_with bzip2 bz2 "${EPREFIX}"/usr) |
396 |
- $(use_enable calendar calendar ) |
397 |
- $(use_enable ctype ctype ) |
398 |
- $(use_with curl curl "${EPREFIX}"/usr) |
399 |
- $(use_enable xml dom ) |
400 |
- $(use_with enchant enchant "${EPREFIX}"/usr) |
401 |
- $(use_enable exif exif ) |
402 |
- $(use_enable fileinfo fileinfo ) |
403 |
- $(use_enable filter filter ) |
404 |
- $(use_enable ftp ftp ) |
405 |
- $(use_with nls gettext "${EPREFIX}"/usr) |
406 |
- $(use_with gmp gmp "${EPREFIX}"/usr) |
407 |
- $(use_enable hash hash ) |
408 |
- $(use_with mhash mhash "${EPREFIX}"/usr) |
409 |
- $(use_with iconv iconv $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}"/usr)) |
410 |
- $(use_enable intl intl ) |
411 |
- $(use_enable ipv6 ipv6 ) |
412 |
- $(use_enable json json ) |
413 |
- $(use_with kerberos kerberos "${EPREFIX}"/usr) |
414 |
- $(use_enable xml libxml ) |
415 |
- $(use_with xml libxml-dir "${EPREFIX}"/usr) |
416 |
- $(use_enable unicode mbstring ) |
417 |
- $(use_with crypt mcrypt "${EPREFIX}"/usr) |
418 |
- $(use_with mssql mssql "${EPREFIX}"/usr) |
419 |
- $(use_with unicode onig "${EPREFIX}"/usr) |
420 |
- $(use_with ssl openssl "${EPREFIX}"/usr) |
421 |
- $(use_with ssl openssl-dir "${EPREFIX}"/usr) |
422 |
- $(use_enable pcntl pcntl ) |
423 |
- $(use_enable phar phar ) |
424 |
- $(use_enable pdo pdo ) |
425 |
- $(use_enable opcache opcache ) |
426 |
- $(use_with postgres pgsql "${EPREFIX}"/usr) |
427 |
- $(use_enable posix posix ) |
428 |
- $(use_with spell pspell "${EPREFIX}"/usr) |
429 |
- $(use_with recode recode "${EPREFIX}"/usr) |
430 |
- $(use_enable simplexml simplexml ) |
431 |
- $(use_enable sharedmem shmop ) |
432 |
- $(use_with snmp snmp "${EPREFIX}"/usr) |
433 |
- $(use_enable soap soap ) |
434 |
- $(use_enable sockets sockets ) |
435 |
- $(use_with sqlite sqlite3 "${EPREFIX}"/usr) |
436 |
- $(use_with sybase-ct sybase-ct "${EPREFIX}"/usr) |
437 |
- $(use_enable sysvipc sysvmsg ) |
438 |
- $(use_enable sysvipc sysvsem ) |
439 |
- $(use_enable sysvipc sysvshm ) |
440 |
- $(use_with systemd fpm-systemd) |
441 |
- $(use_with tidy tidy "${EPREFIX}"/usr) |
442 |
- $(use_enable tokenizer tokenizer ) |
443 |
- $(use_enable wddx wddx ) |
444 |
- $(use_enable xml xml ) |
445 |
- $(use_enable xmlreader xmlreader ) |
446 |
- $(use_enable xmlwriter xmlwriter ) |
447 |
- $(use_with xmlrpc xmlrpc) |
448 |
- $(use_with xslt xsl "${EPREFIX}"/usr) |
449 |
- $(use_enable zip zip ) |
450 |
- $(use_with zlib zlib "${EPREFIX}"/usr) |
451 |
- $(use_enable debug debug )" |
452 |
- |
453 |
- # DBA support |
454 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
455 |
- || use qdbm ; then |
456 |
- my_conf="${my_conf} --enable-dba${shared}" |
457 |
- fi |
458 |
- |
459 |
- # DBA drivers support |
460 |
- my_conf+=" |
461 |
- $(use_with cdb cdb) |
462 |
- $(use_with berkdb db4 ${EPREFIX}/usr) |
463 |
- $(use_enable flatfile flatfile ) |
464 |
- $(use_with gdbm gdbm ${EPREFIX}/usr) |
465 |
- $(use_enable inifile inifile ) |
466 |
- $(use_with qdbm qdbm ${EPREFIX}/usr)" |
467 |
- |
468 |
- # Support for the GD graphics library |
469 |
- my_conf+=" |
470 |
- $(use_with truetype freetype-dir ${EPREFIX}/usr) |
471 |
- $(use_with truetype t1lib ${EPREFIX}/usr) |
472 |
- $(use_enable cjk gd-jis-conv ) |
473 |
- $(use_with gd jpeg-dir ${EPREFIX}/usr) |
474 |
- $(use_with gd png-dir ${EPREFIX}/usr) |
475 |
- $(use_with xpm xpm-dir ${EPREFIX}/usr) |
476 |
- $(use_with vpx vpx-dir ${EPREFIX}/usr)" |
477 |
- # enable gd last, so configure can pick up the previous settings |
478 |
- my_conf+=" |
479 |
- $(use_with gd gd)" |
480 |
- |
481 |
- # IMAP support |
482 |
- if use imap ; then |
483 |
- my_conf+=" |
484 |
- $(use_with imap imap ${EPREFIX}/usr) |
485 |
- $(use_with ssl imap-ssl ${EPREFIX}/usr)" |
486 |
- fi |
487 |
- |
488 |
- # Interbase/firebird support |
489 |
- |
490 |
- if use firebird ; then |
491 |
- my_conf+=" |
492 |
- $(use_with firebird interbase ${EPREFIX}/usr)" |
493 |
- fi |
494 |
- |
495 |
- # LDAP support |
496 |
- if use ldap ; then |
497 |
- my_conf+=" |
498 |
- $(use_with ldap ldap ${EPREFIX}/usr) |
499 |
- $(use_with ldap-sasl ldap-sasl ${EPREFIX}/usr)" |
500 |
- fi |
501 |
- |
502 |
- # MySQL support |
503 |
- local mysqllib="mysqlnd" |
504 |
- local mysqlilib="mysqlnd" |
505 |
- use libmysqlclient && mysqllib="${EPREFIX}/usr" |
506 |
- use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config" |
507 |
- |
508 |
- my_conf+=" $(use_with mysql mysql $mysqllib)" |
509 |
- my_conf+=" $(use_with mysqli mysqli $mysqlilib)" |
510 |
- |
511 |
- local mysqlsock=" $(use_with mysql mysql-sock ${EPREFIX}/var/run/mysqld/mysqld.sock)" |
512 |
- if use mysql ; then |
513 |
- my_conf+="${mysqlsock}" |
514 |
- elif use mysqli ; then |
515 |
- my_conf+="${mysqlsock}" |
516 |
- fi |
517 |
- |
518 |
- # ODBC support |
519 |
- if use odbc ; then |
520 |
- my_conf+=" |
521 |
- $(use_with odbc unixODBC ${EPREFIX}/usr)" |
522 |
- fi |
523 |
- |
524 |
- if use iodbc ; then |
525 |
- my_conf+=" |
526 |
- $(use_with iodbc iodbc ${EPREFIX}/usr)" |
527 |
- fi |
528 |
- |
529 |
- # Oracle support |
530 |
- if use oci8-instant-client ; then |
531 |
- my_conf+=" |
532 |
- $(use_with oci8-instant-client oci8)" |
533 |
- fi |
534 |
- |
535 |
- # PDO support |
536 |
- if use pdo ; then |
537 |
- my_conf+=" |
538 |
- $(use_with mssql pdo-dblib ) |
539 |
- $(use_with mysql pdo-mysql ${mysqllib}) |
540 |
- $(use_with postgres pdo-pgsql ) |
541 |
- $(use_with sqlite pdo-sqlite ${EPREFIX}/usr) |
542 |
- $(use_with odbc pdo-odbc unixODBC,${EPREFIX}/usr)" |
543 |
- if use oci8-instant-client ; then |
544 |
- my_conf+=" |
545 |
- $(use_with oci8-instant-client pdo-oci)" |
546 |
- fi |
547 |
- fi |
548 |
- |
549 |
- # readline/libedit support |
550 |
- my_conf+=" |
551 |
- $(use_with readline readline ${EPREFIX}/usr) |
552 |
- $(use_with libedit libedit ${EPREFIX}/usr)" |
553 |
- |
554 |
- # Session support |
555 |
- if use session ; then |
556 |
- my_conf+=" |
557 |
- $(use_with sharedmem mm ${EPREFIX}/usr)" |
558 |
- else |
559 |
- my_conf+=" |
560 |
- $(use_enable session session )" |
561 |
- fi |
562 |
- |
563 |
- # Use pic for shared modules such as apache2's mod_php |
564 |
- my_conf="${my_conf} --with-pic" |
565 |
- |
566 |
- # we use the system copy of pcre |
567 |
- # --with-pcre-regex affects ext/pcre |
568 |
- # --with-pcre-dir affects ext/filter and ext/zip |
569 |
- my_conf="${my_conf} --with-pcre-regex=${EPREFIX}/usr --with-pcre-dir=${EPREFIX}/usr" |
570 |
- |
571 |
- # Catch CFLAGS problems |
572 |
- # Fixes bug #14067. |
573 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
574 |
- replace-cpu-flags "k6*" "i586" |
575 |
- |
576 |
- # Support user-passed configuration parameters |
577 |
- my_conf="${my_conf} ${EXTRA_ECONF:-}" |
578 |
- |
579 |
- # Support the Apache2 extras, they must be set globally for all |
580 |
- # SAPIs to work correctly, especially for external PHP extensions |
581 |
- |
582 |
- mkdir -p "${WORKDIR}/sapis-build" |
583 |
- for one_sapi in $SAPIS ; do |
584 |
- use "${one_sapi}" || continue |
585 |
- php_set_ini_dir "${one_sapi}" |
586 |
- |
587 |
- cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}" |
588 |
- cd "${WORKDIR}/sapis-build/${one_sapi}" |
589 |
- |
590 |
- sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} |
591 |
- --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}" |
592 |
- |
593 |
- for sapi in $SAPIS ; do |
594 |
- case "$sapi" in |
595 |
- cli|cgi|embed|fpm) |
596 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
597 |
- sapi_conf="${sapi_conf} --enable-${sapi}" |
598 |
- else |
599 |
- sapi_conf="${sapi_conf} --disable-${sapi}" |
600 |
- fi |
601 |
- ;; |
602 |
- |
603 |
- apache2) |
604 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
605 |
- sapi_conf="${sapi_conf} --with-apxs2=${EPREFIX}/usr/sbin/apxs" |
606 |
- else |
607 |
- sapi_conf="${sapi_conf} --without-apxs2" |
608 |
- fi |
609 |
- ;; |
610 |
- esac |
611 |
- done |
612 |
- |
613 |
- econf ${sapi_conf} |
614 |
- done |
615 |
-} |
616 |
- |
617 |
-src_compile() { |
618 |
- # snmp seems to run during src_compile, too (bug #324739) |
619 |
- addpredict /usr/share/snmp/mibs/.index |
620 |
- addpredict /var/lib/net-snmp/mib_indexes |
621 |
- |
622 |
- for sapi in ${SAPIS} ; do |
623 |
- if use "${sapi}"; then |
624 |
- cd "${WORKDIR}/sapis-build/$sapi" || "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
625 |
- emake || die "emake failed" |
626 |
- fi |
627 |
- done |
628 |
-} |
629 |
- |
630 |
-src_install() { |
631 |
- # see bug #324739 for what happens when we don't have that |
632 |
- addpredict /usr/share/snmp/mibs/.index |
633 |
- |
634 |
- # grab the first SAPI that got built and install common files from there |
635 |
- local first_sapi="" |
636 |
- for sapi in $SAPIS ; do |
637 |
- if use $sapi ; then |
638 |
- first_sapi=$sapi |
639 |
- break |
640 |
- fi |
641 |
- done |
642 |
- |
643 |
- # Makefile forgets to create this before trying to write to it... |
644 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
645 |
- |
646 |
- # Install php environment (without any sapis) |
647 |
- cd "${WORKDIR}/sapis-build/$first_sapi" |
648 |
- emake INSTALL_ROOT="${D}" \ |
649 |
- install-build install-headers install-programs \ |
650 |
- || die "emake install failed" |
651 |
- |
652 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
653 |
- |
654 |
- # Create the directory where we'll put version-specific php scripts |
655 |
- keepdir /usr/share/php${PHP_MV} |
656 |
- |
657 |
- local sapi="", file="" |
658 |
- local sapi_list="" |
659 |
- |
660 |
- for sapi in ${SAPIS}; do |
661 |
- if use "${sapi}" ; then |
662 |
- einfo "Installing SAPI: ${sapi}" |
663 |
- cd "${WORKDIR}/sapis-build/${sapi}" |
664 |
- |
665 |
- if [[ "${sapi}" == "apache2" ]] ; then |
666 |
- # We're specifically not using emake install-sapi as libtool |
667 |
- # may cause unnecessary relink failures (see bug #351266) |
668 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
669 |
- newins ".libs/libphp5$(get_libname)" "libphp${PHP_MV}$(get_libname)" |
670 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
671 |
- else |
672 |
- # needed each time, php_install_ini would reset it |
673 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
674 |
- into "${dest}" |
675 |
- case "$sapi" in |
676 |
- cli) |
677 |
- source="sapi/cli/php" |
678 |
- ;; |
679 |
- cgi) |
680 |
- source="sapi/cgi/php-cgi" |
681 |
- ;; |
682 |
- fpm) |
683 |
- source="sapi/fpm/php-fpm" |
684 |
- ;; |
685 |
- embed) |
686 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
687 |
- ;; |
688 |
- *) |
689 |
- die "unhandled sapi in src_install" |
690 |
- ;; |
691 |
- esac |
692 |
- |
693 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
694 |
- dolib.so "${source}" || die "Unable to install ${sapi} sapi" |
695 |
- else |
696 |
- dobin "${source}" || die "Unable to install ${sapi} sapi" |
697 |
- local name="$(basename ${source})" |
698 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
699 |
- fi |
700 |
- fi |
701 |
- |
702 |
- php_install_ini "${sapi}" |
703 |
- |
704 |
- # construct correct SAPI string for php-config |
705 |
- # thanks to ferringb for the bash voodoo |
706 |
- if [[ "${sapi}" == "apache2" ]]; then |
707 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
708 |
- else |
709 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
710 |
- fi |
711 |
- fi |
712 |
- done |
713 |
- |
714 |
- # Installing opcache module |
715 |
- if use_if_iuse opcache ; then |
716 |
- dolib.so "modules/opcache$(get_libname)" || die "Unable to install opcache module" |
717 |
- fi |
718 |
- |
719 |
- # Install env.d files |
720 |
- newenvd "${FILESDIR}/20php5-envd" \ |
721 |
- "20php${SLOT}" |
722 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i \ |
723 |
- "${ED}/etc/env.d/20php${SLOT}" |
724 |
- sed -e "s|php5|php${SLOT}|g" -i \ |
725 |
- "${ED}/etc/env.d/20php${SLOT}" |
726 |
- |
727 |
- # set php-config variable correctly (bug #278439) |
728 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
729 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" |
730 |
- |
731 |
- if use fpm ; then |
732 |
- if use systemd; then |
733 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" "php-fpm@${SLOT}.service" |
734 |
- else |
735 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" "php-fpm@${SLOT}.service" |
736 |
- fi |
737 |
- fi |
738 |
-} |
739 |
- |
740 |
-src_test() { |
741 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
742 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
743 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
744 |
- ewarn "Test phase requires USE=cli, skipping" |
745 |
- return |
746 |
- else |
747 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
748 |
- fi |
749 |
- |
750 |
- if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
751 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
752 |
- fi |
753 |
- |
754 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \ |
755 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d "session.save_path=${T}" |
756 |
- |
757 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
758 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null |
759 |
- done |
760 |
- |
761 |
- local failed="$(find -name '*.out')" |
762 |
- if [[ ${failed} != "" ]] ; then |
763 |
- ewarn "The following test cases failed unexpectedly:" |
764 |
- for name in ${failed}; do |
765 |
- ewarn " ${name/.out/}" |
766 |
- done |
767 |
- else |
768 |
- einfo "No unexpected test failures, all fine" |
769 |
- fi |
770 |
- |
771 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
772 |
- local passed="" |
773 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
774 |
- [[ -f "${name}.diff" ]] && continue |
775 |
- passed="${passed} ${name}" |
776 |
- done |
777 |
- if [[ ${passed} != "" ]] ; then |
778 |
- einfo "The following test cases passed unexpectedly:" |
779 |
- for name in ${passed}; do |
780 |
- ewarn " ${passed}" |
781 |
- done |
782 |
- else |
783 |
- einfo "None of the known-to-fail tests passed, all fine" |
784 |
- fi |
785 |
- fi |
786 |
-} |
787 |
- |
788 |
-pkg_postinst() { |
789 |
- # Output some general info to the user |
790 |
- if use apache2 ; then |
791 |
- APACHE2_MOD_DEFINE="PHP" |
792 |
- APACHE2_MOD_CONF="70_mod_php" # provided by app-eselect/eselect-php |
793 |
- apache-module_pkg_postinst |
794 |
- fi |
795 |
- |
796 |
- # Create the symlinks for php |
797 |
- for m in ${SAPIS}; do |
798 |
- [[ ${m} == 'embed' ]] && continue; |
799 |
- if use $m ; then |
800 |
- local ci=$(eselect php show $m) |
801 |
- if [[ -z $ci ]]; then |
802 |
- eselect php set $m php${SLOT} |
803 |
- einfo "Switched ${m} to use php:${SLOT}" |
804 |
- einfo |
805 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
806 |
- elog "To switch $m to use php:${SLOT}, run" |
807 |
- elog " eselect php set $m php${SLOT}" |
808 |
- elog |
809 |
- fi |
810 |
- fi |
811 |
- done |
812 |
- |
813 |
- elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes php${SLOT/./-} in order" |
814 |
- elog "to compile extensions for the ${SLOT} ABI" |
815 |
- elog |
816 |
- if ! use readline && use cli ; then |
817 |
- ewarn "Note that in order to use php interactivly, you need to enable" |
818 |
- ewarn "the readline USE flag or php -a will hang" |
819 |
- fi |
820 |
- elog |
821 |
- elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version." |
822 |
- elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either" |
823 |
- elog "'production' or 'development' in ${EPREFIX}/etc/make.conf" |
824 |
- elog "Both versions of php.ini can be found in ${EPREFIX}/usr/share/doc/${PF}" |
825 |
- |
826 |
- elog |
827 |
- elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:" |
828 |
- elog "https://www.gentoo.org/proj/en/php/php-upgrading.xml" |
829 |
- elog |
830 |
-} |
831 |
- |
832 |
-pkg_prerm() { |
833 |
- eselect php cleanup |
834 |
-} |
835 |
|
836 |
diff --git a/dev-lang/php/php-5.5.34.ebuild b/dev-lang/php/php-5.5.34.ebuild |
837 |
deleted file mode 100644 |
838 |
index b55091b..0000000 |
839 |
--- a/dev-lang/php/php-5.5.34.ebuild |
840 |
+++ /dev/null |
841 |
@@ -1,784 +0,0 @@ |
842 |
-# Copyright 1999-2016 Gentoo Foundation |
843 |
-# Distributed under the terms of the GNU General Public License v2 |
844 |
-# $Id$ |
845 |
- |
846 |
-EAPI=5 |
847 |
- |
848 |
-inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool systemd |
849 |
- |
850 |
-KEYWORDS="~alpha amd64 arm hppa ~ia64 ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" |
851 |
- |
852 |
-function php_get_uri () |
853 |
-{ |
854 |
- case "${1}" in |
855 |
- "php-pre") |
856 |
- echo "http://downloads.php.net/dsp/${2}" |
857 |
- ;; |
858 |
- "php") |
859 |
- echo "http://www.php.net/distributions/${2}" |
860 |
- ;; |
861 |
- "olemarkus") |
862 |
- echo "https://dev.gentoo.org/~olemarkus/php/${2}" |
863 |
- ;; |
864 |
- "gentoo") |
865 |
- echo "mirror://gentoo/${2}" |
866 |
- ;; |
867 |
- *) |
868 |
- die "unhandled case in php_get_uri" |
869 |
- ;; |
870 |
- esac |
871 |
-} |
872 |
- |
873 |
-PHP_MV="$(get_major_version)" |
874 |
-SLOT="$(get_version_component_range 1-2)" |
875 |
- |
876 |
-# alias, so we can handle different types of releases (finals, rcs, alphas, |
877 |
-# betas, ...) w/o changing the whole ebuild |
878 |
-PHP_PV="${PV/_rc/RC}" |
879 |
-PHP_PV="${PHP_PV/_alpha/alpha}" |
880 |
-PHP_PV="${PHP_PV/_beta/beta}" |
881 |
-PHP_RELEASE="php" |
882 |
-[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre" |
883 |
-[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre" |
884 |
-[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre" |
885 |
-PHP_P="${PN}-${PHP_PV}" |
886 |
- |
887 |
-PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")" |
888 |
- |
889 |
-PHP_FPM_CONF_VER="1" |
890 |
- |
891 |
-SRC_URI="${PHP_SRC_URI}" |
892 |
- |
893 |
-DESCRIPTION="The PHP language runtime engine" |
894 |
-HOMEPAGE="http://php.net/" |
895 |
-LICENSE="PHP-3" |
896 |
- |
897 |
-S="${WORKDIR}/${PHP_P}" |
898 |
- |
899 |
-# We can build the following SAPIs in the given order |
900 |
-SAPIS="embed cli cgi fpm apache2" |
901 |
- |
902 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
903 |
-IUSE="${IUSE} |
904 |
- ${SAPIS/cli/+cli} |
905 |
- threads" |
906 |
- |
907 |
-IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk |
908 |
- crypt +ctype curl debug |
909 |
- enchant exif frontbase +fileinfo +filter firebird |
910 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
911 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash |
912 |
- mssql mysql libmysqlclient mysqli nls |
913 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
914 |
- readline recode selinux +session sharedmem |
915 |
- +simplexml snmp soap sockets spell sqlite ssl |
916 |
- sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx |
917 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
918 |
- |
919 |
-DEPEND=" |
920 |
- >=app-eselect/eselect-php-0.7.1-r3[apache2?,fpm?] |
921 |
- >=dev-libs/libpcre-8.32[unicode] |
922 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
923 |
- <www-servers/apache-2.4[threads=] ) ) |
924 |
- berkdb? ( =sys-libs/db-4* ) |
925 |
- bzip2? ( app-arch/bzip2 ) |
926 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
927 |
- cjk? ( !gd? ( |
928 |
- virtual/jpeg:0 |
929 |
- media-libs/libpng:0= |
930 |
- sys-libs/zlib |
931 |
- ) ) |
932 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
933 |
- curl? ( >=net-misc/curl-7.10.5 ) |
934 |
- enchant? ( app-text/enchant ) |
935 |
- exif? ( !gd? ( |
936 |
- virtual/jpeg:0 |
937 |
- media-libs/libpng:0= |
938 |
- sys-libs/zlib |
939 |
- ) ) |
940 |
- firebird? ( dev-db/firebird ) |
941 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
942 |
- gdbm? ( >=sys-libs/gdbm-1.8.0 ) |
943 |
- gmp? ( >=dev-libs/gmp-4.1.2 ) |
944 |
- iconv? ( virtual/libiconv ) |
945 |
- imap? ( virtual/imap-c-client[ssl=] ) |
946 |
- intl? ( dev-libs/icu:= ) |
947 |
- iodbc? ( dev-db/libiodbc ) |
948 |
- kerberos? ( virtual/krb5 ) |
949 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
950 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
951 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
952 |
- mssql? ( dev-db/freetds[mssql] ) |
953 |
- libmysqlclient? ( |
954 |
- mysql? ( virtual/mysql ) |
955 |
- mysqli? ( >=virtual/mysql-4.1 ) |
956 |
- ) |
957 |
- nls? ( sys-devel/gettext ) |
958 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
959 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
960 |
- postgres? ( dev-db/postgresql ) |
961 |
- qdbm? ( dev-db/qdbm ) |
962 |
- readline? ( sys-libs/readline ) |
963 |
- recode? ( app-text/recode ) |
964 |
- sharedmem? ( dev-libs/mm ) |
965 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
966 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
967 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
968 |
- spell? ( >=app-text/aspell-0.50 ) |
969 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
970 |
- ssl? ( >=dev-libs/openssl-0.9.7 ) |
971 |
- sybase-ct? ( dev-db/freetds ) |
972 |
- tidy? ( app-text/htmltidy ) |
973 |
- truetype? ( |
974 |
- =media-libs/freetype-2* |
975 |
- >=media-libs/t1lib-5.0.0 |
976 |
- !gd? ( |
977 |
- virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
978 |
- ) |
979 |
- unicode? ( dev-libs/oniguruma ) |
980 |
- vpx? ( media-libs/libvpx ) |
981 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
982 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
983 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
984 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
985 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
986 |
- xpm? ( |
987 |
- x11-libs/libXpm |
988 |
- virtual/jpeg:0 |
989 |
- media-libs/libpng:0= sys-libs/zlib |
990 |
- ) |
991 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
992 |
- zip? ( sys-libs/zlib ) |
993 |
- zlib? ( sys-libs/zlib ) |
994 |
- virtual/mta |
995 |
-" |
996 |
- |
997 |
-php="=${CATEGORY}/${PF}" |
998 |
- |
999 |
-REQUIRED_USE=" |
1000 |
- truetype? ( gd ) |
1001 |
- vpx? ( gd ) |
1002 |
- cjk? ( gd ) |
1003 |
- exif? ( gd ) |
1004 |
- |
1005 |
- xpm? ( gd ) |
1006 |
- gd? ( zlib ) |
1007 |
- simplexml? ( xml ) |
1008 |
- soap? ( xml ) |
1009 |
- wddx? ( xml ) |
1010 |
- xmlrpc? ( || ( xml iconv ) ) |
1011 |
- xmlreader? ( xml ) |
1012 |
- xslt? ( xml ) |
1013 |
- ldap-sasl? ( ldap ) |
1014 |
- mhash? ( hash ) |
1015 |
- phar? ( hash ) |
1016 |
- libmysqlclient? ( || ( |
1017 |
- mysql |
1018 |
- mysqli |
1019 |
- pdo |
1020 |
- ) ) |
1021 |
- |
1022 |
- qdbm? ( !gdbm ) |
1023 |
- readline? ( !libedit ) |
1024 |
- recode? ( !imap !mysql !mysqli ) |
1025 |
- sharedmem? ( !threads ) |
1026 |
- |
1027 |
- !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" |
1028 |
- |
1029 |
-RDEPEND="${DEPEND}" |
1030 |
- |
1031 |
-RDEPEND="${RDEPEND} |
1032 |
- fpm? ( |
1033 |
- selinux? ( sec-policy/selinux-phpfpm ) |
1034 |
- systemd? ( sys-apps/systemd ) )" |
1035 |
- |
1036 |
-DEPEND="${DEPEND} |
1037 |
- sys-devel/flex |
1038 |
- >=sys-devel/m4-1.4.3 |
1039 |
- >=sys-devel/libtool-1.5.18" |
1040 |
- |
1041 |
-# Allow users to install production version if they want to |
1042 |
- |
1043 |
-case "${PHP_INI_VERSION}" in |
1044 |
- production|development) |
1045 |
- ;; |
1046 |
- *) |
1047 |
- PHP_INI_VERSION="development" |
1048 |
- ;; |
1049 |
-esac |
1050 |
- |
1051 |
-PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}" |
1052 |
-PHP_INI_FILE="php.ini" |
1053 |
- |
1054 |
-want_apache |
1055 |
- |
1056 |
-pkg_setup() { |
1057 |
- depend.apache_pkg_setup |
1058 |
-} |
1059 |
- |
1060 |
-php_install_ini() { |
1061 |
- local phpsapi="${1}" |
1062 |
- |
1063 |
- # work out where we are installing the ini file |
1064 |
- php_set_ini_dir "${phpsapi}" |
1065 |
- |
1066 |
- local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}" |
1067 |
- cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" |
1068 |
- |
1069 |
- # default to /tmp for save_path, bug #282768 |
1070 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" |
1071 |
- |
1072 |
- # Set the extension dir |
1073 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" |
1074 |
- |
1075 |
- # Set the include path to point to where we want to find PEAR packages |
1076 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" |
1077 |
- |
1078 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
1079 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
1080 |
- newins "${phpinisrc}" "${PHP_INI_FILE}" |
1081 |
- |
1082 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
1083 |
- elog |
1084 |
- |
1085 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
1086 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
1087 |
- |
1088 |
- if use_if_iuse opcache; then |
1089 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
1090 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
1091 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
1092 |
- fi |
1093 |
- |
1094 |
- # SAPI-specific handling |
1095 |
- |
1096 |
- if [[ "${sapi}" == "fpm" ]] ; then |
1097 |
- [[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0 |
1098 |
- einfo "Installing FPM CGI config file php-fpm.conf" |
1099 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
1100 |
- newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" php-fpm.conf |
1101 |
- |
1102 |
- # Remove bogus /etc/php-fpm.conf.default (bug 359906) |
1103 |
- [[ -f "${ED}/etc/php-fpm.conf.default" ]] && rm "${ED}/etc/php-fpm.conf.default" |
1104 |
- fi |
1105 |
- |
1106 |
- # Install PHP ini files into /usr/share/php |
1107 |
- |
1108 |
- dodoc php.ini-development |
1109 |
- dodoc php.ini-production |
1110 |
- |
1111 |
-} |
1112 |
- |
1113 |
-php_set_ini_dir() { |
1114 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
1115 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
1116 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
1117 |
-} |
1118 |
- |
1119 |
-src_prepare() { |
1120 |
- # USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path |
1121 |
- # ([empty session.save_path]/session_mm_[sapi][gid].sem) |
1122 |
- # there is no easy way to circumvent that, all php calls during |
1123 |
- # install use -n, so no php.ini file will be used. |
1124 |
- # As such, this is the easiest way to get around |
1125 |
- addpredict /session_mm_cli250.sem |
1126 |
- addpredict /session_mm_cli0.sem |
1127 |
- |
1128 |
- # Change PHP branding |
1129 |
- # Get the alpha/beta/rc version |
1130 |
- sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ |
1131 |
- -i configure.in || die "Unable to change PHP branding" |
1132 |
- |
1133 |
- # Patch PHP to show Gentoo as the server platform |
1134 |
- sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
1135 |
- -i configure.in || die "Failed to fix server platform name" |
1136 |
- |
1137 |
- # Prevent PHP from activating the Apache config, |
1138 |
- # as we will do that ourselves |
1139 |
- sed -i \ |
1140 |
- -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
1141 |
- -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
1142 |
- configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 |
1143 |
- |
1144 |
- # Patch PHP to support heimdal instead of mit-krb5 |
1145 |
- if has_version "app-crypt/heimdal" ; then |
1146 |
- sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
1147 |
- || die "Failed to fix heimdal libname" |
1148 |
- sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
1149 |
- || die "Failed to fix heimdal crypt library reference" |
1150 |
- fi |
1151 |
- |
1152 |
- #Add user patches #357637 |
1153 |
- epatch_user |
1154 |
- |
1155 |
- #force rebuilding aclocal.m4 |
1156 |
- rm aclocal.m4 |
1157 |
- eautoreconf |
1158 |
- |
1159 |
- if [[ ${CHOST} == *-darwin* ]] ; then |
1160 |
- # http://bugs.php.net/bug.php?id=48795, bug #343481 |
1161 |
- sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die |
1162 |
- fi |
1163 |
-} |
1164 |
- |
1165 |
-src_configure() { |
1166 |
- addpredict /usr/share/snmp/mibs/.index |
1167 |
- addpredict /var/lib/net-snmp/mib_indexes |
1168 |
- |
1169 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
1170 |
- |
1171 |
- # This is a global variable and should be in caps. It isn't because the |
1172 |
- # phpconfutils eclass relies on exactly this name... |
1173 |
- # for --with-libdir see bug #327025 |
1174 |
- my_conf=" |
1175 |
- --prefix="${PHP_DESTDIR}" |
1176 |
- --mandir="${PHP_DESTDIR}"/man |
1177 |
- --infodir="${PHP_DESTDIR}"/info |
1178 |
- --libdir="${PHP_DESTDIR}"/lib |
1179 |
- --with-libdir=$(get_libdir) |
1180 |
- --without-pear |
1181 |
- $(use_enable threads maintainer-zts)" |
1182 |
- |
1183 |
- # extension USE flag shared |
1184 |
- my_conf+=" |
1185 |
- $(use_enable bcmath bcmath ) |
1186 |
- $(use_with bzip2 bz2 "${EPREFIX}"/usr) |
1187 |
- $(use_enable calendar calendar ) |
1188 |
- $(use_enable ctype ctype ) |
1189 |
- $(use_with curl curl "${EPREFIX}"/usr) |
1190 |
- $(use_enable xml dom ) |
1191 |
- $(use_with enchant enchant "${EPREFIX}"/usr) |
1192 |
- $(use_enable exif exif ) |
1193 |
- $(use_enable fileinfo fileinfo ) |
1194 |
- $(use_enable filter filter ) |
1195 |
- $(use_enable ftp ftp ) |
1196 |
- $(use_with nls gettext "${EPREFIX}"/usr) |
1197 |
- $(use_with gmp gmp "${EPREFIX}"/usr) |
1198 |
- $(use_enable hash hash ) |
1199 |
- $(use_with mhash mhash "${EPREFIX}"/usr) |
1200 |
- $(use_with iconv iconv $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}"/usr)) |
1201 |
- $(use_enable intl intl ) |
1202 |
- $(use_enable ipv6 ipv6 ) |
1203 |
- $(use_enable json json ) |
1204 |
- $(use_with kerberos kerberos "${EPREFIX}"/usr) |
1205 |
- $(use_enable xml libxml ) |
1206 |
- $(use_with xml libxml-dir "${EPREFIX}"/usr) |
1207 |
- $(use_enable unicode mbstring ) |
1208 |
- $(use_with crypt mcrypt "${EPREFIX}"/usr) |
1209 |
- $(use_with mssql mssql "${EPREFIX}"/usr) |
1210 |
- $(use_with unicode onig "${EPREFIX}"/usr) |
1211 |
- $(use_with ssl openssl "${EPREFIX}"/usr) |
1212 |
- $(use_with ssl openssl-dir "${EPREFIX}"/usr) |
1213 |
- $(use_enable pcntl pcntl ) |
1214 |
- $(use_enable phar phar ) |
1215 |
- $(use_enable pdo pdo ) |
1216 |
- $(use_enable opcache opcache ) |
1217 |
- $(use_with postgres pgsql "${EPREFIX}"/usr) |
1218 |
- $(use_enable posix posix ) |
1219 |
- $(use_with spell pspell "${EPREFIX}"/usr) |
1220 |
- $(use_with recode recode "${EPREFIX}"/usr) |
1221 |
- $(use_enable simplexml simplexml ) |
1222 |
- $(use_enable sharedmem shmop ) |
1223 |
- $(use_with snmp snmp "${EPREFIX}"/usr) |
1224 |
- $(use_enable soap soap ) |
1225 |
- $(use_enable sockets sockets ) |
1226 |
- $(use_with sqlite sqlite3 "${EPREFIX}"/usr) |
1227 |
- $(use_with sybase-ct sybase-ct "${EPREFIX}"/usr) |
1228 |
- $(use_enable sysvipc sysvmsg ) |
1229 |
- $(use_enable sysvipc sysvsem ) |
1230 |
- $(use_enable sysvipc sysvshm ) |
1231 |
- $(use_with systemd fpm-systemd) |
1232 |
- $(use_with tidy tidy "${EPREFIX}"/usr) |
1233 |
- $(use_enable tokenizer tokenizer ) |
1234 |
- $(use_enable wddx wddx ) |
1235 |
- $(use_enable xml xml ) |
1236 |
- $(use_enable xmlreader xmlreader ) |
1237 |
- $(use_enable xmlwriter xmlwriter ) |
1238 |
- $(use_with xmlrpc xmlrpc) |
1239 |
- $(use_with xslt xsl "${EPREFIX}"/usr) |
1240 |
- $(use_enable zip zip ) |
1241 |
- $(use_with zlib zlib "${EPREFIX}"/usr) |
1242 |
- $(use_enable debug debug )" |
1243 |
- |
1244 |
- # DBA support |
1245 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
1246 |
- || use qdbm ; then |
1247 |
- my_conf="${my_conf} --enable-dba${shared}" |
1248 |
- fi |
1249 |
- |
1250 |
- # DBA drivers support |
1251 |
- my_conf+=" |
1252 |
- $(use_with cdb cdb) |
1253 |
- $(use_with berkdb db4 ${EPREFIX}/usr) |
1254 |
- $(use_enable flatfile flatfile ) |
1255 |
- $(use_with gdbm gdbm ${EPREFIX}/usr) |
1256 |
- $(use_enable inifile inifile ) |
1257 |
- $(use_with qdbm qdbm ${EPREFIX}/usr)" |
1258 |
- |
1259 |
- # Support for the GD graphics library |
1260 |
- my_conf+=" |
1261 |
- $(use_with truetype freetype-dir ${EPREFIX}/usr) |
1262 |
- $(use_with truetype t1lib ${EPREFIX}/usr) |
1263 |
- $(use_enable cjk gd-jis-conv ) |
1264 |
- $(use_with gd jpeg-dir ${EPREFIX}/usr) |
1265 |
- $(use_with gd png-dir ${EPREFIX}/usr) |
1266 |
- $(use_with xpm xpm-dir ${EPREFIX}/usr) |
1267 |
- $(use_with vpx vpx-dir ${EPREFIX}/usr)" |
1268 |
- # enable gd last, so configure can pick up the previous settings |
1269 |
- my_conf+=" |
1270 |
- $(use_with gd gd)" |
1271 |
- |
1272 |
- # IMAP support |
1273 |
- if use imap ; then |
1274 |
- my_conf+=" |
1275 |
- $(use_with imap imap ${EPREFIX}/usr) |
1276 |
- $(use_with ssl imap-ssl ${EPREFIX}/usr)" |
1277 |
- fi |
1278 |
- |
1279 |
- # Interbase/firebird support |
1280 |
- |
1281 |
- if use firebird ; then |
1282 |
- my_conf+=" |
1283 |
- $(use_with firebird interbase ${EPREFIX}/usr)" |
1284 |
- fi |
1285 |
- |
1286 |
- # LDAP support |
1287 |
- if use ldap ; then |
1288 |
- my_conf+=" |
1289 |
- $(use_with ldap ldap ${EPREFIX}/usr) |
1290 |
- $(use_with ldap-sasl ldap-sasl ${EPREFIX}/usr)" |
1291 |
- fi |
1292 |
- |
1293 |
- # MySQL support |
1294 |
- local mysqllib="mysqlnd" |
1295 |
- local mysqlilib="mysqlnd" |
1296 |
- use libmysqlclient && mysqllib="${EPREFIX}/usr" |
1297 |
- use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config" |
1298 |
- |
1299 |
- my_conf+=" $(use_with mysql mysql $mysqllib)" |
1300 |
- my_conf+=" $(use_with mysqli mysqli $mysqlilib)" |
1301 |
- |
1302 |
- local mysqlsock=" $(use_with mysql mysql-sock ${EPREFIX}/var/run/mysqld/mysqld.sock)" |
1303 |
- if use mysql ; then |
1304 |
- my_conf+="${mysqlsock}" |
1305 |
- elif use mysqli ; then |
1306 |
- my_conf+="${mysqlsock}" |
1307 |
- fi |
1308 |
- |
1309 |
- # ODBC support |
1310 |
- if use odbc ; then |
1311 |
- my_conf+=" |
1312 |
- $(use_with odbc unixODBC ${EPREFIX}/usr)" |
1313 |
- fi |
1314 |
- |
1315 |
- if use iodbc ; then |
1316 |
- my_conf+=" |
1317 |
- $(use_with iodbc iodbc ${EPREFIX}/usr)" |
1318 |
- fi |
1319 |
- |
1320 |
- # Oracle support |
1321 |
- if use oci8-instant-client ; then |
1322 |
- my_conf+=" |
1323 |
- $(use_with oci8-instant-client oci8)" |
1324 |
- fi |
1325 |
- |
1326 |
- # PDO support |
1327 |
- if use pdo ; then |
1328 |
- my_conf+=" |
1329 |
- $(use_with mssql pdo-dblib ) |
1330 |
- $(use_with mysql pdo-mysql ${mysqllib}) |
1331 |
- $(use_with postgres pdo-pgsql ) |
1332 |
- $(use_with sqlite pdo-sqlite ${EPREFIX}/usr) |
1333 |
- $(use_with odbc pdo-odbc unixODBC,${EPREFIX}/usr)" |
1334 |
- if use oci8-instant-client ; then |
1335 |
- my_conf+=" |
1336 |
- $(use_with oci8-instant-client pdo-oci)" |
1337 |
- fi |
1338 |
- fi |
1339 |
- |
1340 |
- # readline/libedit support |
1341 |
- my_conf+=" |
1342 |
- $(use_with readline readline ${EPREFIX}/usr) |
1343 |
- $(use_with libedit libedit ${EPREFIX}/usr)" |
1344 |
- |
1345 |
- # Session support |
1346 |
- if use session ; then |
1347 |
- my_conf+=" |
1348 |
- $(use_with sharedmem mm ${EPREFIX}/usr)" |
1349 |
- else |
1350 |
- my_conf+=" |
1351 |
- $(use_enable session session )" |
1352 |
- fi |
1353 |
- |
1354 |
- # Use pic for shared modules such as apache2's mod_php |
1355 |
- my_conf="${my_conf} --with-pic" |
1356 |
- |
1357 |
- # we use the system copy of pcre |
1358 |
- # --with-pcre-regex affects ext/pcre |
1359 |
- # --with-pcre-dir affects ext/filter and ext/zip |
1360 |
- my_conf="${my_conf} --with-pcre-regex=${EPREFIX}/usr --with-pcre-dir=${EPREFIX}/usr" |
1361 |
- |
1362 |
- # Catch CFLAGS problems |
1363 |
- # Fixes bug #14067. |
1364 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
1365 |
- replace-cpu-flags "k6*" "i586" |
1366 |
- |
1367 |
- # Support user-passed configuration parameters |
1368 |
- my_conf="${my_conf} ${EXTRA_ECONF:-}" |
1369 |
- |
1370 |
- # Support the Apache2 extras, they must be set globally for all |
1371 |
- # SAPIs to work correctly, especially for external PHP extensions |
1372 |
- |
1373 |
- mkdir -p "${WORKDIR}/sapis-build" |
1374 |
- for one_sapi in $SAPIS ; do |
1375 |
- use "${one_sapi}" || continue |
1376 |
- php_set_ini_dir "${one_sapi}" |
1377 |
- |
1378 |
- cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}" |
1379 |
- cd "${WORKDIR}/sapis-build/${one_sapi}" |
1380 |
- |
1381 |
- sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} |
1382 |
- --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}" |
1383 |
- |
1384 |
- for sapi in $SAPIS ; do |
1385 |
- case "$sapi" in |
1386 |
- cli|cgi|embed|fpm) |
1387 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
1388 |
- sapi_conf="${sapi_conf} --enable-${sapi}" |
1389 |
- else |
1390 |
- sapi_conf="${sapi_conf} --disable-${sapi}" |
1391 |
- fi |
1392 |
- ;; |
1393 |
- |
1394 |
- apache2) |
1395 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
1396 |
- sapi_conf="${sapi_conf} --with-apxs2=${EPREFIX}/usr/sbin/apxs" |
1397 |
- else |
1398 |
- sapi_conf="${sapi_conf} --without-apxs2" |
1399 |
- fi |
1400 |
- ;; |
1401 |
- esac |
1402 |
- done |
1403 |
- |
1404 |
- econf ${sapi_conf} |
1405 |
- done |
1406 |
-} |
1407 |
- |
1408 |
-src_compile() { |
1409 |
- # snmp seems to run during src_compile, too (bug #324739) |
1410 |
- addpredict /usr/share/snmp/mibs/.index |
1411 |
- addpredict /var/lib/net-snmp/mib_indexes |
1412 |
- |
1413 |
- for sapi in ${SAPIS} ; do |
1414 |
- if use "${sapi}"; then |
1415 |
- cd "${WORKDIR}/sapis-build/$sapi" || "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
1416 |
- emake || die "emake failed" |
1417 |
- fi |
1418 |
- done |
1419 |
-} |
1420 |
- |
1421 |
-src_install() { |
1422 |
- # see bug #324739 for what happens when we don't have that |
1423 |
- addpredict /usr/share/snmp/mibs/.index |
1424 |
- |
1425 |
- # grab the first SAPI that got built and install common files from there |
1426 |
- local first_sapi="" |
1427 |
- for sapi in $SAPIS ; do |
1428 |
- if use $sapi ; then |
1429 |
- first_sapi=$sapi |
1430 |
- break |
1431 |
- fi |
1432 |
- done |
1433 |
- |
1434 |
- # Makefile forgets to create this before trying to write to it... |
1435 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
1436 |
- |
1437 |
- # Install php environment (without any sapis) |
1438 |
- cd "${WORKDIR}/sapis-build/$first_sapi" |
1439 |
- emake INSTALL_ROOT="${D}" \ |
1440 |
- install-build install-headers install-programs \ |
1441 |
- || die "emake install failed" |
1442 |
- |
1443 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
1444 |
- |
1445 |
- # Create the directory where we'll put version-specific php scripts |
1446 |
- keepdir /usr/share/php${PHP_MV} |
1447 |
- |
1448 |
- local sapi="", file="" |
1449 |
- local sapi_list="" |
1450 |
- |
1451 |
- for sapi in ${SAPIS}; do |
1452 |
- if use "${sapi}" ; then |
1453 |
- einfo "Installing SAPI: ${sapi}" |
1454 |
- cd "${WORKDIR}/sapis-build/${sapi}" |
1455 |
- |
1456 |
- if [[ "${sapi}" == "apache2" ]] ; then |
1457 |
- # We're specifically not using emake install-sapi as libtool |
1458 |
- # may cause unnecessary relink failures (see bug #351266) |
1459 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
1460 |
- newins ".libs/libphp5$(get_libname)" "libphp${PHP_MV}$(get_libname)" |
1461 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
1462 |
- else |
1463 |
- # needed each time, php_install_ini would reset it |
1464 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
1465 |
- into "${dest}" |
1466 |
- case "$sapi" in |
1467 |
- cli) |
1468 |
- source="sapi/cli/php" |
1469 |
- ;; |
1470 |
- cgi) |
1471 |
- source="sapi/cgi/php-cgi" |
1472 |
- ;; |
1473 |
- fpm) |
1474 |
- source="sapi/fpm/php-fpm" |
1475 |
- ;; |
1476 |
- embed) |
1477 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
1478 |
- ;; |
1479 |
- *) |
1480 |
- die "unhandled sapi in src_install" |
1481 |
- ;; |
1482 |
- esac |
1483 |
- |
1484 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
1485 |
- dolib.so "${source}" || die "Unable to install ${sapi} sapi" |
1486 |
- else |
1487 |
- dobin "${source}" || die "Unable to install ${sapi} sapi" |
1488 |
- local name="$(basename ${source})" |
1489 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
1490 |
- fi |
1491 |
- fi |
1492 |
- |
1493 |
- php_install_ini "${sapi}" |
1494 |
- |
1495 |
- # construct correct SAPI string for php-config |
1496 |
- # thanks to ferringb for the bash voodoo |
1497 |
- if [[ "${sapi}" == "apache2" ]]; then |
1498 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
1499 |
- else |
1500 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
1501 |
- fi |
1502 |
- fi |
1503 |
- done |
1504 |
- |
1505 |
- # Installing opcache module |
1506 |
- if use_if_iuse opcache ; then |
1507 |
- dolib.so "modules/opcache$(get_libname)" || die "Unable to install opcache module" |
1508 |
- fi |
1509 |
- |
1510 |
- # Install env.d files |
1511 |
- newenvd "${FILESDIR}/20php5-envd" \ |
1512 |
- "20php${SLOT}" |
1513 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i \ |
1514 |
- "${ED}/etc/env.d/20php${SLOT}" |
1515 |
- sed -e "s|php5|php${SLOT}|g" -i \ |
1516 |
- "${ED}/etc/env.d/20php${SLOT}" |
1517 |
- |
1518 |
- # set php-config variable correctly (bug #278439) |
1519 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
1520 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" |
1521 |
- |
1522 |
- if use fpm ; then |
1523 |
- if use systemd; then |
1524 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" "php-fpm@${SLOT}.service" |
1525 |
- else |
1526 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" "php-fpm@${SLOT}.service" |
1527 |
- fi |
1528 |
- fi |
1529 |
-} |
1530 |
- |
1531 |
-src_test() { |
1532 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
1533 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
1534 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
1535 |
- ewarn "Test phase requires USE=cli, skipping" |
1536 |
- return |
1537 |
- else |
1538 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
1539 |
- fi |
1540 |
- |
1541 |
- if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
1542 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
1543 |
- fi |
1544 |
- |
1545 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \ |
1546 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d "session.save_path=${T}" |
1547 |
- |
1548 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
1549 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null |
1550 |
- done |
1551 |
- |
1552 |
- local failed="$(find -name '*.out')" |
1553 |
- if [[ ${failed} != "" ]] ; then |
1554 |
- ewarn "The following test cases failed unexpectedly:" |
1555 |
- for name in ${failed}; do |
1556 |
- ewarn " ${name/.out/}" |
1557 |
- done |
1558 |
- else |
1559 |
- einfo "No unexpected test failures, all fine" |
1560 |
- fi |
1561 |
- |
1562 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
1563 |
- local passed="" |
1564 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
1565 |
- [[ -f "${name}.diff" ]] && continue |
1566 |
- passed="${passed} ${name}" |
1567 |
- done |
1568 |
- if [[ ${passed} != "" ]] ; then |
1569 |
- einfo "The following test cases passed unexpectedly:" |
1570 |
- for name in ${passed}; do |
1571 |
- ewarn " ${passed}" |
1572 |
- done |
1573 |
- else |
1574 |
- einfo "None of the known-to-fail tests passed, all fine" |
1575 |
- fi |
1576 |
- fi |
1577 |
-} |
1578 |
- |
1579 |
-pkg_postinst() { |
1580 |
- # Output some general info to the user |
1581 |
- if use apache2 ; then |
1582 |
- APACHE2_MOD_DEFINE="PHP" |
1583 |
- APACHE2_MOD_CONF="70_mod_php" # provided by app-eselect/eselect-php |
1584 |
- apache-module_pkg_postinst |
1585 |
- fi |
1586 |
- |
1587 |
- # Create the symlinks for php |
1588 |
- for m in ${SAPIS}; do |
1589 |
- [[ ${m} == 'embed' ]] && continue; |
1590 |
- if use $m ; then |
1591 |
- local ci=$(eselect php show $m) |
1592 |
- if [[ -z $ci ]]; then |
1593 |
- eselect php set $m php${SLOT} |
1594 |
- einfo "Switched ${m} to use php:${SLOT}" |
1595 |
- einfo |
1596 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
1597 |
- elog "To switch $m to use php:${SLOT}, run" |
1598 |
- elog " eselect php set $m php${SLOT}" |
1599 |
- elog |
1600 |
- fi |
1601 |
- fi |
1602 |
- done |
1603 |
- |
1604 |
- elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes php${SLOT/./-} in order" |
1605 |
- elog "to compile extensions for the ${SLOT} ABI" |
1606 |
- elog |
1607 |
- if ! use readline && use cli ; then |
1608 |
- ewarn "Note that in order to use php interactivly, you need to enable" |
1609 |
- ewarn "the readline USE flag or php -a will hang" |
1610 |
- fi |
1611 |
- elog |
1612 |
- elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version." |
1613 |
- elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either" |
1614 |
- elog "'production' or 'development' in ${EPREFIX}/etc/make.conf" |
1615 |
- elog "Both versions of php.ini can be found in ${EPREFIX}/usr/share/doc/${PF}" |
1616 |
- |
1617 |
- elog |
1618 |
- elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:" |
1619 |
- elog "https://www.gentoo.org/proj/en/php/php-upgrading.xml" |
1620 |
- elog |
1621 |
-} |
1622 |
- |
1623 |
-pkg_prerm() { |
1624 |
- eselect php cleanup |
1625 |
-} |
1626 |
|
1627 |
diff --git a/dev-lang/php/php-5.5.35.ebuild b/dev-lang/php/php-5.5.35.ebuild |
1628 |
deleted file mode 100644 |
1629 |
index 6b9b1ff..0000000 |
1630 |
--- a/dev-lang/php/php-5.5.35.ebuild |
1631 |
+++ /dev/null |
1632 |
@@ -1,784 +0,0 @@ |
1633 |
-# Copyright 1999-2016 Gentoo Foundation |
1634 |
-# Distributed under the terms of the GNU General Public License v2 |
1635 |
-# $Id$ |
1636 |
- |
1637 |
-EAPI=5 |
1638 |
- |
1639 |
-inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool systemd |
1640 |
- |
1641 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" |
1642 |
- |
1643 |
-function php_get_uri () |
1644 |
-{ |
1645 |
- case "${1}" in |
1646 |
- "php-pre") |
1647 |
- echo "http://downloads.php.net/dsp/${2}" |
1648 |
- ;; |
1649 |
- "php") |
1650 |
- echo "http://www.php.net/distributions/${2}" |
1651 |
- ;; |
1652 |
- "olemarkus") |
1653 |
- echo "https://dev.gentoo.org/~olemarkus/php/${2}" |
1654 |
- ;; |
1655 |
- "gentoo") |
1656 |
- echo "mirror://gentoo/${2}" |
1657 |
- ;; |
1658 |
- *) |
1659 |
- die "unhandled case in php_get_uri" |
1660 |
- ;; |
1661 |
- esac |
1662 |
-} |
1663 |
- |
1664 |
-PHP_MV="$(get_major_version)" |
1665 |
-SLOT="$(get_version_component_range 1-2)" |
1666 |
- |
1667 |
-# alias, so we can handle different types of releases (finals, rcs, alphas, |
1668 |
-# betas, ...) w/o changing the whole ebuild |
1669 |
-PHP_PV="${PV/_rc/RC}" |
1670 |
-PHP_PV="${PHP_PV/_alpha/alpha}" |
1671 |
-PHP_PV="${PHP_PV/_beta/beta}" |
1672 |
-PHP_RELEASE="php" |
1673 |
-[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre" |
1674 |
-[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre" |
1675 |
-[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre" |
1676 |
-PHP_P="${PN}-${PHP_PV}" |
1677 |
- |
1678 |
-PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")" |
1679 |
- |
1680 |
-PHP_FPM_CONF_VER="1" |
1681 |
- |
1682 |
-SRC_URI="${PHP_SRC_URI}" |
1683 |
- |
1684 |
-DESCRIPTION="The PHP language runtime engine" |
1685 |
-HOMEPAGE="http://php.net/" |
1686 |
-LICENSE="PHP-3" |
1687 |
- |
1688 |
-S="${WORKDIR}/${PHP_P}" |
1689 |
- |
1690 |
-# We can build the following SAPIs in the given order |
1691 |
-SAPIS="embed cli cgi fpm apache2" |
1692 |
- |
1693 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
1694 |
-IUSE="${IUSE} |
1695 |
- ${SAPIS/cli/+cli} |
1696 |
- threads" |
1697 |
- |
1698 |
-IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk |
1699 |
- crypt +ctype curl debug |
1700 |
- enchant exif frontbase +fileinfo +filter firebird |
1701 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
1702 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash |
1703 |
- mssql mysql libmysqlclient mysqli nls |
1704 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
1705 |
- readline recode selinux +session sharedmem |
1706 |
- +simplexml snmp soap sockets spell sqlite ssl |
1707 |
- sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx |
1708 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
1709 |
- |
1710 |
-DEPEND=" |
1711 |
- >=app-eselect/eselect-php-0.7.1-r3[apache2?,fpm?] |
1712 |
- >=dev-libs/libpcre-8.32[unicode] |
1713 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
1714 |
- <www-servers/apache-2.4[threads=] ) ) |
1715 |
- berkdb? ( =sys-libs/db-4* ) |
1716 |
- bzip2? ( app-arch/bzip2 ) |
1717 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
1718 |
- cjk? ( !gd? ( |
1719 |
- virtual/jpeg:0 |
1720 |
- media-libs/libpng:0= |
1721 |
- sys-libs/zlib |
1722 |
- ) ) |
1723 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
1724 |
- curl? ( >=net-misc/curl-7.10.5 ) |
1725 |
- enchant? ( app-text/enchant ) |
1726 |
- exif? ( !gd? ( |
1727 |
- virtual/jpeg:0 |
1728 |
- media-libs/libpng:0= |
1729 |
- sys-libs/zlib |
1730 |
- ) ) |
1731 |
- firebird? ( dev-db/firebird ) |
1732 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
1733 |
- gdbm? ( >=sys-libs/gdbm-1.8.0 ) |
1734 |
- gmp? ( >=dev-libs/gmp-4.1.2 ) |
1735 |
- iconv? ( virtual/libiconv ) |
1736 |
- imap? ( virtual/imap-c-client[ssl=] ) |
1737 |
- intl? ( dev-libs/icu:= ) |
1738 |
- iodbc? ( dev-db/libiodbc ) |
1739 |
- kerberos? ( virtual/krb5 ) |
1740 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
1741 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
1742 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
1743 |
- mssql? ( dev-db/freetds[mssql] ) |
1744 |
- libmysqlclient? ( |
1745 |
- mysql? ( virtual/mysql ) |
1746 |
- mysqli? ( >=virtual/mysql-4.1 ) |
1747 |
- ) |
1748 |
- nls? ( sys-devel/gettext ) |
1749 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
1750 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
1751 |
- postgres? ( dev-db/postgresql ) |
1752 |
- qdbm? ( dev-db/qdbm ) |
1753 |
- readline? ( sys-libs/readline ) |
1754 |
- recode? ( app-text/recode ) |
1755 |
- sharedmem? ( dev-libs/mm ) |
1756 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
1757 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
1758 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
1759 |
- spell? ( >=app-text/aspell-0.50 ) |
1760 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
1761 |
- ssl? ( >=dev-libs/openssl-0.9.7 ) |
1762 |
- sybase-ct? ( dev-db/freetds ) |
1763 |
- tidy? ( app-text/htmltidy ) |
1764 |
- truetype? ( |
1765 |
- =media-libs/freetype-2* |
1766 |
- >=media-libs/t1lib-5.0.0 |
1767 |
- !gd? ( |
1768 |
- virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
1769 |
- ) |
1770 |
- unicode? ( dev-libs/oniguruma ) |
1771 |
- vpx? ( media-libs/libvpx ) |
1772 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
1773 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
1774 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
1775 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
1776 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
1777 |
- xpm? ( |
1778 |
- x11-libs/libXpm |
1779 |
- virtual/jpeg:0 |
1780 |
- media-libs/libpng:0= sys-libs/zlib |
1781 |
- ) |
1782 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
1783 |
- zip? ( sys-libs/zlib ) |
1784 |
- zlib? ( sys-libs/zlib ) |
1785 |
- virtual/mta |
1786 |
-" |
1787 |
- |
1788 |
-php="=${CATEGORY}/${PF}" |
1789 |
- |
1790 |
-REQUIRED_USE=" |
1791 |
- truetype? ( gd ) |
1792 |
- vpx? ( gd ) |
1793 |
- cjk? ( gd ) |
1794 |
- exif? ( gd ) |
1795 |
- |
1796 |
- xpm? ( gd ) |
1797 |
- gd? ( zlib ) |
1798 |
- simplexml? ( xml ) |
1799 |
- soap? ( xml ) |
1800 |
- wddx? ( xml ) |
1801 |
- xmlrpc? ( || ( xml iconv ) ) |
1802 |
- xmlreader? ( xml ) |
1803 |
- xslt? ( xml ) |
1804 |
- ldap-sasl? ( ldap ) |
1805 |
- mhash? ( hash ) |
1806 |
- phar? ( hash ) |
1807 |
- libmysqlclient? ( || ( |
1808 |
- mysql |
1809 |
- mysqli |
1810 |
- pdo |
1811 |
- ) ) |
1812 |
- |
1813 |
- qdbm? ( !gdbm ) |
1814 |
- readline? ( !libedit ) |
1815 |
- recode? ( !imap !mysql !mysqli ) |
1816 |
- sharedmem? ( !threads ) |
1817 |
- |
1818 |
- !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" |
1819 |
- |
1820 |
-RDEPEND="${DEPEND}" |
1821 |
- |
1822 |
-RDEPEND="${RDEPEND} |
1823 |
- fpm? ( |
1824 |
- selinux? ( sec-policy/selinux-phpfpm ) |
1825 |
- systemd? ( sys-apps/systemd ) )" |
1826 |
- |
1827 |
-DEPEND="${DEPEND} |
1828 |
- sys-devel/flex |
1829 |
- >=sys-devel/m4-1.4.3 |
1830 |
- >=sys-devel/libtool-1.5.18" |
1831 |
- |
1832 |
-# Allow users to install production version if they want to |
1833 |
- |
1834 |
-case "${PHP_INI_VERSION}" in |
1835 |
- production|development) |
1836 |
- ;; |
1837 |
- *) |
1838 |
- PHP_INI_VERSION="development" |
1839 |
- ;; |
1840 |
-esac |
1841 |
- |
1842 |
-PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}" |
1843 |
-PHP_INI_FILE="php.ini" |
1844 |
- |
1845 |
-want_apache |
1846 |
- |
1847 |
-pkg_setup() { |
1848 |
- depend.apache_pkg_setup |
1849 |
-} |
1850 |
- |
1851 |
-php_install_ini() { |
1852 |
- local phpsapi="${1}" |
1853 |
- |
1854 |
- # work out where we are installing the ini file |
1855 |
- php_set_ini_dir "${phpsapi}" |
1856 |
- |
1857 |
- local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}" |
1858 |
- cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" |
1859 |
- |
1860 |
- # default to /tmp for save_path, bug #282768 |
1861 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" |
1862 |
- |
1863 |
- # Set the extension dir |
1864 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" |
1865 |
- |
1866 |
- # Set the include path to point to where we want to find PEAR packages |
1867 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" |
1868 |
- |
1869 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
1870 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
1871 |
- newins "${phpinisrc}" "${PHP_INI_FILE}" |
1872 |
- |
1873 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
1874 |
- elog |
1875 |
- |
1876 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
1877 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
1878 |
- |
1879 |
- if use_if_iuse opcache; then |
1880 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
1881 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
1882 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
1883 |
- fi |
1884 |
- |
1885 |
- # SAPI-specific handling |
1886 |
- |
1887 |
- if [[ "${sapi}" == "fpm" ]] ; then |
1888 |
- [[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0 |
1889 |
- einfo "Installing FPM CGI config file php-fpm.conf" |
1890 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
1891 |
- newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" php-fpm.conf |
1892 |
- |
1893 |
- # Remove bogus /etc/php-fpm.conf.default (bug 359906) |
1894 |
- [[ -f "${ED}/etc/php-fpm.conf.default" ]] && rm "${ED}/etc/php-fpm.conf.default" |
1895 |
- fi |
1896 |
- |
1897 |
- # Install PHP ini files into /usr/share/php |
1898 |
- |
1899 |
- dodoc php.ini-development |
1900 |
- dodoc php.ini-production |
1901 |
- |
1902 |
-} |
1903 |
- |
1904 |
-php_set_ini_dir() { |
1905 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
1906 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
1907 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
1908 |
-} |
1909 |
- |
1910 |
-src_prepare() { |
1911 |
- # USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path |
1912 |
- # ([empty session.save_path]/session_mm_[sapi][gid].sem) |
1913 |
- # there is no easy way to circumvent that, all php calls during |
1914 |
- # install use -n, so no php.ini file will be used. |
1915 |
- # As such, this is the easiest way to get around |
1916 |
- addpredict /session_mm_cli250.sem |
1917 |
- addpredict /session_mm_cli0.sem |
1918 |
- |
1919 |
- # Change PHP branding |
1920 |
- # Get the alpha/beta/rc version |
1921 |
- sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ |
1922 |
- -i configure.in || die "Unable to change PHP branding" |
1923 |
- |
1924 |
- # Patch PHP to show Gentoo as the server platform |
1925 |
- sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
1926 |
- -i configure.in || die "Failed to fix server platform name" |
1927 |
- |
1928 |
- # Prevent PHP from activating the Apache config, |
1929 |
- # as we will do that ourselves |
1930 |
- sed -i \ |
1931 |
- -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
1932 |
- -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
1933 |
- configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 |
1934 |
- |
1935 |
- # Patch PHP to support heimdal instead of mit-krb5 |
1936 |
- if has_version "app-crypt/heimdal" ; then |
1937 |
- sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
1938 |
- || die "Failed to fix heimdal libname" |
1939 |
- sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
1940 |
- || die "Failed to fix heimdal crypt library reference" |
1941 |
- fi |
1942 |
- |
1943 |
- #Add user patches #357637 |
1944 |
- epatch_user |
1945 |
- |
1946 |
- #force rebuilding aclocal.m4 |
1947 |
- rm aclocal.m4 |
1948 |
- eautoreconf |
1949 |
- |
1950 |
- if [[ ${CHOST} == *-darwin* ]] ; then |
1951 |
- # http://bugs.php.net/bug.php?id=48795, bug #343481 |
1952 |
- sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die |
1953 |
- fi |
1954 |
-} |
1955 |
- |
1956 |
-src_configure() { |
1957 |
- addpredict /usr/share/snmp/mibs/.index |
1958 |
- addpredict /var/lib/net-snmp/mib_indexes |
1959 |
- |
1960 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
1961 |
- |
1962 |
- # This is a global variable and should be in caps. It isn't because the |
1963 |
- # phpconfutils eclass relies on exactly this name... |
1964 |
- # for --with-libdir see bug #327025 |
1965 |
- my_conf=" |
1966 |
- --prefix="${PHP_DESTDIR}" |
1967 |
- --mandir="${PHP_DESTDIR}"/man |
1968 |
- --infodir="${PHP_DESTDIR}"/info |
1969 |
- --libdir="${PHP_DESTDIR}"/lib |
1970 |
- --with-libdir=$(get_libdir) |
1971 |
- --without-pear |
1972 |
- $(use_enable threads maintainer-zts)" |
1973 |
- |
1974 |
- # extension USE flag shared |
1975 |
- my_conf+=" |
1976 |
- $(use_enable bcmath bcmath ) |
1977 |
- $(use_with bzip2 bz2 "${EPREFIX}"/usr) |
1978 |
- $(use_enable calendar calendar ) |
1979 |
- $(use_enable ctype ctype ) |
1980 |
- $(use_with curl curl "${EPREFIX}"/usr) |
1981 |
- $(use_enable xml dom ) |
1982 |
- $(use_with enchant enchant "${EPREFIX}"/usr) |
1983 |
- $(use_enable exif exif ) |
1984 |
- $(use_enable fileinfo fileinfo ) |
1985 |
- $(use_enable filter filter ) |
1986 |
- $(use_enable ftp ftp ) |
1987 |
- $(use_with nls gettext "${EPREFIX}"/usr) |
1988 |
- $(use_with gmp gmp "${EPREFIX}"/usr) |
1989 |
- $(use_enable hash hash ) |
1990 |
- $(use_with mhash mhash "${EPREFIX}"/usr) |
1991 |
- $(use_with iconv iconv $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}"/usr)) |
1992 |
- $(use_enable intl intl ) |
1993 |
- $(use_enable ipv6 ipv6 ) |
1994 |
- $(use_enable json json ) |
1995 |
- $(use_with kerberos kerberos "${EPREFIX}"/usr) |
1996 |
- $(use_enable xml libxml ) |
1997 |
- $(use_with xml libxml-dir "${EPREFIX}"/usr) |
1998 |
- $(use_enable unicode mbstring ) |
1999 |
- $(use_with crypt mcrypt "${EPREFIX}"/usr) |
2000 |
- $(use_with mssql mssql "${EPREFIX}"/usr) |
2001 |
- $(use_with unicode onig "${EPREFIX}"/usr) |
2002 |
- $(use_with ssl openssl "${EPREFIX}"/usr) |
2003 |
- $(use_with ssl openssl-dir "${EPREFIX}"/usr) |
2004 |
- $(use_enable pcntl pcntl ) |
2005 |
- $(use_enable phar phar ) |
2006 |
- $(use_enable pdo pdo ) |
2007 |
- $(use_enable opcache opcache ) |
2008 |
- $(use_with postgres pgsql "${EPREFIX}"/usr) |
2009 |
- $(use_enable posix posix ) |
2010 |
- $(use_with spell pspell "${EPREFIX}"/usr) |
2011 |
- $(use_with recode recode "${EPREFIX}"/usr) |
2012 |
- $(use_enable simplexml simplexml ) |
2013 |
- $(use_enable sharedmem shmop ) |
2014 |
- $(use_with snmp snmp "${EPREFIX}"/usr) |
2015 |
- $(use_enable soap soap ) |
2016 |
- $(use_enable sockets sockets ) |
2017 |
- $(use_with sqlite sqlite3 "${EPREFIX}"/usr) |
2018 |
- $(use_with sybase-ct sybase-ct "${EPREFIX}"/usr) |
2019 |
- $(use_enable sysvipc sysvmsg ) |
2020 |
- $(use_enable sysvipc sysvsem ) |
2021 |
- $(use_enable sysvipc sysvshm ) |
2022 |
- $(use_with systemd fpm-systemd) |
2023 |
- $(use_with tidy tidy "${EPREFIX}"/usr) |
2024 |
- $(use_enable tokenizer tokenizer ) |
2025 |
- $(use_enable wddx wddx ) |
2026 |
- $(use_enable xml xml ) |
2027 |
- $(use_enable xmlreader xmlreader ) |
2028 |
- $(use_enable xmlwriter xmlwriter ) |
2029 |
- $(use_with xmlrpc xmlrpc) |
2030 |
- $(use_with xslt xsl "${EPREFIX}"/usr) |
2031 |
- $(use_enable zip zip ) |
2032 |
- $(use_with zlib zlib "${EPREFIX}"/usr) |
2033 |
- $(use_enable debug debug )" |
2034 |
- |
2035 |
- # DBA support |
2036 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
2037 |
- || use qdbm ; then |
2038 |
- my_conf="${my_conf} --enable-dba${shared}" |
2039 |
- fi |
2040 |
- |
2041 |
- # DBA drivers support |
2042 |
- my_conf+=" |
2043 |
- $(use_with cdb cdb) |
2044 |
- $(use_with berkdb db4 ${EPREFIX}/usr) |
2045 |
- $(use_enable flatfile flatfile ) |
2046 |
- $(use_with gdbm gdbm ${EPREFIX}/usr) |
2047 |
- $(use_enable inifile inifile ) |
2048 |
- $(use_with qdbm qdbm ${EPREFIX}/usr)" |
2049 |
- |
2050 |
- # Support for the GD graphics library |
2051 |
- my_conf+=" |
2052 |
- $(use_with truetype freetype-dir ${EPREFIX}/usr) |
2053 |
- $(use_with truetype t1lib ${EPREFIX}/usr) |
2054 |
- $(use_enable cjk gd-jis-conv ) |
2055 |
- $(use_with gd jpeg-dir ${EPREFIX}/usr) |
2056 |
- $(use_with gd png-dir ${EPREFIX}/usr) |
2057 |
- $(use_with xpm xpm-dir ${EPREFIX}/usr) |
2058 |
- $(use_with vpx vpx-dir ${EPREFIX}/usr)" |
2059 |
- # enable gd last, so configure can pick up the previous settings |
2060 |
- my_conf+=" |
2061 |
- $(use_with gd gd)" |
2062 |
- |
2063 |
- # IMAP support |
2064 |
- if use imap ; then |
2065 |
- my_conf+=" |
2066 |
- $(use_with imap imap ${EPREFIX}/usr) |
2067 |
- $(use_with ssl imap-ssl ${EPREFIX}/usr)" |
2068 |
- fi |
2069 |
- |
2070 |
- # Interbase/firebird support |
2071 |
- |
2072 |
- if use firebird ; then |
2073 |
- my_conf+=" |
2074 |
- $(use_with firebird interbase ${EPREFIX}/usr)" |
2075 |
- fi |
2076 |
- |
2077 |
- # LDAP support |
2078 |
- if use ldap ; then |
2079 |
- my_conf+=" |
2080 |
- $(use_with ldap ldap ${EPREFIX}/usr) |
2081 |
- $(use_with ldap-sasl ldap-sasl ${EPREFIX}/usr)" |
2082 |
- fi |
2083 |
- |
2084 |
- # MySQL support |
2085 |
- local mysqllib="mysqlnd" |
2086 |
- local mysqlilib="mysqlnd" |
2087 |
- use libmysqlclient && mysqllib="${EPREFIX}/usr" |
2088 |
- use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config" |
2089 |
- |
2090 |
- my_conf+=" $(use_with mysql mysql $mysqllib)" |
2091 |
- my_conf+=" $(use_with mysqli mysqli $mysqlilib)" |
2092 |
- |
2093 |
- local mysqlsock=" $(use_with mysql mysql-sock ${EPREFIX}/var/run/mysqld/mysqld.sock)" |
2094 |
- if use mysql ; then |
2095 |
- my_conf+="${mysqlsock}" |
2096 |
- elif use mysqli ; then |
2097 |
- my_conf+="${mysqlsock}" |
2098 |
- fi |
2099 |
- |
2100 |
- # ODBC support |
2101 |
- if use odbc ; then |
2102 |
- my_conf+=" |
2103 |
- $(use_with odbc unixODBC ${EPREFIX}/usr)" |
2104 |
- fi |
2105 |
- |
2106 |
- if use iodbc ; then |
2107 |
- my_conf+=" |
2108 |
- $(use_with iodbc iodbc ${EPREFIX}/usr)" |
2109 |
- fi |
2110 |
- |
2111 |
- # Oracle support |
2112 |
- if use oci8-instant-client ; then |
2113 |
- my_conf+=" |
2114 |
- $(use_with oci8-instant-client oci8)" |
2115 |
- fi |
2116 |
- |
2117 |
- # PDO support |
2118 |
- if use pdo ; then |
2119 |
- my_conf+=" |
2120 |
- $(use_with mssql pdo-dblib ) |
2121 |
- $(use_with mysql pdo-mysql ${mysqllib}) |
2122 |
- $(use_with postgres pdo-pgsql ) |
2123 |
- $(use_with sqlite pdo-sqlite ${EPREFIX}/usr) |
2124 |
- $(use_with odbc pdo-odbc unixODBC,${EPREFIX}/usr)" |
2125 |
- if use oci8-instant-client ; then |
2126 |
- my_conf+=" |
2127 |
- $(use_with oci8-instant-client pdo-oci)" |
2128 |
- fi |
2129 |
- fi |
2130 |
- |
2131 |
- # readline/libedit support |
2132 |
- my_conf+=" |
2133 |
- $(use_with readline readline ${EPREFIX}/usr) |
2134 |
- $(use_with libedit libedit ${EPREFIX}/usr)" |
2135 |
- |
2136 |
- # Session support |
2137 |
- if use session ; then |
2138 |
- my_conf+=" |
2139 |
- $(use_with sharedmem mm ${EPREFIX}/usr)" |
2140 |
- else |
2141 |
- my_conf+=" |
2142 |
- $(use_enable session session )" |
2143 |
- fi |
2144 |
- |
2145 |
- # Use pic for shared modules such as apache2's mod_php |
2146 |
- my_conf="${my_conf} --with-pic" |
2147 |
- |
2148 |
- # we use the system copy of pcre |
2149 |
- # --with-pcre-regex affects ext/pcre |
2150 |
- # --with-pcre-dir affects ext/filter and ext/zip |
2151 |
- my_conf="${my_conf} --with-pcre-regex=${EPREFIX}/usr --with-pcre-dir=${EPREFIX}/usr" |
2152 |
- |
2153 |
- # Catch CFLAGS problems |
2154 |
- # Fixes bug #14067. |
2155 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
2156 |
- replace-cpu-flags "k6*" "i586" |
2157 |
- |
2158 |
- # Support user-passed configuration parameters |
2159 |
- my_conf="${my_conf} ${EXTRA_ECONF:-}" |
2160 |
- |
2161 |
- # Support the Apache2 extras, they must be set globally for all |
2162 |
- # SAPIs to work correctly, especially for external PHP extensions |
2163 |
- |
2164 |
- mkdir -p "${WORKDIR}/sapis-build" |
2165 |
- for one_sapi in $SAPIS ; do |
2166 |
- use "${one_sapi}" || continue |
2167 |
- php_set_ini_dir "${one_sapi}" |
2168 |
- |
2169 |
- cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}" |
2170 |
- cd "${WORKDIR}/sapis-build/${one_sapi}" |
2171 |
- |
2172 |
- sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} |
2173 |
- --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}" |
2174 |
- |
2175 |
- for sapi in $SAPIS ; do |
2176 |
- case "$sapi" in |
2177 |
- cli|cgi|embed|fpm) |
2178 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
2179 |
- sapi_conf="${sapi_conf} --enable-${sapi}" |
2180 |
- else |
2181 |
- sapi_conf="${sapi_conf} --disable-${sapi}" |
2182 |
- fi |
2183 |
- ;; |
2184 |
- |
2185 |
- apache2) |
2186 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
2187 |
- sapi_conf="${sapi_conf} --with-apxs2=${EPREFIX}/usr/sbin/apxs" |
2188 |
- else |
2189 |
- sapi_conf="${sapi_conf} --without-apxs2" |
2190 |
- fi |
2191 |
- ;; |
2192 |
- esac |
2193 |
- done |
2194 |
- |
2195 |
- econf ${sapi_conf} |
2196 |
- done |
2197 |
-} |
2198 |
- |
2199 |
-src_compile() { |
2200 |
- # snmp seems to run during src_compile, too (bug #324739) |
2201 |
- addpredict /usr/share/snmp/mibs/.index |
2202 |
- addpredict /var/lib/net-snmp/mib_indexes |
2203 |
- |
2204 |
- for sapi in ${SAPIS} ; do |
2205 |
- if use "${sapi}"; then |
2206 |
- cd "${WORKDIR}/sapis-build/$sapi" || "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
2207 |
- emake || die "emake failed" |
2208 |
- fi |
2209 |
- done |
2210 |
-} |
2211 |
- |
2212 |
-src_install() { |
2213 |
- # see bug #324739 for what happens when we don't have that |
2214 |
- addpredict /usr/share/snmp/mibs/.index |
2215 |
- |
2216 |
- # grab the first SAPI that got built and install common files from there |
2217 |
- local first_sapi="" |
2218 |
- for sapi in $SAPIS ; do |
2219 |
- if use $sapi ; then |
2220 |
- first_sapi=$sapi |
2221 |
- break |
2222 |
- fi |
2223 |
- done |
2224 |
- |
2225 |
- # Makefile forgets to create this before trying to write to it... |
2226 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
2227 |
- |
2228 |
- # Install php environment (without any sapis) |
2229 |
- cd "${WORKDIR}/sapis-build/$first_sapi" |
2230 |
- emake INSTALL_ROOT="${D}" \ |
2231 |
- install-build install-headers install-programs \ |
2232 |
- || die "emake install failed" |
2233 |
- |
2234 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
2235 |
- |
2236 |
- # Create the directory where we'll put version-specific php scripts |
2237 |
- keepdir /usr/share/php${PHP_MV} |
2238 |
- |
2239 |
- local sapi="", file="" |
2240 |
- local sapi_list="" |
2241 |
- |
2242 |
- for sapi in ${SAPIS}; do |
2243 |
- if use "${sapi}" ; then |
2244 |
- einfo "Installing SAPI: ${sapi}" |
2245 |
- cd "${WORKDIR}/sapis-build/${sapi}" |
2246 |
- |
2247 |
- if [[ "${sapi}" == "apache2" ]] ; then |
2248 |
- # We're specifically not using emake install-sapi as libtool |
2249 |
- # may cause unnecessary relink failures (see bug #351266) |
2250 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
2251 |
- newins ".libs/libphp5$(get_libname)" "libphp${PHP_MV}$(get_libname)" |
2252 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
2253 |
- else |
2254 |
- # needed each time, php_install_ini would reset it |
2255 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
2256 |
- into "${dest}" |
2257 |
- case "$sapi" in |
2258 |
- cli) |
2259 |
- source="sapi/cli/php" |
2260 |
- ;; |
2261 |
- cgi) |
2262 |
- source="sapi/cgi/php-cgi" |
2263 |
- ;; |
2264 |
- fpm) |
2265 |
- source="sapi/fpm/php-fpm" |
2266 |
- ;; |
2267 |
- embed) |
2268 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
2269 |
- ;; |
2270 |
- *) |
2271 |
- die "unhandled sapi in src_install" |
2272 |
- ;; |
2273 |
- esac |
2274 |
- |
2275 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
2276 |
- dolib.so "${source}" || die "Unable to install ${sapi} sapi" |
2277 |
- else |
2278 |
- dobin "${source}" || die "Unable to install ${sapi} sapi" |
2279 |
- local name="$(basename ${source})" |
2280 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
2281 |
- fi |
2282 |
- fi |
2283 |
- |
2284 |
- php_install_ini "${sapi}" |
2285 |
- |
2286 |
- # construct correct SAPI string for php-config |
2287 |
- # thanks to ferringb for the bash voodoo |
2288 |
- if [[ "${sapi}" == "apache2" ]]; then |
2289 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
2290 |
- else |
2291 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
2292 |
- fi |
2293 |
- fi |
2294 |
- done |
2295 |
- |
2296 |
- # Installing opcache module |
2297 |
- if use_if_iuse opcache ; then |
2298 |
- dolib.so "modules/opcache$(get_libname)" || die "Unable to install opcache module" |
2299 |
- fi |
2300 |
- |
2301 |
- # Install env.d files |
2302 |
- newenvd "${FILESDIR}/20php5-envd" \ |
2303 |
- "20php${SLOT}" |
2304 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i \ |
2305 |
- "${ED}/etc/env.d/20php${SLOT}" |
2306 |
- sed -e "s|php5|php${SLOT}|g" -i \ |
2307 |
- "${ED}/etc/env.d/20php${SLOT}" |
2308 |
- |
2309 |
- # set php-config variable correctly (bug #278439) |
2310 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
2311 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" |
2312 |
- |
2313 |
- if use fpm ; then |
2314 |
- if use systemd; then |
2315 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" "php-fpm@${SLOT}.service" |
2316 |
- else |
2317 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" "php-fpm@${SLOT}.service" |
2318 |
- fi |
2319 |
- fi |
2320 |
-} |
2321 |
- |
2322 |
-src_test() { |
2323 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
2324 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
2325 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
2326 |
- ewarn "Test phase requires USE=cli, skipping" |
2327 |
- return |
2328 |
- else |
2329 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
2330 |
- fi |
2331 |
- |
2332 |
- if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
2333 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
2334 |
- fi |
2335 |
- |
2336 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \ |
2337 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d "session.save_path=${T}" |
2338 |
- |
2339 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
2340 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null |
2341 |
- done |
2342 |
- |
2343 |
- local failed="$(find -name '*.out')" |
2344 |
- if [[ ${failed} != "" ]] ; then |
2345 |
- ewarn "The following test cases failed unexpectedly:" |
2346 |
- for name in ${failed}; do |
2347 |
- ewarn " ${name/.out/}" |
2348 |
- done |
2349 |
- else |
2350 |
- einfo "No unexpected test failures, all fine" |
2351 |
- fi |
2352 |
- |
2353 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
2354 |
- local passed="" |
2355 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
2356 |
- [[ -f "${name}.diff" ]] && continue |
2357 |
- passed="${passed} ${name}" |
2358 |
- done |
2359 |
- if [[ ${passed} != "" ]] ; then |
2360 |
- einfo "The following test cases passed unexpectedly:" |
2361 |
- for name in ${passed}; do |
2362 |
- ewarn " ${passed}" |
2363 |
- done |
2364 |
- else |
2365 |
- einfo "None of the known-to-fail tests passed, all fine" |
2366 |
- fi |
2367 |
- fi |
2368 |
-} |
2369 |
- |
2370 |
-pkg_postinst() { |
2371 |
- # Output some general info to the user |
2372 |
- if use apache2 ; then |
2373 |
- APACHE2_MOD_DEFINE="PHP" |
2374 |
- APACHE2_MOD_CONF="70_mod_php" # provided by app-eselect/eselect-php |
2375 |
- apache-module_pkg_postinst |
2376 |
- fi |
2377 |
- |
2378 |
- # Create the symlinks for php |
2379 |
- for m in ${SAPIS}; do |
2380 |
- [[ ${m} == 'embed' ]] && continue; |
2381 |
- if use $m ; then |
2382 |
- local ci=$(eselect php show $m) |
2383 |
- if [[ -z $ci ]]; then |
2384 |
- eselect php set $m php${SLOT} |
2385 |
- einfo "Switched ${m} to use php:${SLOT}" |
2386 |
- einfo |
2387 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
2388 |
- elog "To switch $m to use php:${SLOT}, run" |
2389 |
- elog " eselect php set $m php${SLOT}" |
2390 |
- elog |
2391 |
- fi |
2392 |
- fi |
2393 |
- done |
2394 |
- |
2395 |
- elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes php${SLOT/./-} in order" |
2396 |
- elog "to compile extensions for the ${SLOT} ABI" |
2397 |
- elog |
2398 |
- if ! use readline && use cli ; then |
2399 |
- ewarn "Note that in order to use php interactivly, you need to enable" |
2400 |
- ewarn "the readline USE flag or php -a will hang" |
2401 |
- fi |
2402 |
- elog |
2403 |
- elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version." |
2404 |
- elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either" |
2405 |
- elog "'production' or 'development' in ${EPREFIX}/etc/make.conf" |
2406 |
- elog "Both versions of php.ini can be found in ${EPREFIX}/usr/share/doc/${PF}" |
2407 |
- |
2408 |
- elog |
2409 |
- elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:" |
2410 |
- elog "https://www.gentoo.org/proj/en/php/php-upgrading.xml" |
2411 |
- elog |
2412 |
-} |
2413 |
- |
2414 |
-pkg_prerm() { |
2415 |
- eselect php cleanup |
2416 |
-} |
2417 |
|
2418 |
diff --git a/dev-lang/php/php-5.5.36.ebuild b/dev-lang/php/php-5.5.36.ebuild |
2419 |
deleted file mode 100644 |
2420 |
index 20e34ef..0000000 |
2421 |
--- a/dev-lang/php/php-5.5.36.ebuild |
2422 |
+++ /dev/null |
2423 |
@@ -1,784 +0,0 @@ |
2424 |
-# Copyright 1999-2016 Gentoo Foundation |
2425 |
-# Distributed under the terms of the GNU General Public License v2 |
2426 |
-# $Id$ |
2427 |
- |
2428 |
-EAPI=5 |
2429 |
- |
2430 |
-inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool systemd |
2431 |
- |
2432 |
-KEYWORDS="alpha amd64 arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" |
2433 |
- |
2434 |
-function php_get_uri () |
2435 |
-{ |
2436 |
- case "${1}" in |
2437 |
- "php-pre") |
2438 |
- echo "http://downloads.php.net/dsp/${2}" |
2439 |
- ;; |
2440 |
- "php") |
2441 |
- echo "http://www.php.net/distributions/${2}" |
2442 |
- ;; |
2443 |
- "olemarkus") |
2444 |
- echo "https://dev.gentoo.org/~olemarkus/php/${2}" |
2445 |
- ;; |
2446 |
- "gentoo") |
2447 |
- echo "mirror://gentoo/${2}" |
2448 |
- ;; |
2449 |
- *) |
2450 |
- die "unhandled case in php_get_uri" |
2451 |
- ;; |
2452 |
- esac |
2453 |
-} |
2454 |
- |
2455 |
-PHP_MV="$(get_major_version)" |
2456 |
-SLOT="$(get_version_component_range 1-2)" |
2457 |
- |
2458 |
-# alias, so we can handle different types of releases (finals, rcs, alphas, |
2459 |
-# betas, ...) w/o changing the whole ebuild |
2460 |
-PHP_PV="${PV/_rc/RC}" |
2461 |
-PHP_PV="${PHP_PV/_alpha/alpha}" |
2462 |
-PHP_PV="${PHP_PV/_beta/beta}" |
2463 |
-PHP_RELEASE="php" |
2464 |
-[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre" |
2465 |
-[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre" |
2466 |
-[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre" |
2467 |
-PHP_P="${PN}-${PHP_PV}" |
2468 |
- |
2469 |
-PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")" |
2470 |
- |
2471 |
-PHP_FPM_CONF_VER="1" |
2472 |
- |
2473 |
-SRC_URI="${PHP_SRC_URI}" |
2474 |
- |
2475 |
-DESCRIPTION="The PHP language runtime engine" |
2476 |
-HOMEPAGE="http://php.net/" |
2477 |
-LICENSE="PHP-3" |
2478 |
- |
2479 |
-S="${WORKDIR}/${PHP_P}" |
2480 |
- |
2481 |
-# We can build the following SAPIs in the given order |
2482 |
-SAPIS="embed cli cgi fpm apache2" |
2483 |
- |
2484 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
2485 |
-IUSE="${IUSE} |
2486 |
- ${SAPIS/cli/+cli} |
2487 |
- threads" |
2488 |
- |
2489 |
-IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk |
2490 |
- crypt +ctype curl debug |
2491 |
- enchant exif frontbase +fileinfo +filter firebird |
2492 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
2493 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash |
2494 |
- mssql mysql libmysqlclient mysqli nls |
2495 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
2496 |
- readline recode selinux +session sharedmem |
2497 |
- +simplexml snmp soap sockets spell sqlite ssl |
2498 |
- sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx |
2499 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
2500 |
- |
2501 |
-DEPEND=" |
2502 |
- >=app-eselect/eselect-php-0.7.1-r3[apache2?,fpm?] |
2503 |
- >=dev-libs/libpcre-8.32[unicode] |
2504 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
2505 |
- <www-servers/apache-2.4[threads=] ) ) |
2506 |
- berkdb? ( =sys-libs/db-4* ) |
2507 |
- bzip2? ( app-arch/bzip2 ) |
2508 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
2509 |
- cjk? ( !gd? ( |
2510 |
- virtual/jpeg:0 |
2511 |
- media-libs/libpng:0= |
2512 |
- sys-libs/zlib |
2513 |
- ) ) |
2514 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
2515 |
- curl? ( >=net-misc/curl-7.10.5 ) |
2516 |
- enchant? ( app-text/enchant ) |
2517 |
- exif? ( !gd? ( |
2518 |
- virtual/jpeg:0 |
2519 |
- media-libs/libpng:0= |
2520 |
- sys-libs/zlib |
2521 |
- ) ) |
2522 |
- firebird? ( dev-db/firebird ) |
2523 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
2524 |
- gdbm? ( >=sys-libs/gdbm-1.8.0 ) |
2525 |
- gmp? ( >=dev-libs/gmp-4.1.2 ) |
2526 |
- iconv? ( virtual/libiconv ) |
2527 |
- imap? ( virtual/imap-c-client[ssl=] ) |
2528 |
- intl? ( dev-libs/icu:= ) |
2529 |
- iodbc? ( dev-db/libiodbc ) |
2530 |
- kerberos? ( virtual/krb5 ) |
2531 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
2532 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
2533 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
2534 |
- mssql? ( dev-db/freetds[mssql] ) |
2535 |
- libmysqlclient? ( |
2536 |
- mysql? ( virtual/mysql ) |
2537 |
- mysqli? ( >=virtual/mysql-4.1 ) |
2538 |
- ) |
2539 |
- nls? ( sys-devel/gettext ) |
2540 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
2541 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
2542 |
- postgres? ( dev-db/postgresql ) |
2543 |
- qdbm? ( dev-db/qdbm ) |
2544 |
- readline? ( sys-libs/readline ) |
2545 |
- recode? ( app-text/recode ) |
2546 |
- sharedmem? ( dev-libs/mm ) |
2547 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
2548 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
2549 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
2550 |
- spell? ( >=app-text/aspell-0.50 ) |
2551 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
2552 |
- ssl? ( >=dev-libs/openssl-0.9.7 ) |
2553 |
- sybase-ct? ( dev-db/freetds ) |
2554 |
- tidy? ( app-text/htmltidy ) |
2555 |
- truetype? ( |
2556 |
- =media-libs/freetype-2* |
2557 |
- >=media-libs/t1lib-5.0.0 |
2558 |
- !gd? ( |
2559 |
- virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
2560 |
- ) |
2561 |
- unicode? ( dev-libs/oniguruma ) |
2562 |
- vpx? ( media-libs/libvpx ) |
2563 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
2564 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
2565 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
2566 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
2567 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
2568 |
- xpm? ( |
2569 |
- x11-libs/libXpm |
2570 |
- virtual/jpeg:0 |
2571 |
- media-libs/libpng:0= sys-libs/zlib |
2572 |
- ) |
2573 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
2574 |
- zip? ( sys-libs/zlib ) |
2575 |
- zlib? ( sys-libs/zlib ) |
2576 |
- virtual/mta |
2577 |
-" |
2578 |
- |
2579 |
-php="=${CATEGORY}/${PF}" |
2580 |
- |
2581 |
-REQUIRED_USE=" |
2582 |
- truetype? ( gd ) |
2583 |
- vpx? ( gd ) |
2584 |
- cjk? ( gd ) |
2585 |
- exif? ( gd ) |
2586 |
- |
2587 |
- xpm? ( gd ) |
2588 |
- gd? ( zlib ) |
2589 |
- simplexml? ( xml ) |
2590 |
- soap? ( xml ) |
2591 |
- wddx? ( xml ) |
2592 |
- xmlrpc? ( || ( xml iconv ) ) |
2593 |
- xmlreader? ( xml ) |
2594 |
- xslt? ( xml ) |
2595 |
- ldap-sasl? ( ldap ) |
2596 |
- mhash? ( hash ) |
2597 |
- phar? ( hash ) |
2598 |
- libmysqlclient? ( || ( |
2599 |
- mysql |
2600 |
- mysqli |
2601 |
- pdo |
2602 |
- ) ) |
2603 |
- |
2604 |
- qdbm? ( !gdbm ) |
2605 |
- readline? ( !libedit ) |
2606 |
- recode? ( !imap !mysql !mysqli ) |
2607 |
- sharedmem? ( !threads ) |
2608 |
- |
2609 |
- !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" |
2610 |
- |
2611 |
-RDEPEND="${DEPEND}" |
2612 |
- |
2613 |
-RDEPEND="${RDEPEND} |
2614 |
- fpm? ( |
2615 |
- selinux? ( sec-policy/selinux-phpfpm ) |
2616 |
- systemd? ( sys-apps/systemd ) )" |
2617 |
- |
2618 |
-DEPEND="${DEPEND} |
2619 |
- sys-devel/flex |
2620 |
- >=sys-devel/m4-1.4.3 |
2621 |
- >=sys-devel/libtool-1.5.18" |
2622 |
- |
2623 |
-# Allow users to install production version if they want to |
2624 |
- |
2625 |
-case "${PHP_INI_VERSION}" in |
2626 |
- production|development) |
2627 |
- ;; |
2628 |
- *) |
2629 |
- PHP_INI_VERSION="development" |
2630 |
- ;; |
2631 |
-esac |
2632 |
- |
2633 |
-PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}" |
2634 |
-PHP_INI_FILE="php.ini" |
2635 |
- |
2636 |
-want_apache |
2637 |
- |
2638 |
-pkg_setup() { |
2639 |
- depend.apache_pkg_setup |
2640 |
-} |
2641 |
- |
2642 |
-php_install_ini() { |
2643 |
- local phpsapi="${1}" |
2644 |
- |
2645 |
- # work out where we are installing the ini file |
2646 |
- php_set_ini_dir "${phpsapi}" |
2647 |
- |
2648 |
- local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}" |
2649 |
- cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" |
2650 |
- |
2651 |
- # default to /tmp for save_path, bug #282768 |
2652 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" |
2653 |
- |
2654 |
- # Set the extension dir |
2655 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" |
2656 |
- |
2657 |
- # Set the include path to point to where we want to find PEAR packages |
2658 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" |
2659 |
- |
2660 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
2661 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
2662 |
- newins "${phpinisrc}" "${PHP_INI_FILE}" |
2663 |
- |
2664 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
2665 |
- elog |
2666 |
- |
2667 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
2668 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
2669 |
- |
2670 |
- if use_if_iuse opcache; then |
2671 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
2672 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
2673 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
2674 |
- fi |
2675 |
- |
2676 |
- # SAPI-specific handling |
2677 |
- |
2678 |
- if [[ "${sapi}" == "fpm" ]] ; then |
2679 |
- [[ -z ${PHP_FPM_CONF_VER} ]] && PHP_FPM_CONF_VER=0 |
2680 |
- einfo "Installing FPM CGI config file php-fpm.conf" |
2681 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
2682 |
- newins "${FILESDIR}/php-fpm-r${PHP_FPM_CONF_VER}.conf" php-fpm.conf |
2683 |
- |
2684 |
- # Remove bogus /etc/php-fpm.conf.default (bug 359906) |
2685 |
- [[ -f "${ED}/etc/php-fpm.conf.default" ]] && rm "${ED}/etc/php-fpm.conf.default" |
2686 |
- fi |
2687 |
- |
2688 |
- # Install PHP ini files into /usr/share/php |
2689 |
- |
2690 |
- dodoc php.ini-development |
2691 |
- dodoc php.ini-production |
2692 |
- |
2693 |
-} |
2694 |
- |
2695 |
-php_set_ini_dir() { |
2696 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
2697 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
2698 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
2699 |
-} |
2700 |
- |
2701 |
-src_prepare() { |
2702 |
- # USE=sharedmem (session/mod_mm to be exact) tries to mmap() this path |
2703 |
- # ([empty session.save_path]/session_mm_[sapi][gid].sem) |
2704 |
- # there is no easy way to circumvent that, all php calls during |
2705 |
- # install use -n, so no php.ini file will be used. |
2706 |
- # As such, this is the easiest way to get around |
2707 |
- addpredict /session_mm_cli250.sem |
2708 |
- addpredict /session_mm_cli0.sem |
2709 |
- |
2710 |
- # Change PHP branding |
2711 |
- # Get the alpha/beta/rc version |
2712 |
- sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ |
2713 |
- -i configure.in || die "Unable to change PHP branding" |
2714 |
- |
2715 |
- # Patch PHP to show Gentoo as the server platform |
2716 |
- sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
2717 |
- -i configure.in || die "Failed to fix server platform name" |
2718 |
- |
2719 |
- # Prevent PHP from activating the Apache config, |
2720 |
- # as we will do that ourselves |
2721 |
- sed -i \ |
2722 |
- -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
2723 |
- -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
2724 |
- configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 |
2725 |
- |
2726 |
- # Patch PHP to support heimdal instead of mit-krb5 |
2727 |
- if has_version "app-crypt/heimdal" ; then |
2728 |
- sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
2729 |
- || die "Failed to fix heimdal libname" |
2730 |
- sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
2731 |
- || die "Failed to fix heimdal crypt library reference" |
2732 |
- fi |
2733 |
- |
2734 |
- #Add user patches #357637 |
2735 |
- epatch_user |
2736 |
- |
2737 |
- #force rebuilding aclocal.m4 |
2738 |
- rm aclocal.m4 |
2739 |
- eautoreconf |
2740 |
- |
2741 |
- if [[ ${CHOST} == *-darwin* ]] ; then |
2742 |
- # http://bugs.php.net/bug.php?id=48795, bug #343481 |
2743 |
- sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die |
2744 |
- fi |
2745 |
-} |
2746 |
- |
2747 |
-src_configure() { |
2748 |
- addpredict /usr/share/snmp/mibs/.index |
2749 |
- addpredict /var/lib/net-snmp/mib_indexes |
2750 |
- |
2751 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
2752 |
- |
2753 |
- # This is a global variable and should be in caps. It isn't because the |
2754 |
- # phpconfutils eclass relies on exactly this name... |
2755 |
- # for --with-libdir see bug #327025 |
2756 |
- my_conf=" |
2757 |
- --prefix="${PHP_DESTDIR}" |
2758 |
- --mandir="${PHP_DESTDIR}"/man |
2759 |
- --infodir="${PHP_DESTDIR}"/info |
2760 |
- --libdir="${PHP_DESTDIR}"/lib |
2761 |
- --with-libdir=$(get_libdir) |
2762 |
- --without-pear |
2763 |
- $(use_enable threads maintainer-zts)" |
2764 |
- |
2765 |
- # extension USE flag shared |
2766 |
- my_conf+=" |
2767 |
- $(use_enable bcmath bcmath ) |
2768 |
- $(use_with bzip2 bz2 "${EPREFIX}"/usr) |
2769 |
- $(use_enable calendar calendar ) |
2770 |
- $(use_enable ctype ctype ) |
2771 |
- $(use_with curl curl "${EPREFIX}"/usr) |
2772 |
- $(use_enable xml dom ) |
2773 |
- $(use_with enchant enchant "${EPREFIX}"/usr) |
2774 |
- $(use_enable exif exif ) |
2775 |
- $(use_enable fileinfo fileinfo ) |
2776 |
- $(use_enable filter filter ) |
2777 |
- $(use_enable ftp ftp ) |
2778 |
- $(use_with nls gettext "${EPREFIX}"/usr) |
2779 |
- $(use_with gmp gmp "${EPREFIX}"/usr) |
2780 |
- $(use_enable hash hash ) |
2781 |
- $(use_with mhash mhash "${EPREFIX}"/usr) |
2782 |
- $(use_with iconv iconv $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}"/usr)) |
2783 |
- $(use_enable intl intl ) |
2784 |
- $(use_enable ipv6 ipv6 ) |
2785 |
- $(use_enable json json ) |
2786 |
- $(use_with kerberos kerberos "${EPREFIX}"/usr) |
2787 |
- $(use_enable xml libxml ) |
2788 |
- $(use_with xml libxml-dir "${EPREFIX}"/usr) |
2789 |
- $(use_enable unicode mbstring ) |
2790 |
- $(use_with crypt mcrypt "${EPREFIX}"/usr) |
2791 |
- $(use_with mssql mssql "${EPREFIX}"/usr) |
2792 |
- $(use_with unicode onig "${EPREFIX}"/usr) |
2793 |
- $(use_with ssl openssl "${EPREFIX}"/usr) |
2794 |
- $(use_with ssl openssl-dir "${EPREFIX}"/usr) |
2795 |
- $(use_enable pcntl pcntl ) |
2796 |
- $(use_enable phar phar ) |
2797 |
- $(use_enable pdo pdo ) |
2798 |
- $(use_enable opcache opcache ) |
2799 |
- $(use_with postgres pgsql "${EPREFIX}"/usr) |
2800 |
- $(use_enable posix posix ) |
2801 |
- $(use_with spell pspell "${EPREFIX}"/usr) |
2802 |
- $(use_with recode recode "${EPREFIX}"/usr) |
2803 |
- $(use_enable simplexml simplexml ) |
2804 |
- $(use_enable sharedmem shmop ) |
2805 |
- $(use_with snmp snmp "${EPREFIX}"/usr) |
2806 |
- $(use_enable soap soap ) |
2807 |
- $(use_enable sockets sockets ) |
2808 |
- $(use_with sqlite sqlite3 "${EPREFIX}"/usr) |
2809 |
- $(use_with sybase-ct sybase-ct "${EPREFIX}"/usr) |
2810 |
- $(use_enable sysvipc sysvmsg ) |
2811 |
- $(use_enable sysvipc sysvsem ) |
2812 |
- $(use_enable sysvipc sysvshm ) |
2813 |
- $(use_with systemd fpm-systemd) |
2814 |
- $(use_with tidy tidy "${EPREFIX}"/usr) |
2815 |
- $(use_enable tokenizer tokenizer ) |
2816 |
- $(use_enable wddx wddx ) |
2817 |
- $(use_enable xml xml ) |
2818 |
- $(use_enable xmlreader xmlreader ) |
2819 |
- $(use_enable xmlwriter xmlwriter ) |
2820 |
- $(use_with xmlrpc xmlrpc) |
2821 |
- $(use_with xslt xsl "${EPREFIX}"/usr) |
2822 |
- $(use_enable zip zip ) |
2823 |
- $(use_with zlib zlib "${EPREFIX}"/usr) |
2824 |
- $(use_enable debug debug )" |
2825 |
- |
2826 |
- # DBA support |
2827 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
2828 |
- || use qdbm ; then |
2829 |
- my_conf="${my_conf} --enable-dba${shared}" |
2830 |
- fi |
2831 |
- |
2832 |
- # DBA drivers support |
2833 |
- my_conf+=" |
2834 |
- $(use_with cdb cdb) |
2835 |
- $(use_with berkdb db4 ${EPREFIX}/usr) |
2836 |
- $(use_enable flatfile flatfile ) |
2837 |
- $(use_with gdbm gdbm ${EPREFIX}/usr) |
2838 |
- $(use_enable inifile inifile ) |
2839 |
- $(use_with qdbm qdbm ${EPREFIX}/usr)" |
2840 |
- |
2841 |
- # Support for the GD graphics library |
2842 |
- my_conf+=" |
2843 |
- $(use_with truetype freetype-dir ${EPREFIX}/usr) |
2844 |
- $(use_with truetype t1lib ${EPREFIX}/usr) |
2845 |
- $(use_enable cjk gd-jis-conv ) |
2846 |
- $(use_with gd jpeg-dir ${EPREFIX}/usr) |
2847 |
- $(use_with gd png-dir ${EPREFIX}/usr) |
2848 |
- $(use_with xpm xpm-dir ${EPREFIX}/usr) |
2849 |
- $(use_with vpx vpx-dir ${EPREFIX}/usr)" |
2850 |
- # enable gd last, so configure can pick up the previous settings |
2851 |
- my_conf+=" |
2852 |
- $(use_with gd gd)" |
2853 |
- |
2854 |
- # IMAP support |
2855 |
- if use imap ; then |
2856 |
- my_conf+=" |
2857 |
- $(use_with imap imap ${EPREFIX}/usr) |
2858 |
- $(use_with ssl imap-ssl ${EPREFIX}/usr)" |
2859 |
- fi |
2860 |
- |
2861 |
- # Interbase/firebird support |
2862 |
- |
2863 |
- if use firebird ; then |
2864 |
- my_conf+=" |
2865 |
- $(use_with firebird interbase ${EPREFIX}/usr)" |
2866 |
- fi |
2867 |
- |
2868 |
- # LDAP support |
2869 |
- if use ldap ; then |
2870 |
- my_conf+=" |
2871 |
- $(use_with ldap ldap ${EPREFIX}/usr) |
2872 |
- $(use_with ldap-sasl ldap-sasl ${EPREFIX}/usr)" |
2873 |
- fi |
2874 |
- |
2875 |
- # MySQL support |
2876 |
- local mysqllib="mysqlnd" |
2877 |
- local mysqlilib="mysqlnd" |
2878 |
- use libmysqlclient && mysqllib="${EPREFIX}/usr" |
2879 |
- use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config" |
2880 |
- |
2881 |
- my_conf+=" $(use_with mysql mysql $mysqllib)" |
2882 |
- my_conf+=" $(use_with mysqli mysqli $mysqlilib)" |
2883 |
- |
2884 |
- local mysqlsock=" $(use_with mysql mysql-sock ${EPREFIX}/var/run/mysqld/mysqld.sock)" |
2885 |
- if use mysql ; then |
2886 |
- my_conf+="${mysqlsock}" |
2887 |
- elif use mysqli ; then |
2888 |
- my_conf+="${mysqlsock}" |
2889 |
- fi |
2890 |
- |
2891 |
- # ODBC support |
2892 |
- if use odbc ; then |
2893 |
- my_conf+=" |
2894 |
- $(use_with odbc unixODBC ${EPREFIX}/usr)" |
2895 |
- fi |
2896 |
- |
2897 |
- if use iodbc ; then |
2898 |
- my_conf+=" |
2899 |
- $(use_with iodbc iodbc ${EPREFIX}/usr)" |
2900 |
- fi |
2901 |
- |
2902 |
- # Oracle support |
2903 |
- if use oci8-instant-client ; then |
2904 |
- my_conf+=" |
2905 |
- $(use_with oci8-instant-client oci8)" |
2906 |
- fi |
2907 |
- |
2908 |
- # PDO support |
2909 |
- if use pdo ; then |
2910 |
- my_conf+=" |
2911 |
- $(use_with mssql pdo-dblib ) |
2912 |
- $(use_with mysql pdo-mysql ${mysqllib}) |
2913 |
- $(use_with postgres pdo-pgsql ) |
2914 |
- $(use_with sqlite pdo-sqlite ${EPREFIX}/usr) |
2915 |
- $(use_with odbc pdo-odbc unixODBC,${EPREFIX}/usr)" |
2916 |
- if use oci8-instant-client ; then |
2917 |
- my_conf+=" |
2918 |
- $(use_with oci8-instant-client pdo-oci)" |
2919 |
- fi |
2920 |
- fi |
2921 |
- |
2922 |
- # readline/libedit support |
2923 |
- my_conf+=" |
2924 |
- $(use_with readline readline ${EPREFIX}/usr) |
2925 |
- $(use_with libedit libedit ${EPREFIX}/usr)" |
2926 |
- |
2927 |
- # Session support |
2928 |
- if use session ; then |
2929 |
- my_conf+=" |
2930 |
- $(use_with sharedmem mm ${EPREFIX}/usr)" |
2931 |
- else |
2932 |
- my_conf+=" |
2933 |
- $(use_enable session session )" |
2934 |
- fi |
2935 |
- |
2936 |
- # Use pic for shared modules such as apache2's mod_php |
2937 |
- my_conf="${my_conf} --with-pic" |
2938 |
- |
2939 |
- # we use the system copy of pcre |
2940 |
- # --with-pcre-regex affects ext/pcre |
2941 |
- # --with-pcre-dir affects ext/filter and ext/zip |
2942 |
- my_conf="${my_conf} --with-pcre-regex=${EPREFIX}/usr --with-pcre-dir=${EPREFIX}/usr" |
2943 |
- |
2944 |
- # Catch CFLAGS problems |
2945 |
- # Fixes bug #14067. |
2946 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
2947 |
- replace-cpu-flags "k6*" "i586" |
2948 |
- |
2949 |
- # Support user-passed configuration parameters |
2950 |
- my_conf="${my_conf} ${EXTRA_ECONF:-}" |
2951 |
- |
2952 |
- # Support the Apache2 extras, they must be set globally for all |
2953 |
- # SAPIs to work correctly, especially for external PHP extensions |
2954 |
- |
2955 |
- mkdir -p "${WORKDIR}/sapis-build" |
2956 |
- for one_sapi in $SAPIS ; do |
2957 |
- use "${one_sapi}" || continue |
2958 |
- php_set_ini_dir "${one_sapi}" |
2959 |
- |
2960 |
- cp -r "${S}" "${WORKDIR}/sapis-build/${one_sapi}" |
2961 |
- cd "${WORKDIR}/sapis-build/${one_sapi}" |
2962 |
- |
2963 |
- sapi_conf="${my_conf} --with-config-file-path=${PHP_INI_DIR} |
2964 |
- --with-config-file-scan-dir=${PHP_EXT_INI_DIR_ACTIVE}" |
2965 |
- |
2966 |
- for sapi in $SAPIS ; do |
2967 |
- case "$sapi" in |
2968 |
- cli|cgi|embed|fpm) |
2969 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
2970 |
- sapi_conf="${sapi_conf} --enable-${sapi}" |
2971 |
- else |
2972 |
- sapi_conf="${sapi_conf} --disable-${sapi}" |
2973 |
- fi |
2974 |
- ;; |
2975 |
- |
2976 |
- apache2) |
2977 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
2978 |
- sapi_conf="${sapi_conf} --with-apxs2=${EPREFIX}/usr/sbin/apxs" |
2979 |
- else |
2980 |
- sapi_conf="${sapi_conf} --without-apxs2" |
2981 |
- fi |
2982 |
- ;; |
2983 |
- esac |
2984 |
- done |
2985 |
- |
2986 |
- econf ${sapi_conf} |
2987 |
- done |
2988 |
-} |
2989 |
- |
2990 |
-src_compile() { |
2991 |
- # snmp seems to run during src_compile, too (bug #324739) |
2992 |
- addpredict /usr/share/snmp/mibs/.index |
2993 |
- addpredict /var/lib/net-snmp/mib_indexes |
2994 |
- |
2995 |
- for sapi in ${SAPIS} ; do |
2996 |
- if use "${sapi}"; then |
2997 |
- cd "${WORKDIR}/sapis-build/$sapi" || "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
2998 |
- emake || die "emake failed" |
2999 |
- fi |
3000 |
- done |
3001 |
-} |
3002 |
- |
3003 |
-src_install() { |
3004 |
- # see bug #324739 for what happens when we don't have that |
3005 |
- addpredict /usr/share/snmp/mibs/.index |
3006 |
- |
3007 |
- # grab the first SAPI that got built and install common files from there |
3008 |
- local first_sapi="" |
3009 |
- for sapi in $SAPIS ; do |
3010 |
- if use $sapi ; then |
3011 |
- first_sapi=$sapi |
3012 |
- break |
3013 |
- fi |
3014 |
- done |
3015 |
- |
3016 |
- # Makefile forgets to create this before trying to write to it... |
3017 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
3018 |
- |
3019 |
- # Install php environment (without any sapis) |
3020 |
- cd "${WORKDIR}/sapis-build/$first_sapi" |
3021 |
- emake INSTALL_ROOT="${D}" \ |
3022 |
- install-build install-headers install-programs \ |
3023 |
- || die "emake install failed" |
3024 |
- |
3025 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
3026 |
- |
3027 |
- # Create the directory where we'll put version-specific php scripts |
3028 |
- keepdir /usr/share/php${PHP_MV} |
3029 |
- |
3030 |
- local sapi="", file="" |
3031 |
- local sapi_list="" |
3032 |
- |
3033 |
- for sapi in ${SAPIS}; do |
3034 |
- if use "${sapi}" ; then |
3035 |
- einfo "Installing SAPI: ${sapi}" |
3036 |
- cd "${WORKDIR}/sapis-build/${sapi}" |
3037 |
- |
3038 |
- if [[ "${sapi}" == "apache2" ]] ; then |
3039 |
- # We're specifically not using emake install-sapi as libtool |
3040 |
- # may cause unnecessary relink failures (see bug #351266) |
3041 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
3042 |
- newins ".libs/libphp5$(get_libname)" "libphp${PHP_MV}$(get_libname)" |
3043 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
3044 |
- else |
3045 |
- # needed each time, php_install_ini would reset it |
3046 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
3047 |
- into "${dest}" |
3048 |
- case "$sapi" in |
3049 |
- cli) |
3050 |
- source="sapi/cli/php" |
3051 |
- ;; |
3052 |
- cgi) |
3053 |
- source="sapi/cgi/php-cgi" |
3054 |
- ;; |
3055 |
- fpm) |
3056 |
- source="sapi/fpm/php-fpm" |
3057 |
- ;; |
3058 |
- embed) |
3059 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
3060 |
- ;; |
3061 |
- *) |
3062 |
- die "unhandled sapi in src_install" |
3063 |
- ;; |
3064 |
- esac |
3065 |
- |
3066 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
3067 |
- dolib.so "${source}" || die "Unable to install ${sapi} sapi" |
3068 |
- else |
3069 |
- dobin "${source}" || die "Unable to install ${sapi} sapi" |
3070 |
- local name="$(basename ${source})" |
3071 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
3072 |
- fi |
3073 |
- fi |
3074 |
- |
3075 |
- php_install_ini "${sapi}" |
3076 |
- |
3077 |
- # construct correct SAPI string for php-config |
3078 |
- # thanks to ferringb for the bash voodoo |
3079 |
- if [[ "${sapi}" == "apache2" ]]; then |
3080 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
3081 |
- else |
3082 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
3083 |
- fi |
3084 |
- fi |
3085 |
- done |
3086 |
- |
3087 |
- # Installing opcache module |
3088 |
- if use_if_iuse opcache ; then |
3089 |
- dolib.so "modules/opcache$(get_libname)" || die "Unable to install opcache module" |
3090 |
- fi |
3091 |
- |
3092 |
- # Install env.d files |
3093 |
- newenvd "${FILESDIR}/20php5-envd" \ |
3094 |
- "20php${SLOT}" |
3095 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i \ |
3096 |
- "${ED}/etc/env.d/20php${SLOT}" |
3097 |
- sed -e "s|php5|php${SLOT}|g" -i \ |
3098 |
- "${ED}/etc/env.d/20php${SLOT}" |
3099 |
- |
3100 |
- # set php-config variable correctly (bug #278439) |
3101 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
3102 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" |
3103 |
- |
3104 |
- if use fpm ; then |
3105 |
- if use systemd; then |
3106 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" "php-fpm@${SLOT}.service" |
3107 |
- else |
3108 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" "php-fpm@${SLOT}.service" |
3109 |
- fi |
3110 |
- fi |
3111 |
-} |
3112 |
- |
3113 |
-src_test() { |
3114 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
3115 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
3116 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
3117 |
- ewarn "Test phase requires USE=cli, skipping" |
3118 |
- return |
3119 |
- else |
3120 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
3121 |
- fi |
3122 |
- |
3123 |
- if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
3124 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
3125 |
- fi |
3126 |
- |
3127 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d "session.save_path=${T}" \ |
3128 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d "session.save_path=${T}" |
3129 |
- |
3130 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
3131 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null |
3132 |
- done |
3133 |
- |
3134 |
- local failed="$(find -name '*.out')" |
3135 |
- if [[ ${failed} != "" ]] ; then |
3136 |
- ewarn "The following test cases failed unexpectedly:" |
3137 |
- for name in ${failed}; do |
3138 |
- ewarn " ${name/.out/}" |
3139 |
- done |
3140 |
- else |
3141 |
- einfo "No unexpected test failures, all fine" |
3142 |
- fi |
3143 |
- |
3144 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
3145 |
- local passed="" |
3146 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
3147 |
- [[ -f "${name}.diff" ]] && continue |
3148 |
- passed="${passed} ${name}" |
3149 |
- done |
3150 |
- if [[ ${passed} != "" ]] ; then |
3151 |
- einfo "The following test cases passed unexpectedly:" |
3152 |
- for name in ${passed}; do |
3153 |
- ewarn " ${passed}" |
3154 |
- done |
3155 |
- else |
3156 |
- einfo "None of the known-to-fail tests passed, all fine" |
3157 |
- fi |
3158 |
- fi |
3159 |
-} |
3160 |
- |
3161 |
-pkg_postinst() { |
3162 |
- # Output some general info to the user |
3163 |
- if use apache2 ; then |
3164 |
- APACHE2_MOD_DEFINE="PHP" |
3165 |
- APACHE2_MOD_CONF="70_mod_php" # provided by app-eselect/eselect-php |
3166 |
- apache-module_pkg_postinst |
3167 |
- fi |
3168 |
- |
3169 |
- # Create the symlinks for php |
3170 |
- for m in ${SAPIS}; do |
3171 |
- [[ ${m} == 'embed' ]] && continue; |
3172 |
- if use $m ; then |
3173 |
- local ci=$(eselect php show $m) |
3174 |
- if [[ -z $ci ]]; then |
3175 |
- eselect php set $m php${SLOT} |
3176 |
- einfo "Switched ${m} to use php:${SLOT}" |
3177 |
- einfo |
3178 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
3179 |
- elog "To switch $m to use php:${SLOT}, run" |
3180 |
- elog " eselect php set $m php${SLOT}" |
3181 |
- elog |
3182 |
- fi |
3183 |
- fi |
3184 |
- done |
3185 |
- |
3186 |
- elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes php${SLOT/./-} in order" |
3187 |
- elog "to compile extensions for the ${SLOT} ABI" |
3188 |
- elog |
3189 |
- if ! use readline && use cli ; then |
3190 |
- ewarn "Note that in order to use php interactivly, you need to enable" |
3191 |
- ewarn "the readline USE flag or php -a will hang" |
3192 |
- fi |
3193 |
- elog |
3194 |
- elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version." |
3195 |
- elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either" |
3196 |
- elog "'production' or 'development' in ${EPREFIX}/etc/make.conf" |
3197 |
- elog "Both versions of php.ini can be found in ${EPREFIX}/usr/share/doc/${PF}" |
3198 |
- |
3199 |
- elog |
3200 |
- elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:" |
3201 |
- elog "https://www.gentoo.org/proj/en/php/php-upgrading.xml" |
3202 |
- elog |
3203 |
-} |
3204 |
- |
3205 |
-pkg_prerm() { |
3206 |
- eselect php cleanup |
3207 |
-} |
3208 |
|
3209 |
diff --git a/dev-lang/php/php-5.6.19.ebuild b/dev-lang/php/php-5.6.19.ebuild |
3210 |
deleted file mode 100644 |
3211 |
index 7d4b6ae..0000000 |
3212 |
--- a/dev-lang/php/php-5.6.19.ebuild |
3213 |
+++ /dev/null |
3214 |
@@ -1,807 +0,0 @@ |
3215 |
-# Copyright 1999-2016 Gentoo Foundation |
3216 |
-# Distributed under the terms of the GNU General Public License v2 |
3217 |
-# $Id$ |
3218 |
- |
3219 |
-EAPI=5 |
3220 |
- |
3221 |
-inherit eutils autotools flag-o-matic versionator depend.apache apache-module libtool systemd |
3222 |
- |
3223 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" |
3224 |
- |
3225 |
-function php_get_uri () |
3226 |
-{ |
3227 |
- case "${1}" in |
3228 |
- "php-pre") |
3229 |
- echo "http://downloads.php.net/dsp/${2}" |
3230 |
- ;; |
3231 |
- "php") |
3232 |
- echo "http://www.php.net/distributions/${2}" |
3233 |
- ;; |
3234 |
- "olemarkus") |
3235 |
- echo "https://dev.gentoo.org/~olemarkus/php/${2}" |
3236 |
- ;; |
3237 |
- "gentoo") |
3238 |
- echo "mirror://gentoo/${2}" |
3239 |
- ;; |
3240 |
- *) |
3241 |
- die "unhandled case in php_get_uri" |
3242 |
- ;; |
3243 |
- esac |
3244 |
-} |
3245 |
- |
3246 |
-PHP_MV="$(get_major_version)" |
3247 |
-SLOT="$(get_version_component_range 1-2)" |
3248 |
- |
3249 |
-# alias, so we can handle different types of releases (finals, rcs, alphas, |
3250 |
-# betas, ...) w/o changing the whole ebuild |
3251 |
-PHP_PV="${PV/_rc/RC}" |
3252 |
-PHP_PV="${PHP_PV/_alpha/alpha}" |
3253 |
-PHP_PV="${PHP_PV/_beta/beta}" |
3254 |
-PHP_RELEASE="php" |
3255 |
-[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre" |
3256 |
-[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre" |
3257 |
-[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre" |
3258 |
-PHP_P="${PN}-${PHP_PV}" |
3259 |
- |
3260 |
-PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")" |
3261 |
- |
3262 |
-PHP_FPM_CONF_VER="1" |
3263 |
- |
3264 |
-SRC_URI="${PHP_SRC_URI}" |
3265 |
- |
3266 |
-DESCRIPTION="The PHP language runtime engine" |
3267 |
-HOMEPAGE="http://php.net/" |
3268 |
-LICENSE="PHP-3" |
3269 |
- |
3270 |
-S="${WORKDIR}/${PHP_P}" |
3271 |
- |
3272 |
-# We can build the following SAPIs in the given order |
3273 |
-SAPIS="embed cli cgi fpm apache2" |
3274 |
- |
3275 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
3276 |
-IUSE="${IUSE} |
3277 |
- ${SAPIS/cli/+cli} |
3278 |
- threads" |
3279 |
- |
3280 |
-IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk |
3281 |
- crypt +ctype curl debug |
3282 |
- enchant exif frontbase +fileinfo +filter firebird |
3283 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
3284 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl |
3285 |
- mhash mssql mysql libmysqlclient mysqli nls |
3286 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
3287 |
- readline recode selinux +session sharedmem |
3288 |
- +simplexml snmp soap sockets spell sqlite ssl |
3289 |
- sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx |
3290 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
3291 |
- |
3292 |
-DEPEND=" |
3293 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
3294 |
- >=dev-libs/libpcre-8.32[unicode] |
3295 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
3296 |
- <www-servers/apache-2.4[threads=] ) )" |
3297 |
- |
3298 |
-# The supported (that is, autodetected) versions of BDB are listed in |
3299 |
-# the ./configure script. Other versions *work*, but we need to stick to |
3300 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
3301 |
-DEPEND="${DEPEND} |
3302 |
- berkdb? ( || ( sys-libs/db:5.3 |
3303 |
- sys-libs/db:5.1 |
3304 |
- sys-libs/db:4.8 |
3305 |
- sys-libs/db:4.7 |
3306 |
- sys-libs/db:4.6 |
3307 |
- sys-libs/db:4.5 ) ) |
3308 |
- bzip2? ( app-arch/bzip2 ) |
3309 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
3310 |
- cjk? ( !gd? ( |
3311 |
- virtual/jpeg:0 |
3312 |
- media-libs/libpng:0= |
3313 |
- sys-libs/zlib |
3314 |
- ) ) |
3315 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
3316 |
- curl? ( >=net-misc/curl-7.10.5 ) |
3317 |
- enchant? ( app-text/enchant ) |
3318 |
- exif? ( !gd? ( |
3319 |
- virtual/jpeg:0 |
3320 |
- media-libs/libpng:0= |
3321 |
- sys-libs/zlib |
3322 |
- ) ) |
3323 |
- firebird? ( dev-db/firebird ) |
3324 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
3325 |
- gdbm? ( >=sys-libs/gdbm-1.8.0 ) |
3326 |
- gmp? ( dev-libs/gmp:0 ) |
3327 |
- iconv? ( virtual/libiconv ) |
3328 |
- imap? ( virtual/imap-c-client[ssl=] ) |
3329 |
- intl? ( dev-libs/icu:= ) |
3330 |
- iodbc? ( dev-db/libiodbc ) |
3331 |
- kerberos? ( virtual/krb5 ) |
3332 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
3333 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
3334 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
3335 |
- mssql? ( dev-db/freetds[mssql] ) |
3336 |
- libmysqlclient? ( |
3337 |
- mysql? ( virtual/mysql ) |
3338 |
- mysqli? ( >=virtual/mysql-4.1 ) |
3339 |
- ) |
3340 |
- nls? ( sys-devel/gettext ) |
3341 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
3342 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
3343 |
- postgres? ( dev-db/postgresql:* ) |
3344 |
- qdbm? ( dev-db/qdbm ) |
3345 |
- readline? ( sys-libs/readline:0 ) |
3346 |
- recode? ( app-text/recode ) |
3347 |
- sharedmem? ( dev-libs/mm ) |
3348 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
3349 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
3350 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
3351 |
- spell? ( >=app-text/aspell-0.50 ) |
3352 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
3353 |
- ssl? ( |
3354 |
- !libressl? ( dev-libs/openssl:0 ) |
3355 |
- libressl? ( dev-libs/libressl ) |
3356 |
- ) |
3357 |
- sybase-ct? ( dev-db/freetds ) |
3358 |
- tidy? ( app-text/htmltidy ) |
3359 |
- truetype? ( |
3360 |
- =media-libs/freetype-2* |
3361 |
- >=media-libs/t1lib-5.0.0 |
3362 |
- !gd? ( |
3363 |
- virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
3364 |
- ) |
3365 |
- unicode? ( dev-libs/oniguruma ) |
3366 |
- vpx? ( media-libs/libvpx ) |
3367 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
3368 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
3369 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
3370 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
3371 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
3372 |
- xpm? ( |
3373 |
- x11-libs/libXpm |
3374 |
- virtual/jpeg:0 |
3375 |
- media-libs/libpng:0= sys-libs/zlib |
3376 |
- ) |
3377 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
3378 |
- zip? ( sys-libs/zlib ) |
3379 |
- zlib? ( sys-libs/zlib ) |
3380 |
- virtual/mta |
3381 |
-" |
3382 |
- |
3383 |
-php="=${CATEGORY}/${PF}" |
3384 |
- |
3385 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
3386 |
-REQUIRED_USE=" |
3387 |
- cli? ( ^^ ( readline libedit ) ) |
3388 |
- truetype? ( gd ) |
3389 |
- vpx? ( gd ) |
3390 |
- cjk? ( gd ) |
3391 |
- exif? ( gd ) |
3392 |
- |
3393 |
- xpm? ( gd ) |
3394 |
- gd? ( zlib ) |
3395 |
- simplexml? ( xml ) |
3396 |
- soap? ( xml ) |
3397 |
- wddx? ( xml ) |
3398 |
- xmlrpc? ( || ( xml iconv ) ) |
3399 |
- xmlreader? ( xml ) |
3400 |
- xslt? ( xml ) |
3401 |
- ldap-sasl? ( ldap ) |
3402 |
- mhash? ( hash ) |
3403 |
- phar? ( hash ) |
3404 |
- libmysqlclient? ( || ( |
3405 |
- mysql |
3406 |
- mysqli |
3407 |
- pdo |
3408 |
- ) ) |
3409 |
- |
3410 |
- qdbm? ( !gdbm ) |
3411 |
- readline? ( !libedit ) |
3412 |
- recode? ( !imap !mysql !mysqli ) |
3413 |
- sharedmem? ( !threads ) |
3414 |
- |
3415 |
- !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" |
3416 |
- |
3417 |
-RDEPEND="${DEPEND}" |
3418 |
- |
3419 |
-RDEPEND="${RDEPEND} |
3420 |
- fpm? ( |
3421 |
- selinux? ( sec-policy/selinux-phpfpm ) |
3422 |
- systemd? ( sys-apps/systemd ) )" |
3423 |
- |
3424 |
-DEPEND="${DEPEND} |
3425 |
- sys-devel/flex |
3426 |
- >=sys-devel/m4-1.4.3 |
3427 |
- >=sys-devel/libtool-1.5.18" |
3428 |
- |
3429 |
-# Allow users to install production version if they want to |
3430 |
- |
3431 |
-case "${PHP_INI_VERSION}" in |
3432 |
- production|development) |
3433 |
- ;; |
3434 |
- *) |
3435 |
- PHP_INI_VERSION="development" |
3436 |
- ;; |
3437 |
-esac |
3438 |
- |
3439 |
-PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}" |
3440 |
-PHP_INI_FILE="php.ini" |
3441 |
- |
3442 |
-want_apache |
3443 |
- |
3444 |
-pkg_setup() { |
3445 |
- depend.apache_pkg_setup |
3446 |
-} |
3447 |
- |
3448 |
-php_install_ini() { |
3449 |
- local phpsapi="${1}" |
3450 |
- |
3451 |
- # work out where we are installing the ini file |
3452 |
- php_set_ini_dir "${phpsapi}" |
3453 |
- |
3454 |
- local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}" |
3455 |
- cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die |
3456 |
- |
3457 |
- # default to /tmp for save_path, bug #282768 |
3458 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
3459 |
- |
3460 |
- # Set the extension dir |
3461 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" || die |
3462 |
- |
3463 |
- # Set the include path to point to where we want to find PEAR packages |
3464 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
3465 |
- |
3466 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
3467 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
3468 |
- newins "${phpinisrc}" "${PHP_INI_FILE}" |
3469 |
- |
3470 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
3471 |
- elog |
3472 |
- |
3473 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
3474 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
3475 |
- |
3476 |
- if use_if_iuse opcache; then |
3477 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
3478 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
3479 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
3480 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \ |
3481 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
3482 |
- fi |
3483 |
- |
3484 |
- # SAPI-specific handling |
3485 |
- if [[ "${sapi}" == "fpm" ]] ; then |
3486 |
- einfo "Installing FPM config file php-fpm.conf" |
3487 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
3488 |
- doins sapi/fpm/php-fpm.conf |
3489 |
- fi |
3490 |
- |
3491 |
- dodoc php.ini-development |
3492 |
- dodoc php.ini-production |
3493 |
-} |
3494 |
- |
3495 |
-php_set_ini_dir() { |
3496 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
3497 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
3498 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
3499 |
-} |
3500 |
- |
3501 |
-src_prepare() { |
3502 |
- # Change PHP branding |
3503 |
- # Get the alpha/beta/rc version |
3504 |
- sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ |
3505 |
- -i configure.in || die "Unable to change PHP branding" |
3506 |
- |
3507 |
- # Patch PHP to show Gentoo as the server platform |
3508 |
- sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
3509 |
- -i configure.in || die "Failed to fix server platform name" |
3510 |
- |
3511 |
- # Prevent PHP from activating the Apache config, |
3512 |
- # as we will do that ourselves |
3513 |
- sed -i \ |
3514 |
- -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
3515 |
- -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
3516 |
- configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \ |
3517 |
- || die |
3518 |
- |
3519 |
- # Patch PHP to support heimdal instead of mit-krb5 |
3520 |
- if has_version "app-crypt/heimdal" ; then |
3521 |
- sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
3522 |
- || die "Failed to fix heimdal libname" |
3523 |
- sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
3524 |
- || die "Failed to fix heimdal crypt library reference" |
3525 |
- fi |
3526 |
- |
3527 |
- # Add user patches #357637 |
3528 |
- epatch_user |
3529 |
- |
3530 |
- # Force rebuilding aclocal.m4 |
3531 |
- rm -f aclocal.m4 || die |
3532 |
- eautoreconf |
3533 |
- |
3534 |
- if [[ ${CHOST} == *-darwin* ]] ; then |
3535 |
- # http://bugs.php.net/bug.php?id=48795, bug #343481 |
3536 |
- sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die |
3537 |
- fi |
3538 |
-} |
3539 |
- |
3540 |
-src_configure() { |
3541 |
- addpredict /usr/share/snmp/mibs/.index |
3542 |
- addpredict /var/lib/net-snmp/mib_indexes |
3543 |
- |
3544 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
3545 |
- |
3546 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
3547 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
3548 |
- local our_conf=( |
3549 |
- --prefix="${PHP_DESTDIR}" |
3550 |
- --mandir="${PHP_DESTDIR}/man" |
3551 |
- --infodir="${PHP_DESTDIR}/info" |
3552 |
- --libdir="${PHP_DESTDIR}/lib" |
3553 |
- --with-libdir="$(get_libdir)" |
3554 |
- --localstatedir="${EPREFIX}/var" |
3555 |
- --without-pear |
3556 |
- $(use_enable threads maintainer-zts) |
3557 |
- ) |
3558 |
- |
3559 |
- our_conf+=( |
3560 |
- $(use_enable bcmath bcmath) |
3561 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
3562 |
- $(use_enable calendar calendar) |
3563 |
- $(use_enable ctype ctype) |
3564 |
- $(use_with curl curl "${EPREFIX}/usr") |
3565 |
- $(use_enable xml dom) |
3566 |
- $(use_with enchant enchant "${EPREFIX}/usr") |
3567 |
- $(use_enable exif exif) |
3568 |
- $(use_enable fileinfo fileinfo) |
3569 |
- $(use_enable filter filter) |
3570 |
- $(use_enable ftp ftp) |
3571 |
- $(use_with nls gettext "${EPREFIX}/usr") |
3572 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
3573 |
- $(use_enable hash hash) |
3574 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
3575 |
- $(use_with iconv iconv \ |
3576 |
- $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr")) |
3577 |
- $(use_enable intl intl) |
3578 |
- $(use_enable ipv6 ipv6) |
3579 |
- $(use_enable json json) |
3580 |
- $(use_with kerberos kerberos "${EPREFIX}/usr") |
3581 |
- $(use_enable xml libxml) |
3582 |
- $(use_with xml libxml-dir "${EPREFIX}/usr") |
3583 |
- $(use_enable unicode mbstring) |
3584 |
- $(use_with crypt mcrypt "${EPREFIX}/usr") |
3585 |
- $(use_with mssql mssql "${EPREFIX}/usr") |
3586 |
- $(use_with unicode onig "${EPREFIX}/usr") |
3587 |
- $(use_with ssl openssl "${EPREFIX}/usr") |
3588 |
- $(use_with ssl openssl-dir "${EPREFIX}/usr") |
3589 |
- $(use_enable pcntl pcntl) |
3590 |
- $(use_enable phar phar) |
3591 |
- $(use_enable pdo pdo) |
3592 |
- $(use_enable opcache opcache) |
3593 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
3594 |
- $(use_enable posix posix) |
3595 |
- $(use_with spell pspell "${EPREFIX}/usr") |
3596 |
- $(use_with recode recode "${EPREFIX}/usr") |
3597 |
- $(use_enable simplexml simplexml) |
3598 |
- $(use_enable sharedmem shmop) |
3599 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
3600 |
- $(use_enable soap soap) |
3601 |
- $(use_enable sockets sockets) |
3602 |
- $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
3603 |
- $(use_with sybase-ct sybase-ct "${EPREFIX}/usr") |
3604 |
- $(use_enable sysvipc sysvmsg) |
3605 |
- $(use_enable sysvipc sysvsem) |
3606 |
- $(use_enable sysvipc sysvshm) |
3607 |
- $(use_with systemd fpm-systemd) |
3608 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
3609 |
- $(use_enable tokenizer tokenizer) |
3610 |
- $(use_enable wddx wddx) |
3611 |
- $(use_enable xml xml) |
3612 |
- $(use_enable xmlreader xmlreader) |
3613 |
- $(use_enable xmlwriter xmlwriter) |
3614 |
- $(use_with xmlrpc xmlrpc) |
3615 |
- $(use_with xslt xsl "${EPREFIX}/usr") |
3616 |
- $(use_enable zip zip) |
3617 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
3618 |
- $(use_enable debug debug) |
3619 |
- ) |
3620 |
- |
3621 |
- # DBA support |
3622 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
3623 |
- || use qdbm ; then |
3624 |
- our_conf+=( "--enable-dba${shared}" ) |
3625 |
- fi |
3626 |
- |
3627 |
- # DBA drivers support |
3628 |
- our_conf+=( |
3629 |
- $(use_with cdb cdb) |
3630 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
3631 |
- $(use_enable flatfile flatfile) |
3632 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
3633 |
- $(use_enable inifile inifile) |
3634 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
3635 |
- ) |
3636 |
- |
3637 |
- # Support for the GD graphics library |
3638 |
- our_conf+=( |
3639 |
- $(use_with truetype freetype-dir "${EPREFIX}/usr") |
3640 |
- $(use_with truetype t1lib "${EPREFIX}/usr") |
3641 |
- $(use_enable cjk gd-jis-conv) |
3642 |
- $(use_with gd jpeg-dir "${EPREFIX}/usr") |
3643 |
- $(use_with gd png-dir "${EPREFIX}/usr") |
3644 |
- $(use_with xpm xpm-dir "${EPREFIX}/usr") |
3645 |
- $(use_with vpx vpx-dir "${EPREFIX}/usr") |
3646 |
- ) |
3647 |
- # enable gd last, so configure can pick up the previous settings |
3648 |
- our_conf+=( $(use_with gd gd) ) |
3649 |
- |
3650 |
- # IMAP support |
3651 |
- if use imap ; then |
3652 |
- our_conf+=( |
3653 |
- $(use_with imap imap "${EPREFIX}/usr") |
3654 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
3655 |
- ) |
3656 |
- fi |
3657 |
- |
3658 |
- # Interbase/firebird support |
3659 |
- our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
3660 |
- |
3661 |
- # LDAP support |
3662 |
- if use ldap ; then |
3663 |
- our_conf+=( |
3664 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
3665 |
- $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
3666 |
- ) |
3667 |
- fi |
3668 |
- |
3669 |
- # MySQL support |
3670 |
- local mysqllib="mysqlnd" |
3671 |
- local mysqlilib="mysqlnd" |
3672 |
- use libmysqlclient && mysqllib="${EPREFIX}/usr" |
3673 |
- use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config" |
3674 |
- |
3675 |
- our_conf+=( $(use_with mysql mysql "${mysqllib}") ) |
3676 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
3677 |
- |
3678 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
3679 |
- if use mysql || use mysqli ; then |
3680 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
3681 |
- fi |
3682 |
- |
3683 |
- # ODBC support |
3684 |
- our_conf+=( |
3685 |
- $(use_with odbc unixODBC "${EPREFIX}/usr") |
3686 |
- $(use_with iodbc iodbc "${EPREFIX}/usr") |
3687 |
- ) |
3688 |
- |
3689 |
- # Oracle support |
3690 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
3691 |
- |
3692 |
- # PDO support |
3693 |
- if use pdo ; then |
3694 |
- our_conf+=( |
3695 |
- $(use_with mssql pdo-dblib) |
3696 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
3697 |
- $(use_with postgres pdo-pgsql) |
3698 |
- $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
3699 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
3700 |
- $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
3701 |
- $(use_with oci8-instant-client pdo-oci) |
3702 |
- ) |
3703 |
- fi |
3704 |
- |
3705 |
- # readline/libedit support |
3706 |
- our_conf+=( |
3707 |
- $(use_with readline readline "${EPREFIX}/usr") |
3708 |
- $(use_with libedit libedit "${EPREFIX}/usr") |
3709 |
- ) |
3710 |
- |
3711 |
- # Session support |
3712 |
- if use session ; then |
3713 |
- our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") ) |
3714 |
- else |
3715 |
- our_conf+=( $(use_enable session session) ) |
3716 |
- fi |
3717 |
- |
3718 |
- # Use pic for shared modules such as apache2's mod_php |
3719 |
- our_conf+=( --with-pic ) |
3720 |
- |
3721 |
- # we use the system copy of pcre |
3722 |
- # --with-pcre-regex affects ext/pcre |
3723 |
- # --with-pcre-dir affects ext/filter and ext/zip |
3724 |
- our_conf+=( |
3725 |
- --with-pcre-regex="${EPREFIX}/usr" |
3726 |
- --with-pcre-dir="${EPREFIX}/usr" |
3727 |
- ) |
3728 |
- |
3729 |
- # Catch CFLAGS problems |
3730 |
- # Fixes bug #14067. |
3731 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
3732 |
- replace-cpu-flags "k6*" "i586" |
3733 |
- |
3734 |
- # Support user-passed configuration parameters |
3735 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
3736 |
- |
3737 |
- # Support the Apache2 extras, they must be set globally for all |
3738 |
- # SAPIs to work correctly, especially for external PHP extensions |
3739 |
- |
3740 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
3741 |
- for one_sapi in $SAPIS ; do |
3742 |
- use "${one_sapi}" || continue |
3743 |
- php_set_ini_dir "${one_sapi}" |
3744 |
- |
3745 |
- # The BUILD_DIR variable is used to determine where to output |
3746 |
- # the files that autotools creates. This was all originally |
3747 |
- # based on the autotools-utils eclass. |
3748 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
3749 |
- cp -r "${S}" "${BUILD_DIR}" || die |
3750 |
- cd "${BUILD_DIR}" || die |
3751 |
- |
3752 |
- local sapi_conf=( |
3753 |
- --with-config-file-path="${PHP_INI_DIR}" |
3754 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
3755 |
- ) |
3756 |
- |
3757 |
- for sapi in $SAPIS ; do |
3758 |
- case "$sapi" in |
3759 |
- cli|cgi|embed|fpm) |
3760 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
3761 |
- sapi_conf+=( "--enable-${sapi}" ) |
3762 |
- else |
3763 |
- sapi_conf+=( "--disable-${sapi}" ) |
3764 |
- fi |
3765 |
- ;; |
3766 |
- |
3767 |
- apache2) |
3768 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
3769 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/sbin/apxs" ) |
3770 |
- else |
3771 |
- sapi_conf+=( --without-apxs2 ) |
3772 |
- fi |
3773 |
- ;; |
3774 |
- esac |
3775 |
- done |
3776 |
- |
3777 |
- # Construct the $myeconfargs array by concatenating $our_conf |
3778 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
3779 |
- local myeconfargs=( "${our_conf[@]}" ) |
3780 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
3781 |
- |
3782 |
- pushd "${BUILD_DIR}" > /dev/null || die |
3783 |
- econf "${myeconfargs[@]}" |
3784 |
- popd > /dev/null || die |
3785 |
- done |
3786 |
-} |
3787 |
- |
3788 |
-src_compile() { |
3789 |
- # snmp seems to run during src_compile, too (bug #324739) |
3790 |
- addpredict /usr/share/snmp/mibs/.index |
3791 |
- addpredict /var/lib/net-snmp/mib_indexes |
3792 |
- |
3793 |
- for sapi in ${SAPIS} ; do |
3794 |
- if use "${sapi}"; then |
3795 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
3796 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
3797 |
- emake |
3798 |
- fi |
3799 |
- done |
3800 |
-} |
3801 |
- |
3802 |
-src_install() { |
3803 |
- # see bug #324739 for what happens when we don't have that |
3804 |
- addpredict /usr/share/snmp/mibs/.index |
3805 |
- |
3806 |
- # grab the first SAPI that got built and install common files from there |
3807 |
- local first_sapi="" |
3808 |
- for sapi in $SAPIS ; do |
3809 |
- if use $sapi ; then |
3810 |
- first_sapi=$sapi |
3811 |
- break |
3812 |
- fi |
3813 |
- done |
3814 |
- |
3815 |
- # Makefile forgets to create this before trying to write to it... |
3816 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
3817 |
- |
3818 |
- # Install php environment (without any sapis) |
3819 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
3820 |
- emake INSTALL_ROOT="${D}" \ |
3821 |
- install-build install-headers install-programs |
3822 |
- |
3823 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
3824 |
- |
3825 |
- # Create the directory where we'll put version-specific php scripts |
3826 |
- keepdir "/usr/share/php${PHP_MV}" |
3827 |
- |
3828 |
- local sapi="", file="" |
3829 |
- local sapi_list="" |
3830 |
- |
3831 |
- for sapi in ${SAPIS}; do |
3832 |
- if use "${sapi}" ; then |
3833 |
- einfo "Installing SAPI: ${sapi}" |
3834 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
3835 |
- |
3836 |
- if [[ "${sapi}" == "apache2" ]] ; then |
3837 |
- # We're specifically not using emake install-sapi as libtool |
3838 |
- # may cause unnecessary relink failures (see bug #351266) |
3839 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
3840 |
- newins ".libs/libphp5$(get_libname)" \ |
3841 |
- "libphp${PHP_MV}$(get_libname)" |
3842 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
3843 |
- else |
3844 |
- # needed each time, php_install_ini would reset it |
3845 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
3846 |
- into "${dest}" |
3847 |
- case "$sapi" in |
3848 |
- cli) |
3849 |
- source="sapi/cli/php" |
3850 |
- ;; |
3851 |
- cgi) |
3852 |
- source="sapi/cgi/php-cgi" |
3853 |
- ;; |
3854 |
- fpm) |
3855 |
- source="sapi/fpm/php-fpm" |
3856 |
- ;; |
3857 |
- embed) |
3858 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
3859 |
- ;; |
3860 |
- *) |
3861 |
- die "unhandled sapi in src_install" |
3862 |
- ;; |
3863 |
- esac |
3864 |
- |
3865 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
3866 |
- dolib.so "${source}" |
3867 |
- else |
3868 |
- dobin "${source}" |
3869 |
- local name="$(basename ${source})" |
3870 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
3871 |
- fi |
3872 |
- fi |
3873 |
- |
3874 |
- php_install_ini "${sapi}" |
3875 |
- |
3876 |
- # construct correct SAPI string for php-config |
3877 |
- # thanks to ferringb for the bash voodoo |
3878 |
- if [[ "${sapi}" == "apache2" ]]; then |
3879 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
3880 |
- else |
3881 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
3882 |
- fi |
3883 |
- fi |
3884 |
- done |
3885 |
- |
3886 |
- # Installing opcache module |
3887 |
- if use_if_iuse opcache ; then |
3888 |
- dolib.so "modules/opcache$(get_libname)" |
3889 |
- fi |
3890 |
- |
3891 |
- # Install env.d files |
3892 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
3893 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
3894 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
3895 |
- |
3896 |
- # set php-config variable correctly (bug #278439) |
3897 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
3898 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
3899 |
- |
3900 |
- if use fpm ; then |
3901 |
- if use systemd; then |
3902 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
3903 |
- "php-fpm@${SLOT}.service" |
3904 |
- else |
3905 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
3906 |
- "php-fpm@${SLOT}.service" |
3907 |
- fi |
3908 |
- fi |
3909 |
-} |
3910 |
- |
3911 |
-src_test() { |
3912 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
3913 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
3914 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
3915 |
- ewarn "Test phase requires USE=cli, skipping" |
3916 |
- return |
3917 |
- else |
3918 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
3919 |
- fi |
3920 |
- |
3921 |
- if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
3922 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
3923 |
- fi |
3924 |
- |
3925 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
3926 |
- "session.save_path=${T}" \ |
3927 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
3928 |
- "session.save_path=${T}" |
3929 |
- |
3930 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
3931 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
3932 |
- done |
3933 |
- |
3934 |
- local failed="$(find -name '*.out')" |
3935 |
- if [[ ${failed} != "" ]] ; then |
3936 |
- ewarn "The following test cases failed unexpectedly:" |
3937 |
- for name in ${failed}; do |
3938 |
- ewarn " ${name/.out/}" |
3939 |
- done |
3940 |
- else |
3941 |
- einfo "No unexpected test failures, all fine" |
3942 |
- fi |
3943 |
- |
3944 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
3945 |
- local passed="" |
3946 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
3947 |
- [[ -f "${name}.diff" ]] && continue |
3948 |
- passed="${passed} ${name}" |
3949 |
- done |
3950 |
- if [[ ${passed} != "" ]] ; then |
3951 |
- einfo "The following test cases passed unexpectedly:" |
3952 |
- for name in ${passed}; do |
3953 |
- ewarn " ${passed}" |
3954 |
- done |
3955 |
- else |
3956 |
- einfo "None of the known-to-fail tests passed, all fine" |
3957 |
- fi |
3958 |
- fi |
3959 |
-} |
3960 |
- |
3961 |
-pkg_postinst() { |
3962 |
- # Output some general info to the user |
3963 |
- if use apache2 ; then |
3964 |
- APACHE2_MOD_DEFINE="PHP" |
3965 |
- APACHE2_MOD_CONF="70_mod_php" # Provided by app-eselect/eselect-php |
3966 |
- apache-module_pkg_postinst |
3967 |
- fi |
3968 |
- |
3969 |
- # Create the symlinks for php |
3970 |
- for m in ${SAPIS}; do |
3971 |
- [[ ${m} == 'embed' ]] && continue; |
3972 |
- if use $m ; then |
3973 |
- local ci=$(eselect php show $m) |
3974 |
- if [[ -z $ci ]]; then |
3975 |
- eselect php set $m php${SLOT} || die |
3976 |
- einfo "Switched ${m} to use php:${SLOT}" |
3977 |
- einfo |
3978 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
3979 |
- elog "To switch $m to use php:${SLOT}, run" |
3980 |
- elog " eselect php set $m php${SLOT}" |
3981 |
- elog |
3982 |
- fi |
3983 |
- fi |
3984 |
- done |
3985 |
- |
3986 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
3987 |
- # example, if the user has the cgi SAPI enabled, then he has an |
3988 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
3989 |
- # USE="-cgi", that symlink will break. This call to eselect is |
3990 |
- # supposed to remove that dead link per bug 572436. |
3991 |
- eselect php cleanup || die |
3992 |
- |
3993 |
- elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes" |
3994 |
- elog "php${SLOT/./-} in order to compile extensions for the ${SLOT} ABI." |
3995 |
- elog |
3996 |
- elog "This ebuild installed a version of php.ini based on" |
3997 |
- elog "php.ini-${PHP_INI_VERSION}. You can choose which version of" |
3998 |
- elog "php.ini to install by default by setting PHP_INI_VERSION" |
3999 |
- elog "to either 'production' or 'development' in your make.conf." |
4000 |
- elog "Both versions of php.ini can be found with the PHP docs in" |
4001 |
- elog "${EPREFIX}/usr/share/doc/${PF}" |
4002 |
- elog |
4003 |
- elog "For more details on how version slotting works, please see" |
4004 |
- elog "the wiki:" |
4005 |
- elog |
4006 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
4007 |
- elog |
4008 |
-} |
4009 |
- |
4010 |
-pkg_postrm() { |
4011 |
- # This serves two purposes. First, if we have just removed the last |
4012 |
- # installed version of PHP, then this will remove any dead symlinks |
4013 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
4014 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
4015 |
- # his existing symlinks to point to the new 7.0 installation. The |
4016 |
- # latter is bug 432962. |
4017 |
- # |
4018 |
- # Note: the eselect-php package may not be installed at this point, |
4019 |
- # so we can't die() if this command fails. |
4020 |
- eselect php cleanup |
4021 |
-} |
4022 |
|
4023 |
diff --git a/dev-lang/php/php-5.6.20.ebuild b/dev-lang/php/php-5.6.20.ebuild |
4024 |
deleted file mode 100644 |
4025 |
index 3d50ce6..0000000 |
4026 |
--- a/dev-lang/php/php-5.6.20.ebuild |
4027 |
+++ /dev/null |
4028 |
@@ -1,807 +0,0 @@ |
4029 |
-# Copyright 1999-2016 Gentoo Foundation |
4030 |
-# Distributed under the terms of the GNU General Public License v2 |
4031 |
-# $Id$ |
4032 |
- |
4033 |
-EAPI=5 |
4034 |
- |
4035 |
-inherit eutils autotools flag-o-matic versionator depend.apache apache-module libtool systemd |
4036 |
- |
4037 |
-KEYWORDS="~alpha amd64 arm hppa ~ia64 ~mips ~ppc ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" |
4038 |
- |
4039 |
-function php_get_uri () |
4040 |
-{ |
4041 |
- case "${1}" in |
4042 |
- "php-pre") |
4043 |
- echo "http://downloads.php.net/dsp/${2}" |
4044 |
- ;; |
4045 |
- "php") |
4046 |
- echo "http://www.php.net/distributions/${2}" |
4047 |
- ;; |
4048 |
- "olemarkus") |
4049 |
- echo "https://dev.gentoo.org/~olemarkus/php/${2}" |
4050 |
- ;; |
4051 |
- "gentoo") |
4052 |
- echo "mirror://gentoo/${2}" |
4053 |
- ;; |
4054 |
- *) |
4055 |
- die "unhandled case in php_get_uri" |
4056 |
- ;; |
4057 |
- esac |
4058 |
-} |
4059 |
- |
4060 |
-PHP_MV="$(get_major_version)" |
4061 |
-SLOT="$(get_version_component_range 1-2)" |
4062 |
- |
4063 |
-# alias, so we can handle different types of releases (finals, rcs, alphas, |
4064 |
-# betas, ...) w/o changing the whole ebuild |
4065 |
-PHP_PV="${PV/_rc/RC}" |
4066 |
-PHP_PV="${PHP_PV/_alpha/alpha}" |
4067 |
-PHP_PV="${PHP_PV/_beta/beta}" |
4068 |
-PHP_RELEASE="php" |
4069 |
-[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre" |
4070 |
-[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre" |
4071 |
-[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre" |
4072 |
-PHP_P="${PN}-${PHP_PV}" |
4073 |
- |
4074 |
-PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")" |
4075 |
- |
4076 |
-PHP_FPM_CONF_VER="1" |
4077 |
- |
4078 |
-SRC_URI="${PHP_SRC_URI}" |
4079 |
- |
4080 |
-DESCRIPTION="The PHP language runtime engine" |
4081 |
-HOMEPAGE="http://php.net/" |
4082 |
-LICENSE="PHP-3" |
4083 |
- |
4084 |
-S="${WORKDIR}/${PHP_P}" |
4085 |
- |
4086 |
-# We can build the following SAPIs in the given order |
4087 |
-SAPIS="embed cli cgi fpm apache2" |
4088 |
- |
4089 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
4090 |
-IUSE="${IUSE} |
4091 |
- ${SAPIS/cli/+cli} |
4092 |
- threads" |
4093 |
- |
4094 |
-IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk |
4095 |
- crypt +ctype curl debug |
4096 |
- enchant exif frontbase +fileinfo +filter firebird |
4097 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
4098 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl |
4099 |
- mhash mssql mysql libmysqlclient mysqli nls |
4100 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
4101 |
- readline recode selinux +session sharedmem |
4102 |
- +simplexml snmp soap sockets spell sqlite ssl |
4103 |
- sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx |
4104 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
4105 |
- |
4106 |
-DEPEND=" |
4107 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
4108 |
- >=dev-libs/libpcre-8.32[unicode] |
4109 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
4110 |
- <www-servers/apache-2.4[threads=] ) )" |
4111 |
- |
4112 |
-# The supported (that is, autodetected) versions of BDB are listed in |
4113 |
-# the ./configure script. Other versions *work*, but we need to stick to |
4114 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
4115 |
-DEPEND="${DEPEND} |
4116 |
- berkdb? ( || ( sys-libs/db:5.3 |
4117 |
- sys-libs/db:5.1 |
4118 |
- sys-libs/db:4.8 |
4119 |
- sys-libs/db:4.7 |
4120 |
- sys-libs/db:4.6 |
4121 |
- sys-libs/db:4.5 ) ) |
4122 |
- bzip2? ( app-arch/bzip2 ) |
4123 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
4124 |
- cjk? ( !gd? ( |
4125 |
- virtual/jpeg:0 |
4126 |
- media-libs/libpng:0= |
4127 |
- sys-libs/zlib |
4128 |
- ) ) |
4129 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
4130 |
- curl? ( >=net-misc/curl-7.10.5 ) |
4131 |
- enchant? ( app-text/enchant ) |
4132 |
- exif? ( !gd? ( |
4133 |
- virtual/jpeg:0 |
4134 |
- media-libs/libpng:0= |
4135 |
- sys-libs/zlib |
4136 |
- ) ) |
4137 |
- firebird? ( dev-db/firebird ) |
4138 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
4139 |
- gdbm? ( >=sys-libs/gdbm-1.8.0 ) |
4140 |
- gmp? ( dev-libs/gmp:0 ) |
4141 |
- iconv? ( virtual/libiconv ) |
4142 |
- imap? ( virtual/imap-c-client[ssl=] ) |
4143 |
- intl? ( dev-libs/icu:= ) |
4144 |
- iodbc? ( dev-db/libiodbc ) |
4145 |
- kerberos? ( virtual/krb5 ) |
4146 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
4147 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
4148 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
4149 |
- mssql? ( dev-db/freetds[mssql] ) |
4150 |
- libmysqlclient? ( |
4151 |
- mysql? ( virtual/mysql ) |
4152 |
- mysqli? ( >=virtual/mysql-4.1 ) |
4153 |
- ) |
4154 |
- nls? ( sys-devel/gettext ) |
4155 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
4156 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
4157 |
- postgres? ( dev-db/postgresql:* ) |
4158 |
- qdbm? ( dev-db/qdbm ) |
4159 |
- readline? ( sys-libs/readline:0 ) |
4160 |
- recode? ( app-text/recode ) |
4161 |
- sharedmem? ( dev-libs/mm ) |
4162 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
4163 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
4164 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
4165 |
- spell? ( >=app-text/aspell-0.50 ) |
4166 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
4167 |
- ssl? ( |
4168 |
- !libressl? ( dev-libs/openssl:0 ) |
4169 |
- libressl? ( dev-libs/libressl ) |
4170 |
- ) |
4171 |
- sybase-ct? ( dev-db/freetds ) |
4172 |
- tidy? ( app-text/htmltidy ) |
4173 |
- truetype? ( |
4174 |
- =media-libs/freetype-2* |
4175 |
- >=media-libs/t1lib-5.0.0 |
4176 |
- !gd? ( |
4177 |
- virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
4178 |
- ) |
4179 |
- unicode? ( dev-libs/oniguruma ) |
4180 |
- vpx? ( media-libs/libvpx ) |
4181 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
4182 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
4183 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
4184 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
4185 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
4186 |
- xpm? ( |
4187 |
- x11-libs/libXpm |
4188 |
- virtual/jpeg:0 |
4189 |
- media-libs/libpng:0= sys-libs/zlib |
4190 |
- ) |
4191 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
4192 |
- zip? ( sys-libs/zlib ) |
4193 |
- zlib? ( sys-libs/zlib ) |
4194 |
- virtual/mta |
4195 |
-" |
4196 |
- |
4197 |
-php="=${CATEGORY}/${PF}" |
4198 |
- |
4199 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
4200 |
-REQUIRED_USE=" |
4201 |
- cli? ( ^^ ( readline libedit ) ) |
4202 |
- truetype? ( gd ) |
4203 |
- vpx? ( gd ) |
4204 |
- cjk? ( gd ) |
4205 |
- exif? ( gd ) |
4206 |
- |
4207 |
- xpm? ( gd ) |
4208 |
- gd? ( zlib ) |
4209 |
- simplexml? ( xml ) |
4210 |
- soap? ( xml ) |
4211 |
- wddx? ( xml ) |
4212 |
- xmlrpc? ( || ( xml iconv ) ) |
4213 |
- xmlreader? ( xml ) |
4214 |
- xslt? ( xml ) |
4215 |
- ldap-sasl? ( ldap ) |
4216 |
- mhash? ( hash ) |
4217 |
- phar? ( hash ) |
4218 |
- libmysqlclient? ( || ( |
4219 |
- mysql |
4220 |
- mysqli |
4221 |
- pdo |
4222 |
- ) ) |
4223 |
- |
4224 |
- qdbm? ( !gdbm ) |
4225 |
- readline? ( !libedit ) |
4226 |
- recode? ( !imap !mysql !mysqli ) |
4227 |
- sharedmem? ( !threads ) |
4228 |
- |
4229 |
- !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" |
4230 |
- |
4231 |
-RDEPEND="${DEPEND}" |
4232 |
- |
4233 |
-RDEPEND="${RDEPEND} |
4234 |
- fpm? ( |
4235 |
- selinux? ( sec-policy/selinux-phpfpm ) |
4236 |
- systemd? ( sys-apps/systemd ) )" |
4237 |
- |
4238 |
-DEPEND="${DEPEND} |
4239 |
- sys-devel/flex |
4240 |
- >=sys-devel/m4-1.4.3 |
4241 |
- >=sys-devel/libtool-1.5.18" |
4242 |
- |
4243 |
-# Allow users to install production version if they want to |
4244 |
- |
4245 |
-case "${PHP_INI_VERSION}" in |
4246 |
- production|development) |
4247 |
- ;; |
4248 |
- *) |
4249 |
- PHP_INI_VERSION="development" |
4250 |
- ;; |
4251 |
-esac |
4252 |
- |
4253 |
-PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}" |
4254 |
-PHP_INI_FILE="php.ini" |
4255 |
- |
4256 |
-want_apache |
4257 |
- |
4258 |
-pkg_setup() { |
4259 |
- depend.apache_pkg_setup |
4260 |
-} |
4261 |
- |
4262 |
-php_install_ini() { |
4263 |
- local phpsapi="${1}" |
4264 |
- |
4265 |
- # work out where we are installing the ini file |
4266 |
- php_set_ini_dir "${phpsapi}" |
4267 |
- |
4268 |
- local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}" |
4269 |
- cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die |
4270 |
- |
4271 |
- # default to /tmp for save_path, bug #282768 |
4272 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
4273 |
- |
4274 |
- # Set the extension dir |
4275 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" || die |
4276 |
- |
4277 |
- # Set the include path to point to where we want to find PEAR packages |
4278 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
4279 |
- |
4280 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
4281 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
4282 |
- newins "${phpinisrc}" "${PHP_INI_FILE}" |
4283 |
- |
4284 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
4285 |
- elog |
4286 |
- |
4287 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
4288 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
4289 |
- |
4290 |
- if use_if_iuse opcache; then |
4291 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
4292 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
4293 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
4294 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \ |
4295 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
4296 |
- fi |
4297 |
- |
4298 |
- # SAPI-specific handling |
4299 |
- if [[ "${sapi}" == "fpm" ]] ; then |
4300 |
- einfo "Installing FPM config file php-fpm.conf" |
4301 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
4302 |
- doins sapi/fpm/php-fpm.conf |
4303 |
- fi |
4304 |
- |
4305 |
- dodoc php.ini-development |
4306 |
- dodoc php.ini-production |
4307 |
-} |
4308 |
- |
4309 |
-php_set_ini_dir() { |
4310 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
4311 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
4312 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
4313 |
-} |
4314 |
- |
4315 |
-src_prepare() { |
4316 |
- # Change PHP branding |
4317 |
- # Get the alpha/beta/rc version |
4318 |
- sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ |
4319 |
- -i configure.in || die "Unable to change PHP branding" |
4320 |
- |
4321 |
- # Patch PHP to show Gentoo as the server platform |
4322 |
- sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
4323 |
- -i configure.in || die "Failed to fix server platform name" |
4324 |
- |
4325 |
- # Prevent PHP from activating the Apache config, |
4326 |
- # as we will do that ourselves |
4327 |
- sed -i \ |
4328 |
- -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
4329 |
- -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
4330 |
- configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \ |
4331 |
- || die |
4332 |
- |
4333 |
- # Patch PHP to support heimdal instead of mit-krb5 |
4334 |
- if has_version "app-crypt/heimdal" ; then |
4335 |
- sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
4336 |
- || die "Failed to fix heimdal libname" |
4337 |
- sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
4338 |
- || die "Failed to fix heimdal crypt library reference" |
4339 |
- fi |
4340 |
- |
4341 |
- # Add user patches #357637 |
4342 |
- epatch_user |
4343 |
- |
4344 |
- # Force rebuilding aclocal.m4 |
4345 |
- rm -f aclocal.m4 || die |
4346 |
- eautoreconf |
4347 |
- |
4348 |
- if [[ ${CHOST} == *-darwin* ]] ; then |
4349 |
- # http://bugs.php.net/bug.php?id=48795, bug #343481 |
4350 |
- sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die |
4351 |
- fi |
4352 |
-} |
4353 |
- |
4354 |
-src_configure() { |
4355 |
- addpredict /usr/share/snmp/mibs/.index |
4356 |
- addpredict /var/lib/net-snmp/mib_indexes |
4357 |
- |
4358 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
4359 |
- |
4360 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
4361 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
4362 |
- local our_conf=( |
4363 |
- --prefix="${PHP_DESTDIR}" |
4364 |
- --mandir="${PHP_DESTDIR}/man" |
4365 |
- --infodir="${PHP_DESTDIR}/info" |
4366 |
- --libdir="${PHP_DESTDIR}/lib" |
4367 |
- --with-libdir="$(get_libdir)" |
4368 |
- --localstatedir="${EPREFIX}/var" |
4369 |
- --without-pear |
4370 |
- $(use_enable threads maintainer-zts) |
4371 |
- ) |
4372 |
- |
4373 |
- our_conf+=( |
4374 |
- $(use_enable bcmath bcmath) |
4375 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
4376 |
- $(use_enable calendar calendar) |
4377 |
- $(use_enable ctype ctype) |
4378 |
- $(use_with curl curl "${EPREFIX}/usr") |
4379 |
- $(use_enable xml dom) |
4380 |
- $(use_with enchant enchant "${EPREFIX}/usr") |
4381 |
- $(use_enable exif exif) |
4382 |
- $(use_enable fileinfo fileinfo) |
4383 |
- $(use_enable filter filter) |
4384 |
- $(use_enable ftp ftp) |
4385 |
- $(use_with nls gettext "${EPREFIX}/usr") |
4386 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
4387 |
- $(use_enable hash hash) |
4388 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
4389 |
- $(use_with iconv iconv \ |
4390 |
- $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr")) |
4391 |
- $(use_enable intl intl) |
4392 |
- $(use_enable ipv6 ipv6) |
4393 |
- $(use_enable json json) |
4394 |
- $(use_with kerberos kerberos "${EPREFIX}/usr") |
4395 |
- $(use_enable xml libxml) |
4396 |
- $(use_with xml libxml-dir "${EPREFIX}/usr") |
4397 |
- $(use_enable unicode mbstring) |
4398 |
- $(use_with crypt mcrypt "${EPREFIX}/usr") |
4399 |
- $(use_with mssql mssql "${EPREFIX}/usr") |
4400 |
- $(use_with unicode onig "${EPREFIX}/usr") |
4401 |
- $(use_with ssl openssl "${EPREFIX}/usr") |
4402 |
- $(use_with ssl openssl-dir "${EPREFIX}/usr") |
4403 |
- $(use_enable pcntl pcntl) |
4404 |
- $(use_enable phar phar) |
4405 |
- $(use_enable pdo pdo) |
4406 |
- $(use_enable opcache opcache) |
4407 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
4408 |
- $(use_enable posix posix) |
4409 |
- $(use_with spell pspell "${EPREFIX}/usr") |
4410 |
- $(use_with recode recode "${EPREFIX}/usr") |
4411 |
- $(use_enable simplexml simplexml) |
4412 |
- $(use_enable sharedmem shmop) |
4413 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
4414 |
- $(use_enable soap soap) |
4415 |
- $(use_enable sockets sockets) |
4416 |
- $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
4417 |
- $(use_with sybase-ct sybase-ct "${EPREFIX}/usr") |
4418 |
- $(use_enable sysvipc sysvmsg) |
4419 |
- $(use_enable sysvipc sysvsem) |
4420 |
- $(use_enable sysvipc sysvshm) |
4421 |
- $(use_with systemd fpm-systemd) |
4422 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
4423 |
- $(use_enable tokenizer tokenizer) |
4424 |
- $(use_enable wddx wddx) |
4425 |
- $(use_enable xml xml) |
4426 |
- $(use_enable xmlreader xmlreader) |
4427 |
- $(use_enable xmlwriter xmlwriter) |
4428 |
- $(use_with xmlrpc xmlrpc) |
4429 |
- $(use_with xslt xsl "${EPREFIX}/usr") |
4430 |
- $(use_enable zip zip) |
4431 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
4432 |
- $(use_enable debug debug) |
4433 |
- ) |
4434 |
- |
4435 |
- # DBA support |
4436 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
4437 |
- || use qdbm ; then |
4438 |
- our_conf+=( "--enable-dba${shared}" ) |
4439 |
- fi |
4440 |
- |
4441 |
- # DBA drivers support |
4442 |
- our_conf+=( |
4443 |
- $(use_with cdb cdb) |
4444 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
4445 |
- $(use_enable flatfile flatfile) |
4446 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
4447 |
- $(use_enable inifile inifile) |
4448 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
4449 |
- ) |
4450 |
- |
4451 |
- # Support for the GD graphics library |
4452 |
- our_conf+=( |
4453 |
- $(use_with truetype freetype-dir "${EPREFIX}/usr") |
4454 |
- $(use_with truetype t1lib "${EPREFIX}/usr") |
4455 |
- $(use_enable cjk gd-jis-conv) |
4456 |
- $(use_with gd jpeg-dir "${EPREFIX}/usr") |
4457 |
- $(use_with gd png-dir "${EPREFIX}/usr") |
4458 |
- $(use_with xpm xpm-dir "${EPREFIX}/usr") |
4459 |
- $(use_with vpx vpx-dir "${EPREFIX}/usr") |
4460 |
- ) |
4461 |
- # enable gd last, so configure can pick up the previous settings |
4462 |
- our_conf+=( $(use_with gd gd) ) |
4463 |
- |
4464 |
- # IMAP support |
4465 |
- if use imap ; then |
4466 |
- our_conf+=( |
4467 |
- $(use_with imap imap "${EPREFIX}/usr") |
4468 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
4469 |
- ) |
4470 |
- fi |
4471 |
- |
4472 |
- # Interbase/firebird support |
4473 |
- our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
4474 |
- |
4475 |
- # LDAP support |
4476 |
- if use ldap ; then |
4477 |
- our_conf+=( |
4478 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
4479 |
- $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
4480 |
- ) |
4481 |
- fi |
4482 |
- |
4483 |
- # MySQL support |
4484 |
- local mysqllib="mysqlnd" |
4485 |
- local mysqlilib="mysqlnd" |
4486 |
- use libmysqlclient && mysqllib="${EPREFIX}/usr" |
4487 |
- use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config" |
4488 |
- |
4489 |
- our_conf+=( $(use_with mysql mysql "${mysqllib}") ) |
4490 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
4491 |
- |
4492 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
4493 |
- if use mysql || use mysqli ; then |
4494 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
4495 |
- fi |
4496 |
- |
4497 |
- # ODBC support |
4498 |
- our_conf+=( |
4499 |
- $(use_with odbc unixODBC "${EPREFIX}/usr") |
4500 |
- $(use_with iodbc iodbc "${EPREFIX}/usr") |
4501 |
- ) |
4502 |
- |
4503 |
- # Oracle support |
4504 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
4505 |
- |
4506 |
- # PDO support |
4507 |
- if use pdo ; then |
4508 |
- our_conf+=( |
4509 |
- $(use_with mssql pdo-dblib) |
4510 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
4511 |
- $(use_with postgres pdo-pgsql) |
4512 |
- $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
4513 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
4514 |
- $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
4515 |
- $(use_with oci8-instant-client pdo-oci) |
4516 |
- ) |
4517 |
- fi |
4518 |
- |
4519 |
- # readline/libedit support |
4520 |
- our_conf+=( |
4521 |
- $(use_with readline readline "${EPREFIX}/usr") |
4522 |
- $(use_with libedit libedit "${EPREFIX}/usr") |
4523 |
- ) |
4524 |
- |
4525 |
- # Session support |
4526 |
- if use session ; then |
4527 |
- our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") ) |
4528 |
- else |
4529 |
- our_conf+=( $(use_enable session session) ) |
4530 |
- fi |
4531 |
- |
4532 |
- # Use pic for shared modules such as apache2's mod_php |
4533 |
- our_conf+=( --with-pic ) |
4534 |
- |
4535 |
- # we use the system copy of pcre |
4536 |
- # --with-pcre-regex affects ext/pcre |
4537 |
- # --with-pcre-dir affects ext/filter and ext/zip |
4538 |
- our_conf+=( |
4539 |
- --with-pcre-regex="${EPREFIX}/usr" |
4540 |
- --with-pcre-dir="${EPREFIX}/usr" |
4541 |
- ) |
4542 |
- |
4543 |
- # Catch CFLAGS problems |
4544 |
- # Fixes bug #14067. |
4545 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
4546 |
- replace-cpu-flags "k6*" "i586" |
4547 |
- |
4548 |
- # Support user-passed configuration parameters |
4549 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
4550 |
- |
4551 |
- # Support the Apache2 extras, they must be set globally for all |
4552 |
- # SAPIs to work correctly, especially for external PHP extensions |
4553 |
- |
4554 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
4555 |
- for one_sapi in $SAPIS ; do |
4556 |
- use "${one_sapi}" || continue |
4557 |
- php_set_ini_dir "${one_sapi}" |
4558 |
- |
4559 |
- # The BUILD_DIR variable is used to determine where to output |
4560 |
- # the files that autotools creates. This was all originally |
4561 |
- # based on the autotools-utils eclass. |
4562 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
4563 |
- cp -r "${S}" "${BUILD_DIR}" || die |
4564 |
- cd "${BUILD_DIR}" || die |
4565 |
- |
4566 |
- local sapi_conf=( |
4567 |
- --with-config-file-path="${PHP_INI_DIR}" |
4568 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
4569 |
- ) |
4570 |
- |
4571 |
- for sapi in $SAPIS ; do |
4572 |
- case "$sapi" in |
4573 |
- cli|cgi|embed|fpm) |
4574 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
4575 |
- sapi_conf+=( "--enable-${sapi}" ) |
4576 |
- else |
4577 |
- sapi_conf+=( "--disable-${sapi}" ) |
4578 |
- fi |
4579 |
- ;; |
4580 |
- |
4581 |
- apache2) |
4582 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
4583 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/sbin/apxs" ) |
4584 |
- else |
4585 |
- sapi_conf+=( --without-apxs2 ) |
4586 |
- fi |
4587 |
- ;; |
4588 |
- esac |
4589 |
- done |
4590 |
- |
4591 |
- # Construct the $myeconfargs array by concatenating $our_conf |
4592 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
4593 |
- local myeconfargs=( "${our_conf[@]}" ) |
4594 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
4595 |
- |
4596 |
- pushd "${BUILD_DIR}" > /dev/null || die |
4597 |
- econf "${myeconfargs[@]}" |
4598 |
- popd > /dev/null || die |
4599 |
- done |
4600 |
-} |
4601 |
- |
4602 |
-src_compile() { |
4603 |
- # snmp seems to run during src_compile, too (bug #324739) |
4604 |
- addpredict /usr/share/snmp/mibs/.index |
4605 |
- addpredict /var/lib/net-snmp/mib_indexes |
4606 |
- |
4607 |
- for sapi in ${SAPIS} ; do |
4608 |
- if use "${sapi}"; then |
4609 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
4610 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
4611 |
- emake |
4612 |
- fi |
4613 |
- done |
4614 |
-} |
4615 |
- |
4616 |
-src_install() { |
4617 |
- # see bug #324739 for what happens when we don't have that |
4618 |
- addpredict /usr/share/snmp/mibs/.index |
4619 |
- |
4620 |
- # grab the first SAPI that got built and install common files from there |
4621 |
- local first_sapi="" |
4622 |
- for sapi in $SAPIS ; do |
4623 |
- if use $sapi ; then |
4624 |
- first_sapi=$sapi |
4625 |
- break |
4626 |
- fi |
4627 |
- done |
4628 |
- |
4629 |
- # Makefile forgets to create this before trying to write to it... |
4630 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
4631 |
- |
4632 |
- # Install php environment (without any sapis) |
4633 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
4634 |
- emake INSTALL_ROOT="${D}" \ |
4635 |
- install-build install-headers install-programs |
4636 |
- |
4637 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
4638 |
- |
4639 |
- # Create the directory where we'll put version-specific php scripts |
4640 |
- keepdir "/usr/share/php${PHP_MV}" |
4641 |
- |
4642 |
- local sapi="", file="" |
4643 |
- local sapi_list="" |
4644 |
- |
4645 |
- for sapi in ${SAPIS}; do |
4646 |
- if use "${sapi}" ; then |
4647 |
- einfo "Installing SAPI: ${sapi}" |
4648 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
4649 |
- |
4650 |
- if [[ "${sapi}" == "apache2" ]] ; then |
4651 |
- # We're specifically not using emake install-sapi as libtool |
4652 |
- # may cause unnecessary relink failures (see bug #351266) |
4653 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
4654 |
- newins ".libs/libphp5$(get_libname)" \ |
4655 |
- "libphp${PHP_MV}$(get_libname)" |
4656 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
4657 |
- else |
4658 |
- # needed each time, php_install_ini would reset it |
4659 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
4660 |
- into "${dest}" |
4661 |
- case "$sapi" in |
4662 |
- cli) |
4663 |
- source="sapi/cli/php" |
4664 |
- ;; |
4665 |
- cgi) |
4666 |
- source="sapi/cgi/php-cgi" |
4667 |
- ;; |
4668 |
- fpm) |
4669 |
- source="sapi/fpm/php-fpm" |
4670 |
- ;; |
4671 |
- embed) |
4672 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
4673 |
- ;; |
4674 |
- *) |
4675 |
- die "unhandled sapi in src_install" |
4676 |
- ;; |
4677 |
- esac |
4678 |
- |
4679 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
4680 |
- dolib.so "${source}" |
4681 |
- else |
4682 |
- dobin "${source}" |
4683 |
- local name="$(basename ${source})" |
4684 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
4685 |
- fi |
4686 |
- fi |
4687 |
- |
4688 |
- php_install_ini "${sapi}" |
4689 |
- |
4690 |
- # construct correct SAPI string for php-config |
4691 |
- # thanks to ferringb for the bash voodoo |
4692 |
- if [[ "${sapi}" == "apache2" ]]; then |
4693 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
4694 |
- else |
4695 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
4696 |
- fi |
4697 |
- fi |
4698 |
- done |
4699 |
- |
4700 |
- # Installing opcache module |
4701 |
- if use_if_iuse opcache ; then |
4702 |
- dolib.so "modules/opcache$(get_libname)" |
4703 |
- fi |
4704 |
- |
4705 |
- # Install env.d files |
4706 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
4707 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
4708 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
4709 |
- |
4710 |
- # set php-config variable correctly (bug #278439) |
4711 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
4712 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
4713 |
- |
4714 |
- if use fpm ; then |
4715 |
- if use systemd; then |
4716 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
4717 |
- "php-fpm@${SLOT}.service" |
4718 |
- else |
4719 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
4720 |
- "php-fpm@${SLOT}.service" |
4721 |
- fi |
4722 |
- fi |
4723 |
-} |
4724 |
- |
4725 |
-src_test() { |
4726 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
4727 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
4728 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
4729 |
- ewarn "Test phase requires USE=cli, skipping" |
4730 |
- return |
4731 |
- else |
4732 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
4733 |
- fi |
4734 |
- |
4735 |
- if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
4736 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
4737 |
- fi |
4738 |
- |
4739 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
4740 |
- "session.save_path=${T}" \ |
4741 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
4742 |
- "session.save_path=${T}" |
4743 |
- |
4744 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
4745 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
4746 |
- done |
4747 |
- |
4748 |
- local failed="$(find -name '*.out')" |
4749 |
- if [[ ${failed} != "" ]] ; then |
4750 |
- ewarn "The following test cases failed unexpectedly:" |
4751 |
- for name in ${failed}; do |
4752 |
- ewarn " ${name/.out/}" |
4753 |
- done |
4754 |
- else |
4755 |
- einfo "No unexpected test failures, all fine" |
4756 |
- fi |
4757 |
- |
4758 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
4759 |
- local passed="" |
4760 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
4761 |
- [[ -f "${name}.diff" ]] && continue |
4762 |
- passed="${passed} ${name}" |
4763 |
- done |
4764 |
- if [[ ${passed} != "" ]] ; then |
4765 |
- einfo "The following test cases passed unexpectedly:" |
4766 |
- for name in ${passed}; do |
4767 |
- ewarn " ${passed}" |
4768 |
- done |
4769 |
- else |
4770 |
- einfo "None of the known-to-fail tests passed, all fine" |
4771 |
- fi |
4772 |
- fi |
4773 |
-} |
4774 |
- |
4775 |
-pkg_postinst() { |
4776 |
- # Output some general info to the user |
4777 |
- if use apache2 ; then |
4778 |
- APACHE2_MOD_DEFINE="PHP" |
4779 |
- APACHE2_MOD_CONF="70_mod_php" # Provided by app-eselect/eselect-php |
4780 |
- apache-module_pkg_postinst |
4781 |
- fi |
4782 |
- |
4783 |
- # Create the symlinks for php |
4784 |
- for m in ${SAPIS}; do |
4785 |
- [[ ${m} == 'embed' ]] && continue; |
4786 |
- if use $m ; then |
4787 |
- local ci=$(eselect php show $m) |
4788 |
- if [[ -z $ci ]]; then |
4789 |
- eselect php set $m php${SLOT} || die |
4790 |
- einfo "Switched ${m} to use php:${SLOT}" |
4791 |
- einfo |
4792 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
4793 |
- elog "To switch $m to use php:${SLOT}, run" |
4794 |
- elog " eselect php set $m php${SLOT}" |
4795 |
- elog |
4796 |
- fi |
4797 |
- fi |
4798 |
- done |
4799 |
- |
4800 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
4801 |
- # example, if the user has the cgi SAPI enabled, then he has an |
4802 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
4803 |
- # USE="-cgi", that symlink will break. This call to eselect is |
4804 |
- # supposed to remove that dead link per bug 572436. |
4805 |
- eselect php cleanup || die |
4806 |
- |
4807 |
- elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes" |
4808 |
- elog "php${SLOT/./-} in order to compile extensions for the ${SLOT} ABI." |
4809 |
- elog |
4810 |
- elog "This ebuild installed a version of php.ini based on" |
4811 |
- elog "php.ini-${PHP_INI_VERSION}. You can choose which version of" |
4812 |
- elog "php.ini to install by default by setting PHP_INI_VERSION" |
4813 |
- elog "to either 'production' or 'development' in your make.conf." |
4814 |
- elog "Both versions of php.ini can be found with the PHP docs in" |
4815 |
- elog "${EPREFIX}/usr/share/doc/${PF}" |
4816 |
- elog |
4817 |
- elog "For more details on how version slotting works, please see" |
4818 |
- elog "the wiki:" |
4819 |
- elog |
4820 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
4821 |
- elog |
4822 |
-} |
4823 |
- |
4824 |
-pkg_postrm() { |
4825 |
- # This serves two purposes. First, if we have just removed the last |
4826 |
- # installed version of PHP, then this will remove any dead symlinks |
4827 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
4828 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
4829 |
- # his existing symlinks to point to the new 7.0 installation. The |
4830 |
- # latter is bug 432962. |
4831 |
- # |
4832 |
- # Note: the eselect-php package may not be installed at this point, |
4833 |
- # so we can't die() if this command fails. |
4834 |
- eselect php cleanup |
4835 |
-} |
4836 |
|
4837 |
diff --git a/dev-lang/php/php-5.6.21.ebuild b/dev-lang/php/php-5.6.21.ebuild |
4838 |
deleted file mode 100644 |
4839 |
index 7d4b6ae..0000000 |
4840 |
--- a/dev-lang/php/php-5.6.21.ebuild |
4841 |
+++ /dev/null |
4842 |
@@ -1,807 +0,0 @@ |
4843 |
-# Copyright 1999-2016 Gentoo Foundation |
4844 |
-# Distributed under the terms of the GNU General Public License v2 |
4845 |
-# $Id$ |
4846 |
- |
4847 |
-EAPI=5 |
4848 |
- |
4849 |
-inherit eutils autotools flag-o-matic versionator depend.apache apache-module libtool systemd |
4850 |
- |
4851 |
-KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" |
4852 |
- |
4853 |
-function php_get_uri () |
4854 |
-{ |
4855 |
- case "${1}" in |
4856 |
- "php-pre") |
4857 |
- echo "http://downloads.php.net/dsp/${2}" |
4858 |
- ;; |
4859 |
- "php") |
4860 |
- echo "http://www.php.net/distributions/${2}" |
4861 |
- ;; |
4862 |
- "olemarkus") |
4863 |
- echo "https://dev.gentoo.org/~olemarkus/php/${2}" |
4864 |
- ;; |
4865 |
- "gentoo") |
4866 |
- echo "mirror://gentoo/${2}" |
4867 |
- ;; |
4868 |
- *) |
4869 |
- die "unhandled case in php_get_uri" |
4870 |
- ;; |
4871 |
- esac |
4872 |
-} |
4873 |
- |
4874 |
-PHP_MV="$(get_major_version)" |
4875 |
-SLOT="$(get_version_component_range 1-2)" |
4876 |
- |
4877 |
-# alias, so we can handle different types of releases (finals, rcs, alphas, |
4878 |
-# betas, ...) w/o changing the whole ebuild |
4879 |
-PHP_PV="${PV/_rc/RC}" |
4880 |
-PHP_PV="${PHP_PV/_alpha/alpha}" |
4881 |
-PHP_PV="${PHP_PV/_beta/beta}" |
4882 |
-PHP_RELEASE="php" |
4883 |
-[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre" |
4884 |
-[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre" |
4885 |
-[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre" |
4886 |
-PHP_P="${PN}-${PHP_PV}" |
4887 |
- |
4888 |
-PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")" |
4889 |
- |
4890 |
-PHP_FPM_CONF_VER="1" |
4891 |
- |
4892 |
-SRC_URI="${PHP_SRC_URI}" |
4893 |
- |
4894 |
-DESCRIPTION="The PHP language runtime engine" |
4895 |
-HOMEPAGE="http://php.net/" |
4896 |
-LICENSE="PHP-3" |
4897 |
- |
4898 |
-S="${WORKDIR}/${PHP_P}" |
4899 |
- |
4900 |
-# We can build the following SAPIs in the given order |
4901 |
-SAPIS="embed cli cgi fpm apache2" |
4902 |
- |
4903 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
4904 |
-IUSE="${IUSE} |
4905 |
- ${SAPIS/cli/+cli} |
4906 |
- threads" |
4907 |
- |
4908 |
-IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk |
4909 |
- crypt +ctype curl debug |
4910 |
- enchant exif frontbase +fileinfo +filter firebird |
4911 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
4912 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl |
4913 |
- mhash mssql mysql libmysqlclient mysqli nls |
4914 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
4915 |
- readline recode selinux +session sharedmem |
4916 |
- +simplexml snmp soap sockets spell sqlite ssl |
4917 |
- sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx |
4918 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
4919 |
- |
4920 |
-DEPEND=" |
4921 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
4922 |
- >=dev-libs/libpcre-8.32[unicode] |
4923 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
4924 |
- <www-servers/apache-2.4[threads=] ) )" |
4925 |
- |
4926 |
-# The supported (that is, autodetected) versions of BDB are listed in |
4927 |
-# the ./configure script. Other versions *work*, but we need to stick to |
4928 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
4929 |
-DEPEND="${DEPEND} |
4930 |
- berkdb? ( || ( sys-libs/db:5.3 |
4931 |
- sys-libs/db:5.1 |
4932 |
- sys-libs/db:4.8 |
4933 |
- sys-libs/db:4.7 |
4934 |
- sys-libs/db:4.6 |
4935 |
- sys-libs/db:4.5 ) ) |
4936 |
- bzip2? ( app-arch/bzip2 ) |
4937 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
4938 |
- cjk? ( !gd? ( |
4939 |
- virtual/jpeg:0 |
4940 |
- media-libs/libpng:0= |
4941 |
- sys-libs/zlib |
4942 |
- ) ) |
4943 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
4944 |
- curl? ( >=net-misc/curl-7.10.5 ) |
4945 |
- enchant? ( app-text/enchant ) |
4946 |
- exif? ( !gd? ( |
4947 |
- virtual/jpeg:0 |
4948 |
- media-libs/libpng:0= |
4949 |
- sys-libs/zlib |
4950 |
- ) ) |
4951 |
- firebird? ( dev-db/firebird ) |
4952 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
4953 |
- gdbm? ( >=sys-libs/gdbm-1.8.0 ) |
4954 |
- gmp? ( dev-libs/gmp:0 ) |
4955 |
- iconv? ( virtual/libiconv ) |
4956 |
- imap? ( virtual/imap-c-client[ssl=] ) |
4957 |
- intl? ( dev-libs/icu:= ) |
4958 |
- iodbc? ( dev-db/libiodbc ) |
4959 |
- kerberos? ( virtual/krb5 ) |
4960 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
4961 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
4962 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
4963 |
- mssql? ( dev-db/freetds[mssql] ) |
4964 |
- libmysqlclient? ( |
4965 |
- mysql? ( virtual/mysql ) |
4966 |
- mysqli? ( >=virtual/mysql-4.1 ) |
4967 |
- ) |
4968 |
- nls? ( sys-devel/gettext ) |
4969 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
4970 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
4971 |
- postgres? ( dev-db/postgresql:* ) |
4972 |
- qdbm? ( dev-db/qdbm ) |
4973 |
- readline? ( sys-libs/readline:0 ) |
4974 |
- recode? ( app-text/recode ) |
4975 |
- sharedmem? ( dev-libs/mm ) |
4976 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
4977 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
4978 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
4979 |
- spell? ( >=app-text/aspell-0.50 ) |
4980 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
4981 |
- ssl? ( |
4982 |
- !libressl? ( dev-libs/openssl:0 ) |
4983 |
- libressl? ( dev-libs/libressl ) |
4984 |
- ) |
4985 |
- sybase-ct? ( dev-db/freetds ) |
4986 |
- tidy? ( app-text/htmltidy ) |
4987 |
- truetype? ( |
4988 |
- =media-libs/freetype-2* |
4989 |
- >=media-libs/t1lib-5.0.0 |
4990 |
- !gd? ( |
4991 |
- virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
4992 |
- ) |
4993 |
- unicode? ( dev-libs/oniguruma ) |
4994 |
- vpx? ( media-libs/libvpx ) |
4995 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
4996 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
4997 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
4998 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
4999 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
5000 |
- xpm? ( |
5001 |
- x11-libs/libXpm |
5002 |
- virtual/jpeg:0 |
5003 |
- media-libs/libpng:0= sys-libs/zlib |
5004 |
- ) |
5005 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
5006 |
- zip? ( sys-libs/zlib ) |
5007 |
- zlib? ( sys-libs/zlib ) |
5008 |
- virtual/mta |
5009 |
-" |
5010 |
- |
5011 |
-php="=${CATEGORY}/${PF}" |
5012 |
- |
5013 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
5014 |
-REQUIRED_USE=" |
5015 |
- cli? ( ^^ ( readline libedit ) ) |
5016 |
- truetype? ( gd ) |
5017 |
- vpx? ( gd ) |
5018 |
- cjk? ( gd ) |
5019 |
- exif? ( gd ) |
5020 |
- |
5021 |
- xpm? ( gd ) |
5022 |
- gd? ( zlib ) |
5023 |
- simplexml? ( xml ) |
5024 |
- soap? ( xml ) |
5025 |
- wddx? ( xml ) |
5026 |
- xmlrpc? ( || ( xml iconv ) ) |
5027 |
- xmlreader? ( xml ) |
5028 |
- xslt? ( xml ) |
5029 |
- ldap-sasl? ( ldap ) |
5030 |
- mhash? ( hash ) |
5031 |
- phar? ( hash ) |
5032 |
- libmysqlclient? ( || ( |
5033 |
- mysql |
5034 |
- mysqli |
5035 |
- pdo |
5036 |
- ) ) |
5037 |
- |
5038 |
- qdbm? ( !gdbm ) |
5039 |
- readline? ( !libedit ) |
5040 |
- recode? ( !imap !mysql !mysqli ) |
5041 |
- sharedmem? ( !threads ) |
5042 |
- |
5043 |
- !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" |
5044 |
- |
5045 |
-RDEPEND="${DEPEND}" |
5046 |
- |
5047 |
-RDEPEND="${RDEPEND} |
5048 |
- fpm? ( |
5049 |
- selinux? ( sec-policy/selinux-phpfpm ) |
5050 |
- systemd? ( sys-apps/systemd ) )" |
5051 |
- |
5052 |
-DEPEND="${DEPEND} |
5053 |
- sys-devel/flex |
5054 |
- >=sys-devel/m4-1.4.3 |
5055 |
- >=sys-devel/libtool-1.5.18" |
5056 |
- |
5057 |
-# Allow users to install production version if they want to |
5058 |
- |
5059 |
-case "${PHP_INI_VERSION}" in |
5060 |
- production|development) |
5061 |
- ;; |
5062 |
- *) |
5063 |
- PHP_INI_VERSION="development" |
5064 |
- ;; |
5065 |
-esac |
5066 |
- |
5067 |
-PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}" |
5068 |
-PHP_INI_FILE="php.ini" |
5069 |
- |
5070 |
-want_apache |
5071 |
- |
5072 |
-pkg_setup() { |
5073 |
- depend.apache_pkg_setup |
5074 |
-} |
5075 |
- |
5076 |
-php_install_ini() { |
5077 |
- local phpsapi="${1}" |
5078 |
- |
5079 |
- # work out where we are installing the ini file |
5080 |
- php_set_ini_dir "${phpsapi}" |
5081 |
- |
5082 |
- local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}" |
5083 |
- cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die |
5084 |
- |
5085 |
- # default to /tmp for save_path, bug #282768 |
5086 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
5087 |
- |
5088 |
- # Set the extension dir |
5089 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" || die |
5090 |
- |
5091 |
- # Set the include path to point to where we want to find PEAR packages |
5092 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
5093 |
- |
5094 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
5095 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
5096 |
- newins "${phpinisrc}" "${PHP_INI_FILE}" |
5097 |
- |
5098 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
5099 |
- elog |
5100 |
- |
5101 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
5102 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
5103 |
- |
5104 |
- if use_if_iuse opcache; then |
5105 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
5106 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
5107 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
5108 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \ |
5109 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
5110 |
- fi |
5111 |
- |
5112 |
- # SAPI-specific handling |
5113 |
- if [[ "${sapi}" == "fpm" ]] ; then |
5114 |
- einfo "Installing FPM config file php-fpm.conf" |
5115 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
5116 |
- doins sapi/fpm/php-fpm.conf |
5117 |
- fi |
5118 |
- |
5119 |
- dodoc php.ini-development |
5120 |
- dodoc php.ini-production |
5121 |
-} |
5122 |
- |
5123 |
-php_set_ini_dir() { |
5124 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
5125 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
5126 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
5127 |
-} |
5128 |
- |
5129 |
-src_prepare() { |
5130 |
- # Change PHP branding |
5131 |
- # Get the alpha/beta/rc version |
5132 |
- sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ |
5133 |
- -i configure.in || die "Unable to change PHP branding" |
5134 |
- |
5135 |
- # Patch PHP to show Gentoo as the server platform |
5136 |
- sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
5137 |
- -i configure.in || die "Failed to fix server platform name" |
5138 |
- |
5139 |
- # Prevent PHP from activating the Apache config, |
5140 |
- # as we will do that ourselves |
5141 |
- sed -i \ |
5142 |
- -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
5143 |
- -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
5144 |
- configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \ |
5145 |
- || die |
5146 |
- |
5147 |
- # Patch PHP to support heimdal instead of mit-krb5 |
5148 |
- if has_version "app-crypt/heimdal" ; then |
5149 |
- sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
5150 |
- || die "Failed to fix heimdal libname" |
5151 |
- sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
5152 |
- || die "Failed to fix heimdal crypt library reference" |
5153 |
- fi |
5154 |
- |
5155 |
- # Add user patches #357637 |
5156 |
- epatch_user |
5157 |
- |
5158 |
- # Force rebuilding aclocal.m4 |
5159 |
- rm -f aclocal.m4 || die |
5160 |
- eautoreconf |
5161 |
- |
5162 |
- if [[ ${CHOST} == *-darwin* ]] ; then |
5163 |
- # http://bugs.php.net/bug.php?id=48795, bug #343481 |
5164 |
- sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die |
5165 |
- fi |
5166 |
-} |
5167 |
- |
5168 |
-src_configure() { |
5169 |
- addpredict /usr/share/snmp/mibs/.index |
5170 |
- addpredict /var/lib/net-snmp/mib_indexes |
5171 |
- |
5172 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
5173 |
- |
5174 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
5175 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
5176 |
- local our_conf=( |
5177 |
- --prefix="${PHP_DESTDIR}" |
5178 |
- --mandir="${PHP_DESTDIR}/man" |
5179 |
- --infodir="${PHP_DESTDIR}/info" |
5180 |
- --libdir="${PHP_DESTDIR}/lib" |
5181 |
- --with-libdir="$(get_libdir)" |
5182 |
- --localstatedir="${EPREFIX}/var" |
5183 |
- --without-pear |
5184 |
- $(use_enable threads maintainer-zts) |
5185 |
- ) |
5186 |
- |
5187 |
- our_conf+=( |
5188 |
- $(use_enable bcmath bcmath) |
5189 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
5190 |
- $(use_enable calendar calendar) |
5191 |
- $(use_enable ctype ctype) |
5192 |
- $(use_with curl curl "${EPREFIX}/usr") |
5193 |
- $(use_enable xml dom) |
5194 |
- $(use_with enchant enchant "${EPREFIX}/usr") |
5195 |
- $(use_enable exif exif) |
5196 |
- $(use_enable fileinfo fileinfo) |
5197 |
- $(use_enable filter filter) |
5198 |
- $(use_enable ftp ftp) |
5199 |
- $(use_with nls gettext "${EPREFIX}/usr") |
5200 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
5201 |
- $(use_enable hash hash) |
5202 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
5203 |
- $(use_with iconv iconv \ |
5204 |
- $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr")) |
5205 |
- $(use_enable intl intl) |
5206 |
- $(use_enable ipv6 ipv6) |
5207 |
- $(use_enable json json) |
5208 |
- $(use_with kerberos kerberos "${EPREFIX}/usr") |
5209 |
- $(use_enable xml libxml) |
5210 |
- $(use_with xml libxml-dir "${EPREFIX}/usr") |
5211 |
- $(use_enable unicode mbstring) |
5212 |
- $(use_with crypt mcrypt "${EPREFIX}/usr") |
5213 |
- $(use_with mssql mssql "${EPREFIX}/usr") |
5214 |
- $(use_with unicode onig "${EPREFIX}/usr") |
5215 |
- $(use_with ssl openssl "${EPREFIX}/usr") |
5216 |
- $(use_with ssl openssl-dir "${EPREFIX}/usr") |
5217 |
- $(use_enable pcntl pcntl) |
5218 |
- $(use_enable phar phar) |
5219 |
- $(use_enable pdo pdo) |
5220 |
- $(use_enable opcache opcache) |
5221 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
5222 |
- $(use_enable posix posix) |
5223 |
- $(use_with spell pspell "${EPREFIX}/usr") |
5224 |
- $(use_with recode recode "${EPREFIX}/usr") |
5225 |
- $(use_enable simplexml simplexml) |
5226 |
- $(use_enable sharedmem shmop) |
5227 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
5228 |
- $(use_enable soap soap) |
5229 |
- $(use_enable sockets sockets) |
5230 |
- $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
5231 |
- $(use_with sybase-ct sybase-ct "${EPREFIX}/usr") |
5232 |
- $(use_enable sysvipc sysvmsg) |
5233 |
- $(use_enable sysvipc sysvsem) |
5234 |
- $(use_enable sysvipc sysvshm) |
5235 |
- $(use_with systemd fpm-systemd) |
5236 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
5237 |
- $(use_enable tokenizer tokenizer) |
5238 |
- $(use_enable wddx wddx) |
5239 |
- $(use_enable xml xml) |
5240 |
- $(use_enable xmlreader xmlreader) |
5241 |
- $(use_enable xmlwriter xmlwriter) |
5242 |
- $(use_with xmlrpc xmlrpc) |
5243 |
- $(use_with xslt xsl "${EPREFIX}/usr") |
5244 |
- $(use_enable zip zip) |
5245 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
5246 |
- $(use_enable debug debug) |
5247 |
- ) |
5248 |
- |
5249 |
- # DBA support |
5250 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
5251 |
- || use qdbm ; then |
5252 |
- our_conf+=( "--enable-dba${shared}" ) |
5253 |
- fi |
5254 |
- |
5255 |
- # DBA drivers support |
5256 |
- our_conf+=( |
5257 |
- $(use_with cdb cdb) |
5258 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
5259 |
- $(use_enable flatfile flatfile) |
5260 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
5261 |
- $(use_enable inifile inifile) |
5262 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
5263 |
- ) |
5264 |
- |
5265 |
- # Support for the GD graphics library |
5266 |
- our_conf+=( |
5267 |
- $(use_with truetype freetype-dir "${EPREFIX}/usr") |
5268 |
- $(use_with truetype t1lib "${EPREFIX}/usr") |
5269 |
- $(use_enable cjk gd-jis-conv) |
5270 |
- $(use_with gd jpeg-dir "${EPREFIX}/usr") |
5271 |
- $(use_with gd png-dir "${EPREFIX}/usr") |
5272 |
- $(use_with xpm xpm-dir "${EPREFIX}/usr") |
5273 |
- $(use_with vpx vpx-dir "${EPREFIX}/usr") |
5274 |
- ) |
5275 |
- # enable gd last, so configure can pick up the previous settings |
5276 |
- our_conf+=( $(use_with gd gd) ) |
5277 |
- |
5278 |
- # IMAP support |
5279 |
- if use imap ; then |
5280 |
- our_conf+=( |
5281 |
- $(use_with imap imap "${EPREFIX}/usr") |
5282 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
5283 |
- ) |
5284 |
- fi |
5285 |
- |
5286 |
- # Interbase/firebird support |
5287 |
- our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
5288 |
- |
5289 |
- # LDAP support |
5290 |
- if use ldap ; then |
5291 |
- our_conf+=( |
5292 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
5293 |
- $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
5294 |
- ) |
5295 |
- fi |
5296 |
- |
5297 |
- # MySQL support |
5298 |
- local mysqllib="mysqlnd" |
5299 |
- local mysqlilib="mysqlnd" |
5300 |
- use libmysqlclient && mysqllib="${EPREFIX}/usr" |
5301 |
- use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config" |
5302 |
- |
5303 |
- our_conf+=( $(use_with mysql mysql "${mysqllib}") ) |
5304 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
5305 |
- |
5306 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
5307 |
- if use mysql || use mysqli ; then |
5308 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
5309 |
- fi |
5310 |
- |
5311 |
- # ODBC support |
5312 |
- our_conf+=( |
5313 |
- $(use_with odbc unixODBC "${EPREFIX}/usr") |
5314 |
- $(use_with iodbc iodbc "${EPREFIX}/usr") |
5315 |
- ) |
5316 |
- |
5317 |
- # Oracle support |
5318 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
5319 |
- |
5320 |
- # PDO support |
5321 |
- if use pdo ; then |
5322 |
- our_conf+=( |
5323 |
- $(use_with mssql pdo-dblib) |
5324 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
5325 |
- $(use_with postgres pdo-pgsql) |
5326 |
- $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
5327 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
5328 |
- $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
5329 |
- $(use_with oci8-instant-client pdo-oci) |
5330 |
- ) |
5331 |
- fi |
5332 |
- |
5333 |
- # readline/libedit support |
5334 |
- our_conf+=( |
5335 |
- $(use_with readline readline "${EPREFIX}/usr") |
5336 |
- $(use_with libedit libedit "${EPREFIX}/usr") |
5337 |
- ) |
5338 |
- |
5339 |
- # Session support |
5340 |
- if use session ; then |
5341 |
- our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") ) |
5342 |
- else |
5343 |
- our_conf+=( $(use_enable session session) ) |
5344 |
- fi |
5345 |
- |
5346 |
- # Use pic for shared modules such as apache2's mod_php |
5347 |
- our_conf+=( --with-pic ) |
5348 |
- |
5349 |
- # we use the system copy of pcre |
5350 |
- # --with-pcre-regex affects ext/pcre |
5351 |
- # --with-pcre-dir affects ext/filter and ext/zip |
5352 |
- our_conf+=( |
5353 |
- --with-pcre-regex="${EPREFIX}/usr" |
5354 |
- --with-pcre-dir="${EPREFIX}/usr" |
5355 |
- ) |
5356 |
- |
5357 |
- # Catch CFLAGS problems |
5358 |
- # Fixes bug #14067. |
5359 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
5360 |
- replace-cpu-flags "k6*" "i586" |
5361 |
- |
5362 |
- # Support user-passed configuration parameters |
5363 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
5364 |
- |
5365 |
- # Support the Apache2 extras, they must be set globally for all |
5366 |
- # SAPIs to work correctly, especially for external PHP extensions |
5367 |
- |
5368 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
5369 |
- for one_sapi in $SAPIS ; do |
5370 |
- use "${one_sapi}" || continue |
5371 |
- php_set_ini_dir "${one_sapi}" |
5372 |
- |
5373 |
- # The BUILD_DIR variable is used to determine where to output |
5374 |
- # the files that autotools creates. This was all originally |
5375 |
- # based on the autotools-utils eclass. |
5376 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
5377 |
- cp -r "${S}" "${BUILD_DIR}" || die |
5378 |
- cd "${BUILD_DIR}" || die |
5379 |
- |
5380 |
- local sapi_conf=( |
5381 |
- --with-config-file-path="${PHP_INI_DIR}" |
5382 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
5383 |
- ) |
5384 |
- |
5385 |
- for sapi in $SAPIS ; do |
5386 |
- case "$sapi" in |
5387 |
- cli|cgi|embed|fpm) |
5388 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
5389 |
- sapi_conf+=( "--enable-${sapi}" ) |
5390 |
- else |
5391 |
- sapi_conf+=( "--disable-${sapi}" ) |
5392 |
- fi |
5393 |
- ;; |
5394 |
- |
5395 |
- apache2) |
5396 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
5397 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/sbin/apxs" ) |
5398 |
- else |
5399 |
- sapi_conf+=( --without-apxs2 ) |
5400 |
- fi |
5401 |
- ;; |
5402 |
- esac |
5403 |
- done |
5404 |
- |
5405 |
- # Construct the $myeconfargs array by concatenating $our_conf |
5406 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
5407 |
- local myeconfargs=( "${our_conf[@]}" ) |
5408 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
5409 |
- |
5410 |
- pushd "${BUILD_DIR}" > /dev/null || die |
5411 |
- econf "${myeconfargs[@]}" |
5412 |
- popd > /dev/null || die |
5413 |
- done |
5414 |
-} |
5415 |
- |
5416 |
-src_compile() { |
5417 |
- # snmp seems to run during src_compile, too (bug #324739) |
5418 |
- addpredict /usr/share/snmp/mibs/.index |
5419 |
- addpredict /var/lib/net-snmp/mib_indexes |
5420 |
- |
5421 |
- for sapi in ${SAPIS} ; do |
5422 |
- if use "${sapi}"; then |
5423 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
5424 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
5425 |
- emake |
5426 |
- fi |
5427 |
- done |
5428 |
-} |
5429 |
- |
5430 |
-src_install() { |
5431 |
- # see bug #324739 for what happens when we don't have that |
5432 |
- addpredict /usr/share/snmp/mibs/.index |
5433 |
- |
5434 |
- # grab the first SAPI that got built and install common files from there |
5435 |
- local first_sapi="" |
5436 |
- for sapi in $SAPIS ; do |
5437 |
- if use $sapi ; then |
5438 |
- first_sapi=$sapi |
5439 |
- break |
5440 |
- fi |
5441 |
- done |
5442 |
- |
5443 |
- # Makefile forgets to create this before trying to write to it... |
5444 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
5445 |
- |
5446 |
- # Install php environment (without any sapis) |
5447 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
5448 |
- emake INSTALL_ROOT="${D}" \ |
5449 |
- install-build install-headers install-programs |
5450 |
- |
5451 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
5452 |
- |
5453 |
- # Create the directory where we'll put version-specific php scripts |
5454 |
- keepdir "/usr/share/php${PHP_MV}" |
5455 |
- |
5456 |
- local sapi="", file="" |
5457 |
- local sapi_list="" |
5458 |
- |
5459 |
- for sapi in ${SAPIS}; do |
5460 |
- if use "${sapi}" ; then |
5461 |
- einfo "Installing SAPI: ${sapi}" |
5462 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
5463 |
- |
5464 |
- if [[ "${sapi}" == "apache2" ]] ; then |
5465 |
- # We're specifically not using emake install-sapi as libtool |
5466 |
- # may cause unnecessary relink failures (see bug #351266) |
5467 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
5468 |
- newins ".libs/libphp5$(get_libname)" \ |
5469 |
- "libphp${PHP_MV}$(get_libname)" |
5470 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
5471 |
- else |
5472 |
- # needed each time, php_install_ini would reset it |
5473 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
5474 |
- into "${dest}" |
5475 |
- case "$sapi" in |
5476 |
- cli) |
5477 |
- source="sapi/cli/php" |
5478 |
- ;; |
5479 |
- cgi) |
5480 |
- source="sapi/cgi/php-cgi" |
5481 |
- ;; |
5482 |
- fpm) |
5483 |
- source="sapi/fpm/php-fpm" |
5484 |
- ;; |
5485 |
- embed) |
5486 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
5487 |
- ;; |
5488 |
- *) |
5489 |
- die "unhandled sapi in src_install" |
5490 |
- ;; |
5491 |
- esac |
5492 |
- |
5493 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
5494 |
- dolib.so "${source}" |
5495 |
- else |
5496 |
- dobin "${source}" |
5497 |
- local name="$(basename ${source})" |
5498 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
5499 |
- fi |
5500 |
- fi |
5501 |
- |
5502 |
- php_install_ini "${sapi}" |
5503 |
- |
5504 |
- # construct correct SAPI string for php-config |
5505 |
- # thanks to ferringb for the bash voodoo |
5506 |
- if [[ "${sapi}" == "apache2" ]]; then |
5507 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
5508 |
- else |
5509 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
5510 |
- fi |
5511 |
- fi |
5512 |
- done |
5513 |
- |
5514 |
- # Installing opcache module |
5515 |
- if use_if_iuse opcache ; then |
5516 |
- dolib.so "modules/opcache$(get_libname)" |
5517 |
- fi |
5518 |
- |
5519 |
- # Install env.d files |
5520 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
5521 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
5522 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
5523 |
- |
5524 |
- # set php-config variable correctly (bug #278439) |
5525 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
5526 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
5527 |
- |
5528 |
- if use fpm ; then |
5529 |
- if use systemd; then |
5530 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
5531 |
- "php-fpm@${SLOT}.service" |
5532 |
- else |
5533 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
5534 |
- "php-fpm@${SLOT}.service" |
5535 |
- fi |
5536 |
- fi |
5537 |
-} |
5538 |
- |
5539 |
-src_test() { |
5540 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
5541 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
5542 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
5543 |
- ewarn "Test phase requires USE=cli, skipping" |
5544 |
- return |
5545 |
- else |
5546 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
5547 |
- fi |
5548 |
- |
5549 |
- if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
5550 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
5551 |
- fi |
5552 |
- |
5553 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
5554 |
- "session.save_path=${T}" \ |
5555 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
5556 |
- "session.save_path=${T}" |
5557 |
- |
5558 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
5559 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
5560 |
- done |
5561 |
- |
5562 |
- local failed="$(find -name '*.out')" |
5563 |
- if [[ ${failed} != "" ]] ; then |
5564 |
- ewarn "The following test cases failed unexpectedly:" |
5565 |
- for name in ${failed}; do |
5566 |
- ewarn " ${name/.out/}" |
5567 |
- done |
5568 |
- else |
5569 |
- einfo "No unexpected test failures, all fine" |
5570 |
- fi |
5571 |
- |
5572 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
5573 |
- local passed="" |
5574 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
5575 |
- [[ -f "${name}.diff" ]] && continue |
5576 |
- passed="${passed} ${name}" |
5577 |
- done |
5578 |
- if [[ ${passed} != "" ]] ; then |
5579 |
- einfo "The following test cases passed unexpectedly:" |
5580 |
- for name in ${passed}; do |
5581 |
- ewarn " ${passed}" |
5582 |
- done |
5583 |
- else |
5584 |
- einfo "None of the known-to-fail tests passed, all fine" |
5585 |
- fi |
5586 |
- fi |
5587 |
-} |
5588 |
- |
5589 |
-pkg_postinst() { |
5590 |
- # Output some general info to the user |
5591 |
- if use apache2 ; then |
5592 |
- APACHE2_MOD_DEFINE="PHP" |
5593 |
- APACHE2_MOD_CONF="70_mod_php" # Provided by app-eselect/eselect-php |
5594 |
- apache-module_pkg_postinst |
5595 |
- fi |
5596 |
- |
5597 |
- # Create the symlinks for php |
5598 |
- for m in ${SAPIS}; do |
5599 |
- [[ ${m} == 'embed' ]] && continue; |
5600 |
- if use $m ; then |
5601 |
- local ci=$(eselect php show $m) |
5602 |
- if [[ -z $ci ]]; then |
5603 |
- eselect php set $m php${SLOT} || die |
5604 |
- einfo "Switched ${m} to use php:${SLOT}" |
5605 |
- einfo |
5606 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
5607 |
- elog "To switch $m to use php:${SLOT}, run" |
5608 |
- elog " eselect php set $m php${SLOT}" |
5609 |
- elog |
5610 |
- fi |
5611 |
- fi |
5612 |
- done |
5613 |
- |
5614 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
5615 |
- # example, if the user has the cgi SAPI enabled, then he has an |
5616 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
5617 |
- # USE="-cgi", that symlink will break. This call to eselect is |
5618 |
- # supposed to remove that dead link per bug 572436. |
5619 |
- eselect php cleanup || die |
5620 |
- |
5621 |
- elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes" |
5622 |
- elog "php${SLOT/./-} in order to compile extensions for the ${SLOT} ABI." |
5623 |
- elog |
5624 |
- elog "This ebuild installed a version of php.ini based on" |
5625 |
- elog "php.ini-${PHP_INI_VERSION}. You can choose which version of" |
5626 |
- elog "php.ini to install by default by setting PHP_INI_VERSION" |
5627 |
- elog "to either 'production' or 'development' in your make.conf." |
5628 |
- elog "Both versions of php.ini can be found with the PHP docs in" |
5629 |
- elog "${EPREFIX}/usr/share/doc/${PF}" |
5630 |
- elog |
5631 |
- elog "For more details on how version slotting works, please see" |
5632 |
- elog "the wiki:" |
5633 |
- elog |
5634 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
5635 |
- elog |
5636 |
-} |
5637 |
- |
5638 |
-pkg_postrm() { |
5639 |
- # This serves two purposes. First, if we have just removed the last |
5640 |
- # installed version of PHP, then this will remove any dead symlinks |
5641 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
5642 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
5643 |
- # his existing symlinks to point to the new 7.0 installation. The |
5644 |
- # latter is bug 432962. |
5645 |
- # |
5646 |
- # Note: the eselect-php package may not be installed at this point, |
5647 |
- # so we can't die() if this command fails. |
5648 |
- eselect php cleanup |
5649 |
-} |
5650 |
|
5651 |
diff --git a/dev-lang/php/php-5.6.22.ebuild b/dev-lang/php/php-5.6.22.ebuild |
5652 |
deleted file mode 100644 |
5653 |
index b5e347e..0000000 |
5654 |
--- a/dev-lang/php/php-5.6.22.ebuild |
5655 |
+++ /dev/null |
5656 |
@@ -1,807 +0,0 @@ |
5657 |
-# Copyright 1999-2016 Gentoo Foundation |
5658 |
-# Distributed under the terms of the GNU General Public License v2 |
5659 |
-# $Id$ |
5660 |
- |
5661 |
-EAPI=5 |
5662 |
- |
5663 |
-inherit eutils autotools flag-o-matic versionator depend.apache apache-module libtool systemd |
5664 |
- |
5665 |
-KEYWORDS="alpha amd64 arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~amd64-fbsd ~x86-fbsd ~x86-freebsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" |
5666 |
- |
5667 |
-function php_get_uri () |
5668 |
-{ |
5669 |
- case "${1}" in |
5670 |
- "php-pre") |
5671 |
- echo "http://downloads.php.net/dsp/${2}" |
5672 |
- ;; |
5673 |
- "php") |
5674 |
- echo "http://www.php.net/distributions/${2}" |
5675 |
- ;; |
5676 |
- "olemarkus") |
5677 |
- echo "https://dev.gentoo.org/~olemarkus/php/${2}" |
5678 |
- ;; |
5679 |
- "gentoo") |
5680 |
- echo "mirror://gentoo/${2}" |
5681 |
- ;; |
5682 |
- *) |
5683 |
- die "unhandled case in php_get_uri" |
5684 |
- ;; |
5685 |
- esac |
5686 |
-} |
5687 |
- |
5688 |
-PHP_MV="$(get_major_version)" |
5689 |
-SLOT="$(get_version_component_range 1-2)" |
5690 |
- |
5691 |
-# alias, so we can handle different types of releases (finals, rcs, alphas, |
5692 |
-# betas, ...) w/o changing the whole ebuild |
5693 |
-PHP_PV="${PV/_rc/RC}" |
5694 |
-PHP_PV="${PHP_PV/_alpha/alpha}" |
5695 |
-PHP_PV="${PHP_PV/_beta/beta}" |
5696 |
-PHP_RELEASE="php" |
5697 |
-[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre" |
5698 |
-[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre" |
5699 |
-[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre" |
5700 |
-PHP_P="${PN}-${PHP_PV}" |
5701 |
- |
5702 |
-PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")" |
5703 |
- |
5704 |
-PHP_FPM_CONF_VER="1" |
5705 |
- |
5706 |
-SRC_URI="${PHP_SRC_URI}" |
5707 |
- |
5708 |
-DESCRIPTION="The PHP language runtime engine" |
5709 |
-HOMEPAGE="http://php.net/" |
5710 |
-LICENSE="PHP-3" |
5711 |
- |
5712 |
-S="${WORKDIR}/${PHP_P}" |
5713 |
- |
5714 |
-# We can build the following SAPIs in the given order |
5715 |
-SAPIS="embed cli cgi fpm apache2" |
5716 |
- |
5717 |
-# SAPIs and SAPI-specific USE flags (cli SAPI is default on): |
5718 |
-IUSE="${IUSE} |
5719 |
- ${SAPIS/cli/+cli} |
5720 |
- threads" |
5721 |
- |
5722 |
-IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk |
5723 |
- crypt +ctype curl debug |
5724 |
- enchant exif frontbase +fileinfo +filter firebird |
5725 |
- flatfile ftp gd gdbm gmp +hash +iconv imap inifile |
5726 |
- intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl |
5727 |
- mhash mssql mysql libmysqlclient mysqli nls |
5728 |
- oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm |
5729 |
- readline recode selinux +session sharedmem |
5730 |
- +simplexml snmp soap sockets spell sqlite ssl |
5731 |
- sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx |
5732 |
- +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib" |
5733 |
- |
5734 |
-DEPEND=" |
5735 |
- >=app-eselect/eselect-php-0.9.1[apache2?,fpm?] |
5736 |
- >=dev-libs/libpcre-8.32[unicode] |
5737 |
- apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=] |
5738 |
- <www-servers/apache-2.4[threads=] ) )" |
5739 |
- |
5740 |
-# The supported (that is, autodetected) versions of BDB are listed in |
5741 |
-# the ./configure script. Other versions *work*, but we need to stick to |
5742 |
-# the ones that can be detected to avoid a repeat of bug #564824. |
5743 |
-DEPEND="${DEPEND} |
5744 |
- berkdb? ( || ( sys-libs/db:5.3 |
5745 |
- sys-libs/db:5.1 |
5746 |
- sys-libs/db:4.8 |
5747 |
- sys-libs/db:4.7 |
5748 |
- sys-libs/db:4.6 |
5749 |
- sys-libs/db:4.5 ) ) |
5750 |
- bzip2? ( app-arch/bzip2 ) |
5751 |
- cdb? ( || ( dev-db/cdb dev-db/tinycdb ) ) |
5752 |
- cjk? ( !gd? ( |
5753 |
- virtual/jpeg:0 |
5754 |
- media-libs/libpng:0= |
5755 |
- sys-libs/zlib |
5756 |
- ) ) |
5757 |
- crypt? ( >=dev-libs/libmcrypt-2.4 ) |
5758 |
- curl? ( >=net-misc/curl-7.10.5 ) |
5759 |
- enchant? ( app-text/enchant ) |
5760 |
- exif? ( !gd? ( |
5761 |
- virtual/jpeg:0 |
5762 |
- media-libs/libpng:0= |
5763 |
- sys-libs/zlib |
5764 |
- ) ) |
5765 |
- firebird? ( dev-db/firebird ) |
5766 |
- gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
5767 |
- gdbm? ( >=sys-libs/gdbm-1.8.0 ) |
5768 |
- gmp? ( dev-libs/gmp:0 ) |
5769 |
- iconv? ( virtual/libiconv ) |
5770 |
- imap? ( virtual/imap-c-client[ssl=] ) |
5771 |
- intl? ( dev-libs/icu:= ) |
5772 |
- iodbc? ( dev-db/libiodbc ) |
5773 |
- kerberos? ( virtual/krb5 ) |
5774 |
- ldap? ( >=net-nds/openldap-1.2.11 ) |
5775 |
- ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 ) |
5776 |
- libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) ) |
5777 |
- mssql? ( dev-db/freetds[mssql] ) |
5778 |
- libmysqlclient? ( |
5779 |
- mysql? ( virtual/mysql ) |
5780 |
- mysqli? ( >=virtual/mysql-4.1 ) |
5781 |
- ) |
5782 |
- nls? ( sys-devel/gettext ) |
5783 |
- oci8-instant-client? ( dev-db/oracle-instantclient-basic ) |
5784 |
- odbc? ( >=dev-db/unixODBC-1.8.13 ) |
5785 |
- postgres? ( dev-db/postgresql:* ) |
5786 |
- qdbm? ( dev-db/qdbm ) |
5787 |
- readline? ( sys-libs/readline:0 ) |
5788 |
- recode? ( app-text/recode ) |
5789 |
- sharedmem? ( dev-libs/mm ) |
5790 |
- simplexml? ( >=dev-libs/libxml2-2.6.8 ) |
5791 |
- snmp? ( >=net-analyzer/net-snmp-5.2 ) |
5792 |
- soap? ( >=dev-libs/libxml2-2.6.8 ) |
5793 |
- spell? ( >=app-text/aspell-0.50 ) |
5794 |
- sqlite? ( >=dev-db/sqlite-3.7.6.3 ) |
5795 |
- ssl? ( |
5796 |
- !libressl? ( dev-libs/openssl:0 ) |
5797 |
- libressl? ( dev-libs/libressl ) |
5798 |
- ) |
5799 |
- sybase-ct? ( dev-db/freetds ) |
5800 |
- tidy? ( app-text/htmltidy ) |
5801 |
- truetype? ( |
5802 |
- =media-libs/freetype-2* |
5803 |
- >=media-libs/t1lib-5.0.0 |
5804 |
- !gd? ( |
5805 |
- virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib ) |
5806 |
- ) |
5807 |
- unicode? ( dev-libs/oniguruma ) |
5808 |
- vpx? ( media-libs/libvpx ) |
5809 |
- wddx? ( >=dev-libs/libxml2-2.6.8 ) |
5810 |
- xml? ( >=dev-libs/libxml2-2.6.8 ) |
5811 |
- xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv ) |
5812 |
- xmlreader? ( >=dev-libs/libxml2-2.6.8 ) |
5813 |
- xmlwriter? ( >=dev-libs/libxml2-2.6.8 ) |
5814 |
- xpm? ( |
5815 |
- x11-libs/libXpm |
5816 |
- virtual/jpeg:0 |
5817 |
- media-libs/libpng:0= sys-libs/zlib |
5818 |
- ) |
5819 |
- xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 ) |
5820 |
- zip? ( sys-libs/zlib ) |
5821 |
- zlib? ( sys-libs/zlib ) |
5822 |
- virtual/mta |
5823 |
-" |
5824 |
- |
5825 |
-php="=${CATEGORY}/${PF}" |
5826 |
- |
5827 |
-# Without USE=readline or libedit, the interactive "php -a" CLI will hang. |
5828 |
-REQUIRED_USE=" |
5829 |
- cli? ( ^^ ( readline libedit ) ) |
5830 |
- truetype? ( gd ) |
5831 |
- vpx? ( gd ) |
5832 |
- cjk? ( gd ) |
5833 |
- exif? ( gd ) |
5834 |
- |
5835 |
- xpm? ( gd ) |
5836 |
- gd? ( zlib ) |
5837 |
- simplexml? ( xml ) |
5838 |
- soap? ( xml ) |
5839 |
- wddx? ( xml ) |
5840 |
- xmlrpc? ( || ( xml iconv ) ) |
5841 |
- xmlreader? ( xml ) |
5842 |
- xslt? ( xml ) |
5843 |
- ldap-sasl? ( ldap ) |
5844 |
- mhash? ( hash ) |
5845 |
- phar? ( hash ) |
5846 |
- libmysqlclient? ( || ( |
5847 |
- mysql |
5848 |
- mysqli |
5849 |
- pdo |
5850 |
- ) ) |
5851 |
- |
5852 |
- qdbm? ( !gdbm ) |
5853 |
- readline? ( !libedit ) |
5854 |
- recode? ( !imap !mysql !mysqli ) |
5855 |
- sharedmem? ( !threads ) |
5856 |
- |
5857 |
- !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )" |
5858 |
- |
5859 |
-RDEPEND="${DEPEND}" |
5860 |
- |
5861 |
-RDEPEND="${RDEPEND} |
5862 |
- fpm? ( |
5863 |
- selinux? ( sec-policy/selinux-phpfpm ) |
5864 |
- systemd? ( sys-apps/systemd ) )" |
5865 |
- |
5866 |
-DEPEND="${DEPEND} |
5867 |
- sys-devel/flex |
5868 |
- >=sys-devel/m4-1.4.3 |
5869 |
- >=sys-devel/libtool-1.5.18" |
5870 |
- |
5871 |
-# Allow users to install production version if they want to |
5872 |
- |
5873 |
-case "${PHP_INI_VERSION}" in |
5874 |
- production|development) |
5875 |
- ;; |
5876 |
- *) |
5877 |
- PHP_INI_VERSION="development" |
5878 |
- ;; |
5879 |
-esac |
5880 |
- |
5881 |
-PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}" |
5882 |
-PHP_INI_FILE="php.ini" |
5883 |
- |
5884 |
-want_apache |
5885 |
- |
5886 |
-pkg_setup() { |
5887 |
- depend.apache_pkg_setup |
5888 |
-} |
5889 |
- |
5890 |
-php_install_ini() { |
5891 |
- local phpsapi="${1}" |
5892 |
- |
5893 |
- # work out where we are installing the ini file |
5894 |
- php_set_ini_dir "${phpsapi}" |
5895 |
- |
5896 |
- local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}" |
5897 |
- cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die |
5898 |
- |
5899 |
- # default to /tmp for save_path, bug #282768 |
5900 |
- sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die |
5901 |
- |
5902 |
- # Set the extension dir |
5903 |
- sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" || die |
5904 |
- |
5905 |
- # Set the include path to point to where we want to find PEAR packages |
5906 |
- sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die |
5907 |
- |
5908 |
- dodir "${PHP_INI_DIR#${EPREFIX}}" |
5909 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
5910 |
- newins "${phpinisrc}" "${PHP_INI_FILE}" |
5911 |
- |
5912 |
- elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}" |
5913 |
- elog |
5914 |
- |
5915 |
- dodir "${PHP_EXT_INI_DIR#${EPREFIX}}" |
5916 |
- dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}" |
5917 |
- |
5918 |
- if use_if_iuse opcache; then |
5919 |
- elog "Adding opcache to $PHP_EXT_INI_DIR" |
5920 |
- echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \ |
5921 |
- "${D}/${PHP_EXT_INI_DIR}"/opcache.ini |
5922 |
- dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \ |
5923 |
- "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini" |
5924 |
- fi |
5925 |
- |
5926 |
- # SAPI-specific handling |
5927 |
- if [[ "${sapi}" == "fpm" ]] ; then |
5928 |
- einfo "Installing FPM config file php-fpm.conf" |
5929 |
- insinto "${PHP_INI_DIR#${EPREFIX}}" |
5930 |
- doins sapi/fpm/php-fpm.conf |
5931 |
- fi |
5932 |
- |
5933 |
- dodoc php.ini-development |
5934 |
- dodoc php.ini-production |
5935 |
-} |
5936 |
- |
5937 |
-php_set_ini_dir() { |
5938 |
- PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}" |
5939 |
- PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext" |
5940 |
- PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active" |
5941 |
-} |
5942 |
- |
5943 |
-src_prepare() { |
5944 |
- # Change PHP branding |
5945 |
- # Get the alpha/beta/rc version |
5946 |
- sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \ |
5947 |
- -i configure.in || die "Unable to change PHP branding" |
5948 |
- |
5949 |
- # Patch PHP to show Gentoo as the server platform |
5950 |
- sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \ |
5951 |
- -i configure.in || die "Failed to fix server platform name" |
5952 |
- |
5953 |
- # Prevent PHP from activating the Apache config, |
5954 |
- # as we will do that ourselves |
5955 |
- sed -i \ |
5956 |
- -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
5957 |
- -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \ |
5958 |
- configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \ |
5959 |
- || die |
5960 |
- |
5961 |
- # Patch PHP to support heimdal instead of mit-krb5 |
5962 |
- if has_version "app-crypt/heimdal" ; then |
5963 |
- sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \ |
5964 |
- || die "Failed to fix heimdal libname" |
5965 |
- sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \ |
5966 |
- || die "Failed to fix heimdal crypt library reference" |
5967 |
- fi |
5968 |
- |
5969 |
- # Add user patches #357637 |
5970 |
- epatch_user |
5971 |
- |
5972 |
- # Force rebuilding aclocal.m4 |
5973 |
- rm -f aclocal.m4 || die |
5974 |
- eautoreconf |
5975 |
- |
5976 |
- if [[ ${CHOST} == *-darwin* ]] ; then |
5977 |
- # http://bugs.php.net/bug.php?id=48795, bug #343481 |
5978 |
- sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die |
5979 |
- fi |
5980 |
-} |
5981 |
- |
5982 |
-src_configure() { |
5983 |
- addpredict /usr/share/snmp/mibs/.index |
5984 |
- addpredict /var/lib/net-snmp/mib_indexes |
5985 |
- |
5986 |
- PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}" |
5987 |
- |
5988 |
- # The php-fpm config file wants localstatedir to be ${EPREFIX}/var |
5989 |
- # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002. |
5990 |
- local our_conf=( |
5991 |
- --prefix="${PHP_DESTDIR}" |
5992 |
- --mandir="${PHP_DESTDIR}/man" |
5993 |
- --infodir="${PHP_DESTDIR}/info" |
5994 |
- --libdir="${PHP_DESTDIR}/lib" |
5995 |
- --with-libdir="$(get_libdir)" |
5996 |
- --localstatedir="${EPREFIX}/var" |
5997 |
- --without-pear |
5998 |
- $(use_enable threads maintainer-zts) |
5999 |
- ) |
6000 |
- |
6001 |
- our_conf+=( |
6002 |
- $(use_enable bcmath bcmath) |
6003 |
- $(use_with bzip2 bz2 "${EPREFIX}/usr") |
6004 |
- $(use_enable calendar calendar) |
6005 |
- $(use_enable ctype ctype) |
6006 |
- $(use_with curl curl "${EPREFIX}/usr") |
6007 |
- $(use_enable xml dom) |
6008 |
- $(use_with enchant enchant "${EPREFIX}/usr") |
6009 |
- $(use_enable exif exif) |
6010 |
- $(use_enable fileinfo fileinfo) |
6011 |
- $(use_enable filter filter) |
6012 |
- $(use_enable ftp ftp) |
6013 |
- $(use_with nls gettext "${EPREFIX}/usr") |
6014 |
- $(use_with gmp gmp "${EPREFIX}/usr") |
6015 |
- $(use_enable hash hash) |
6016 |
- $(use_with mhash mhash "${EPREFIX}/usr") |
6017 |
- $(use_with iconv iconv \ |
6018 |
- $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr")) |
6019 |
- $(use_enable intl intl) |
6020 |
- $(use_enable ipv6 ipv6) |
6021 |
- $(use_enable json json) |
6022 |
- $(use_with kerberos kerberos "${EPREFIX}/usr") |
6023 |
- $(use_enable xml libxml) |
6024 |
- $(use_with xml libxml-dir "${EPREFIX}/usr") |
6025 |
- $(use_enable unicode mbstring) |
6026 |
- $(use_with crypt mcrypt "${EPREFIX}/usr") |
6027 |
- $(use_with mssql mssql "${EPREFIX}/usr") |
6028 |
- $(use_with unicode onig "${EPREFIX}/usr") |
6029 |
- $(use_with ssl openssl "${EPREFIX}/usr") |
6030 |
- $(use_with ssl openssl-dir "${EPREFIX}/usr") |
6031 |
- $(use_enable pcntl pcntl) |
6032 |
- $(use_enable phar phar) |
6033 |
- $(use_enable pdo pdo) |
6034 |
- $(use_enable opcache opcache) |
6035 |
- $(use_with postgres pgsql "${EPREFIX}/usr") |
6036 |
- $(use_enable posix posix) |
6037 |
- $(use_with spell pspell "${EPREFIX}/usr") |
6038 |
- $(use_with recode recode "${EPREFIX}/usr") |
6039 |
- $(use_enable simplexml simplexml) |
6040 |
- $(use_enable sharedmem shmop) |
6041 |
- $(use_with snmp snmp "${EPREFIX}/usr") |
6042 |
- $(use_enable soap soap) |
6043 |
- $(use_enable sockets sockets) |
6044 |
- $(use_with sqlite sqlite3 "${EPREFIX}/usr") |
6045 |
- $(use_with sybase-ct sybase-ct "${EPREFIX}/usr") |
6046 |
- $(use_enable sysvipc sysvmsg) |
6047 |
- $(use_enable sysvipc sysvsem) |
6048 |
- $(use_enable sysvipc sysvshm) |
6049 |
- $(use_with systemd fpm-systemd) |
6050 |
- $(use_with tidy tidy "${EPREFIX}/usr") |
6051 |
- $(use_enable tokenizer tokenizer) |
6052 |
- $(use_enable wddx wddx) |
6053 |
- $(use_enable xml xml) |
6054 |
- $(use_enable xmlreader xmlreader) |
6055 |
- $(use_enable xmlwriter xmlwriter) |
6056 |
- $(use_with xmlrpc xmlrpc) |
6057 |
- $(use_with xslt xsl "${EPREFIX}/usr") |
6058 |
- $(use_enable zip zip) |
6059 |
- $(use_with zlib zlib "${EPREFIX}/usr") |
6060 |
- $(use_enable debug debug) |
6061 |
- ) |
6062 |
- |
6063 |
- # DBA support |
6064 |
- if use cdb || use berkdb || use flatfile || use gdbm || use inifile \ |
6065 |
- || use qdbm ; then |
6066 |
- our_conf+=( "--enable-dba${shared}" ) |
6067 |
- fi |
6068 |
- |
6069 |
- # DBA drivers support |
6070 |
- our_conf+=( |
6071 |
- $(use_with cdb cdb) |
6072 |
- $(use_with berkdb db4 "${EPREFIX}/usr") |
6073 |
- $(use_enable flatfile flatfile) |
6074 |
- $(use_with gdbm gdbm "${EPREFIX}/usr") |
6075 |
- $(use_enable inifile inifile) |
6076 |
- $(use_with qdbm qdbm "${EPREFIX}/usr") |
6077 |
- ) |
6078 |
- |
6079 |
- # Support for the GD graphics library |
6080 |
- our_conf+=( |
6081 |
- $(use_with truetype freetype-dir "${EPREFIX}/usr") |
6082 |
- $(use_with truetype t1lib "${EPREFIX}/usr") |
6083 |
- $(use_enable cjk gd-jis-conv) |
6084 |
- $(use_with gd jpeg-dir "${EPREFIX}/usr") |
6085 |
- $(use_with gd png-dir "${EPREFIX}/usr") |
6086 |
- $(use_with xpm xpm-dir "${EPREFIX}/usr") |
6087 |
- $(use_with vpx vpx-dir "${EPREFIX}/usr") |
6088 |
- ) |
6089 |
- # enable gd last, so configure can pick up the previous settings |
6090 |
- our_conf+=( $(use_with gd gd) ) |
6091 |
- |
6092 |
- # IMAP support |
6093 |
- if use imap ; then |
6094 |
- our_conf+=( |
6095 |
- $(use_with imap imap "${EPREFIX}/usr") |
6096 |
- $(use_with ssl imap-ssl "${EPREFIX}/usr") |
6097 |
- ) |
6098 |
- fi |
6099 |
- |
6100 |
- # Interbase/firebird support |
6101 |
- our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") ) |
6102 |
- |
6103 |
- # LDAP support |
6104 |
- if use ldap ; then |
6105 |
- our_conf+=( |
6106 |
- $(use_with ldap ldap "${EPREFIX}/usr") |
6107 |
- $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr") |
6108 |
- ) |
6109 |
- fi |
6110 |
- |
6111 |
- # MySQL support |
6112 |
- local mysqllib="mysqlnd" |
6113 |
- local mysqlilib="mysqlnd" |
6114 |
- use libmysqlclient && mysqllib="${EPREFIX}/usr" |
6115 |
- use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config" |
6116 |
- |
6117 |
- our_conf+=( $(use_with mysql mysql "${mysqllib}") ) |
6118 |
- our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") ) |
6119 |
- |
6120 |
- local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock" |
6121 |
- if use mysql || use mysqli ; then |
6122 |
- our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") ) |
6123 |
- fi |
6124 |
- |
6125 |
- # ODBC support |
6126 |
- our_conf+=( |
6127 |
- $(use_with odbc unixODBC "${EPREFIX}/usr") |
6128 |
- $(use_with iodbc iodbc "${EPREFIX}/usr") |
6129 |
- ) |
6130 |
- |
6131 |
- # Oracle support |
6132 |
- our_conf+=( $(use_with oci8-instant-client oci8) ) |
6133 |
- |
6134 |
- # PDO support |
6135 |
- if use pdo ; then |
6136 |
- our_conf+=( |
6137 |
- $(use_with mssql pdo-dblib) |
6138 |
- $(use_with mysql pdo-mysql "${mysqllib}") |
6139 |
- $(use_with postgres pdo-pgsql) |
6140 |
- $(use_with sqlite pdo-sqlite "${EPREFIX}/usr") |
6141 |
- $(use_with firebird pdo-firebird "${EPREFIX}/usr") |
6142 |
- $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr") |
6143 |
- $(use_with oci8-instant-client pdo-oci) |
6144 |
- ) |
6145 |
- fi |
6146 |
- |
6147 |
- # readline/libedit support |
6148 |
- our_conf+=( |
6149 |
- $(use_with readline readline "${EPREFIX}/usr") |
6150 |
- $(use_with libedit libedit "${EPREFIX}/usr") |
6151 |
- ) |
6152 |
- |
6153 |
- # Session support |
6154 |
- if use session ; then |
6155 |
- our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") ) |
6156 |
- else |
6157 |
- our_conf+=( $(use_enable session session) ) |
6158 |
- fi |
6159 |
- |
6160 |
- # Use pic for shared modules such as apache2's mod_php |
6161 |
- our_conf+=( --with-pic ) |
6162 |
- |
6163 |
- # we use the system copy of pcre |
6164 |
- # --with-pcre-regex affects ext/pcre |
6165 |
- # --with-pcre-dir affects ext/filter and ext/zip |
6166 |
- our_conf+=( |
6167 |
- --with-pcre-regex="${EPREFIX}/usr" |
6168 |
- --with-pcre-dir="${EPREFIX}/usr" |
6169 |
- ) |
6170 |
- |
6171 |
- # Catch CFLAGS problems |
6172 |
- # Fixes bug #14067. |
6173 |
- # Changed order to run it in reverse for bug #32022 and #12021. |
6174 |
- replace-cpu-flags "k6*" "i586" |
6175 |
- |
6176 |
- # Support user-passed configuration parameters |
6177 |
- our_conf+=( ${EXTRA_ECONF:-} ) |
6178 |
- |
6179 |
- # Support the Apache2 extras, they must be set globally for all |
6180 |
- # SAPIs to work correctly, especially for external PHP extensions |
6181 |
- |
6182 |
- mkdir -p "${WORKDIR}/sapis-build" || die |
6183 |
- for one_sapi in $SAPIS ; do |
6184 |
- use "${one_sapi}" || continue |
6185 |
- php_set_ini_dir "${one_sapi}" |
6186 |
- |
6187 |
- # The BUILD_DIR variable is used to determine where to output |
6188 |
- # the files that autotools creates. This was all originally |
6189 |
- # based on the autotools-utils eclass. |
6190 |
- BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}" |
6191 |
- cp -r "${S}" "${BUILD_DIR}" || die |
6192 |
- cd "${BUILD_DIR}" || die |
6193 |
- |
6194 |
- local sapi_conf=( |
6195 |
- --with-config-file-path="${PHP_INI_DIR}" |
6196 |
- --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}" |
6197 |
- ) |
6198 |
- |
6199 |
- for sapi in $SAPIS ; do |
6200 |
- case "$sapi" in |
6201 |
- cli|cgi|embed|fpm) |
6202 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
6203 |
- sapi_conf+=( "--enable-${sapi}" ) |
6204 |
- else |
6205 |
- sapi_conf+=( "--disable-${sapi}" ) |
6206 |
- fi |
6207 |
- ;; |
6208 |
- |
6209 |
- apache2) |
6210 |
- if [[ "${one_sapi}" == "${sapi}" ]] ; then |
6211 |
- sapi_conf+=( --with-apxs2="${EPREFIX}/usr/sbin/apxs" ) |
6212 |
- else |
6213 |
- sapi_conf+=( --without-apxs2 ) |
6214 |
- fi |
6215 |
- ;; |
6216 |
- esac |
6217 |
- done |
6218 |
- |
6219 |
- # Construct the $myeconfargs array by concatenating $our_conf |
6220 |
- # (the common args) and $sapi_conf (the SAPI-specific args). |
6221 |
- local myeconfargs=( "${our_conf[@]}" ) |
6222 |
- myeconfargs+=( "${sapi_conf[@]}" ) |
6223 |
- |
6224 |
- pushd "${BUILD_DIR}" > /dev/null || die |
6225 |
- econf "${myeconfargs[@]}" |
6226 |
- popd > /dev/null || die |
6227 |
- done |
6228 |
-} |
6229 |
- |
6230 |
-src_compile() { |
6231 |
- # snmp seems to run during src_compile, too (bug #324739) |
6232 |
- addpredict /usr/share/snmp/mibs/.index |
6233 |
- addpredict /var/lib/net-snmp/mib_indexes |
6234 |
- |
6235 |
- for sapi in ${SAPIS} ; do |
6236 |
- if use "${sapi}"; then |
6237 |
- cd "${WORKDIR}/sapis-build/$sapi" || \ |
6238 |
- die "Failed to change dir to ${WORKDIR}/sapis-build/$1" |
6239 |
- emake |
6240 |
- fi |
6241 |
- done |
6242 |
-} |
6243 |
- |
6244 |
-src_install() { |
6245 |
- # see bug #324739 for what happens when we don't have that |
6246 |
- addpredict /usr/share/snmp/mibs/.index |
6247 |
- |
6248 |
- # grab the first SAPI that got built and install common files from there |
6249 |
- local first_sapi="" |
6250 |
- for sapi in $SAPIS ; do |
6251 |
- if use $sapi ; then |
6252 |
- first_sapi=$sapi |
6253 |
- break |
6254 |
- fi |
6255 |
- done |
6256 |
- |
6257 |
- # Makefile forgets to create this before trying to write to it... |
6258 |
- dodir "${PHP_DESTDIR#${EPREFIX}}/bin" |
6259 |
- |
6260 |
- # Install php environment (without any sapis) |
6261 |
- cd "${WORKDIR}/sapis-build/$first_sapi" || die |
6262 |
- emake INSTALL_ROOT="${D}" \ |
6263 |
- install-build install-headers install-programs |
6264 |
- |
6265 |
- local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)" |
6266 |
- |
6267 |
- # Create the directory where we'll put version-specific php scripts |
6268 |
- keepdir "/usr/share/php${PHP_MV}" |
6269 |
- |
6270 |
- local sapi="", file="" |
6271 |
- local sapi_list="" |
6272 |
- |
6273 |
- for sapi in ${SAPIS}; do |
6274 |
- if use "${sapi}" ; then |
6275 |
- einfo "Installing SAPI: ${sapi}" |
6276 |
- cd "${WORKDIR}/sapis-build/${sapi}" || die |
6277 |
- |
6278 |
- if [[ "${sapi}" == "apache2" ]] ; then |
6279 |
- # We're specifically not using emake install-sapi as libtool |
6280 |
- # may cause unnecessary relink failures (see bug #351266) |
6281 |
- insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/" |
6282 |
- newins ".libs/libphp5$(get_libname)" \ |
6283 |
- "libphp${PHP_MV}$(get_libname)" |
6284 |
- keepdir "/usr/$(get_libdir)/apache2/modules" |
6285 |
- else |
6286 |
- # needed each time, php_install_ini would reset it |
6287 |
- local dest="${PHP_DESTDIR#${EPREFIX}}" |
6288 |
- into "${dest}" |
6289 |
- case "$sapi" in |
6290 |
- cli) |
6291 |
- source="sapi/cli/php" |
6292 |
- ;; |
6293 |
- cgi) |
6294 |
- source="sapi/cgi/php-cgi" |
6295 |
- ;; |
6296 |
- fpm) |
6297 |
- source="sapi/fpm/php-fpm" |
6298 |
- ;; |
6299 |
- embed) |
6300 |
- source="libs/libphp${PHP_MV}$(get_libname)" |
6301 |
- ;; |
6302 |
- *) |
6303 |
- die "unhandled sapi in src_install" |
6304 |
- ;; |
6305 |
- esac |
6306 |
- |
6307 |
- if [[ "${source}" == *"$(get_libname)" ]]; then |
6308 |
- dolib.so "${source}" |
6309 |
- else |
6310 |
- dobin "${source}" |
6311 |
- local name="$(basename ${source})" |
6312 |
- dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}" |
6313 |
- fi |
6314 |
- fi |
6315 |
- |
6316 |
- php_install_ini "${sapi}" |
6317 |
- |
6318 |
- # construct correct SAPI string for php-config |
6319 |
- # thanks to ferringb for the bash voodoo |
6320 |
- if [[ "${sapi}" == "apache2" ]]; then |
6321 |
- sapi_list="${sapi_list:+${sapi_list} }apache2handler" |
6322 |
- else |
6323 |
- sapi_list="${sapi_list:+${sapi_list} }${sapi}" |
6324 |
- fi |
6325 |
- fi |
6326 |
- done |
6327 |
- |
6328 |
- # Installing opcache module |
6329 |
- if use_if_iuse opcache ; then |
6330 |
- dolib.so "modules/opcache$(get_libname)" |
6331 |
- fi |
6332 |
- |
6333 |
- # Install env.d files |
6334 |
- newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}" |
6335 |
- sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
6336 |
- sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die |
6337 |
- |
6338 |
- # set php-config variable correctly (bug #278439) |
6339 |
- sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \ |
6340 |
- "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die |
6341 |
- |
6342 |
- if use fpm ; then |
6343 |
- if use systemd; then |
6344 |
- systemd_newunit "${FILESDIR}/php-fpm_at.service" \ |
6345 |
- "php-fpm@${SLOT}.service" |
6346 |
- else |
6347 |
- systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \ |
6348 |
- "php-fpm@${SLOT}.service" |
6349 |
- fi |
6350 |
- fi |
6351 |
-} |
6352 |
- |
6353 |
-src_test() { |
6354 |
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
6355 |
- PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php" |
6356 |
- if [[ ! -x "${PHP_BIN}" ]] ; then |
6357 |
- ewarn "Test phase requires USE=cli, skipping" |
6358 |
- return |
6359 |
- else |
6360 |
- export TEST_PHP_EXECUTABLE="${PHP_BIN}" |
6361 |
- fi |
6362 |
- |
6363 |
- if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then |
6364 |
- export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi" |
6365 |
- fi |
6366 |
- |
6367 |
- REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \ |
6368 |
- "session.save_path=${T}" \ |
6369 |
- "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \ |
6370 |
- "session.save_path=${T}" |
6371 |
- |
6372 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
6373 |
- mv "${name}.out" "${name}.out.orig" 2>/dev/null || die |
6374 |
- done |
6375 |
- |
6376 |
- local failed="$(find -name '*.out')" |
6377 |
- if [[ ${failed} != "" ]] ; then |
6378 |
- ewarn "The following test cases failed unexpectedly:" |
6379 |
- for name in ${failed}; do |
6380 |
- ewarn " ${name/.out/}" |
6381 |
- done |
6382 |
- else |
6383 |
- einfo "No unexpected test failures, all fine" |
6384 |
- fi |
6385 |
- |
6386 |
- if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then |
6387 |
- local passed="" |
6388 |
- for name in ${EXPECTED_TEST_FAILURES}; do |
6389 |
- [[ -f "${name}.diff" ]] && continue |
6390 |
- passed="${passed} ${name}" |
6391 |
- done |
6392 |
- if [[ ${passed} != "" ]] ; then |
6393 |
- einfo "The following test cases passed unexpectedly:" |
6394 |
- for name in ${passed}; do |
6395 |
- ewarn " ${passed}" |
6396 |
- done |
6397 |
- else |
6398 |
- einfo "None of the known-to-fail tests passed, all fine" |
6399 |
- fi |
6400 |
- fi |
6401 |
-} |
6402 |
- |
6403 |
-pkg_postinst() { |
6404 |
- # Output some general info to the user |
6405 |
- if use apache2 ; then |
6406 |
- APACHE2_MOD_DEFINE="PHP" |
6407 |
- APACHE2_MOD_CONF="70_mod_php" # Provided by app-eselect/eselect-php |
6408 |
- apache-module_pkg_postinst |
6409 |
- fi |
6410 |
- |
6411 |
- # Create the symlinks for php |
6412 |
- for m in ${SAPIS}; do |
6413 |
- [[ ${m} == 'embed' ]] && continue; |
6414 |
- if use $m ; then |
6415 |
- local ci=$(eselect php show $m) |
6416 |
- if [[ -z $ci ]]; then |
6417 |
- eselect php set $m php${SLOT} || die |
6418 |
- einfo "Switched ${m} to use php:${SLOT}" |
6419 |
- einfo |
6420 |
- elif [[ $ci != "php${SLOT}" ]] ; then |
6421 |
- elog "To switch $m to use php:${SLOT}, run" |
6422 |
- elog " eselect php set $m php${SLOT}" |
6423 |
- elog |
6424 |
- fi |
6425 |
- fi |
6426 |
- done |
6427 |
- |
6428 |
- # Remove dead symlinks for SAPIs that were just disabled. For |
6429 |
- # example, if the user has the cgi SAPI enabled, then he has an |
6430 |
- # eselect-php symlink for it. If he later reinstalls PHP with |
6431 |
- # USE="-cgi", that symlink will break. This call to eselect is |
6432 |
- # supposed to remove that dead link per bug 572436. |
6433 |
- eselect php cleanup || die |
6434 |
- |
6435 |
- elog "Make sure that PHP_TARGETS in ${EPREFIX}/etc/make.conf includes" |
6436 |
- elog "php${SLOT/./-} in order to compile extensions for the ${SLOT} ABI." |
6437 |
- elog |
6438 |
- elog "This ebuild installed a version of php.ini based on" |
6439 |
- elog "php.ini-${PHP_INI_VERSION}. You can choose which version of" |
6440 |
- elog "php.ini to install by default by setting PHP_INI_VERSION" |
6441 |
- elog "to either 'production' or 'development' in your make.conf." |
6442 |
- elog "Both versions of php.ini can be found with the PHP docs in" |
6443 |
- elog "${EPREFIX}/usr/share/doc/${PF}" |
6444 |
- elog |
6445 |
- elog "For more details on how version slotting works, please see" |
6446 |
- elog "the wiki:" |
6447 |
- elog |
6448 |
- elog " https://wiki.gentoo.org/wiki/PHP" |
6449 |
- elog |
6450 |
-} |
6451 |
- |
6452 |
-pkg_postrm() { |
6453 |
- # This serves two purposes. First, if we have just removed the last |
6454 |
- # installed version of PHP, then this will remove any dead symlinks |
6455 |
- # belonging to eselect-php. Second, if a user upgrades slots from |
6456 |
- # (say) 5.6 to 7.0 and depcleans the old slot, then this will update |
6457 |
- # his existing symlinks to point to the new 7.0 installation. The |
6458 |
- # latter is bug 432962. |
6459 |
- # |
6460 |
- # Note: the eselect-php package may not be installed at this point, |
6461 |
- # so we can't die() if this command fails. |
6462 |
- eselect php cleanup |
6463 |
-} |