Gentoo Archives: gentoo-commits

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