Gentoo Archives: gentoo-commits

From: Marius Brehler <marbre@××××××××××××××.de>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: eclass/
Date: Fri, 24 Feb 2017 14:14:19
Message-Id: 1487945581.2e0e40872ac17823e19daeb038e53699a287c200.marbre@gentoo
1 commit: 2e0e40872ac17823e19daeb038e53699a287c200
2 Author: Marius Brehler <marbre <AT> linux <DOT> sungazer <DOT> de>
3 AuthorDate: Fri Feb 24 14:13:01 2017 +0000
4 Commit: Marius Brehler <marbre <AT> linux <DOT> sungazer <DOT> de>
5 CommitDate: Fri Feb 24 14:13:01 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=2e0e4087
7
8 Revert "depend.php.eclass: Import from main tree, required by ganglia_jobmonarch"
9
10 This reverts commit 1c70956ce252680df94134953d0c4dae97223cc9.
11
12 eclass/depend.php.eclass | 258 -----------------------------------------------
13 1 file changed, 258 deletions(-)
14
15 diff --git a/eclass/depend.php.eclass b/eclass/depend.php.eclass
16 deleted file mode 100644
17 index c29cda22c..000000000
18 --- a/eclass/depend.php.eclass
19 +++ /dev/null
20 @@ -1,258 +0,0 @@
21 -# Copyright 1999-2015 Gentoo Foundation
22 -# Distributed under the terms of the GNU General Public License v2
23 -# $Id$
24 -
25 -# @DEAD
26 -# @ECLASS: depend.php.eclass
27 -# @MAINTAINER:
28 -# Gentoo PHP team <php-bugs@g.o>
29 -# @AUTHOR:
30 -# Author: Stuart Herbert <stuart@g.o>
31 -# Author: Luca Longinotti <chtekk@g.o>
32 -# Author: Jakub Moc <jakub@g.o> (documentation)
33 -# @BLURB: Functions to allow ebuilds to depend on php5 and check for specific features.
34 -# @DESCRIPTION:
35 -# This eclass provides functions that allow ebuilds to depend on php5 and check
36 -# for specific PHP features, SAPIs etc. Also provides dodoc-php wrapper to install
37 -# documentation for PHP packages to php-specific location.
38 -# This eclass is deprecated and is set to be removed 30 days after bug 552836 is resolved
39 -
40 -inherit eutils multilib
41 -
42 -# PHP5-only depend functions
43 -
44 -# @FUNCTION: need_php5
45 -# @DESCRIPTION:
46 -# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP5
47 -# (with any SAPI).
48 -need_php5() {
49 - DEPEND="${DEPEND} =dev-lang/php-5*"
50 - RDEPEND="${RDEPEND} =dev-lang/php-5*"
51 - PHP_VERSION="5"
52 - PHP_SHARED_CAT="php5"
53 -}
54 -
55 -# common settings go in here
56 -uses_php5() {
57 - # cache this
58 - libdir=$(get_libdir)
59 -
60 - PHPIZE="/usr/${libdir}/php5/bin/phpize"
61 - PHPCONFIG="/usr/${libdir}/php5/bin/php-config"
62 - PHPCLI="/usr/${libdir}/php5/bin/php"
63 - PHPCGI="/usr/${libdir}/php5/bin/php-cgi"
64 - PHP_PKG="$(best_version =dev-lang/php-5*)"
65 - PHPPREFIX="/usr/${libdir}/php5"
66 - EXT_DIR="$(${PHPCONFIG} --extension-dir 2>/dev/null)"
67 -
68 - einfo
69 - einfo "Using ${PHP_PKG}"
70 - einfo
71 -}
72 -
73 -# general PHP depend functions
74 -
75 -# @FUNCTION: need_php_httpd
76 -# @DESCRIPTION:
77 -# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP
78 -# (any version) with either cgi or apache2 SAPI.
79 -need_php_httpd() {
80 - DEPEND="${DEPEND} virtual/httpd-php"
81 - RDEPEND="${RDEPEND} virtual/httpd-php"
82 -}
83 -
84 -# @FUNCTION: need_php
85 -# @DESCRIPTION:
86 -# Set this after setting DEPEND/RDEPEND in your ebuild if the ebuild requires PHP
87 -# (any version with any SAPI).
88 -need_php() {
89 - DEPEND="${DEPEND} dev-lang/php"
90 - RDEPEND="${RDEPEND} dev-lang/php"
91 - PHP_SHARED_CAT="php"
92 -}
93 -
94 -# @FUNCTION: has_php
95 -# @DESCRIPTION:
96 -# Call this function from your pkg_setup, src_compile, src_install etc. if you
97 -# need to know which PHP version is being used and where the PHP binaries/data
98 -# are installed.
99 -has_php() {
100 - # Detect which PHP version we have installed
101 - if has_version '=dev-lang/php-5*' ; then
102 - PHP_VERSION="5"
103 - else
104 - die "Unable to find an installed dev-lang/php package"
105 - fi
106 -
107 - # If we get here, then PHP_VERSION tells us which version of PHP we
108 - # want to use
109 - uses_php${PHP_VERSION}
110 -}
111 -
112 -# @FUNCTION: require_php_with_use
113 -# @USAGE: <list of USE flags>
114 -# @DESCRIPTION:
115 -# Call this function from pkg_setup if your package requires PHP compiled
116 -# with specific USE flags. Returns if all of the listed USE flags are enabled.
117 -# Dies if any of the listed USE flags are disabled.
118 -
119 -# @VARIABLE: PHPCHECKNODIE
120 -# @DESCRIPTION:
121 -# You can set PHPCHECKNODIE to non-empty value in your ebuild to chain multiple
122 -# require_php_with_(any)_use checks without making the ebuild die on every failure.
123 -# This is useful in cases when certain PHP features are only required if specific
124 -# USE flag(s) are enabled for that ebuild.
125 -# @CODE
126 -# Example:
127 -#
128 -# local flags="pcre session snmp sockets wddx"
129 -# use mysql && flags="${flags} mysql"
130 -# use postgres && flags="${flags} postgres"
131 -# if ! PHPCHECKNODIE="yes" require_php_with_use ${flags} \
132 -# || ! PHPCHECKNODIE="yes" require_php_with_any_use gd gd-external ; then
133 -# die "Re-install ${PHP_PKG} with ${flags} and either gd or gd-external"
134 -# fi
135 -# @CODE
136 -require_php_with_use() {
137 - has_php
138 -
139 - local missing_use=""
140 - local x
141 -
142 - einfo "Checking for required PHP feature(s) ..."
143 -
144 - for x in $@ ; do
145 - case $x in
146 - pcre|spl|reflection|mhash)
147 - eqawarn "require_php_with_use MUST NOT check for the pcre, spl, mhash or reflection USE flag."
148 - eqawarn "These USE flags are removed from >=dev-lang/php-5.3 and your ebuild will break"
149 - eqawarn "if you check the USE flags against PHP 5.3 ebuilds."
150 - eqawarn "Please use USE dependencies from EAPI 2 instead"
151 - ;;
152 - esac
153 -
154 - if ! built_with_use =${PHP_PKG} ${x} ; then
155 - einfo " Discovered missing USE flag: ${x}"
156 - missing_use="${missing_use} ${x}"
157 - fi
158 - done
159 -
160 - if [[ -z "${missing_use}" ]] ; then
161 - if [[ -z "${PHPCHECKNODIE}" ]] ; then
162 - return
163 - else
164 - return 0
165 - fi
166 - fi
167 -
168 - if [[ -z "${PHPCHECKNODIE}" ]] ; then
169 - eerror
170 - eerror "${PHP_PKG} needs to be re-installed with all of the following"
171 - eerror "USE flags enabled:"
172 - eerror
173 - eerror " $@"
174 - eerror
175 - die "Missing PHP USE flags found"
176 - else
177 - return 1
178 - fi
179 -}
180 -
181 -
182 -# ========================================================================
183 -# require_*() functions
184 -#
185 -# These functions die() if PHP was built without the required features
186 -# ========================================================================
187 -
188 -# @FUNCTION: require_php_cgi
189 -# @DESCRIPTION:
190 -# Determines which installed PHP version has the CGI SAPI enabled.
191 -# Useful for anything which needs to run PHP scripts depending on the CGI SAPI.
192 -# @RETURN: die if feature is missing
193 -require_php_cgi() {
194 - # If PHP_PKG is set, then we have remembered our PHP settings
195 - # from last time
196 - if [[ -n ${PHP_PKG} ]] ; then
197 - return
198 - fi
199 -
200 - local PHP_PACKAGE_FOUND=""
201 -
202 - if has_version '=dev-lang/php-5*' ; then
203 - PHP_PACKAGE_FOUND="1"
204 - pkg="$(best_version '=dev-lang/php-5*')"
205 - if built_with_use =${pkg} cgi ; then
206 - PHP_VERSION="5"
207 - fi
208 - fi
209 -
210 - if [[ -z ${PHP_PACKAGE_FOUND} ]] ; then
211 - die "Unable to find an installed dev-lang/php package"
212 - fi
213 -
214 - if [[ -z ${PHP_VERSION} ]] ; then
215 - die "No PHP CGI installed. Re-emerge dev-lang/php with USE=cgi."
216 - fi
217 -
218 - # If we get here, then PHP_VERSION tells us which version of PHP we
219 - # want to use
220 - uses_php${PHP_VERSION}
221 -}
222 -
223 -# ========================================================================
224 -# Misc functions
225 -#
226 -# These functions provide miscellaneous checks and functionality.
227 -# ========================================================================
228 -
229 -# @FUNCTION: dodoc-php
230 -# @USAGE: <list of docs>
231 -# @DESCRIPTION:
232 -# Alternative to dodoc function for use in our PHP eclasses and ebuilds.
233 -# Stored here because depend.php gets always sourced everywhere in the PHP
234 -# ebuilds and eclasses. It simply is dodoc with a changed path to the docs.
235 -# NOTE: No support for docinto is provided!
236 -dodoc-php() {
237 -if [[ $# -lt 1 ]] ; then
238 - echo "$0: at least one argument needed" 1>&2
239 - exit 1
240 -fi
241 -
242 -phpdocdir="/usr/share/doc/${CATEGORY}/${PF}/"
243 -
244 -for x in $@ ; do
245 - if [[ -s "${x}" ]] ; then
246 - insinto "${phpdocdir}"
247 - doins "${x}"
248 - gzip -f -9 "${D}/${phpdocdir}/${x##*/}"
249 - elif [[ ! -e "${x}" ]] ; then
250 - echo "dodoc-php: ${x} does not exist" 1>&2
251 - fi
252 -done
253 -}
254 -
255 -# @FUNCTION: dohtml-php
256 -# @USAGE: <list of html docs>
257 -# @DESCRIPTION:
258 -# Alternative to dohtml function for use in our PHP eclasses and ebuilds.
259 -# Stored here because depend.php gets always sourced everywhere in the PHP
260 -# ebuilds and eclasses. It simply is dohtml with a changed path to the docs.
261 -# NOTE: No support for [-a|-A|-p|-x] options is provided!
262 -dohtml-php() {
263 -if [[ $# -lt 1 ]] ; then
264 - echo "$0: at least one argument needed" 1>&2
265 - exit 1
266 -fi
267 -
268 -phphtmldir="/usr/share/doc/${CATEGORY}/${PF}/html"
269 -
270 -for x in $@ ; do
271 - if [[ -s "${x}" ]] ; then
272 - insinto "${phphtmldir}"
273 - doins "${x}"
274 - elif [[ ! -e "${x}" ]] ; then
275 - echo "dohtml-php: ${x} does not exist" 1>&2
276 - fi
277 -done
278 -}