/[gentoo-alt]/trunk/prefix/eclass/php.eclass
Gentoo

Contents of /trunk/prefix/eclass/php.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 982 - (show annotations) (download)
Thu Feb 2 04:20:17 2006 UTC (13 years, 2 months ago) by kito
File size: 5267 byte(s)
Initial eclass import from gentoo-x86
1 # Copyright 1999-2004 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/eclass/php.eclass,v 1.105 2006/01/26 06:06:40 robbat2 Exp $
4 # Author: Robin H. Johnson <robbat2@gentoo.org>
5
6 # This eclass is the old style of php, that was used before php-core was
7 # introduced.
8
9 inherit eutils flag-o-matic
10
11 EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_postinst pkg_preinst
12
13 [ -z "${MY_PN}" ] && MY_PN=php
14 if [ -z "${MY_PV}" ]; then
15 MY_PV=${PV/_rc/RC}
16 # maybe do stuff for beta/alpha/pre here too?
17 fi
18
19 # our major ver number
20 PHPMAJORVER=${MY_PV//\.*}
21
22 [ -z "${MY_P}" ] && MY_P=${MY_PN}-${MY_PV}
23 [ -z "${MY_PF}" ] && MY_PF=${MY_P}-${PR}
24 [ -z "${HOMEPAGE}" ] && HOMEPAGE="http://www.php.net/"
25 [ -z "${LICENSE}" ] && LICENSE="PHP"
26 [ -z "${PROVIDE}" ] && PROVIDE="virtual/php"
27 # PHP.net does automatic mirroring from this URI
28 [ -z "${SRC_URI_BASE}" ] && SRC_URI_BASE="http://www.php.net/distributions"
29 if [ -z "${SRC_URI}" ]; then
30 SRC_URI="${SRC_URI_BASE}/${MY_P}.tar.bz2"
31 fi
32 # A patch for PHP for security
33 SRC_URI="${SRC_URI} mirror://gentoo/php-4.3.2-fopen-url-secure.patch"
34 [ "${MY_PV}" = "4.3.4" ] && SRC_URI="${SRC_URI} mirror://gentoo/php-4.3.4-phpizeexecfix.patch"
35
36 # Where we work
37 S=${WORKDIR}/${MY_P}
38
39 IUSE="${IUSE} X crypt curl firebird flash freetds gd gd-external gdbm imap informix ipv6 java jpeg ldap mcal memlimit mysql nls oci8 odbc pam pdflib png postgres qt snmp spell ssl tiff truetype xml2"
40
41 # berkdb stuff is complicated
42 # we need db-1.* for ndbm
43 # and then either of db3 or db4
44 IUSE="${IUSE} berkdb"
45 RDEPEND="${RDEPEND} berkdb? ( =sys-libs/db-1.*
46 || ( >=sys-libs/db-4.0.14-r2
47 >=sys-libs/db-3.2.9-r9
48 )
49 )"
50
51 # Everything is in this list is dynamically linked agaist or needed at runtime
52 # in some other way
53 RDEPEND="
54 >=sys-libs/cracklib-2.7-r7
55 app-arch/bzip2
56 X? ( || ( x11-libs/libXpm virtual/x11 ) )
57 crypt? ( >=dev-libs/libmcrypt-2.4 >=app-crypt/mhash-0.8 )
58 curl? ( >=net-misc/curl-7.10.2 )
59 x86? ( firebird? ( >=dev-db/firebird-1.0 ) )
60 freetds? ( >=dev-db/freetds-0.53 )
61 gd-external? ( media-libs/gd >=media-libs/jpeg-6b
62 >=media-libs/libpng-1.2.5 )
63 gd? ( >=media-libs/jpeg-6b >=media-libs/libpng-1.2.5 )
64 gdbm? ( >=sys-libs/gdbm-1.8.0 )
65 !alpha? ( java? ( =virtual/jdk-1.4* dev-java/java-config ) )
66 jpeg? ( >=media-libs/jpeg-6b )
67 ldap? ( >=net-nds/openldap-1.2.11 )
68 mysql? ( >=dev-db/mysql-3.23.26 )
69 nls? ( sys-devel/gettext )
70 odbc? ( >=dev-db/unixODBC-1.8.13 )
71 pam? ( >=sys-libs/pam-0.75 )
72 pdflib? ( >=media-libs/pdflib-4.0.3 >=media-libs/jpeg-6b
73 >=media-libs/libpng-1.2.5 >=media-libs/tiff-3.5.5 )
74 png? ( >=media-libs/libpng-1.2.5 )
75 postgres? ( >=dev-db/postgresql-7.1 )
76 qt? ( >=x11-libs/qt-2.3.0 )
77 snmp? ( net-analyzer/net-snmp )
78 spell? ( app-text/aspell )
79 ssl? ( >=dev-libs/openssl-0.9.5 )
80 tiff? ( >=media-libs/tiff-3.5.5 )
81 xml2? ( dev-libs/libxml2 >=dev-libs/libxslt-1.0.30 )
82 truetype? ( =media-libs/freetype-2* =media-libs/freetype-1*
83 media-libs/t1lib )
84 >=net-libs/libwww-5.3.2
85 >=app-text/sablotron-0.97
86 dev-libs/expat
87 sys-libs/zlib
88 virtual/mta
89 virtual/libc"
90 # virtual/libc line added as a fix for an rsync issue regarding cache
91 # regeneration. It's harmless, but it causes that particular issue to
92 # disappear. (sys-apps -> app-arch move stuff)
93
94 # libswf is ONLY available on x86
95 RDEPEND="${RDEPEND} flash? (
96 x86? ( media-libs/libswf )
97 >=media-libs/ming-0.2a )"
98
99 #The new XML extension in PHP5 requires libxml2-2.5.10
100 if [ "${PHPMAJORVER}" -ge 5 ]; then
101 RDEPEND="${RDEPEND} >=dev-libs/libxml2-2.5.10"
102 fi
103
104 # These are extra bits we need only at compile time
105 DEPEND="${RDEPEND} ${DEPEND}
106 imap? ( virtual/imap-c-client )
107 mcal? ( dev-libs/libmcal )"
108 #9libs causes a configure error
109 DEPEND="${DEPEND} !dev-libs/9libs"
110 #dev-libs/libiconv causes a compile failure
111 DEPEND="${DEPEND} !dev-libs/libiconv"
112
113 #Waiting for somebody to want this:
114 #cyrus? ( net-mail/cyrus-imapd net-mail/cyrus-imap-admin dev-libs/cyrus-imap-dev )
115
116 #export this here so we can use it
117 myconf="${myconf}"
118
119 PHP_INSTALLTARGETS="${PHP_INSTALLTARGETS} install-modules install-pear install-build install-headers install-programs"
120
121 # These are quick fixups for older ebuilds that didn't have PHPSAPI defined.
122 [ -z "${PHPSAPI}" ] && [ "${PN}" = "php" ] && PHPSAPI="cli"
123 if [ -z "${PHPSAPI}" ] && [ "${PN}" = "mod_php" ]; then
124 use apache2 && PHPSAPI="apache2" || PHPSAPI="apache1"
125 fi
126
127 # Now enforce existance of PHPSAPI
128 if [ -z "${PHPSAPI}" ]; then
129 msg="The PHP eclass needs a PHPSAPI setting!"
130 eerror "${msg}"
131 die "${msg}"
132 fi
133 # build the destination and php.ini details
134 PHPINIDIRECTORY="/etc/php/${PHPSAPI}-php${PHPMAJORVER}"
135 PHPINIFILENAME="php.ini"
136
137 php_src_unpack() {
138 die "This eclass must NOT be used."
139 }
140 php_src_compile() {
141 die "This eclass must NOT be used."
142 }
143 php_src_install() {
144 die "This eclass must NOT be used."
145 }
146
147 php_pkg_preinst() {
148 eerror "Warning it is NOT safe to use this version of PHP anymore"
149 eerror "You MUST upgrade to a newer version of PHP."
150 }
151
152 php_pkg_postinst() {
153 eerror "Warning it is NOT safe to use this version of PHP anymore"
154 eerror "You MUST upgrade to a newer version of PHP."
155 }

  ViewVC Help
Powered by ViewVC 1.1.20