Gentoo Archives: gentoo-commits

From: Michael Orlitzky <mjo@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/
Date: Sat, 01 Oct 2016 23:32:58
Message-Id: 1475364711.478a024350f5f25731cbb9ce6a14fe8a9158d7ff.mjo@gentoo
1 commit: 478a024350f5f25731cbb9ce6a14fe8a9158d7ff
2 Author: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 1 23:31:51 2016 +0000
4 Commit: Michael Orlitzky <mjo <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 1 23:31:51 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=478a0243
7
8 dev-lang/php: remove old versions php-5.6.2[345].
9
10 Package-Manager: portage-2.3.0
11
12 dev-lang/php/Manifest | 3 -
13 dev-lang/php/php-5.6.23.ebuild | 807 ----------------------------------------
14 dev-lang/php/php-5.6.24.ebuild | 814 -----------------------------------------
15 dev-lang/php/php-5.6.25.ebuild | 766 --------------------------------------
16 4 files changed, 2390 deletions(-)
17
18 diff --git a/dev-lang/php/Manifest b/dev-lang/php/Manifest
19 index 46f7090..e0096e9 100644
20 --- a/dev-lang/php/Manifest
21 +++ b/dev-lang/php/Manifest
22 @@ -1,7 +1,4 @@
23 DIST php-5.5.37.tar.bz2 13699851 SHA256 d2380ebe46caf17f2c4cd055867d00a82e6702dc5f62dc29ce864a5742905d88 SHA512 d2da921f3efd858e1cb8004873e377ca9c5821d5269d5b8e7c9be830b183f4d18f737b14653f65a43c0957bdca994e09a476d77e3a29a11e357abc24618c4c0f WHIRLPOOL 8db12b1d090bc1bfb3f5b20c661ba05588b8f988484d1887a959f943dd6f1756cb62bac811c809af516e6c3582b64388443546a3b4a17f0527a69fcbafc0452c
24 DIST php-5.5.38.tar.xz 11077780 SHA256 cb527c44b48343c8557fe2446464ff1d4695155a95601083e5d1f175df95580f SHA512 c2cdb18b2c9edaeff66591e8f58f8ff488260f537cdf9ce09820c163f20ff5209c0def89343d429932c9506ad4ef3daacf224946dac1c59622501092483f30c6 WHIRLPOOL 4380c1daa39f04f90d1457152e366720b295e96aba6859625c6b375a3785b4e0f30fea590c1ee1edb439c2a405446526c702a003d68ea6c817ab8684068a7581
25 -DIST php-5.6.23.tar.bz2 14178077 SHA256 facd280896d277e6f7084b60839e693d4db68318bfc92085d3dc0251fd3558c7 SHA512 92be3685926f302223465e9673496971f0ee1b05c7b3a09682d4ef93a27b4c17e5c53c36acab15d26f38508f6d65bebe11a6f0f0fc98b27eafe95b02b4d9897d WHIRLPOOL 71375395742a83ec0f55bd7edf5eeff732e4db24f77f436f519ca81a2ceeb0bac65549ca1ffd34cb7b593771b5f4ccb984900841a20c1620a6121e4fa14ab086
26 -DIST php-5.6.24.tar.xz 12394980 SHA256 ed7c38c6dac539ade62e08118258f4dac0c49beca04d8603bee4e0ea6ca8250b SHA512 1849c58a8c6eeb3efc6b43f874314b146b4a32d886086bc1648fc84e6062148a9373dea9c3713587c3980df70a0e51bf6e5ab5a87b9eff57e54670c5c2ded86b WHIRLPOOL 4e6466444824640a246e8cd02f7da7bf72ff55c714729f7ed7581be63b2f1d87a0f5bf5dab5e09499fabc61d32162aa35cfb095f7e478f7454aacdec2465a7f5
27 -DIST php-5.6.25.tar.xz 12406072 SHA256 7535cd6e20040ccec4594cc386c6f15c3f2c88f24163294a31068cf7dfe7f644 SHA512 43ab901a69e22ac42b676384c338c3b3a5cc8e8fb52cc85296d6880c4a3d079d9e0de151539d0c8549e8856d611f0d8b40c9cc338167a62560e14c939a409b68 WHIRLPOOL 46e593caeb8d59d29568dfdbf0a2d2ae7080a7d8b3e78a11f4116fa54e64e8cc7d8c93fdb40a63beb3ae0a6bd900b8d0dfd4889b858201717a86bcd45b8aee61
28 DIST php-5.6.26.tar.xz 12412992 SHA256 203a854f0f243cb2810d1c832bc871ff133eccdf1ff69d32846f93bc1bef58a8 SHA512 06ef6990c1ab6ef3c94157b72039ddbc40a8373b8f38c88ec4dfa771fcd422a0673ff5f6cbf3cf67a0fb10bedd8b9fa85aa95e08abb0d74163a90a322a1d8c24 WHIRLPOOL 11b183089a43bfad1ee787bd2512faf8d4611916cdfe348fb8ba3a2c2d35d560dcd38656e3a5b3ee98efb649e9f7ab219a89da7a72c163270760ad44a64bba09
29 DIST php-7.0.11.tar.xz 12258500 SHA256 d4cccea8da1d27c11b89386f8b8e95692ad3356610d571253d00ca67d524c735 SHA512 4d7df513a61489ecb1c3a963fbb76ad8e15b88fa134f52295a5339c900f7b2f98e547a3e479b8061dd4ff3c5f90cd62e3c39ec208d7de03b6146501e60500d5e WHIRLPOOL d9867f282df9a86efecb77c44f22a403598dc950b8ae2343000517fdb69890073bd78fbe7d1ee26be41459aefb3336a6508d6dd75b915859533e124b21b4e453
30
31 diff --git a/dev-lang/php/php-5.6.23.ebuild b/dev-lang/php/php-5.6.23.ebuild
32 deleted file mode 100644
33 index 5dcc597..00000000
34 --- a/dev-lang/php/php-5.6.23.ebuild
35 +++ /dev/null
36 @@ -1,807 +0,0 @@
37 -# Copyright 1999-2016 Gentoo Foundation
38 -# Distributed under the terms of the GNU General Public License v2
39 -# $Id$
40 -
41 -EAPI=5
42 -
43 -inherit eutils autotools flag-o-matic versionator depend.apache apache-module libtool systemd
44 -
45 -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"
46 -
47 -function php_get_uri ()
48 -{
49 - case "${1}" in
50 - "php-pre")
51 - echo "http://downloads.php.net/dsp/${2}"
52 - ;;
53 - "php")
54 - echo "http://www.php.net/distributions/${2}"
55 - ;;
56 - "olemarkus")
57 - echo "https://dev.gentoo.org/~olemarkus/php/${2}"
58 - ;;
59 - "gentoo")
60 - echo "mirror://gentoo/${2}"
61 - ;;
62 - *)
63 - die "unhandled case in php_get_uri"
64 - ;;
65 - esac
66 -}
67 -
68 -PHP_MV="$(get_major_version)"
69 -SLOT="$(get_version_component_range 1-2)"
70 -
71 -# alias, so we can handle different types of releases (finals, rcs, alphas,
72 -# betas, ...) w/o changing the whole ebuild
73 -PHP_PV="${PV/_rc/RC}"
74 -PHP_PV="${PHP_PV/_alpha/alpha}"
75 -PHP_PV="${PHP_PV/_beta/beta}"
76 -PHP_RELEASE="php"
77 -[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre"
78 -[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre"
79 -[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre"
80 -PHP_P="${PN}-${PHP_PV}"
81 -
82 -PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")"
83 -
84 -PHP_FPM_CONF_VER="1"
85 -
86 -SRC_URI="${PHP_SRC_URI}"
87 -
88 -DESCRIPTION="The PHP language runtime engine"
89 -HOMEPAGE="http://php.net/"
90 -LICENSE="PHP-3"
91 -
92 -S="${WORKDIR}/${PHP_P}"
93 -
94 -# We can build the following SAPIs in the given order
95 -SAPIS="embed cli cgi fpm apache2"
96 -
97 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
98 -IUSE="${IUSE}
99 - ${SAPIS/cli/+cli}
100 - threads"
101 -
102 -IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
103 - crypt +ctype curl debug
104 - enchant exif frontbase +fileinfo +filter firebird
105 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
106 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
107 - mhash mssql mysql libmysqlclient mysqli nls
108 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
109 - readline recode selinux +session sharedmem
110 - +simplexml snmp soap sockets spell sqlite ssl
111 - sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
112 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
113 -
114 -DEPEND="
115 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
116 - >=dev-libs/libpcre-8.32[unicode]
117 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
118 - <www-servers/apache-2.4[threads=] ) )"
119 -
120 -# The supported (that is, autodetected) versions of BDB are listed in
121 -# the ./configure script. Other versions *work*, but we need to stick to
122 -# the ones that can be detected to avoid a repeat of bug #564824.
123 -DEPEND="${DEPEND}
124 - berkdb? ( || ( sys-libs/db:5.3
125 - sys-libs/db:5.1
126 - sys-libs/db:4.8
127 - sys-libs/db:4.7
128 - sys-libs/db:4.6
129 - sys-libs/db:4.5 ) )
130 - bzip2? ( app-arch/bzip2 )
131 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
132 - cjk? ( !gd? (
133 - virtual/jpeg:0
134 - media-libs/libpng:0=
135 - sys-libs/zlib
136 - ) )
137 - crypt? ( >=dev-libs/libmcrypt-2.4 )
138 - curl? ( >=net-misc/curl-7.10.5 )
139 - enchant? ( app-text/enchant )
140 - exif? ( !gd? (
141 - virtual/jpeg:0
142 - media-libs/libpng:0=
143 - sys-libs/zlib
144 - ) )
145 - firebird? ( dev-db/firebird )
146 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
147 - gdbm? ( >=sys-libs/gdbm-1.8.0 )
148 - gmp? ( dev-libs/gmp:0 )
149 - iconv? ( virtual/libiconv )
150 - imap? ( virtual/imap-c-client[ssl=] )
151 - intl? ( dev-libs/icu:= )
152 - iodbc? ( dev-db/libiodbc )
153 - kerberos? ( virtual/krb5 )
154 - ldap? ( >=net-nds/openldap-1.2.11 )
155 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
156 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
157 - mssql? ( dev-db/freetds[mssql] )
158 - libmysqlclient? (
159 - mysql? ( virtual/mysql )
160 - mysqli? ( >=virtual/mysql-4.1 )
161 - )
162 - nls? ( sys-devel/gettext )
163 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
164 - odbc? ( >=dev-db/unixODBC-1.8.13 )
165 - postgres? ( dev-db/postgresql:* )
166 - qdbm? ( dev-db/qdbm )
167 - readline? ( sys-libs/readline:0 )
168 - recode? ( app-text/recode )
169 - sharedmem? ( dev-libs/mm )
170 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
171 - snmp? ( >=net-analyzer/net-snmp-5.2 )
172 - soap? ( >=dev-libs/libxml2-2.6.8 )
173 - spell? ( >=app-text/aspell-0.50 )
174 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
175 - ssl? (
176 - !libressl? ( dev-libs/openssl:0 )
177 - libressl? ( dev-libs/libressl )
178 - )
179 - sybase-ct? ( dev-db/freetds )
180 - tidy? ( app-text/htmltidy )
181 - truetype? (
182 - =media-libs/freetype-2*
183 - >=media-libs/t1lib-5.0.0
184 - !gd? (
185 - virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
186 - )
187 - unicode? ( dev-libs/oniguruma )
188 - vpx? ( media-libs/libvpx )
189 - wddx? ( >=dev-libs/libxml2-2.6.8 )
190 - xml? ( >=dev-libs/libxml2-2.6.8 )
191 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
192 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
193 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
194 - xpm? (
195 - x11-libs/libXpm
196 - virtual/jpeg:0
197 - media-libs/libpng:0= sys-libs/zlib
198 - )
199 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
200 - zip? ( sys-libs/zlib )
201 - zlib? ( sys-libs/zlib )
202 - virtual/mta
203 -"
204 -
205 -php="=${CATEGORY}/${PF}"
206 -
207 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
208 -REQUIRED_USE="
209 - cli? ( ^^ ( readline libedit ) )
210 - truetype? ( gd )
211 - vpx? ( gd )
212 - cjk? ( gd )
213 - exif? ( gd )
214 -
215 - xpm? ( gd )
216 - gd? ( zlib )
217 - simplexml? ( xml )
218 - soap? ( xml )
219 - wddx? ( xml )
220 - xmlrpc? ( || ( xml iconv ) )
221 - xmlreader? ( xml )
222 - xslt? ( xml )
223 - ldap-sasl? ( ldap )
224 - mhash? ( hash )
225 - phar? ( hash )
226 - libmysqlclient? ( || (
227 - mysql
228 - mysqli
229 - pdo
230 - ) )
231 -
232 - qdbm? ( !gdbm )
233 - readline? ( !libedit )
234 - recode? ( !imap !mysql !mysqli )
235 - sharedmem? ( !threads )
236 -
237 - !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
238 -
239 -RDEPEND="${DEPEND}"
240 -
241 -RDEPEND="${RDEPEND}
242 - fpm? (
243 - selinux? ( sec-policy/selinux-phpfpm )
244 - systemd? ( sys-apps/systemd ) )"
245 -
246 -DEPEND="${DEPEND}
247 - sys-devel/flex
248 - >=sys-devel/m4-1.4.3
249 - >=sys-devel/libtool-1.5.18"
250 -
251 -# Allow users to install production version if they want to
252 -
253 -case "${PHP_INI_VERSION}" in
254 - production|development)
255 - ;;
256 - *)
257 - PHP_INI_VERSION="development"
258 - ;;
259 -esac
260 -
261 -PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}"
262 -PHP_INI_FILE="php.ini"
263 -
264 -want_apache
265 -
266 -pkg_setup() {
267 - depend.apache_pkg_setup
268 -}
269 -
270 -php_install_ini() {
271 - local phpsapi="${1}"
272 -
273 - # work out where we are installing the ini file
274 - php_set_ini_dir "${phpsapi}"
275 -
276 - local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
277 - cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die
278 -
279 - # default to /tmp for save_path, bug #282768
280 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
281 -
282 - # Set the extension dir
283 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" || die
284 -
285 - # Set the include path to point to where we want to find PEAR packages
286 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
287 -
288 - dodir "${PHP_INI_DIR#${EPREFIX}}"
289 - insinto "${PHP_INI_DIR#${EPREFIX}}"
290 - newins "${phpinisrc}" "${PHP_INI_FILE}"
291 -
292 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
293 - elog
294 -
295 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
296 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
297 -
298 - if use_if_iuse opcache; then
299 - elog "Adding opcache to $PHP_EXT_INI_DIR"
300 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
301 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
302 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
303 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
304 - fi
305 -
306 - # SAPI-specific handling
307 - if [[ "${sapi}" == "fpm" ]] ; then
308 - einfo "Installing FPM config file php-fpm.conf"
309 - insinto "${PHP_INI_DIR#${EPREFIX}}"
310 - doins sapi/fpm/php-fpm.conf
311 - fi
312 -
313 - dodoc php.ini-development
314 - dodoc php.ini-production
315 -}
316 -
317 -php_set_ini_dir() {
318 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
319 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
320 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
321 -}
322 -
323 -src_prepare() {
324 - # Change PHP branding
325 - # Get the alpha/beta/rc version
326 - sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
327 - -i configure.in || die "Unable to change PHP branding"
328 -
329 - # Patch PHP to show Gentoo as the server platform
330 - sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
331 - -i configure.in || die "Failed to fix server platform name"
332 -
333 - # Prevent PHP from activating the Apache config,
334 - # as we will do that ourselves
335 - sed -i \
336 - -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
337 - -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
338 - configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
339 - || die
340 -
341 - # Patch PHP to support heimdal instead of mit-krb5
342 - if has_version "app-crypt/heimdal" ; then
343 - sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
344 - || die "Failed to fix heimdal libname"
345 - sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
346 - || die "Failed to fix heimdal crypt library reference"
347 - fi
348 -
349 - # Add user patches #357637
350 - epatch_user
351 -
352 - # Force rebuilding aclocal.m4
353 - rm -f aclocal.m4 || die
354 - eautoreconf
355 -
356 - if [[ ${CHOST} == *-darwin* ]] ; then
357 - # http://bugs.php.net/bug.php?id=48795, bug #343481
358 - sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
359 - fi
360 -}
361 -
362 -src_configure() {
363 - addpredict /usr/share/snmp/mibs/.index
364 - addpredict /var/lib/net-snmp/mib_indexes
365 -
366 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
367 -
368 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
369 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
370 - local our_conf=(
371 - --prefix="${PHP_DESTDIR}"
372 - --mandir="${PHP_DESTDIR}/man"
373 - --infodir="${PHP_DESTDIR}/info"
374 - --libdir="${PHP_DESTDIR}/lib"
375 - --with-libdir="$(get_libdir)"
376 - --localstatedir="${EPREFIX}/var"
377 - --without-pear
378 - $(use_enable threads maintainer-zts)
379 - )
380 -
381 - our_conf+=(
382 - $(use_enable bcmath bcmath)
383 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
384 - $(use_enable calendar calendar)
385 - $(use_enable ctype ctype)
386 - $(use_with curl curl "${EPREFIX}/usr")
387 - $(use_enable xml dom)
388 - $(use_with enchant enchant "${EPREFIX}/usr")
389 - $(use_enable exif exif)
390 - $(use_enable fileinfo fileinfo)
391 - $(use_enable filter filter)
392 - $(use_enable ftp ftp)
393 - $(use_with nls gettext "${EPREFIX}/usr")
394 - $(use_with gmp gmp "${EPREFIX}/usr")
395 - $(use_enable hash hash)
396 - $(use_with mhash mhash "${EPREFIX}/usr")
397 - $(use_with iconv iconv \
398 - $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
399 - $(use_enable intl intl)
400 - $(use_enable ipv6 ipv6)
401 - $(use_enable json json)
402 - $(use_with kerberos kerberos "${EPREFIX}/usr")
403 - $(use_enable xml libxml)
404 - $(use_with xml libxml-dir "${EPREFIX}/usr")
405 - $(use_enable unicode mbstring)
406 - $(use_with crypt mcrypt "${EPREFIX}/usr")
407 - $(use_with mssql mssql "${EPREFIX}/usr")
408 - $(use_with unicode onig "${EPREFIX}/usr")
409 - $(use_with ssl openssl "${EPREFIX}/usr")
410 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
411 - $(use_enable pcntl pcntl)
412 - $(use_enable phar phar)
413 - $(use_enable pdo pdo)
414 - $(use_enable opcache opcache)
415 - $(use_with postgres pgsql "${EPREFIX}/usr")
416 - $(use_enable posix posix)
417 - $(use_with spell pspell "${EPREFIX}/usr")
418 - $(use_with recode recode "${EPREFIX}/usr")
419 - $(use_enable simplexml simplexml)
420 - $(use_enable sharedmem shmop)
421 - $(use_with snmp snmp "${EPREFIX}/usr")
422 - $(use_enable soap soap)
423 - $(use_enable sockets sockets)
424 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
425 - $(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
426 - $(use_enable sysvipc sysvmsg)
427 - $(use_enable sysvipc sysvsem)
428 - $(use_enable sysvipc sysvshm)
429 - $(use_with systemd fpm-systemd)
430 - $(use_with tidy tidy "${EPREFIX}/usr")
431 - $(use_enable tokenizer tokenizer)
432 - $(use_enable wddx wddx)
433 - $(use_enable xml xml)
434 - $(use_enable xmlreader xmlreader)
435 - $(use_enable xmlwriter xmlwriter)
436 - $(use_with xmlrpc xmlrpc)
437 - $(use_with xslt xsl "${EPREFIX}/usr")
438 - $(use_enable zip zip)
439 - $(use_with zlib zlib "${EPREFIX}/usr")
440 - $(use_enable debug debug)
441 - )
442 -
443 - # DBA support
444 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
445 - || use qdbm ; then
446 - our_conf+=( "--enable-dba${shared}" )
447 - fi
448 -
449 - # DBA drivers support
450 - our_conf+=(
451 - $(use_with cdb cdb)
452 - $(use_with berkdb db4 "${EPREFIX}/usr")
453 - $(use_enable flatfile flatfile)
454 - $(use_with gdbm gdbm "${EPREFIX}/usr")
455 - $(use_enable inifile inifile)
456 - $(use_with qdbm qdbm "${EPREFIX}/usr")
457 - )
458 -
459 - # Support for the GD graphics library
460 - our_conf+=(
461 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
462 - $(use_with truetype t1lib "${EPREFIX}/usr")
463 - $(use_enable cjk gd-jis-conv)
464 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
465 - $(use_with gd png-dir "${EPREFIX}/usr")
466 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
467 - $(use_with vpx vpx-dir "${EPREFIX}/usr")
468 - )
469 - # enable gd last, so configure can pick up the previous settings
470 - our_conf+=( $(use_with gd gd) )
471 -
472 - # IMAP support
473 - if use imap ; then
474 - our_conf+=(
475 - $(use_with imap imap "${EPREFIX}/usr")
476 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
477 - )
478 - fi
479 -
480 - # Interbase/firebird support
481 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
482 -
483 - # LDAP support
484 - if use ldap ; then
485 - our_conf+=(
486 - $(use_with ldap ldap "${EPREFIX}/usr")
487 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
488 - )
489 - fi
490 -
491 - # MySQL support
492 - local mysqllib="mysqlnd"
493 - local mysqlilib="mysqlnd"
494 - use libmysqlclient && mysqllib="${EPREFIX}/usr"
495 - use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
496 -
497 - our_conf+=( $(use_with mysql mysql "${mysqllib}") )
498 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
499 -
500 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
501 - if use mysql || use mysqli ; then
502 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
503 - fi
504 -
505 - # ODBC support
506 - our_conf+=(
507 - $(use_with odbc unixODBC "${EPREFIX}/usr")
508 - $(use_with iodbc iodbc "${EPREFIX}/usr")
509 - )
510 -
511 - # Oracle support
512 - our_conf+=( $(use_with oci8-instant-client oci8) )
513 -
514 - # PDO support
515 - if use pdo ; then
516 - our_conf+=(
517 - $(use_with mssql pdo-dblib)
518 - $(use_with mysql pdo-mysql "${mysqllib}")
519 - $(use_with postgres pdo-pgsql)
520 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
521 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
522 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
523 - $(use_with oci8-instant-client pdo-oci)
524 - )
525 - fi
526 -
527 - # readline/libedit support
528 - our_conf+=(
529 - $(use_with readline readline "${EPREFIX}/usr")
530 - $(use_with libedit libedit "${EPREFIX}/usr")
531 - )
532 -
533 - # Session support
534 - if use session ; then
535 - our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
536 - else
537 - our_conf+=( $(use_enable session session) )
538 - fi
539 -
540 - # Use pic for shared modules such as apache2's mod_php
541 - our_conf+=( --with-pic )
542 -
543 - # we use the system copy of pcre
544 - # --with-pcre-regex affects ext/pcre
545 - # --with-pcre-dir affects ext/filter and ext/zip
546 - our_conf+=(
547 - --with-pcre-regex="${EPREFIX}/usr"
548 - --with-pcre-dir="${EPREFIX}/usr"
549 - )
550 -
551 - # Catch CFLAGS problems
552 - # Fixes bug #14067.
553 - # Changed order to run it in reverse for bug #32022 and #12021.
554 - replace-cpu-flags "k6*" "i586"
555 -
556 - # Support user-passed configuration parameters
557 - our_conf+=( ${EXTRA_ECONF:-} )
558 -
559 - # Support the Apache2 extras, they must be set globally for all
560 - # SAPIs to work correctly, especially for external PHP extensions
561 -
562 - mkdir -p "${WORKDIR}/sapis-build" || die
563 - for one_sapi in $SAPIS ; do
564 - use "${one_sapi}" || continue
565 - php_set_ini_dir "${one_sapi}"
566 -
567 - # The BUILD_DIR variable is used to determine where to output
568 - # the files that autotools creates. This was all originally
569 - # based on the autotools-utils eclass.
570 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
571 - cp -r "${S}" "${BUILD_DIR}" || die
572 - cd "${BUILD_DIR}" || die
573 -
574 - local sapi_conf=(
575 - --with-config-file-path="${PHP_INI_DIR}"
576 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
577 - )
578 -
579 - for sapi in $SAPIS ; do
580 - case "$sapi" in
581 - cli|cgi|embed|fpm)
582 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
583 - sapi_conf+=( "--enable-${sapi}" )
584 - else
585 - sapi_conf+=( "--disable-${sapi}" )
586 - fi
587 - ;;
588 -
589 - apache2)
590 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
591 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/sbin/apxs" )
592 - else
593 - sapi_conf+=( --without-apxs2 )
594 - fi
595 - ;;
596 - esac
597 - done
598 -
599 - # Construct the $myeconfargs array by concatenating $our_conf
600 - # (the common args) and $sapi_conf (the SAPI-specific args).
601 - local myeconfargs=( "${our_conf[@]}" )
602 - myeconfargs+=( "${sapi_conf[@]}" )
603 -
604 - pushd "${BUILD_DIR}" > /dev/null || die
605 - econf "${myeconfargs[@]}"
606 - popd > /dev/null || die
607 - done
608 -}
609 -
610 -src_compile() {
611 - # snmp seems to run during src_compile, too (bug #324739)
612 - addpredict /usr/share/snmp/mibs/.index
613 - addpredict /var/lib/net-snmp/mib_indexes
614 -
615 - for sapi in ${SAPIS} ; do
616 - if use "${sapi}"; then
617 - cd "${WORKDIR}/sapis-build/$sapi" || \
618 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
619 - emake
620 - fi
621 - done
622 -}
623 -
624 -src_install() {
625 - # see bug #324739 for what happens when we don't have that
626 - addpredict /usr/share/snmp/mibs/.index
627 -
628 - # grab the first SAPI that got built and install common files from there
629 - local first_sapi=""
630 - for sapi in $SAPIS ; do
631 - if use $sapi ; then
632 - first_sapi=$sapi
633 - break
634 - fi
635 - done
636 -
637 - # Makefile forgets to create this before trying to write to it...
638 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
639 -
640 - # Install php environment (without any sapis)
641 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
642 - emake INSTALL_ROOT="${D}" \
643 - install-build install-headers install-programs
644 -
645 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
646 -
647 - # Create the directory where we'll put version-specific php scripts
648 - keepdir "/usr/share/php${PHP_MV}"
649 -
650 - local sapi="", file=""
651 - local sapi_list=""
652 -
653 - for sapi in ${SAPIS}; do
654 - if use "${sapi}" ; then
655 - einfo "Installing SAPI: ${sapi}"
656 - cd "${WORKDIR}/sapis-build/${sapi}" || die
657 -
658 - if [[ "${sapi}" == "apache2" ]] ; then
659 - # We're specifically not using emake install-sapi as libtool
660 - # may cause unnecessary relink failures (see bug #351266)
661 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
662 - newins ".libs/libphp5$(get_libname)" \
663 - "libphp${PHP_MV}$(get_libname)"
664 - keepdir "/usr/$(get_libdir)/apache2/modules"
665 - else
666 - # needed each time, php_install_ini would reset it
667 - local dest="${PHP_DESTDIR#${EPREFIX}}"
668 - into "${dest}"
669 - case "$sapi" in
670 - cli)
671 - source="sapi/cli/php"
672 - ;;
673 - cgi)
674 - source="sapi/cgi/php-cgi"
675 - ;;
676 - fpm)
677 - source="sapi/fpm/php-fpm"
678 - ;;
679 - embed)
680 - source="libs/libphp${PHP_MV}$(get_libname)"
681 - ;;
682 - *)
683 - die "unhandled sapi in src_install"
684 - ;;
685 - esac
686 -
687 - if [[ "${source}" == *"$(get_libname)" ]]; then
688 - dolib.so "${source}"
689 - else
690 - dobin "${source}"
691 - local name="$(basename ${source})"
692 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
693 - fi
694 - fi
695 -
696 - php_install_ini "${sapi}"
697 -
698 - # construct correct SAPI string for php-config
699 - # thanks to ferringb for the bash voodoo
700 - if [[ "${sapi}" == "apache2" ]]; then
701 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
702 - else
703 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
704 - fi
705 - fi
706 - done
707 -
708 - # Installing opcache module
709 - if use_if_iuse opcache ; then
710 - dolib.so "modules/opcache$(get_libname)"
711 - fi
712 -
713 - # Install env.d files
714 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
715 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
716 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
717 -
718 - # set php-config variable correctly (bug #278439)
719 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
720 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
721 -
722 - if use fpm ; then
723 - if use systemd; then
724 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
725 - "php-fpm@${SLOT}.service"
726 - else
727 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
728 - "php-fpm@${SLOT}.service"
729 - fi
730 - fi
731 -}
732 -
733 -src_test() {
734 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
735 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
736 - if [[ ! -x "${PHP_BIN}" ]] ; then
737 - ewarn "Test phase requires USE=cli, skipping"
738 - return
739 - else
740 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
741 - fi
742 -
743 - if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
744 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
745 - fi
746 -
747 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
748 - "session.save_path=${T}" \
749 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
750 - "session.save_path=${T}"
751 -
752 - for name in ${EXPECTED_TEST_FAILURES}; do
753 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
754 - done
755 -
756 - local failed="$(find -name '*.out')"
757 - if [[ ${failed} != "" ]] ; then
758 - ewarn "The following test cases failed unexpectedly:"
759 - for name in ${failed}; do
760 - ewarn " ${name/.out/}"
761 - done
762 - else
763 - einfo "No unexpected test failures, all fine"
764 - fi
765 -
766 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
767 - local passed=""
768 - for name in ${EXPECTED_TEST_FAILURES}; do
769 - [[ -f "${name}.diff" ]] && continue
770 - passed="${passed} ${name}"
771 - done
772 - if [[ ${passed} != "" ]] ; then
773 - einfo "The following test cases passed unexpectedly:"
774 - for name in ${passed}; do
775 - ewarn " ${passed}"
776 - done
777 - else
778 - einfo "None of the known-to-fail tests passed, all fine"
779 - fi
780 - fi
781 -}
782 -
783 -pkg_postinst() {
784 - # Output some general info to the user
785 - if use apache2 ; then
786 - APACHE2_MOD_DEFINE="PHP"
787 - APACHE2_MOD_CONF="70_mod_php" # Provided by app-eselect/eselect-php
788 - apache-module_pkg_postinst
789 - fi
790 -
791 - # Create the symlinks for php
792 - for m in ${SAPIS}; do
793 - [[ ${m} == 'embed' ]] && continue;
794 - if use $m ; then
795 - local ci=$(eselect php show $m)
796 - if [[ -z $ci ]]; then
797 - eselect php set $m php${SLOT} || die
798 - einfo "Switched ${m} to use php:${SLOT}"
799 - einfo
800 - elif [[ $ci != "php${SLOT}" ]] ; then
801 - elog "To switch $m to use php:${SLOT}, run"
802 - elog " eselect php set $m php${SLOT}"
803 - elog
804 - fi
805 - fi
806 - done
807 -
808 - # Remove dead symlinks for SAPIs that were just disabled. For
809 - # example, if the user has the cgi SAPI enabled, then he has an
810 - # eselect-php symlink for it. If he later reinstalls PHP with
811 - # USE="-cgi", that symlink will break. This call to eselect is
812 - # supposed to remove that dead link per bug 572436.
813 - eselect php cleanup || die
814 -
815 - elog "To build extensions for this version of PHP, you will need to"
816 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
817 - elog
818 - elog "This ebuild installed a version of php.ini based on"
819 - elog "php.ini-${PHP_INI_VERSION}. You can choose which version of"
820 - elog "php.ini to install by default by setting PHP_INI_VERSION"
821 - elog "to either 'production' or 'development' in your make.conf."
822 - elog "Both versions of php.ini can be found with the PHP docs in"
823 - elog "${EPREFIX}/usr/share/doc/${PF}"
824 - elog
825 - elog "For more details on how version slotting works, please see"
826 - elog "the wiki:"
827 - elog
828 - elog " https://wiki.gentoo.org/wiki/PHP"
829 - elog
830 -}
831 -
832 -pkg_postrm() {
833 - # This serves two purposes. First, if we have just removed the last
834 - # installed version of PHP, then this will remove any dead symlinks
835 - # belonging to eselect-php. Second, if a user upgrades slots from
836 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
837 - # his existing symlinks to point to the new 7.0 installation. The
838 - # latter is bug 432962.
839 - #
840 - # Note: the eselect-php package may not be installed at this point,
841 - # so we can't die() if this command fails.
842 - eselect php cleanup
843 -}
844
845 diff --git a/dev-lang/php/php-5.6.24.ebuild b/dev-lang/php/php-5.6.24.ebuild
846 deleted file mode 100644
847 index 9830c1d..00000000
848 --- a/dev-lang/php/php-5.6.24.ebuild
849 +++ /dev/null
850 @@ -1,814 +0,0 @@
851 -# Copyright 1999-2016 Gentoo Foundation
852 -# Distributed under the terms of the GNU General Public License v2
853 -# $Id$
854 -
855 -EAPI=5
856 -
857 -inherit eutils autotools flag-o-matic versionator libtool systemd
858 -
859 -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"
860 -
861 -function php_get_uri ()
862 -{
863 - case "${1}" in
864 - "php-pre")
865 - echo "http://downloads.php.net/dsp/${2}"
866 - ;;
867 - "php")
868 - echo "http://www.php.net/distributions/${2}"
869 - ;;
870 - "olemarkus")
871 - echo "https://dev.gentoo.org/~olemarkus/php/${2}"
872 - ;;
873 - "gentoo")
874 - echo "mirror://gentoo/${2}"
875 - ;;
876 - *)
877 - die "unhandled case in php_get_uri"
878 - ;;
879 - esac
880 -}
881 -
882 -PHP_MV="$(get_major_version)"
883 -SLOT="$(get_version_component_range 1-2)"
884 -
885 -# alias, so we can handle different types of releases (finals, rcs, alphas,
886 -# betas, ...) w/o changing the whole ebuild
887 -PHP_PV="${PV/_rc/RC}"
888 -PHP_PV="${PHP_PV/_alpha/alpha}"
889 -PHP_PV="${PHP_PV/_beta/beta}"
890 -PHP_RELEASE="php"
891 -[[ ${PV} == ${PV/_alpha/} ]] || PHP_RELEASE="php-pre"
892 -[[ ${PV} == ${PV/_beta/} ]] || PHP_RELEASE="php-pre"
893 -[[ ${PV} == ${PV/_rc/} ]] || PHP_RELEASE="php-pre"
894 -PHP_P="${PN}-${PHP_PV}"
895 -
896 -PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.xz")"
897 -
898 -PHP_FPM_CONF_VER="1"
899 -
900 -SRC_URI="${PHP_SRC_URI}"
901 -
902 -DESCRIPTION="The PHP language runtime engine"
903 -HOMEPAGE="http://php.net/"
904 -LICENSE="PHP-3"
905 -
906 -S="${WORKDIR}/${PHP_P}"
907 -
908 -# We can build the following SAPIs in the given order
909 -SAPIS="embed cli cgi fpm apache2"
910 -
911 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
912 -IUSE="${IUSE}
913 - ${SAPIS/cli/+cli}
914 - threads"
915 -
916 -IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
917 - crypt +ctype curl debug
918 - enchant exif frontbase +fileinfo +filter firebird
919 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
920 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
921 - mhash mssql mysql libmysqlclient mysqli nls
922 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
923 - readline recode selinux +session sharedmem
924 - +simplexml snmp soap sockets spell sqlite ssl
925 - sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
926 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
927 -
928 -DEPEND="
929 - >=app-eselect/eselect-php-0.9.1[apache2?,fpm?]
930 - >=dev-libs/libpcre-8.32[unicode]
931 - apache2? ( || ( >=www-servers/apache-2.4[apache2_modules_unixd,threads=]
932 - <www-servers/apache-2.4[threads=] ) )"
933 -
934 -# The supported (that is, autodetected) versions of BDB are listed in
935 -# the ./configure script. Other versions *work*, but we need to stick to
936 -# the ones that can be detected to avoid a repeat of bug #564824.
937 -DEPEND="${DEPEND}
938 - berkdb? ( || ( sys-libs/db:5.3
939 - sys-libs/db:5.1
940 - sys-libs/db:4.8
941 - sys-libs/db:4.7
942 - sys-libs/db:4.6
943 - sys-libs/db:4.5 ) )
944 - bzip2? ( app-arch/bzip2 )
945 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
946 - cjk? ( !gd? (
947 - virtual/jpeg:0
948 - media-libs/libpng:0=
949 - sys-libs/zlib
950 - ) )
951 - crypt? ( >=dev-libs/libmcrypt-2.4 )
952 - curl? ( >=net-misc/curl-7.10.5 )
953 - enchant? ( app-text/enchant )
954 - exif? ( !gd? (
955 - virtual/jpeg:0
956 - media-libs/libpng:0=
957 - sys-libs/zlib
958 - ) )
959 - firebird? ( dev-db/firebird )
960 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
961 - gdbm? ( >=sys-libs/gdbm-1.8.0 )
962 - gmp? ( dev-libs/gmp:0 )
963 - iconv? ( virtual/libiconv )
964 - imap? ( virtual/imap-c-client[ssl=] )
965 - intl? ( dev-libs/icu:= )
966 - iodbc? ( dev-db/libiodbc )
967 - kerberos? ( virtual/krb5 )
968 - ldap? ( >=net-nds/openldap-1.2.11 )
969 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
970 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
971 - mssql? ( dev-db/freetds[mssql] )
972 - libmysqlclient? (
973 - mysql? ( virtual/mysql )
974 - mysqli? ( >=virtual/mysql-4.1 )
975 - )
976 - nls? ( sys-devel/gettext )
977 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
978 - odbc? ( >=dev-db/unixODBC-1.8.13 )
979 - postgres? ( dev-db/postgresql:* )
980 - qdbm? ( dev-db/qdbm )
981 - readline? ( sys-libs/readline:0 )
982 - recode? ( app-text/recode )
983 - sharedmem? ( dev-libs/mm )
984 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
985 - snmp? ( >=net-analyzer/net-snmp-5.2 )
986 - soap? ( >=dev-libs/libxml2-2.6.8 )
987 - spell? ( >=app-text/aspell-0.50 )
988 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
989 - ssl? (
990 - !libressl? ( dev-libs/openssl:0 )
991 - libressl? ( dev-libs/libressl )
992 - )
993 - sybase-ct? ( dev-db/freetds )
994 - tidy? ( app-text/htmltidy )
995 - truetype? (
996 - =media-libs/freetype-2*
997 - >=media-libs/t1lib-5.0.0
998 - !gd? (
999 - virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
1000 - )
1001 - unicode? ( dev-libs/oniguruma )
1002 - vpx? ( media-libs/libvpx )
1003 - wddx? ( >=dev-libs/libxml2-2.6.8 )
1004 - xml? ( >=dev-libs/libxml2-2.6.8 )
1005 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
1006 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
1007 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
1008 - xpm? (
1009 - x11-libs/libXpm
1010 - virtual/jpeg:0
1011 - media-libs/libpng:0= sys-libs/zlib
1012 - )
1013 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
1014 - zip? ( sys-libs/zlib )
1015 - zlib? ( sys-libs/zlib )
1016 - virtual/mta
1017 -"
1018 -
1019 -php="=${CATEGORY}/${PF}"
1020 -
1021 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
1022 -REQUIRED_USE="
1023 - cli? ( ^^ ( readline libedit ) )
1024 - truetype? ( gd )
1025 - vpx? ( gd )
1026 - cjk? ( gd )
1027 - exif? ( gd )
1028 -
1029 - xpm? ( gd )
1030 - gd? ( zlib )
1031 - simplexml? ( xml )
1032 - soap? ( xml )
1033 - wddx? ( xml )
1034 - xmlrpc? ( || ( xml iconv ) )
1035 - xmlreader? ( xml )
1036 - xslt? ( xml )
1037 - ldap-sasl? ( ldap )
1038 - mhash? ( hash )
1039 - phar? ( hash )
1040 - libmysqlclient? ( || (
1041 - mysql
1042 - mysqli
1043 - pdo
1044 - ) )
1045 -
1046 - qdbm? ( !gdbm )
1047 - readline? ( !libedit )
1048 - recode? ( !imap !mysql !mysqli )
1049 - sharedmem? ( !threads )
1050 -
1051 - !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
1052 -
1053 -RDEPEND="${DEPEND}"
1054 -
1055 -RDEPEND="${RDEPEND}
1056 - fpm? (
1057 - selinux? ( sec-policy/selinux-phpfpm )
1058 - systemd? ( sys-apps/systemd ) )"
1059 -
1060 -DEPEND="${DEPEND}
1061 - sys-devel/flex
1062 - >=sys-devel/m4-1.4.3
1063 - >=sys-devel/libtool-1.5.18"
1064 -
1065 -# Allow users to install production version if they want to
1066 -if [[ "${PHP_INI_VERSION}" == "production" ]]; then
1067 - PHP_INI_UPSTREAM="php.ini-production"
1068 -else
1069 - PHP_INI_UPSTREAM="php.ini-development"
1070 -fi
1071 -
1072 -PHP_INI_FILE="php.ini"
1073 -
1074 -php_install_ini() {
1075 - local phpsapi="${1}"
1076 -
1077 - # work out where we are installing the ini file
1078 - php_set_ini_dir "${phpsapi}"
1079 -
1080 - local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
1081 - cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die
1082 -
1083 - # default to /tmp for save_path, bug #282768
1084 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
1085 -
1086 - # Set the extension dir
1087 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" || die
1088 -
1089 - # Set the include path to point to where we want to find PEAR packages
1090 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
1091 -
1092 - dodir "${PHP_INI_DIR#${EPREFIX}}"
1093 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1094 - newins "${phpinisrc}" "${PHP_INI_FILE}"
1095 -
1096 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
1097 - elog
1098 -
1099 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
1100 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
1101 -
1102 - if use opcache; then
1103 - elog "Adding opcache to $PHP_EXT_INI_DIR"
1104 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
1105 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
1106 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
1107 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
1108 - fi
1109 -
1110 - # SAPI-specific handling
1111 - if [[ "${sapi}" == "fpm" ]] ; then
1112 - einfo "Installing FPM config file php-fpm.conf"
1113 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1114 - doins sapi/fpm/php-fpm.conf
1115 - fi
1116 -
1117 - dodoc php.ini-development
1118 - dodoc php.ini-production
1119 -}
1120 -
1121 -php_set_ini_dir() {
1122 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
1123 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
1124 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
1125 -}
1126 -
1127 -src_prepare() {
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 - || die
1144 -
1145 - # Patch PHP to support heimdal instead of mit-krb5
1146 - if has_version "app-crypt/heimdal" ; then
1147 - sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
1148 - || die "Failed to fix heimdal libname"
1149 - sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
1150 - || die "Failed to fix heimdal crypt library reference"
1151 - fi
1152 -
1153 - # Add user patches #357637
1154 - epatch_user
1155 -
1156 - # Force rebuilding aclocal.m4
1157 - rm -f aclocal.m4 || die
1158 - eautoreconf
1159 -
1160 - if [[ ${CHOST} == *-darwin* ]] ; then
1161 - # http://bugs.php.net/bug.php?id=48795, bug #343481
1162 - sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
1163 - fi
1164 -}
1165 -
1166 -src_configure() {
1167 - addpredict /usr/share/snmp/mibs/.index
1168 - addpredict /var/lib/net-snmp/mib_indexes
1169 -
1170 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
1171 -
1172 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
1173 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
1174 - local our_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 - --localstatedir="${EPREFIX}/var"
1181 - --without-pear
1182 - $(use_enable threads maintainer-zts)
1183 - )
1184 -
1185 - our_conf+=(
1186 - $(use_enable bcmath bcmath)
1187 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
1188 - $(use_enable calendar calendar)
1189 - $(use_enable ctype ctype)
1190 - $(use_with curl curl "${EPREFIX}/usr")
1191 - $(use_enable xml dom)
1192 - $(use_with enchant enchant "${EPREFIX}/usr")
1193 - $(use_enable exif exif)
1194 - $(use_enable fileinfo fileinfo)
1195 - $(use_enable filter filter)
1196 - $(use_enable ftp ftp)
1197 - $(use_with nls gettext "${EPREFIX}/usr")
1198 - $(use_with gmp gmp "${EPREFIX}/usr")
1199 - $(use_enable hash hash)
1200 - $(use_with mhash mhash "${EPREFIX}/usr")
1201 - $(use_with iconv iconv \
1202 - $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
1203 - $(use_enable intl intl)
1204 - $(use_enable ipv6 ipv6)
1205 - $(use_enable json json)
1206 - $(use_with kerberos kerberos "${EPREFIX}/usr")
1207 - $(use_enable xml libxml)
1208 - $(use_with xml libxml-dir "${EPREFIX}/usr")
1209 - $(use_enable unicode mbstring)
1210 - $(use_with crypt mcrypt "${EPREFIX}/usr")
1211 - $(use_with mssql mssql "${EPREFIX}/usr")
1212 - $(use_with unicode onig "${EPREFIX}/usr")
1213 - $(use_with ssl openssl "${EPREFIX}/usr")
1214 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
1215 - $(use_enable pcntl pcntl)
1216 - $(use_enable phar phar)
1217 - $(use_enable pdo pdo)
1218 - $(use_enable opcache opcache)
1219 - $(use_with postgres pgsql "${EPREFIX}/usr")
1220 - $(use_enable posix posix)
1221 - $(use_with spell pspell "${EPREFIX}/usr")
1222 - $(use_with recode recode "${EPREFIX}/usr")
1223 - $(use_enable simplexml simplexml)
1224 - $(use_enable sharedmem shmop)
1225 - $(use_with snmp snmp "${EPREFIX}/usr")
1226 - $(use_enable soap soap)
1227 - $(use_enable sockets sockets)
1228 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
1229 - $(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
1230 - $(use_enable sysvipc sysvmsg)
1231 - $(use_enable sysvipc sysvsem)
1232 - $(use_enable sysvipc sysvshm)
1233 - $(use_with systemd fpm-systemd)
1234 - $(use_with tidy tidy "${EPREFIX}/usr")
1235 - $(use_enable tokenizer tokenizer)
1236 - $(use_enable wddx wddx)
1237 - $(use_enable xml xml)
1238 - $(use_enable xmlreader xmlreader)
1239 - $(use_enable xmlwriter xmlwriter)
1240 - $(use_with xmlrpc xmlrpc)
1241 - $(use_with xslt xsl "${EPREFIX}/usr")
1242 - $(use_enable zip zip)
1243 - $(use_with zlib zlib "${EPREFIX}/usr")
1244 - $(use_enable debug debug)
1245 - )
1246 -
1247 - # DBA support
1248 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
1249 - || use qdbm ; then
1250 - our_conf+=( "--enable-dba${shared}" )
1251 - fi
1252 -
1253 - # DBA drivers support
1254 - our_conf+=(
1255 - $(use_with cdb cdb)
1256 - $(use_with berkdb db4 "${EPREFIX}/usr")
1257 - $(use_enable flatfile flatfile)
1258 - $(use_with gdbm gdbm "${EPREFIX}/usr")
1259 - $(use_enable inifile inifile)
1260 - $(use_with qdbm qdbm "${EPREFIX}/usr")
1261 - )
1262 -
1263 - # Support for the GD graphics library
1264 - our_conf+=(
1265 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
1266 - $(use_with truetype t1lib "${EPREFIX}/usr")
1267 - $(use_enable cjk gd-jis-conv)
1268 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
1269 - $(use_with gd png-dir "${EPREFIX}/usr")
1270 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
1271 - $(use_with vpx vpx-dir "${EPREFIX}/usr")
1272 - )
1273 - # enable gd last, so configure can pick up the previous settings
1274 - our_conf+=( $(use_with gd gd) )
1275 -
1276 - # IMAP support
1277 - if use imap ; then
1278 - our_conf+=(
1279 - $(use_with imap imap "${EPREFIX}/usr")
1280 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
1281 - )
1282 - fi
1283 -
1284 - # Interbase/firebird support
1285 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
1286 -
1287 - # LDAP support
1288 - if use ldap ; then
1289 - our_conf+=(
1290 - $(use_with ldap ldap "${EPREFIX}/usr")
1291 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
1292 - )
1293 - fi
1294 -
1295 - # MySQL support
1296 - local mysqllib="mysqlnd"
1297 - local mysqlilib="mysqlnd"
1298 - use libmysqlclient && mysqllib="${EPREFIX}/usr"
1299 - use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
1300 -
1301 - our_conf+=( $(use_with mysql mysql "${mysqllib}") )
1302 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
1303 -
1304 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
1305 - if use mysql || use mysqli ; then
1306 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
1307 - fi
1308 -
1309 - # ODBC support
1310 - our_conf+=(
1311 - $(use_with odbc unixODBC "${EPREFIX}/usr")
1312 - $(use_with iodbc iodbc "${EPREFIX}/usr")
1313 - )
1314 -
1315 - # Oracle support
1316 - our_conf+=( $(use_with oci8-instant-client oci8) )
1317 -
1318 - # PDO support
1319 - if use pdo ; then
1320 - our_conf+=(
1321 - $(use_with mssql pdo-dblib)
1322 - $(use_with mysql pdo-mysql "${mysqllib}")
1323 - $(use_with postgres pdo-pgsql)
1324 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
1325 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
1326 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
1327 - $(use_with oci8-instant-client pdo-oci)
1328 - )
1329 - fi
1330 -
1331 - # readline/libedit support
1332 - our_conf+=(
1333 - $(use_with readline readline "${EPREFIX}/usr")
1334 - $(use_with libedit libedit "${EPREFIX}/usr")
1335 - )
1336 -
1337 - # Session support
1338 - if use session ; then
1339 - our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
1340 - else
1341 - our_conf+=( $(use_enable session session) )
1342 - fi
1343 -
1344 - # Use pic for shared modules such as apache2's mod_php
1345 - our_conf+=( --with-pic )
1346 -
1347 - # we use the system copy of pcre
1348 - # --with-pcre-regex affects ext/pcre
1349 - # --with-pcre-dir affects ext/filter and ext/zip
1350 - our_conf+=(
1351 - --with-pcre-regex="${EPREFIX}/usr"
1352 - --with-pcre-dir="${EPREFIX}/usr"
1353 - )
1354 -
1355 - # Catch CFLAGS problems
1356 - # Fixes bug #14067.
1357 - # Changed order to run it in reverse for bug #32022 and #12021.
1358 - replace-cpu-flags "k6*" "i586"
1359 -
1360 - # Support user-passed configuration parameters
1361 - our_conf+=( ${EXTRA_ECONF:-} )
1362 -
1363 - # Support the Apache2 extras, they must be set globally for all
1364 - # SAPIs to work correctly, especially for external PHP extensions
1365 -
1366 - mkdir -p "${WORKDIR}/sapis-build" || die
1367 - for one_sapi in $SAPIS ; do
1368 - use "${one_sapi}" || continue
1369 - php_set_ini_dir "${one_sapi}"
1370 -
1371 - # The BUILD_DIR variable is used to determine where to output
1372 - # the files that autotools creates. This was all originally
1373 - # based on the autotools-utils eclass.
1374 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
1375 - cp -r "${S}" "${BUILD_DIR}" || die
1376 - cd "${BUILD_DIR}" || die
1377 -
1378 - local sapi_conf=(
1379 - --with-config-file-path="${PHP_INI_DIR}"
1380 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
1381 - )
1382 -
1383 - for sapi in $SAPIS ; do
1384 - case "$sapi" in
1385 - cli|cgi|embed|fpm)
1386 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
1387 - sapi_conf+=( "--enable-${sapi}" )
1388 - else
1389 - sapi_conf+=( "--disable-${sapi}" )
1390 - fi
1391 - ;;
1392 -
1393 - apache2)
1394 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
1395 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/sbin/apxs" )
1396 - else
1397 - sapi_conf+=( --without-apxs2 )
1398 - fi
1399 - ;;
1400 - esac
1401 - done
1402 -
1403 - # Construct the $myeconfargs array by concatenating $our_conf
1404 - # (the common args) and $sapi_conf (the SAPI-specific args).
1405 - local myeconfargs=( "${our_conf[@]}" )
1406 - myeconfargs+=( "${sapi_conf[@]}" )
1407 -
1408 - pushd "${BUILD_DIR}" > /dev/null || die
1409 - econf "${myeconfargs[@]}"
1410 - popd > /dev/null || die
1411 - done
1412 -}
1413 -
1414 -src_compile() {
1415 - # snmp seems to run during src_compile, too (bug #324739)
1416 - addpredict /usr/share/snmp/mibs/.index
1417 - addpredict /var/lib/net-snmp/mib_indexes
1418 -
1419 - for sapi in ${SAPIS} ; do
1420 - if use "${sapi}"; then
1421 - cd "${WORKDIR}/sapis-build/$sapi" || \
1422 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
1423 - emake
1424 - fi
1425 - done
1426 -}
1427 -
1428 -src_install() {
1429 - # see bug #324739 for what happens when we don't have that
1430 - addpredict /usr/share/snmp/mibs/.index
1431 -
1432 - # grab the first SAPI that got built and install common files from there
1433 - local first_sapi=""
1434 - for sapi in $SAPIS ; do
1435 - if use $sapi ; then
1436 - first_sapi=$sapi
1437 - break
1438 - fi
1439 - done
1440 -
1441 - # Makefile forgets to create this before trying to write to it...
1442 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
1443 -
1444 - # Install php environment (without any sapis)
1445 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
1446 - emake INSTALL_ROOT="${D}" \
1447 - install-build install-headers install-programs
1448 -
1449 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
1450 -
1451 - # Create the directory where we'll put version-specific php scripts
1452 - keepdir "/usr/share/php${PHP_MV}"
1453 -
1454 - local sapi="", file=""
1455 - local sapi_list=""
1456 -
1457 - for sapi in ${SAPIS}; do
1458 - if use "${sapi}" ; then
1459 - einfo "Installing SAPI: ${sapi}"
1460 - cd "${WORKDIR}/sapis-build/${sapi}" || die
1461 -
1462 - if [[ "${sapi}" == "apache2" ]] ; then
1463 - # We're specifically not using emake install-sapi as libtool
1464 - # may cause unnecessary relink failures (see bug #351266)
1465 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
1466 - newins ".libs/libphp5$(get_libname)" \
1467 - "libphp${PHP_MV}$(get_libname)"
1468 - keepdir "/usr/$(get_libdir)/apache2/modules"
1469 - else
1470 - # needed each time, php_install_ini would reset it
1471 - local dest="${PHP_DESTDIR#${EPREFIX}}"
1472 - into "${dest}"
1473 - case "$sapi" in
1474 - cli)
1475 - source="sapi/cli/php"
1476 - ;;
1477 - cgi)
1478 - source="sapi/cgi/php-cgi"
1479 - ;;
1480 - fpm)
1481 - source="sapi/fpm/php-fpm"
1482 - ;;
1483 - embed)
1484 - source="libs/libphp${PHP_MV}$(get_libname)"
1485 - ;;
1486 - *)
1487 - die "unhandled sapi in src_install"
1488 - ;;
1489 - esac
1490 -
1491 - if [[ "${source}" == *"$(get_libname)" ]]; then
1492 - dolib.so "${source}"
1493 - else
1494 - dobin "${source}"
1495 - local name="$(basename ${source})"
1496 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
1497 - fi
1498 - fi
1499 -
1500 - php_install_ini "${sapi}"
1501 -
1502 - # construct correct SAPI string for php-config
1503 - # thanks to ferringb for the bash voodoo
1504 - if [[ "${sapi}" == "apache2" ]]; then
1505 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
1506 - else
1507 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
1508 - fi
1509 - fi
1510 - done
1511 -
1512 - # Installing opcache module
1513 - if use opcache ; then
1514 - into "${PHP_DESTDIR#${EPREFIX}}"
1515 - dolib.so "modules/opcache$(get_libname)"
1516 - fi
1517 -
1518 - # Install env.d files
1519 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
1520 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
1521 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
1522 -
1523 - # set php-config variable correctly (bug #278439)
1524 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
1525 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
1526 -
1527 - if use fpm ; then
1528 - if use systemd; then
1529 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
1530 - "php-fpm@${SLOT}.service"
1531 - else
1532 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
1533 - "php-fpm@${SLOT}.service"
1534 - fi
1535 - fi
1536 -}
1537 -
1538 -src_test() {
1539 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
1540 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
1541 - if [[ ! -x "${PHP_BIN}" ]] ; then
1542 - ewarn "Test phase requires USE=cli, skipping"
1543 - return
1544 - else
1545 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
1546 - fi
1547 -
1548 - if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
1549 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
1550 - fi
1551 -
1552 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
1553 - "session.save_path=${T}" \
1554 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
1555 - "session.save_path=${T}"
1556 -
1557 - for name in ${EXPECTED_TEST_FAILURES}; do
1558 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
1559 - done
1560 -
1561 - local failed="$(find -name '*.out')"
1562 - if [[ ${failed} != "" ]] ; then
1563 - ewarn "The following test cases failed unexpectedly:"
1564 - for name in ${failed}; do
1565 - ewarn " ${name/.out/}"
1566 - done
1567 - else
1568 - einfo "No unexpected test failures, all fine"
1569 - fi
1570 -
1571 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
1572 - local passed=""
1573 - for name in ${EXPECTED_TEST_FAILURES}; do
1574 - [[ -f "${name}.diff" ]] && continue
1575 - passed="${passed} ${name}"
1576 - done
1577 - if [[ ${passed} != "" ]] ; then
1578 - einfo "The following test cases passed unexpectedly:"
1579 - for name in ${passed}; do
1580 - ewarn " ${passed}"
1581 - done
1582 - else
1583 - einfo "None of the known-to-fail tests passed, all fine"
1584 - fi
1585 - fi
1586 -}
1587 -
1588 -pkg_postinst() {
1589 - # Output some general info to the user
1590 - if use apache2 ; then
1591 - elog
1592 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
1593 - elog "your apache2 command. OpenRC users can append that string to"
1594 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
1595 - elog
1596 - elog "The apache module configuration file 70_mod_php.conf is"
1597 - elog "provided (and maintained) by eselect-php."
1598 - elog
1599 - fi
1600 -
1601 - # Create the symlinks for php
1602 - for m in ${SAPIS}; do
1603 - [[ ${m} == 'embed' ]] && continue;
1604 - if use $m ; then
1605 - local ci=$(eselect php show $m)
1606 - if [[ -z $ci ]]; then
1607 - eselect php set $m php${SLOT} || die
1608 - einfo "Switched ${m} to use php:${SLOT}"
1609 - einfo
1610 - elif [[ $ci != "php${SLOT}" ]] ; then
1611 - elog "To switch $m to use php:${SLOT}, run"
1612 - elog " eselect php set $m php${SLOT}"
1613 - elog
1614 - fi
1615 - fi
1616 - done
1617 -
1618 - # Remove dead symlinks for SAPIs that were just disabled. For
1619 - # example, if the user has the cgi SAPI enabled, then he has an
1620 - # eselect-php symlink for it. If he later reinstalls PHP with
1621 - # USE="-cgi", that symlink will break. This call to eselect is
1622 - # supposed to remove that dead link per bug 572436.
1623 - eselect php cleanup || die
1624 -
1625 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
1626 - elog "To build extensions for this version of PHP, you will need to"
1627 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
1628 - elog
1629 - fi
1630 -
1631 - # Only mention PHP_INI_VERSION if the user doesn't have it set.
1632 - case "${PHP_INI_VERSION}" in
1633 - production|development)
1634 - ;;
1635 - *)
1636 - elog "This ebuild installed a version of php.ini based on"
1637 - elog "${PHP_INI_UPSTREAM}. You can choose which version of"
1638 - elog "php.ini to install by default by setting PHP_INI_VERSION"
1639 - elog "to either 'production' or 'development' in your make.conf."
1640 - elog "Both versions of php.ini can be found with the PHP docs in"
1641 - elog "${EPREFIX}/usr/share/doc/${PF}"
1642 - elog
1643 - ;;
1644 - esac
1645 -
1646 - elog "For details on how version slotting works, please see"
1647 - elog "the wiki:"
1648 - elog
1649 - elog " https://wiki.gentoo.org/wiki/PHP"
1650 - elog
1651 -}
1652 -
1653 -pkg_postrm() {
1654 - # This serves two purposes. First, if we have just removed the last
1655 - # installed version of PHP, then this will remove any dead symlinks
1656 - # belonging to eselect-php. Second, if a user upgrades slots from
1657 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
1658 - # his existing symlinks to point to the new 7.0 installation. The
1659 - # latter is bug 432962.
1660 - #
1661 - # Note: the eselect-php package may not be installed at this point,
1662 - # so we can't die() if this command fails.
1663 - eselect php cleanup
1664 -}
1665
1666 diff --git a/dev-lang/php/php-5.6.25.ebuild b/dev-lang/php/php-5.6.25.ebuild
1667 deleted file mode 100644
1668 index 0ac9c9d..00000000
1669 --- a/dev-lang/php/php-5.6.25.ebuild
1670 +++ /dev/null
1671 @@ -1,766 +0,0 @@
1672 -# Copyright 1999-2016 Gentoo Foundation
1673 -# Distributed under the terms of the GNU General Public License v2
1674 -# $Id$
1675 -
1676 -EAPI=6
1677 -
1678 -inherit autotools flag-o-matic versionator libtool systemd
1679 -
1680 -DESCRIPTION="The PHP language runtime engine"
1681 -HOMEPAGE="http://php.net/"
1682 -SRC_URI="http://php.net/distributions/${P}.tar.xz"
1683 -LICENSE="PHP-3"
1684 -SLOT="$(get_version_component_range 1-2)"
1685 -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"
1686 -
1687 -# We can build the following SAPIs in the given order
1688 -SAPIS="embed cli cgi fpm apache2"
1689 -
1690 -# SAPIs and SAPI-specific USE flags (cli SAPI is default on):
1691 -IUSE="${IUSE}
1692 - ${SAPIS/cli/+cli}
1693 - threads"
1694 -
1695 -IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
1696 - crypt +ctype curl debug
1697 - enchant exif frontbase +fileinfo +filter firebird
1698 - flatfile ftp gd gdbm gmp +hash +iconv imap inifile
1699 - intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit libressl
1700 - mhash mssql mysql libmysqlclient mysqli nls
1701 - oci8-instant-client odbc +opcache pcntl pdo +phar +posix postgres qdbm
1702 - readline recode selinux +session sharedmem
1703 - +simplexml snmp soap sockets spell sqlite ssl
1704 - sybase-ct sysvipc systemd tidy +tokenizer truetype unicode vpx wddx
1705 - +xml xmlreader xmlwriter xmlrpc xpm xslt zip zlib"
1706 -
1707 -# The supported (that is, autodetected) versions of BDB are listed in
1708 -# the ./configure script. Other versions *work*, but we need to stick to
1709 -# the ones that can be detected to avoid a repeat of bug #564824.
1710 -COMMON_DEPEND="
1711 - >=app-eselect/eselect-php-0.9.1[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:5.3
1716 - sys-libs/db:5.1
1717 - sys-libs/db:4.8
1718 - sys-libs/db:4.7
1719 - sys-libs/db:4.6
1720 - sys-libs/db:4.5 ) )
1721 - bzip2? ( app-arch/bzip2 )
1722 - cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
1723 - cjk? ( !gd? (
1724 - virtual/jpeg:0
1725 - media-libs/libpng:0=
1726 - sys-libs/zlib
1727 - ) )
1728 - crypt? ( >=dev-libs/libmcrypt-2.4 )
1729 - curl? ( >=net-misc/curl-7.10.5 )
1730 - enchant? ( app-text/enchant )
1731 - exif? ( !gd? (
1732 - virtual/jpeg:0
1733 - media-libs/libpng:0=
1734 - sys-libs/zlib
1735 - ) )
1736 - firebird? ( dev-db/firebird )
1737 - gd? ( virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
1738 - gdbm? ( >=sys-libs/gdbm-1.8.0 )
1739 - gmp? ( dev-libs/gmp:0 )
1740 - iconv? ( virtual/libiconv )
1741 - imap? ( virtual/imap-c-client[ssl=] )
1742 - intl? ( dev-libs/icu:= )
1743 - iodbc? ( dev-db/libiodbc )
1744 - kerberos? ( virtual/krb5 )
1745 - ldap? ( >=net-nds/openldap-1.2.11 )
1746 - ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
1747 - libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
1748 - mssql? ( dev-db/freetds[mssql] )
1749 - libmysqlclient? (
1750 - mysql? ( virtual/mysql )
1751 - mysqli? ( >=virtual/mysql-4.1 )
1752 - )
1753 - nls? ( sys-devel/gettext )
1754 - oci8-instant-client? ( dev-db/oracle-instantclient-basic )
1755 - odbc? ( >=dev-db/unixODBC-1.8.13 )
1756 - postgres? ( dev-db/postgresql:* )
1757 - qdbm? ( dev-db/qdbm )
1758 - readline? ( sys-libs/readline:0 )
1759 - recode? ( app-text/recode )
1760 - sharedmem? ( dev-libs/mm )
1761 - simplexml? ( >=dev-libs/libxml2-2.6.8 )
1762 - snmp? ( >=net-analyzer/net-snmp-5.2 )
1763 - soap? ( >=dev-libs/libxml2-2.6.8 )
1764 - spell? ( >=app-text/aspell-0.50 )
1765 - sqlite? ( >=dev-db/sqlite-3.7.6.3 )
1766 - ssl? (
1767 - !libressl? ( dev-libs/openssl:0 )
1768 - libressl? ( dev-libs/libressl )
1769 - )
1770 - sybase-ct? ( dev-db/freetds )
1771 - tidy? ( app-text/htmltidy )
1772 - truetype? (
1773 - =media-libs/freetype-2*
1774 - >=media-libs/t1lib-5.0.0
1775 - !gd? (
1776 - virtual/jpeg:0 media-libs/libpng:0= sys-libs/zlib )
1777 - )
1778 - unicode? ( dev-libs/oniguruma )
1779 - vpx? ( media-libs/libvpx )
1780 - wddx? ( >=dev-libs/libxml2-2.6.8 )
1781 - xml? ( >=dev-libs/libxml2-2.6.8 )
1782 - xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
1783 - xmlreader? ( >=dev-libs/libxml2-2.6.8 )
1784 - xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
1785 - xpm? (
1786 - x11-libs/libXpm
1787 - virtual/jpeg:0
1788 - media-libs/libpng:0= sys-libs/zlib
1789 - )
1790 - xslt? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
1791 - zip? ( sys-libs/zlib )
1792 - zlib? ( sys-libs/zlib )
1793 -"
1794 -
1795 -RDEPEND="${COMMON_DEPEND}
1796 - virtual/mta
1797 - fpm? (
1798 - selinux? ( sec-policy/selinux-phpfpm )
1799 - systemd? ( sys-apps/systemd ) )"
1800 -
1801 -DEPEND="${COMMON_DEPEND}
1802 - app-arch/xz-utils
1803 - sys-devel/flex
1804 - >=sys-devel/m4-1.4.3
1805 - >=sys-devel/libtool-1.5.18"
1806 -
1807 -# Without USE=readline or libedit, the interactive "php -a" CLI will hang.
1808 -REQUIRED_USE="
1809 - cli? ( ^^ ( readline libedit ) )
1810 - truetype? ( gd )
1811 - vpx? ( gd )
1812 - cjk? ( gd )
1813 - exif? ( gd )
1814 -
1815 - xpm? ( gd )
1816 - gd? ( zlib )
1817 - simplexml? ( xml )
1818 - soap? ( xml )
1819 - wddx? ( xml )
1820 - xmlrpc? ( || ( xml iconv ) )
1821 - xmlreader? ( xml )
1822 - xslt? ( xml )
1823 - ldap-sasl? ( ldap )
1824 - mhash? ( hash )
1825 - phar? ( hash )
1826 - libmysqlclient? ( || (
1827 - mysql
1828 - mysqli
1829 - pdo
1830 - ) )
1831 -
1832 - qdbm? ( !gdbm )
1833 - readline? ( !libedit )
1834 - recode? ( !imap !mysql !mysqli )
1835 - sharedmem? ( !threads )
1836 -
1837 - !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
1838 -
1839 -PHP_MV="$(get_major_version)"
1840 -
1841 -# Allow users to install production version if they want to
1842 -if [[ "${PHP_INI_VERSION}" == "production" ]]; then
1843 - PHP_INI_UPSTREAM="php.ini-production"
1844 -else
1845 - PHP_INI_UPSTREAM="php.ini-development"
1846 -fi
1847 -
1848 -php_install_ini() {
1849 - local phpsapi="${1}"
1850 -
1851 - # work out where we are installing the ini file
1852 - php_set_ini_dir "${phpsapi}"
1853 -
1854 - local phpinisrc="${PHP_INI_UPSTREAM}-${phpsapi}"
1855 - cp "${PHP_INI_UPSTREAM}" "${phpinisrc}" || die
1856 -
1857 - # default to /tmp for save_path, bug #282768
1858 - sed -e 's|^;session.save_path .*$|session.save_path = "'"${EPREFIX}"'/tmp"|g' -i "${phpinisrc}" || die
1859 -
1860 - # Set the extension dir
1861 - sed -e "s|^extension_dir .*$|extension_dir = ${extension_dir}|g" -i "${phpinisrc}" || die
1862 -
1863 - # Set the include path to point to where we want to find PEAR packages
1864 - sed -e 's|^;include_path = ".:/php/includes".*|include_path = ".:'"${EPREFIX}"'/usr/share/php'${PHP_MV}':'"${EPREFIX}"'/usr/share/php"|' -i "${phpinisrc}" || die
1865 -
1866 - dodir "${PHP_INI_DIR#${EPREFIX}}"
1867 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1868 - newins "${phpinisrc}" php.ini
1869 -
1870 - elog "Installing php.ini for ${phpsapi} into ${PHP_INI_DIR#${EPREFIX}}"
1871 - elog
1872 -
1873 - dodir "${PHP_EXT_INI_DIR#${EPREFIX}}"
1874 - dodir "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}"
1875 -
1876 - if use opcache; then
1877 - elog "Adding opcache to $PHP_EXT_INI_DIR"
1878 - echo "zend_extension=${PHP_DESTDIR}/$(get_libdir)/opcache.so" >> \
1879 - "${D}/${PHP_EXT_INI_DIR}"/opcache.ini
1880 - dosym "${PHP_EXT_INI_DIR#${EPREFIX}}/opcache.ini" \
1881 - "${PHP_EXT_INI_DIR_ACTIVE#${EPREFIX}}/opcache.ini"
1882 - fi
1883 -
1884 - # SAPI-specific handling
1885 - if [[ "${sapi}" == "fpm" ]] ; then
1886 - einfo "Installing FPM config file php-fpm.conf"
1887 - insinto "${PHP_INI_DIR#${EPREFIX}}"
1888 - doins sapi/fpm/php-fpm.conf
1889 - fi
1890 -
1891 - dodoc php.ini-development
1892 - dodoc php.ini-production
1893 -}
1894 -
1895 -php_set_ini_dir() {
1896 - PHP_INI_DIR="${EPREFIX}/etc/php/${1}-php${SLOT}"
1897 - PHP_EXT_INI_DIR="${PHP_INI_DIR}/ext"
1898 - PHP_EXT_INI_DIR_ACTIVE="${PHP_INI_DIR}/ext-active"
1899 -}
1900 -
1901 -src_prepare() {
1902 - # Change PHP branding
1903 - # Get the alpha/beta/rc version
1904 - sed -re "s|^(PHP_EXTRA_VERSION=\").*(\")|\1-pl${PR/r/}-gentoo\2|g" \
1905 - -i configure.in || die "Unable to change PHP branding"
1906 -
1907 - # Patch PHP to show Gentoo as the server platform
1908 - sed -e 's/PHP_UNAME=`uname -a | xargs`/PHP_UNAME=`uname -s -n -r -v | xargs`/g' \
1909 - -i configure.in || die "Failed to fix server platform name"
1910 -
1911 - # Prevent PHP from activating the Apache config,
1912 - # as we will do that ourselves
1913 - sed -i \
1914 - -e "s,-i -a -n php${PHP_MV},-i -n php${PHP_MV},g" \
1915 - -e "s,-i -A -n php${PHP_MV},-i -n php${PHP_MV},g" \
1916 - configure sapi/apache2filter/config.m4 sapi/apache2handler/config.m4 \
1917 - || die
1918 -
1919 - # Patch PHP to support heimdal instead of mit-krb5
1920 - if has_version "app-crypt/heimdal" ; then
1921 - sed -e 's|gssapi_krb5|gssapi|g' -i acinclude.m4 \
1922 - || die "Failed to fix heimdal libname"
1923 - sed -e 's|PHP_ADD_LIBRARY(k5crypto, 1, $1)||g' -i acinclude.m4 \
1924 - || die "Failed to fix heimdal crypt library reference"
1925 - fi
1926 -
1927 - eapply_user
1928 -
1929 - # Force rebuilding aclocal.m4
1930 - rm -f aclocal.m4 || die "failed to remove aclocal.m4 in src_prepare"
1931 - eautoreconf
1932 -
1933 - if [[ ${CHOST} == *-darwin* ]] ; then
1934 - # http://bugs.php.net/bug.php?id=48795, bug #343481
1935 - sed -i -e '/BUILD_CGI="\\$(CC)/s/CC/CXX/' configure || die
1936 - fi
1937 -}
1938 -
1939 -src_configure() {
1940 - addpredict /usr/share/snmp/mibs/.index
1941 - addpredict /var/lib/net-snmp/mib_indexes
1942 -
1943 - PHP_DESTDIR="${EPREFIX}/usr/$(get_libdir)/php${SLOT}"
1944 -
1945 - # The php-fpm config file wants localstatedir to be ${EPREFIX}/var
1946 - # and not the Gentoo default ${EPREFIX}/var/lib. See bug 572002.
1947 - local our_conf=(
1948 - --prefix="${PHP_DESTDIR}"
1949 - --mandir="${PHP_DESTDIR}/man"
1950 - --infodir="${PHP_DESTDIR}/info"
1951 - --libdir="${PHP_DESTDIR}/lib"
1952 - --with-libdir="$(get_libdir)"
1953 - --localstatedir="${EPREFIX}/var"
1954 - --without-pear
1955 - $(use_enable threads maintainer-zts)
1956 - )
1957 -
1958 - our_conf+=(
1959 - $(use_enable bcmath bcmath)
1960 - $(use_with bzip2 bz2 "${EPREFIX}/usr")
1961 - $(use_enable calendar calendar)
1962 - $(use_enable ctype ctype)
1963 - $(use_with curl curl "${EPREFIX}/usr")
1964 - $(use_enable xml dom)
1965 - $(use_with enchant enchant "${EPREFIX}/usr")
1966 - $(use_enable exif exif)
1967 - $(use_enable fileinfo fileinfo)
1968 - $(use_enable filter filter)
1969 - $(use_enable ftp ftp)
1970 - $(use_with nls gettext "${EPREFIX}/usr")
1971 - $(use_with gmp gmp "${EPREFIX}/usr")
1972 - $(use_enable hash hash)
1973 - $(use_with mhash mhash "${EPREFIX}/usr")
1974 - $(use_with iconv iconv \
1975 - $(use elibc_glibc || use elibc_musl || echo "${EPREFIX}/usr"))
1976 - $(use_enable intl intl)
1977 - $(use_enable ipv6 ipv6)
1978 - $(use_enable json json)
1979 - $(use_with kerberos kerberos "${EPREFIX}/usr")
1980 - $(use_enable xml libxml)
1981 - $(use_with xml libxml-dir "${EPREFIX}/usr")
1982 - $(use_enable unicode mbstring)
1983 - $(use_with crypt mcrypt "${EPREFIX}/usr")
1984 - $(use_with mssql mssql "${EPREFIX}/usr")
1985 - $(use_with unicode onig "${EPREFIX}/usr")
1986 - $(use_with ssl openssl "${EPREFIX}/usr")
1987 - $(use_with ssl openssl-dir "${EPREFIX}/usr")
1988 - $(use_enable pcntl pcntl)
1989 - $(use_enable phar phar)
1990 - $(use_enable pdo pdo)
1991 - $(use_enable opcache opcache)
1992 - $(use_with postgres pgsql "${EPREFIX}/usr")
1993 - $(use_enable posix posix)
1994 - $(use_with spell pspell "${EPREFIX}/usr")
1995 - $(use_with recode recode "${EPREFIX}/usr")
1996 - $(use_enable simplexml simplexml)
1997 - $(use_enable sharedmem shmop)
1998 - $(use_with snmp snmp "${EPREFIX}/usr")
1999 - $(use_enable soap soap)
2000 - $(use_enable sockets sockets)
2001 - $(use_with sqlite sqlite3 "${EPREFIX}/usr")
2002 - $(use_with sybase-ct sybase-ct "${EPREFIX}/usr")
2003 - $(use_enable sysvipc sysvmsg)
2004 - $(use_enable sysvipc sysvsem)
2005 - $(use_enable sysvipc sysvshm)
2006 - $(use_with systemd fpm-systemd)
2007 - $(use_with tidy tidy "${EPREFIX}/usr")
2008 - $(use_enable tokenizer tokenizer)
2009 - $(use_enable wddx wddx)
2010 - $(use_enable xml xml)
2011 - $(use_enable xmlreader xmlreader)
2012 - $(use_enable xmlwriter xmlwriter)
2013 - $(use_with xmlrpc xmlrpc)
2014 - $(use_with xslt xsl "${EPREFIX}/usr")
2015 - $(use_enable zip zip)
2016 - $(use_with zlib zlib "${EPREFIX}/usr")
2017 - $(use_enable debug debug)
2018 - )
2019 -
2020 - # DBA support
2021 - if use cdb || use berkdb || use flatfile || use gdbm || use inifile \
2022 - || use qdbm ; then
2023 - our_conf+=( "--enable-dba${shared}" )
2024 - fi
2025 -
2026 - # DBA drivers support
2027 - our_conf+=(
2028 - $(use_with cdb cdb)
2029 - $(use_with berkdb db4 "${EPREFIX}/usr")
2030 - $(use_enable flatfile flatfile)
2031 - $(use_with gdbm gdbm "${EPREFIX}/usr")
2032 - $(use_enable inifile inifile)
2033 - $(use_with qdbm qdbm "${EPREFIX}/usr")
2034 - )
2035 -
2036 - # Support for the GD graphics library
2037 - our_conf+=(
2038 - $(use_with truetype freetype-dir "${EPREFIX}/usr")
2039 - $(use_with truetype t1lib "${EPREFIX}/usr")
2040 - $(use_enable cjk gd-jis-conv)
2041 - $(use_with gd jpeg-dir "${EPREFIX}/usr")
2042 - $(use_with gd png-dir "${EPREFIX}/usr")
2043 - $(use_with xpm xpm-dir "${EPREFIX}/usr")
2044 - $(use_with vpx vpx-dir "${EPREFIX}/usr")
2045 - )
2046 - # enable gd last, so configure can pick up the previous settings
2047 - our_conf+=( $(use_with gd gd) )
2048 -
2049 - # IMAP support
2050 - if use imap ; then
2051 - our_conf+=(
2052 - $(use_with imap imap "${EPREFIX}/usr")
2053 - $(use_with ssl imap-ssl "${EPREFIX}/usr")
2054 - )
2055 - fi
2056 -
2057 - # Interbase/firebird support
2058 - our_conf+=( $(use_with firebird interbase "${EPREFIX}/usr") )
2059 -
2060 - # LDAP support
2061 - if use ldap ; then
2062 - our_conf+=(
2063 - $(use_with ldap ldap "${EPREFIX}/usr")
2064 - $(use_with ldap-sasl ldap-sasl "${EPREFIX}/usr")
2065 - )
2066 - fi
2067 -
2068 - # MySQL support
2069 - local mysqllib="mysqlnd"
2070 - local mysqlilib="mysqlnd"
2071 - use libmysqlclient && mysqllib="${EPREFIX}/usr"
2072 - use libmysqlclient && mysqlilib="${EPREFIX}/usr/bin/mysql_config"
2073 -
2074 - our_conf+=( $(use_with mysql mysql "${mysqllib}") )
2075 - our_conf+=( $(use_with mysqli mysqli "${mysqlilib}") )
2076 -
2077 - local mysqlsock="${EPREFIX}/var/run/mysqld/mysqld.sock"
2078 - if use mysql || use mysqli ; then
2079 - our_conf+=( $(use_with mysql mysql-sock "${mysqlsock}") )
2080 - fi
2081 -
2082 - # ODBC support
2083 - our_conf+=(
2084 - $(use_with odbc unixODBC "${EPREFIX}/usr")
2085 - $(use_with iodbc iodbc "${EPREFIX}/usr")
2086 - )
2087 -
2088 - # Oracle support
2089 - our_conf+=( $(use_with oci8-instant-client oci8) )
2090 -
2091 - # PDO support
2092 - if use pdo ; then
2093 - our_conf+=(
2094 - $(use_with mssql pdo-dblib)
2095 - $(use_with mysql pdo-mysql "${mysqllib}")
2096 - $(use_with postgres pdo-pgsql)
2097 - $(use_with sqlite pdo-sqlite "${EPREFIX}/usr")
2098 - $(use_with firebird pdo-firebird "${EPREFIX}/usr")
2099 - $(use_with odbc pdo-odbc "unixODBC,${EPREFIX}/usr")
2100 - $(use_with oci8-instant-client pdo-oci)
2101 - )
2102 - fi
2103 -
2104 - # readline/libedit support
2105 - our_conf+=(
2106 - $(use_with readline readline "${EPREFIX}/usr")
2107 - $(use_with libedit libedit "${EPREFIX}/usr")
2108 - )
2109 -
2110 - # Session support
2111 - if use session ; then
2112 - our_conf+=( $(use_with sharedmem mm "${EPREFIX}/usr") )
2113 - else
2114 - our_conf+=( $(use_enable session session) )
2115 - fi
2116 -
2117 - # Use pic for shared modules such as apache2's mod_php
2118 - our_conf+=( --with-pic )
2119 -
2120 - # we use the system copy of pcre
2121 - # --with-pcre-regex affects ext/pcre
2122 - # --with-pcre-dir affects ext/filter and ext/zip
2123 - our_conf+=(
2124 - --with-pcre-regex="${EPREFIX}/usr"
2125 - --with-pcre-dir="${EPREFIX}/usr"
2126 - )
2127 -
2128 - # Catch CFLAGS problems
2129 - # Fixes bug #14067.
2130 - # Changed order to run it in reverse for bug #32022 and #12021.
2131 - replace-cpu-flags "k6*" "i586"
2132 -
2133 - # Support user-passed configuration parameters
2134 - our_conf+=( ${EXTRA_ECONF:-} )
2135 -
2136 - # Support the Apache2 extras, they must be set globally for all
2137 - # SAPIs to work correctly, especially for external PHP extensions
2138 -
2139 - mkdir -p "${WORKDIR}/sapis-build" || die
2140 - for one_sapi in $SAPIS ; do
2141 - use "${one_sapi}" || continue
2142 - php_set_ini_dir "${one_sapi}"
2143 -
2144 - # The BUILD_DIR variable is used to determine where to output
2145 - # the files that autotools creates. This was all originally
2146 - # based on the autotools-utils eclass.
2147 - BUILD_DIR="${WORKDIR}/sapis-build/${one_sapi}"
2148 - cp -r "${S}" "${BUILD_DIR}" || die
2149 - cd "${BUILD_DIR}" || die
2150 -
2151 - local sapi_conf=(
2152 - --with-config-file-path="${PHP_INI_DIR}"
2153 - --with-config-file-scan-dir="${PHP_EXT_INI_DIR_ACTIVE}"
2154 - )
2155 -
2156 - for sapi in $SAPIS ; do
2157 - case "$sapi" in
2158 - cli|cgi|embed|fpm)
2159 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2160 - sapi_conf+=( "--enable-${sapi}" )
2161 - else
2162 - sapi_conf+=( "--disable-${sapi}" )
2163 - fi
2164 - ;;
2165 -
2166 - apache2)
2167 - if [[ "${one_sapi}" == "${sapi}" ]] ; then
2168 - sapi_conf+=( --with-apxs2="${EPREFIX}/usr/bin/apxs" )
2169 - else
2170 - sapi_conf+=( --without-apxs2 )
2171 - fi
2172 - ;;
2173 - esac
2174 - done
2175 -
2176 - # Construct the $myeconfargs array by concatenating $our_conf
2177 - # (the common args) and $sapi_conf (the SAPI-specific args).
2178 - local myeconfargs=( "${our_conf[@]}" )
2179 - myeconfargs+=( "${sapi_conf[@]}" )
2180 -
2181 - pushd "${BUILD_DIR}" > /dev/null || die
2182 - econf "${myeconfargs[@]}"
2183 - popd > /dev/null || die
2184 - done
2185 -}
2186 -
2187 -src_compile() {
2188 - # snmp seems to run during src_compile, too (bug #324739)
2189 - addpredict /usr/share/snmp/mibs/.index
2190 - addpredict /var/lib/net-snmp/mib_indexes
2191 -
2192 - for sapi in ${SAPIS} ; do
2193 - if use "${sapi}"; then
2194 - cd "${WORKDIR}/sapis-build/$sapi" || \
2195 - die "Failed to change dir to ${WORKDIR}/sapis-build/$1"
2196 - emake
2197 - fi
2198 - done
2199 -}
2200 -
2201 -src_install() {
2202 - # see bug #324739 for what happens when we don't have that
2203 - addpredict /usr/share/snmp/mibs/.index
2204 -
2205 - # grab the first SAPI that got built and install common files from there
2206 - local first_sapi=""
2207 - for sapi in $SAPIS ; do
2208 - if use $sapi ; then
2209 - first_sapi=$sapi
2210 - break
2211 - fi
2212 - done
2213 -
2214 - # Makefile forgets to create this before trying to write to it...
2215 - dodir "${PHP_DESTDIR#${EPREFIX}}/bin"
2216 -
2217 - # Install php environment (without any sapis)
2218 - cd "${WORKDIR}/sapis-build/$first_sapi" || die
2219 - emake INSTALL_ROOT="${D}" \
2220 - install-build install-headers install-programs
2221 -
2222 - local extension_dir="$("${ED}/${PHP_DESTDIR#${EPREFIX}}/bin/php-config" --extension-dir)"
2223 -
2224 - # Create the directory where we'll put version-specific php scripts
2225 - keepdir "/usr/share/php${PHP_MV}"
2226 -
2227 - local sapi="", file=""
2228 - local sapi_list=""
2229 -
2230 - for sapi in ${SAPIS}; do
2231 - if use "${sapi}" ; then
2232 - einfo "Installing SAPI: ${sapi}"
2233 - cd "${WORKDIR}/sapis-build/${sapi}" || die
2234 -
2235 - if [[ "${sapi}" == "apache2" ]] ; then
2236 - # We're specifically not using emake install-sapi as libtool
2237 - # may cause unnecessary relink failures (see bug #351266)
2238 - insinto "${PHP_DESTDIR#${EPREFIX}}/apache2/"
2239 - newins ".libs/libphp5$(get_libname)" \
2240 - "libphp${PHP_MV}$(get_libname)"
2241 - keepdir "/usr/$(get_libdir)/apache2/modules"
2242 - else
2243 - # needed each time, php_install_ini would reset it
2244 - local dest="${PHP_DESTDIR#${EPREFIX}}"
2245 - into "${dest}"
2246 - case "$sapi" in
2247 - cli)
2248 - source="sapi/cli/php"
2249 - ;;
2250 - cgi)
2251 - source="sapi/cgi/php-cgi"
2252 - ;;
2253 - fpm)
2254 - source="sapi/fpm/php-fpm"
2255 - ;;
2256 - embed)
2257 - source="libs/libphp${PHP_MV}$(get_libname)"
2258 - ;;
2259 - *)
2260 - die "unhandled sapi in src_install"
2261 - ;;
2262 - esac
2263 -
2264 - if [[ "${source}" == *"$(get_libname)" ]]; then
2265 - dolib.so "${source}"
2266 - else
2267 - dobin "${source}"
2268 - local name="$(basename ${source})"
2269 - dosym "${dest}/bin/${name}" "/usr/bin/${name}${SLOT}"
2270 - fi
2271 - fi
2272 -
2273 - php_install_ini "${sapi}"
2274 -
2275 - # construct correct SAPI string for php-config
2276 - # thanks to ferringb for the bash voodoo
2277 - if [[ "${sapi}" == "apache2" ]]; then
2278 - sapi_list="${sapi_list:+${sapi_list} }apache2handler"
2279 - else
2280 - sapi_list="${sapi_list:+${sapi_list} }${sapi}"
2281 - fi
2282 - fi
2283 - done
2284 -
2285 - # Installing opcache module
2286 - if use opcache ; then
2287 - into "${PHP_DESTDIR#${EPREFIX}}"
2288 - dolib.so "modules/opcache$(get_libname)"
2289 - fi
2290 -
2291 - # Install env.d files
2292 - newenvd "${FILESDIR}/20php5-envd" "20php${SLOT}"
2293 - sed -e "s|/lib/|/$(get_libdir)/|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2294 - sed -e "s|php5|php${SLOT}|g" -i "${ED}/etc/env.d/20php${SLOT}" || die
2295 -
2296 - # set php-config variable correctly (bug #278439)
2297 - sed -e "s:^\(php_sapis=\)\".*\"$:\1\"${sapi_list}\":" -i \
2298 - "${ED}/usr/$(get_libdir)/php${SLOT}/bin/php-config" || die
2299 -
2300 - if use fpm ; then
2301 - if use systemd; then
2302 - systemd_newunit "${FILESDIR}/php-fpm_at.service" \
2303 - "php-fpm@${SLOT}.service"
2304 - else
2305 - systemd_newunit "${FILESDIR}/php-fpm_at-simple.service" \
2306 - "php-fpm@${SLOT}.service"
2307 - fi
2308 - fi
2309 -}
2310 -
2311 -src_test() {
2312 - echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
2313 - PHP_BIN="${WORKDIR}/sapis-build/cli/sapi/cli/php"
2314 - if [[ ! -x "${PHP_BIN}" ]] ; then
2315 - ewarn "Test phase requires USE=cli, skipping"
2316 - return
2317 - else
2318 - export TEST_PHP_EXECUTABLE="${PHP_BIN}"
2319 - fi
2320 -
2321 - if [[ -x "${WORKDIR}/sapis/cgi/php-cgi" ]] ; then
2322 - export TEST_PHP_CGI_EXECUTABLE="${WORKDIR}/sapis/cgi/php-cgi"
2323 - fi
2324 -
2325 - REPORT_EXIT_STATUS=1 "${TEST_PHP_EXECUTABLE}" -n -d \
2326 - "session.save_path=${T}" \
2327 - "${WORKDIR}/sapis-build/cli/run-tests.php" -n -q -d \
2328 - "session.save_path=${T}"
2329 -
2330 - for name in ${EXPECTED_TEST_FAILURES}; do
2331 - mv "${name}.out" "${name}.out.orig" 2>/dev/null || die
2332 - done
2333 -
2334 - local failed="$(find -name '*.out')"
2335 - if [[ ${failed} != "" ]] ; then
2336 - ewarn "The following test cases failed unexpectedly:"
2337 - for name in ${failed}; do
2338 - ewarn " ${name/.out/}"
2339 - done
2340 - else
2341 - einfo "No unexpected test failures, all fine"
2342 - fi
2343 -
2344 - if [[ ${PHP_SHOW_UNEXPECTED_TEST_PASS} == "1" ]] ; then
2345 - local passed=""
2346 - for name in ${EXPECTED_TEST_FAILURES}; do
2347 - [[ -f "${name}.diff" ]] && continue
2348 - passed="${passed} ${name}"
2349 - done
2350 - if [[ ${passed} != "" ]] ; then
2351 - einfo "The following test cases passed unexpectedly:"
2352 - for name in ${passed}; do
2353 - ewarn " ${passed}"
2354 - done
2355 - else
2356 - einfo "None of the known-to-fail tests passed, all fine"
2357 - fi
2358 - fi
2359 -}
2360 -
2361 -pkg_postinst() {
2362 - # Output some general info to the user
2363 - if use apache2 ; then
2364 - elog
2365 - elog "To enable PHP in apache, you will need to add \"-D PHP\" to"
2366 - elog "your apache2 command. OpenRC users can append that string to"
2367 - elog "APACHE2_OPTS in /etc/conf.d/apache2."
2368 - elog
2369 - elog "The apache module configuration file 70_mod_php.conf is"
2370 - elog "provided (and maintained) by eselect-php."
2371 - elog
2372 - fi
2373 -
2374 - # Create the symlinks for php
2375 - for m in ${SAPIS}; do
2376 - [[ ${m} == 'embed' ]] && continue;
2377 - if use $m ; then
2378 - local ci=$(eselect php show $m)
2379 - if [[ -z $ci ]]; then
2380 - eselect php set $m php${SLOT} || die
2381 - einfo "Switched ${m} to use php:${SLOT}"
2382 - einfo
2383 - elif [[ $ci != "php${SLOT}" ]] ; then
2384 - elog "To switch $m to use php:${SLOT}, run"
2385 - elog " eselect php set $m php${SLOT}"
2386 - elog
2387 - fi
2388 - fi
2389 - done
2390 -
2391 - # Remove dead symlinks for SAPIs that were just disabled. For
2392 - # example, if the user has the cgi SAPI enabled, then he has an
2393 - # eselect-php symlink for it. If he later reinstalls PHP with
2394 - # USE="-cgi", that symlink will break. This call to eselect is
2395 - # supposed to remove that dead link per bug 572436.
2396 - eselect php cleanup || die
2397 -
2398 - if ! has "php${SLOT/./-}" ${PHP_TARGETS}; then
2399 - elog "To build extensions for this version of PHP, you will need to"
2400 - elog "add php${SLOT/./-} to your PHP_TARGETS USE_EXPAND variable."
2401 - elog
2402 - fi
2403 -
2404 - # Only mention PHP_INI_VERSION if the user doesn't have it set.
2405 - case "${PHP_INI_VERSION}" in
2406 - production|development)
2407 - ;;
2408 - *)
2409 - elog "This ebuild installed a version of php.ini based on"
2410 - elog "${PHP_INI_UPSTREAM}. You can choose which version of"
2411 - elog "php.ini to install by default by setting PHP_INI_VERSION"
2412 - elog "to either 'production' or 'development' in your make.conf."
2413 - elog "Both versions of php.ini can be found with the PHP docs in"
2414 - elog "${EPREFIX}/usr/share/doc/${PF}"
2415 - elog
2416 - ;;
2417 - esac
2418 -
2419 - elog "For details on how version slotting works, please see"
2420 - elog "the wiki:"
2421 - elog
2422 - elog " https://wiki.gentoo.org/wiki/PHP"
2423 - elog
2424 -}
2425 -
2426 -pkg_postrm() {
2427 - # This serves two purposes. First, if we have just removed the last
2428 - # installed version of PHP, then this will remove any dead symlinks
2429 - # belonging to eselect-php. Second, if a user upgrades slots from
2430 - # (say) 5.6 to 7.0 and depcleans the old slot, then this will update
2431 - # his existing symlinks to point to the new 7.0 installation. The
2432 - # latter is bug 432962.
2433 - #
2434 - # Note: the eselect-php package may not be installed at this point,
2435 - # so we can't die() if this command fails.
2436 - eselect php cleanup
2437 -}