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

Contents of /dev-lang/php/php-5.3.16.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Tue Sep 4 10:00:01 2012 UTC (8 months, 2 weeks ago) by olemarkus
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Removed older php ebuilds

(Portage version: 2.1.11.9/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.13