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