summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2003-05-13 09:39:42 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2003-05-13 09:39:42 +0000
commit31cd44bbb8e513861c6544e09935e28fcb71c49c (patch)
tree9c937f1809570418088635f1f498dfa09dc82c25 /eclass/php.eclass
parentUnmasked, glsa is coming (diff)
downloadgentoo-2-31cd44bbb8e513861c6544e09935e28fcb71c49c.tar.gz
gentoo-2-31cd44bbb8e513861c6544e09935e28fcb71c49c.tar.bz2
gentoo-2-31cd44bbb8e513861c6544e09935e28fcb71c49c.zip
Most issues fixed, ready for testing.
Diffstat (limited to 'eclass/php.eclass')
-rw-r--r--eclass/php.eclass250
1 files changed, 158 insertions, 92 deletions
diff --git a/eclass/php.eclass b/eclass/php.eclass
index 050141b8bf93..7357ae88c37e 100644
--- a/eclass/php.eclass
+++ b/eclass/php.eclass
@@ -1,7 +1,7 @@
# Copyright 2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
# Author: Robin H. Johnson <robbat2@gentoo.org>
-# $Header: /var/cvsroot/gentoo-x86/eclass/php.eclass,v 1.10 2003/05/08 05:49:15 heim Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/php.eclass,v 1.11 2003/05/13 09:39:42 robbat2 Exp $
# This EBUILD is totally masked presently. Use it at your own risk. I know it
# is severely broken, but I needed to get a copy into CVS to pass around and
@@ -10,19 +10,8 @@
# TODO LIST
# * Finish install cleanup
# * USE flags
-# - needs to get cleaned up
-# - dependancies on more things for correctness
-# - JPEG/PNG/CJK correctness checking
-# * SAPI choosing inside eclass
-# - effects configure line and install code
-# * Java still flakey
-# - look at the long gcc line with repeats of java stuff
-# - needs heavy testing
-#
-#
-#
-#
-#
+#sys-libs/ncurses
+#--with-ncurses
inherit eutils flag-o-matic
@@ -31,24 +20,29 @@ INHERITED="$INHERITED $ECLASS"
EXPORT_FUNCTIONS src_unpack src_compile src_install
-MY_P=php-${PV}
+MY_PN=php
+MY_P=${MY_PN}-${PV}
S=${WORKDIR}/${MY_P}
[ -z "$HOMEPAGE" ] && HOMEPAGE="http://www.php.net/"
[ -z "$LICENSE" ] && LICENSE="PHP"
[ -z "$SRC_URI" ] && SRC_URI="http://us3.php.net/distributions/${MY_P}.tar.bz2"
[ -z "$PROVIDE" ] && PROVIDE="virtual/php"
-IUSE="${IUSE} berkdb cjk crypt curl exif firebird flash freetds gd gdbm imap informix java jpeg ldap libwww mcal mysql nls oci8 odbc pam pdflib pic png postgres qt snmp spell ssl tiff truetype X xml xml2 zlib"
-IUSE="${IUSE} phpbcmath phpbz2 phpcalender phpdbase phpftp phpiconv phpmimemagic phpsafemode phpsockets phpsysv phpwddx phpmemlimit"
+IUSE="${IUSE} berkdb cjk crypt curl firebird flash freetds gd gdbm imap informix java jpeg ldap mcal mysql nls oci8 odbc pam pdflib pic png postgres qt snmp spell ssl tiff truetype X xml xml2 zlib"
+IUSE="${IUSE} phpmemlimit"
#removed: gmp
#causes breakage
DEPEND="${DEPEND}
+ sys-libs/cracklib
+ sys-apps/bzip2
+ sys-libs/db
X? ( virtual/x11 )
berkdb? ( >=sys-libs/db-3 )
crypt? ( >=dev-libs/libmcrypt-2.4 >=app-crypt/mhash-0.8 )
curl? ( >=net-ftp/curl-7.10.2 )
+ cyrus? ( net-mail/cyrus-imapd net-mail/cyrus-imap-admin dev-libs/cyrus-imap-dev )
firebird? ( >=dev-db/firebird-1.0 )
flash? ( media-libs/libswf >=media-libs/ming-0.2a )
freetds? ( >=dev-db/freetds-0.53 )
@@ -58,13 +52,12 @@ DEPEND="${DEPEND}
java? ( >=virtual/jdk-1.4 )
jpeg? ( >=media-libs/jpeg-6b )
ldap? ( >=net-nds/openldap-1.2.11 )
- libwww? ( >=net-libs/libwww-5.3.2 )
mcal? ( dev-libs/libmcal )
mysql? ( >=dev-db/mysql-3.23.26 )
nls? ( sys-devel/gettext )
odbc? ( >=dev-db/unixODBC-1.8.13 )
pam? ( >=sys-libs/pam-0.75 )
- pdflib? ( >=media-libs/pdflib-4.0.1-r2 )
+ pdflib? ( >=media-libs/pdflib-4.0.3 )
png? ( >=media-libs/libpng-1.2.5 )
postgres? ( >=dev-db/postgresql-7.1 )
qt? ( x11-libs/qt )
@@ -74,14 +67,52 @@ DEPEND="${DEPEND}
tiff? ( >=media-libs/tiff-3.5.5 )
truetype? ( ~media-libs/freetype-1.3.1 >=media-libs/t1lib-1.3.1 )
xml2? ( dev-libs/libxml2 )
- xml? ( >=net-libs/libwww-5.3.2 >=app-text/sablotron-0.96 )
+ xml? ( >=net-libs/libwww-5.3.2 >=app-text/sablotron-0.96 dev-libs/expat )
+ !dev-libs/9libs
"
-
+#9libs causes a configure error
RDEPEND="${RDEPEND}
xml? ( >=app-text/sablotron-0.95-r1 >=net-libs/libwww-5.3.2 )
qt? ( >=x11-libs/qt-2.3.0 )"
+#export this here so we can use it
+myconf="${myconf}"
+
+## PHP offers a wide range of Server APIs (SAPIs)
+#[ -z "${PHP_SAPI}" ] && die "Your ebuild must specify a PHP SAPI to build with!"
+#local php_sapi_supported
+#php_sapi_supported=0
+#case ${PHP_SAPI} in
+#cgi) php_sapi_supported=1 ; PHP_CGI=1 ;;
+#cli) php_sapi_supported=1 ; PHP_CLI=1 ;;
+#apxs) php_sapi_supported=1 ;;
+#apxs2) php_sapi_supported=1 ;;
+#apache) ;;
+#aolserver) ;;
+#mod_charset) ;;
+#caudium) ;;
+#isapi) ;;
+#nsapi) ;;
+#phttpd) ;;
+#pi3web) ;;
+#roxen) ;;
+#servlet) ;;
+#thttpd) ;;
+#tux) ;;
+#esac
+#
+## be nice to other developers ;-)
+#if [ "${php_sapi_supported}" -ne "1" ]; then
+# ewarn "Your SAPI choice is NOT offically supported in php.eclass yet."
+# ewarn "Please contact php-bugs for any issues."
+#fi
+
+# These are the standard targets that we want to for the install stage since we can't do the full 'make install'
+# You may need to add your own items here for SAPIs etc.
+PHP_INSTALLTARGETS="${PHP_INSTALLTARGETS} install-modules install-pear install-build install-headers install-programs"
+#overall recommended order
+#install-cli install-sapi install-modules install-pear install-build install-headers install-programs
#fixes bug #14067
replace-flags "-march=k6*" "-march=i586"
@@ -102,19 +133,26 @@ php_src_unpack() {
# fix PEAR installer
cp pear/PEAR/Registry.php pear/PEAR/Registry.old
sed "s:\$pear_install_dir\.:\'$D/usr/lib/php/\' . :g" pear/PEAR/Registry.old > pear/PEAR/Registry.php
-
+
+ ## ----- Obsolete, pending removal ------
#if [ "`use java`" ] ; then
+ ## Umm, did something get lost here????
+ ## Obsolete, pending removal
# cp configure configure.orig
# cat configure.orig | \
# sed -e 's/LIBS="-lttf $LIBS"/LIBS="-lttf $LIBS"/' \
# > configure
-
+
+ ## What is the purpose of this change?
+ ## Obsolete, pending removal
# cp ext/gd/gd.c ext/gd/gd.c.orig
# cat ext/gd/gd.c.orig | \
# sed -e "s/typedef FILE gdIOCtx;//" \
# > ext/gd/gd.c
- # if [ "$JAVAC" ];
+
+ ## Obsolete, pending removal
+ # if [ -n "$JAVAC" ];
# then
# cp ext/java/Makefile.in ext/java/Makefile.in.orig
# cat ext/java/Makefile.in.orig | \
@@ -122,104 +160,137 @@ php_src_unpack() {
# > ext/java/Makefile.in
# fi
#fi
+ ## --------------------------------------
# pear's world writable files is a php issue fixed in their cvs tree.
# http://bugs.php.net/bug.php?id=20978
# http://bugs.php.net/bug.php?id=20974
epatch ${FILESDIR}/pear_config.diff || die "epatch failed"
-
}
-#export this here so we can use it
-myconf="${myconf}"
php_src_compile() {
+ # Control the extra SAPI stuff that can be built in addition to any usual SAPI
+# [ -z "${PHP_CGI}" ] && PHP_CGI=0
+# [ -z "${PHP_CLI}" ] && PHP_CLI=0
+# [ -z "${PHP_EMBED}" ] && PHP_EMBED=no
+# [ "${PHP_CGI}" -eq "0" ] \
+# && myconf="${myconf} --disable-cgi" \
+# || myconf="${myconf} --enable-cgi --enable-fastcgi"
+# [ "${PHP_CLI}" -eq "0" ] \
+# && myconf="${myconf} --disable-cli" \
+# || myconf="${myconf} --enable-cli"
+# case "${PHP_EMBED}" in
+# shared) myconf="${myconf} --enable-embed=shared" ;;
+# static) myconf="${myconf} --enable-embed=static" ;;
+# *) myconf="${myconf} --disable-embed" ;;
+# esac;
+
use berkdb && myconf="${myconf} --with-db3=/usr"
- #---
use cjk && myconf="${myconf} --enable-mbstring --enable-mbregex"
- #use cjk && myconf="${myconf} --enable-mbstring"
- #---
- use curl && myconf="${myconf} --with-curl"
- use crypt && myconf="${myconf} --enable-mcrypt=/usr --with-mhash"
+ use crypt && myconf="${myconf} --with-mcrypt=/usr --with-mhash"
use firebird && myconf="${myconf} --with-interbase=/opt/interbase"
use flash && myconf="${myconf} --with-swf=/usr --with-ming=/usr"
use freetds && myconf="${myconf} --with-sybase=/usr"
use gd && myconf="${myconf} --with-gd=/usr"
use gdbm && myconf="${myconf} --with-gdbm=/usr"
+ use informix && [ -n "${INFORMIXDIR}" ] && myconf="${myconf} --with-informix=${INFORMIXDIR}"
use java && myconf="${myconf} --with-java=${JAVA_HOME}"
#--- check out this weirdness
- #use jpeg && myconf="${myconf} --with-jpeg-dir=/usr"
#use jpeg && myconf="${myconf} --with-jpeg-dir=/usr/lib" || myconf="${myconf} --without-jpeg"
- use jpeg && myconf="${myconf} --with-jpeg-dir=/usr" || myconf="${myconf} --without-jpeg"
+ use jpeg && myconf="${myconf} --with-jpeg --with-jpeg-dir=/usr --enable-exif" || myconf="${myconf} --without-jpeg"
+ use jpeg && LDFLAGS="${LDFLAGS} -ljpeg"
#---
- use libwww && myconf="${myconf} --with-xml" || myconf="${myconf} --disable-xml"
- use ldap && myconf="${myconf} --with-ldap"
+ use mcal && myconf="${myconf} --with-mcal=/usr"
use mysql && myconf="${myconf} --with-mysql=/usr" || myconf="${myconf} --without-mysql"
- use nls && myconf="${myconf} --with-gettext" || myconf="${myconf} --without-gettext"
+ use oci8 && [ -n "${ORACLE_HOME}" ] && myconf="${myconf} --with-oci8=${ORACLE_HOME}"
use odbc && myconf="${myconf} --with-unixODBC=/usr"
- use pam && myconf="${myconf} --with-pam"
- use pic && myconf="${myconf} --with-pic"
use pdflib && myconf="${myconf} --with-pdflib=/usr"
- #---
- use png && myconf="${myconf} --with-png-dir=/usr"
- use png || myconf="${myconf} --without-png"
- #---
- use postgres && myconf="${myconf} --with-pgsql=/usr"
- use qt && myconf="${myconf} --with-qtdom"
+ use phpmemlimit && myconf="${myconf} --enable-memory-limit"
+ use png && myconf="${myconf} --with-png-dir=/usr" || myconf="${myconf} --without-png"
+ use postgres && myconf="${myconf} --with-pgsql=/usr" || myconf="${myconf} --without-pgsql"
use snmp && myconf="${myconf} --with-snmp --enable-ucd-snmp-hack"
- use spell && myconf="${myconf} --with-pspell"
- use ssl && myconf="${myconf} --with-openssl"
+ use tiff && LDFLAGS="${LDFLAGS} -ltiff"
use tiff && myconf="${myconf} --with-tiff-dir=/usr" || myconf="${myconf} --without-tiff"
use truetype && myconf="${myconf} --with-ttf --with-t1lib"
use xml2 && myconf="${myconf} --with-dom"
use zlib && myconf="${myconf} --with-zlib --with-zlib-dir=/usr/lib"
- use exif && myconf="${myconf} --enable-exif"
- use mcal && myconf="${myconf} --with-mcal=/usr"
-
- # optional support for oracle oci8
- use oci8 && [ -n "$ORACLE_HOME" ] && myconf="${myconf} --with-oci8=${ORACLE_HOME}"
-
- # optional support for informix
- use informix && [ -n "$INFORMIXDIR" ] && myconf="${myconf} --with-informix=${INFORMIXDIR}"
-
+ #use nls && myconf="${myconf} --with-gettext" || myconf="${myconf} --without-gettext"
+ #use qt && myconf="${myconf} --with-qtdom" || myconf="${myconf} --without-qtdom"
+ #use spell && myconf="${myconf} --with-pspell"
+ #use ssl && myconf="${myconf} --with-openssl"
+ myconf="${myconf} `use_with nls gettext` `use_with qt qtdom` `use_with spell pspell` `use_with ssl openssl`"
+ #use curl && myconf="${myconf} --with-curl"
+ #use imap && myconf="${myconf} --with-imap"
+ #use ldap && myconf="${myconf} --with-ldap"
+ #use pam && myconf="${myconf} --with-pam"
+ #use pic && myconf="${myconf} --with-pic"
+ myconf="${myconf} `use_with curl` `use_with imap` `use_with ldap` `use_with pam` `use_with pic` `use_with cyrus`"
+
+ use mysql || use odbc || use postgres || use oci8 \
+ && myconf="${myconf} --enable-dbx" \
+ || myconf="${myconf} --disable-dbx"
+
+
+ # This presently emits a WEIRD error:
+ # "strings: : No such file or directory"
use imap && use ssl && \
- if [ "`strings ${ROOT}/usr/lib/c-client.a \ | grep ssl_onceonlyinit`" ] ; then
- echo "Compiling imap with SSL support"
- myconf="${myconf} --with-imap --with-imap-ssl"
+ if [ -n "`strings ${ROOT}/usr/lib/c-client.a \ | grep ssl_onceonlyinit`" ]; then
+ myconf="${myconf} --with-imap-ssl"
else
- echo "Compiling imap without SSL support"
- myconf="${myconf} --with-imap"
+ ewarn "USE=\"imap ssl\" specified but IMAP is built WITHOUT ssl support."
+ ewarn "Skipping IMAP-SSL support."
fi
- LDFLAGS="$LDFLAGS -ltiff -ljpeg"
- if [ "`use X`" ] ; then
+ if [ -n "`use X`" ] ; then
myconf="${myconf} --with-xpm-dir=/usr/X11R6"
- LDFLAGS="$LDFLAGS -L/usr/X11R6/lib"
+ LDFLAGS="${LDFLAGS} -L/usr/X11R6/lib"
fi
- if [ "`use xml`" ] ; then
- export LIBS="-lxmlparse -lxmltok"
+ if [ -n "`use xml`" ] ; then
+ LIBS="${LIBS} -lxmlparse -lxmltok"
myconf="${myconf} --with-sablot=/usr"
myconf="${myconf} --enable-xslt"
myconf="${myconf} --with-xslt-sablot"
myconf="${myconf} --with-xmlrpc"
+ myconf="${myconf} --with-wddx"
+ myconf="${myconf} --with-xml"
+ else
+ myconf="${myconf} --disable-xml"
fi
- #local use flags
- use phpbcmath && myconf="${myconf} --enable-bcmath"
- use phpbz2 && myconf="${myconf} --with-bz2"
- use phpcalender && myconf="${myconf} --enable-calendar"
- use phpdbase && myconf="${myconf} --enable-dbase"
- use phpftp && myconf="${myconf} --enable-ftp"
- use phpiconv && myconf="${myconf} --with-iconv"
- use phpmimemagic && myconf="${myconf} --enable-mime-magic"
- use phpsafemode && myconf="${myconf} --enable-safe-mode"
- use phpsockets && myconf="${myconf} --enable-sockets"
- use phpsysv && myconf="${myconf} --enable-sysvsem --enable-sysvshm"
- use phpwddx && myconf="${myconf} --enable-wddx"
- use phpmemlimit && myconf="${myconf} --enable-memory-limit"
-
+ # Somebody might want safe mode, but it causes some problems, so I disable it by default
+ #myconf="${myconf} --enable-safe-mode"
+
+ # These are some things that we don't really need use flags for, we just
+ # throw them in for functionality. Somebody could turn them off if their
+ # heart so desired
+ # DEPEND sys-apps/bzip2
+ myconf="${myconf} --with-bz2"
+ # DEPEND sys-libs/cracklib
+ myconf="${myconf} --with-crack"
+ # DEPEND sys-libs/db
+ myconf="${myconf} --with-ndbm --with-cdb"
+
+ # No DEPENDancies
+ myconf="${myconf} --enable-bcmath"
+ myconf="${myconf} --enable-calendar"
+ myconf="${myconf} --enable-dbase"
+ myconf="${myconf} --enable-filepro"
+ myconf="${myconf} --enable-ftp"
+ myconf="${myconf} --enable-mime-magic"
+ myconf="${myconf} --enable-sockets"
+ myconf="${myconf} --enable-sysvsem --enable-sysvshm --enable-sysvipc"
+ myconf="${myconf} --with-iconv"
+ myconf="${myconf} --enable-shmop"
+ # this might be less than 100% stable, it needs testing
+ myconf="${myconf} --enable-dio"
+
+ # recode is NOT used as it conflicts with IMAP and YAZ
+ # iconv is better anyway
+
+ # Now actual base PHP settings
myconf="${myconf} \
--enable-inline-optimization \
--enable-track-vars \
@@ -234,20 +305,17 @@ php_src_compile() {
}
-#export this here so we can use it
-installtargets="${installtargets}"
-
php_src_install() {
addwrite /usr/share/snmp/mibs/.index
- installtargets="${installtargets} install-pear install-headers install-programs install-build install-modules"
- emake INSTALL_ROOT=${D} ${installtargets} || die
+ # parallel make breaks it
+ # so no emake here
+ make INSTALL_ROOT=${D} ${PHP_INSTALLTARGETS} || die
# put make here
- dodoc CODING_STANDARDS LICENSE EXTENSIONS
- dodoc RELEASE_PROCESS README.* TODO* NEWS
- dodoc ChangeLog* *.txt
+ dodoc LICENSE EXTENSIONS CREDITS INSTALL
+ dodoc README.* TODO* NEWS
#install scripts
exeinto /usr/bin
@@ -256,14 +324,12 @@ php_src_install() {
doexe ${S}/pear/scripts/phpextdist
# PHP module building stuff
- mkdir ${D}/usr/lib/php/build
+ mkdir -p ${D}/usr/lib/php/build
insinto /usr/lib/php/build
doins build/* pear/pear.m4 acinclude.m4 configure.in Makefile.global scan_makefile_in.awk
#revert Pear patch
rm ${D}/usr/lib/php/PEAR/Registry.php
- #mv ${S}/pear/PEAR/Registry.old ${D}/usr/lib/php/PEAR/Registry.php
+ #should this possibly result to the SAME original value it was ? (\$pear_install_dir)
cat ${S}/pear/PEAR/Registry.old | sed -e 's:${PORTAGE_TMPDIR}/${PF}::' > ${D}/usr/lib/php/PEAR/Registry.php
-
-
}