/[gentoo-x86]/dev-lang/php/php-5.3.9_rc3.ebuild
Gentoo

Contents of /dev-lang/php/php-5.3.9_rc3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Thu Jan 26 15:17:15 2012 UTC (2 years, 6 months ago) by olemarkus
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
Removed older versions

(Portage version: 2.1.10.41/cvs/Linux x86_64)

1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-lang/php/php-5.3.9_rc3.ebuild,v 1.3 2011/12/17 19:25:19 olemarkus Exp $
4
5 EAPI=4
6
7 PHPCONFUTILS_MISSING_DEPS="adabas birdstep db2 dbmaker empress empress-bcs esoob interbase oci8 sapdb solid"
8
9 inherit eutils autotools flag-o-matic versionator depend.apache apache-module db-use libtool
10
11 SUHOSIN_VERSION="5.3.7-0.9.10"
12 FPM_VERSION="builtin"
13 EXPECTED_TEST_FAILURES=""
14
15 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
16
17 function php_get_uri ()
18 {
19 case "${1}" in
20 "php-pre")
21 echo "http://downloads.php.net/johannes/${2}"
22 ;;
23 "php")
24 echo "http://www.php.net/distributions/${2}"
25 ;;
26 "suhosin")
27 echo "http://download.suhosin.org/${2}"
28 ;;
29 "olemarkus")
30 echo "http://olemarkus.org/~olemarkus/gentoo/${2}"
31 ;;
32 "gentoo")
33 echo "mirror://gentoo/${2}"
34 ;;
35 *)
36 die "unhandled case in php_get_uri"
37 ;;
38 esac
39 }
40
41 PHP_MV="$(get_major_version)"
42
43 # alias, so we can handle different types of releases (finals, rcs, alphas,
44 # betas, ...) w/o changing the whole ebuild
45 PHP_PV="${PV/_rc/RC}"
46 PHP_RELEASE="php-pre"
47 PHP_P="${PN}-${PHP_PV}"
48
49 PHP_PATCHSET_LOC="olemarkus"
50
51 PHP_SRC_URI="$(php_get_uri "${PHP_RELEASE}" "${PHP_P}.tar.bz2")"
52
53 PHP_PATCHSET="0"
54 PHP_PATCHSET_URI="
55 $(php_get_uri "${PHP_PATCHSET_LOC}" "php-patchset-${PV}-r${PHP_PATCHSET}.tar.bz2")"
56
57 PHP_FPM_INIT_VER="4"
58 PHP_FPM_CONF_VER="1"
59
60 if [[ ${SUHOSIN_VERSION} == *-gentoo ]]; then
61 # in some cases we use our own suhosin patch (very recent version,
62 # patch conflicts, etc.)
63 SUHOSIN_TYPE="gentoo"
64 else
65 SUHOSIN_TYPE="suhosin"
66 fi
67
68 if [[ -n ${SUHOSIN_VERSION} ]]; then
69 SUHOSIN_PATCH="suhosin-patch-${SUHOSIN_VERSION}.patch";
70 SUHOSIN_URI="$(php_get_uri ${SUHOSIN_TYPE} ${SUHOSIN_PATCH}.gz )"
71 fi
72
73 SRC_URI="
74 ${PHP_SRC_URI}
75 ${PHP_PATCHSET_URI}"
76
77 if [[ -n ${SUHOSIN_VERSION} ]]; then
78 SRC_URI="${SRC_URI}
79 suhosin? ( ${SUHOSIN_URI} )"
80 fi
81
82 DESCRIPTION="The PHP language runtime engine: CLI, CGI, FPM/FastCGI, Apache2 and embed SAPIs."
83 HOMEPAGE="http://php.net/"
84 LICENSE="PHP-3"
85
86 SLOT="$(get_version_component_range 1-2)"
87 S="${WORKDIR}/${PHP_P}"
88
89 # We can build the following SAPIs in the given order
90 SAPIS="embed cli cgi fpm apache2"
91
92 # Gentoo-specific, common features
93 IUSE="kolab"
94
95 # SAPIs and SAPI-specific USE flags (cli SAPI is default on):
96 IUSE="${IUSE}
97 ${SAPIS/cli/+cli}
98 threads"
99
100 IUSE="${IUSE} bcmath berkdb bzip2 calendar cdb cjk
101 crypt +ctype curl curlwrappers debug doc
102 enchant exif frontbase +fileinfo +filter firebird
103 flatfile ftp gd gdbm gmp +hash +iconv imap inifile
104 intl iodbc ipv6 +json kerberos ldap ldap-sasl libedit mhash
105 mssql mysql mysqlnd mysqli nls
106 oci8-instant-client odbc pcntl pdo +phar pic +posix postgres qdbm
107 readline recode +session sharedmem
108 +simplexml snmp soap sockets spell sqlite sqlite3 ssl
109 sybase-ct sysvipc tidy +tokenizer truetype unicode wddx
110 +xml xmlreader xmlwriter xmlrpc xpm xsl zip zlib"
111
112 # Enable suhosin if available
113 [[ -n $SUHOSIN_VERSION ]] && IUSE="${IUSE} suhosin"
114
115 DEPEND="!dev-lang/php:5
116 >=app-admin/eselect-php-0.6.2
117 >=dev-libs/libpcre-8.12[unicode]
118 apache2? ( www-servers/apache[threads=] )
119 berkdb? ( =sys-libs/db-4* )
120 bzip2? ( app-arch/bzip2 )
121 cdb? ( || ( dev-db/cdb dev-db/tinycdb ) )
122 cjk? ( !gd? (
123 virtual/jpeg
124 media-libs/libpng
125 sys-libs/zlib
126 ) )
127 crypt? ( >=dev-libs/libmcrypt-2.4 )
128 curl? ( >=net-misc/curl-7.10.5 )
129 enchant? ( app-text/enchant )
130 exif? ( !gd? (
131 virtual/jpeg
132 media-libs/libpng
133 sys-libs/zlib
134 ) )
135 firebird? ( dev-db/firebird )
136 gd? ( virtual/jpeg media-libs/libpng sys-libs/zlib )
137 gdbm? ( >=sys-libs/gdbm-1.8.0 )
138 gmp? ( >=dev-libs/gmp-4.1.2 )
139 iconv? ( virtual/libiconv )
140 imap? ( virtual/imap-c-client[ssl=] )
141 intl? ( dev-libs/icu )
142 iodbc? ( dev-db/libiodbc )
143 kerberos? ( virtual/krb5 )
144 kolab? ( >=net-libs/c-client-2004g-r1 )
145 ldap? ( >=net-nds/openldap-1.2.11 )
146 ldap-sasl? ( dev-libs/cyrus-sasl >=net-nds/openldap-1.2.11 )
147 libedit? ( || ( sys-freebsd/freebsd-lib dev-libs/libedit ) )
148 mssql? ( dev-db/freetds[mssql] )
149 !mysqlnd? (
150 mysql? ( virtual/mysql )
151 mysqli? ( >=virtual/mysql-4.1 )
152 )
153 nls? ( sys-devel/gettext )
154 oci8-instant-client? ( dev-db/oracle-instantclient-basic )
155 odbc? ( >=dev-db/unixODBC-1.8.13 )
156 postgres? ( dev-db/postgresql-base )
157 qdbm? ( dev-db/qdbm )
158 readline? ( sys-libs/readline )
159 recode? ( app-text/recode )
160 sharedmem? ( dev-libs/mm )
161 simplexml? ( >=dev-libs/libxml2-2.6.8 )
162 snmp? ( >=net-analyzer/net-snmp-5.2 )
163 soap? ( >=dev-libs/libxml2-2.6.8 )
164 spell? ( >=app-text/aspell-0.50 )
165 sqlite? ( =dev-db/sqlite-2* pdo? ( >=dev-db/sqlite-3.7.7.1 ) )
166 sqlite3? ( >=dev-db/sqlite-3.7.7.1 )
167 ssl? ( >=dev-libs/openssl-0.9.7 )
168 sybase-ct? ( dev-db/freetds )
169 tidy? ( app-text/htmltidy )
170 truetype? (
171 =media-libs/freetype-2*
172 >=media-libs/t1lib-5.0.0
173 !gd? (
174 virtual/jpeg media-libs/libpng sys-libs/zlib )
175 )
176 unicode? ( dev-libs/oniguruma )
177 wddx? ( >=dev-libs/libxml2-2.6.8 )
178 xml? ( >=dev-libs/libxml2-2.6.8 )
179 xmlrpc? ( >=dev-libs/libxml2-2.6.8 virtual/libiconv )
180 xmlreader? ( >=dev-libs/libxml2-2.6.8 )
181 xmlwriter? ( >=dev-libs/libxml2-2.6.8 )
182 xpm? (
183 x11-libs/libXpm
184 virtual/jpeg
185 media-libs/libpng sys-libs/zlib
186 )
187 xsl? ( dev-libs/libxslt >=dev-libs/libxml2-2.6.8 )
188 zip? ( sys-libs/zlib )
189 zlib? ( sys-libs/zlib )
190 virtual/mta
191 "
192
193 php="=${CATEGORY}/${PF}"
194
195 REQUIRED_USE="
196 truetype? ( gd )
197 cjk? ( gd )
198 exif? ( gd )
199
200 xpm? ( gd )
201 gd? ( zlib )
202 simplexml? ( xml )
203 soap? ( xml )
204 wddx? ( xml )
205 xmlrpc? ( || ( xml iconv ) )
206 xmlreader? ( xml )
207 xsl? ( xml )
208 ldap-sasl? ( ldap )
209 kolab? ( imap )
210 mhash? ( hash )
211 phar? ( hash )
212 mysqlnd? ( || (
213 mysql
214 mysqli
215 pdo
216 ) )
217
218 qdbm? ( !gdbm )
219 readline? ( !libedit )
220 recode? ( !imap !mysql !mysqli )
221 sharedmem? ( !threads )
222
223 !cli? ( !cgi? ( !fpm? ( !apache2? ( !embed? ( cli ) ) ) ) )"
224
225 DEPEND="${DEPEND}
226 enchant? ( !dev-php5/pecl-enchant )
227 fileinfo? ( !<dev-php5/pecl-fileinfo-1.0.4-r2 )
228 filter? ( !dev-php5/pecl-filter )
229 json? ( !dev-php5/pecl-json )
230 phar? ( !dev-php5/pecl-phar )
231 zip? ( !dev-php5/pecl-zip )"
232
233 [[ -n $SUHOSIN_VERSION ]] && RDEPEND="${RDEPEND} suhosin? (
234 =${CATEGORY}/${PN}-${SLOT}*[unicode] )"
235
236 RDEPEND="${DEPEND}"
237
238 DEPEND="${DEPEND}
239 sys-devel/flex
240 >=sys-devel/m4-1.4.3
241 >=sys-devel/libtool-1.5.18"
242
243 # They are in PDEPEND because we need PHP installed first!
244 PDEPEND="doc? ( app-doc/php-docs )"
245
246 # No longer depend on the extension. The suhosin USE flag only installs the
247 # patch
248 #[[ -n $SUHOSIN_VERSION ]] && PDEPEND="${PDEPEND} suhosin? ( dev-php${PHP_MV}/suhosin )"
249
250 # Allow users to install production version if they want to
251
252 case "${PHP_INI_VERSION}" in
253 production|development)
254 ;;
255 *)
256 PHP_INI_VERSION="development"
257 ;;
258 esac
259
260 PHP_INI_UPSTREAM="php.ini-${PHP_INI_VERSION}"
261 PHP_INI_FILE="php.ini"
262
263 want_apache
264
265 # eblit-core
266 # Usage: <function> [version] [eval]
267 # Main eblit engine
268 eblit-core() {
269 [[ -z $FILESDIR ]] && FILESDIR="$(dirname $EBUILD)/files"
270 local e v func=$1 ver=$2 eval_=$3
271 for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
272 e="${FILESDIR}/eblits/${func}${v}.eblit"
273 if [[ -e ${e} ]] ; then
274 . "${e}"
275 [[ ${eval_} == 1 ]] && eval "${func}() { eblit-run ${func} ${ver} ; }"
276 return 0
277 fi
278 done
279 return 1
280 }
281
282 # eblit-include
283 # Usage: [--skip] <function> [version]
284 # Includes an "eblit" -- a chunk of common code among ebuilds in a given
285 # package so that its functions can be sourced and utilized within the
286 # ebuild.
287 eblit-include() {
288 local skipable=false r=0
289 [[ $1 == "--skip" ]] && skipable=true && shift
290 [[ $1 == pkg_* ]] && skipable=true
291
292 [[ -z $1 ]] && die "Usage: eblit-include <function> [version]"
293 eblit-core $1 $2
294 r="$?"
295 ${skipable} && return 0
296 [[ "$r" -gt "0" ]] && die "Could not locate requested eblit '$1' in ${FILESDIR}/eblits/"
297 }
298
299 # eblit-run-maybe
300 # Usage: <function>
301 # Runs a function if it is defined in an eblit
302 eblit-run-maybe() {
303 [[ $(type -t "$@") == "function" ]] && "$@"
304 }
305
306 # eblit-run
307 # Usage: <function> [version]
308 # Runs a function defined in an eblit
309 eblit-run() {
310 eblit-include --skip common "v2"
311 eblit-include "$@"
312 eblit-run-maybe eblit-$1-pre
313 eblit-${PN}-$1
314 eblit-run-maybe eblit-$1-post
315 }
316
317 # eblit-pkg
318 # Usage: <phase> [version]
319 # Includes the given functions AND evals them so they're included in the binpkgs
320 eblit-pkg() {
321 [[ -z $1 ]] && die "Usage: eblit-pkg <phase> [version]"
322 eblit-core $1 $2 1
323 }
324
325 eblit-pkg pkg_setup v3
326
327 src_prepare() { eblit-run src_prepare v3 ; }
328 src_configure() { eblit-run src_configure v53 ; }
329 src_compile() { eblit-run src_compile v1 ; }
330 src_install() { eblit-run src_install v3 ; }
331 src_test() { eblit-run src_test v1 ; }
332
333 #Do not use eblit for this because it will not get sourced when installing from
334 #binary package (bug #380845)
335 pkg_postinst() {
336 # Output some general info to the user
337 if use apache2 ; then
338 APACHE2_MOD_DEFINE="PHP5"
339 APACHE2_MOD_CONF="70_mod_php5"
340 apache-module_pkg_postinst
341 fi
342
343 # Create the symlinks for php
344 for m in ${SAPIS}; do
345 [[ ${m} == 'embed' ]] && continue;
346 if use $m ; then
347 local ci=$(eselect php show $m)
348 if [[ -z $ci ]]; then
349 eselect php set $m php${SLOT}
350 einfo "Switched ${m} to use php:${SLOT}"
351 einfo
352 elif [[ $ci != "php${SLOT}" ]] ; then
353 elog "To switch $m to use php:${SLOT}, run"
354 elog " eselect php set $m php${SLOT}"
355 elog
356 fi
357 fi
358 done
359
360 elog "Make sure that PHP_TARGETS in /etc/make.conf includes php${SLOT/./-} in order"
361 elog "to compile extensions for the ${SLOT} ABI"
362 elog
363 if ! use readline && use cli ; then
364 ewarn "Note that in order to use php interactivly, you need to enable"
365 ewarn "the readline USE flag or php -a will hang"
366 fi
367 elog
368 elog "This ebuild installed a version of php.ini based on php.ini-${PHP_INI_VERSION} version."
369 elog "You can chose which version of php.ini to install by default by setting PHP_INI_VERSION to either"
370 elog "'production' or 'development' in /etc/make.conf"
371 ewarn "Both versions of php.ini can be found in /usr/share/doc/${PF}"
372
373 # check for not yet migrated old style config dirs
374 ls "${ROOT}"/etc/php/*-php5 &>/dev/null
375 if [[ $? -eq 0 ]]; then
376 ewarn "Make sure to migrate your config files, starting with php-5.3.4 and php-5.2.16 config"
377 ewarn "files are now kept at ${ROOT}etc/php/{apache2,cli,cgi,fpm}-php5.x"
378 fi
379 elog
380 elog "For more details on how minor version slotting works (PHP_TARGETS) please read the upgrade guide:"
381 elog "http://www.gentoo.org/proj/en/php/php-upgrading.xml"
382 elog
383
384 if ( [[ -z SUHOSIN_VERSION ]] && use suhosin && version_is_at_least 5.3.6_rc1 ) ; then
385 ewarn "The suhosin USE flag now only installs the suhosin patch!"
386 ewarn "If you want the suhosin extension, make sure you install"
387 ewarn " dev-php5/suhosin"
388 ewarn
389 fi
390 }

  ViewVC Help
Powered by ViewVC 1.1.20