diff options
author | Dan Armak <danarmak@gentoo.org> | 2001-09-29 12:35:38 +0000 |
---|---|---|
committer | Dan Armak <danarmak@gentoo.org> | 2001-09-29 12:35:38 +0000 |
commit | 9632a0b5626fbe6e3f1ef87ff4803a7f4f4ba2ee (patch) | |
tree | 4905c2b8f75c47d5676ff68ee3c318e3f24fe8ed /eclass | |
parent | zap of old portage and added db-3.2.9 to package.mask (diff) | |
download | gentoo-2-9632a0b5626fbe6e3f1ef87ff4803a7f4f4ba2ee.tar.gz gentoo-2-9632a0b5626fbe6e3f1ef87ff4803a7f4f4ba2ee.tar.bz2 gentoo-2-9632a0b5626fbe6e3f1ef87ff4803a7f4f4ba2ee.zip |
Eclasses release 2. This time they are supposed to be fully operational.
Bug hunters please!
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/autoconf.eclass | 13 | ||||
-rw-r--r-- | eclass/base.eclass | 88 | ||||
-rw-r--r-- | eclass/c.eclass | 14 | ||||
-rw-r--r-- | eclass/inherit.eclass | 15 | ||||
-rw-r--r-- | eclass/kde-base.eclass | 90 | ||||
-rw-r--r-- | eclass/kde-i18n.eclass | 55 | ||||
-rw-r--r-- | eclass/kde.eclass | 72 | ||||
-rw-r--r-- | eclass/notes.txt | 32 | ||||
-rw-r--r-- | eclass/virtual.eclass | 58 |
9 files changed, 437 insertions, 0 deletions
diff --git a/eclass/autoconf.eclass b/eclass/autoconf.eclass new file mode 100644 index 000000000000..b4908fd91a84 --- /dev/null +++ b/eclass/autoconf.eclass @@ -0,0 +1,13 @@ +# Copyright 1999-2000 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Dan Armak <danarmak@gentoo.org> +# $Header: /var/cvsroot/gentoo-x86/eclass/autoconf.eclass,v 1.4 2001/09/29 12:35:38 danarmak Exp $ +# The autoconf eclass merely adds autconf/automake deps. +. /usr/portage/eclass/inherit.eclass || die +#inherit virtual || die +ECLASS=autoconf + +S=${WORKDIR}/${P} +DESCRIPTION="Based on the $ECLASS eclass" +DEPEND="${DEPEND} sys-devel/autoconf sys-devel/automake" + diff --git a/eclass/base.eclass b/eclass/base.eclass new file mode 100644 index 000000000000..92368ae8bd03 --- /dev/null +++ b/eclass/base.eclass @@ -0,0 +1,88 @@ +# Copyright 1999-2000 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Dan Armak <danarmak@gentoo.org> +# $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.4 2001/09/29 12:35:38 danarmak Exp $ +# The base eclass defines some default functions and variables. Nearly everything +# else inherits from here. +. /usr/portage/eclass/inherit.eclass || die +inherit virtual || die +ECLASS=base + +S=${WORKDIR}/${P} +DESCRIPTION="Based on the $ECLASS eclass" + +base_src_unpack() { + + echo "in base_src_unpack, 1st parameter is $1" + [ -z "$1" ] && base_src_unpack all + + while [ "$1" ]; do + + case $1 in + unpack) + echo "in base_src_unpack, action unpack" + unpack ${A} + ;; + all) + echo "in base_src_unpack, action all" + base_src_unpack unpack + ;; + esac + + shift + done + +} + +base_src_compile() { + + echo "in base_src_compile, 1st parameter is $1" + [ -z "$1" ] && base_src_compile all + + while [ "$1" ]; do + + case $1 in + configure) + echo "in base_src_compile, action configure" + ./configure || die + ;; + make) + echo "in base_src_compile, action make" + make || die + ;; + all) + echo "in base_src_compile, action all" + base_src_compile configure make + ;; + esac + + shift + done + +} + +base_src_install() { + + echo "in base_src_install, 1st parameter is $1" + [ -z "$1" ] && base_src_install all + + while [ "$1" ]; do + + case $1 in + make) + echo "in base_src_install, action make" + make DESTDIR=${D} install || die + ;; + all) + echo "in base_src_install, action all" + base_src_install make + ;; + esac + + shift + done + +} + +EXPORT_FUNCTIONS src_unpack src_compile src_install + diff --git a/eclass/c.eclass b/eclass/c.eclass new file mode 100644 index 000000000000..7dba641eaebb --- /dev/null +++ b/eclass/c.eclass @@ -0,0 +1,14 @@ +# Copyright 1999-2000 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Dan Armak <danarmak@gentoo.org> +# $Header: /var/cvsroot/gentoo-x86/eclass/c.eclass,v 1.4 2001/09/29 12:35:38 danarmak Exp $ +# The "c" eclass merely adds gcc, glibc and ld.so to DEPEND/RDEPEND for comfort. +. /usr/portage/eclass/inherit.eclass || die +#inherit virtual || die +ECLASS=c + +S=${WORKDIR}/${P} +DESCRIPTION="Based on the $ECLASS eclass" +DEPEND="${DEPEND} sys-devel/gcc virtual/glibc sys-devel/ld.so" +RDEPEND="${RDEPEND} sys-devel/gcc virtual/glibc sys-devel/ld.so" + diff --git a/eclass/inherit.eclass b/eclass/inherit.eclass new file mode 100644 index 000000000000..74cd051737b9 --- /dev/null +++ b/eclass/inherit.eclass @@ -0,0 +1,15 @@ +# $Header: /var/cvsroot/gentoo-x86/eclass/inherit.eclass,v 1.4 2001/09/29 12:35:38 danarmak Exp $ +# This eclass provides the inherit() function. In the future it will be placed in ebuild.sh, but for now drobbins +# doesn't want to make a new portage just for my testing, so every eclass/ebuild will source this file manually and +# then inherit(). This way whn the tmie comes for this to move into stable ebuild.sh, we can just delete the source lines. + +ECLASSDIR=/usr/portage/eclass + +inherit() { + + while [ "$1" ]; do + source ${ECLASSDIR}/${1}.eclass + shift + done + +}
\ No newline at end of file diff --git a/eclass/kde-base.eclass b/eclass/kde-base.eclass new file mode 100644 index 000000000000..86bc568c0f46 --- /dev/null +++ b/eclass/kde-base.eclass @@ -0,0 +1,90 @@ +# Copyright 1999-2000 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Dan Armak <danarmak@gentoo.org> +# $Header: /var/cvsroot/gentoo-x86/eclass/kde-base.eclass,v 1.4 2001/09/29 12:35:38 danarmak Exp $ +# This is the kde ebuild for >=2.2.1 kde base packages. Don't use for kdelibs though :-) +. /usr/portage/eclass/inherit.eclass || die +inherit c autoconf base || die +ECLASS=kde-base + +DESCRIPTION="KDE ${PV} - " +HOMEPAGE="http://www.kde.org/" + +SRC_PATH="kde/stable/${PV}/src/${P}.tar.bz2" +SRC_URI="ftp://ftp.kde.org/pub/$SRC_PATH + ftp://ftp.fh-heilbronn.de/pub/mirrors/$SRC_PATH + ftp://ftp.sourceforge.net/pub/mirrors/$SRC_PATH" + +DEPEND="${DEPEND} + ( kde-base/kdelibs-${PV} ) + dev-util/objprelink + >=x11-libs/qt-x11-2.3.0" + +RDEPEND="${RDEPEND} + ( kde-base/kdelibs-${PV} ) + >=x11-libs/qt-x11-2.3.0" + +kde-base_src_compile() { + + echo "in kde-base_src_compile, 1st parameter is $1" + [ -z "$1" ] && kde-base_src_compile all + + while [ "$1" ]; do + + case $1 in + myconf) + echo "in kde-base_src_compile, action is myconf" + use qtmt && myconf="$myconf --enable-mt" + use mitshm && myconf="$myconf --enable-mitshm" + use objprelink && myconf="$myconf --enable-objprelink" + ;; + configure) + echo "in kde-base_src_compile, action is configure" + ./configure --host=${CHOST} --with-x \ + ${myconf} --with-xinerama || die + ;; + make) + echo "in kde-base_src_compile, action is make" + make || die + ;; + all) + echo "in kde-base_src_compile, action is all" + kde-base_src_compile myconf configure make + ;; + esac + + shift + done + +} + +kde-base_src_install() { + + echo "in kde-base_src_install, 1st parameter is $1" + [ -z "$1" ] && kde-base_src_install all + + while [ "$1" ]; do + + case $1 in + make) + echo "in kde-base_src_install, action is make" + make install DESTDIR=${D} || die + ;; + dodoc) + echo "in kde-base_src_install, action is dodoc" + dodoc AUTHORS ChangeLog COPYING README* + ;; + all) + echo "in kde-base_src_install, action is all" + kde-base_src_install make dodoc + ;; + esac + + shift + done + +} + + +EXPORT_FUNCTIONS src_compile src_install + diff --git a/eclass/kde-i18n.eclass b/eclass/kde-i18n.eclass new file mode 100644 index 000000000000..5923d9263519 --- /dev/null +++ b/eclass/kde-i18n.eclass @@ -0,0 +1,55 @@ +# Copyright 1999-2000 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Dan Armak <danarmak@gentoo.ogr> +# $Header: /var/cvsroot/gentoo-x86/eclass/kde-i18n.eclass,v 1.1 2001/09/29 12:35:38 danarmak Exp $ +. /usr/portage/eclass/inherit.eclass || die +inherit autoconf base || die +ECLASS=kde-i18n + +A=${P}.tar.bz2 +S=${WORKDIR}/${PN} +DESCRIPTION="KDE ${PV} - i18n: ${PN}" +SRC_PATH="kde/stable/${PV}/src/${A}" +SRC_URI="ftp://ftp.kde.org/pub/$SRC_PATH + ftp://ftp.fh-heilbronn.de/pub/mirrors/$SRC_PATH + ftp://ftp.sourceforge.net/pub/mirrors/$SRC_PATH" + +HOMEPAGE="http://www.kde.org/" + +DEPEND=">=kde-base/kdelibs-${PV}" + +PROVIDE="virtual/kde-i18n-${PV}" + +kde-i18n_src_compile() { + + echo "in kde-i18n_src_compile, 1st parameter is $1" + [ $1="" ] && kde-i18n_src_compile all + + while [ "$1" ]; do + + case $1 in + configure) + echo "in kde-i18n_src_compile, action configure" + ./configure --host=${CHOST} || die + ;; + make) + echo "in kde-i18n_src_compile, action make" + make || die + ;; + all) + echo "in kde-i18n_src_compile, action all" + kde-i18n_src_compile all + ;; + esac + + shift + done + +} + +kde-i18n_src_install() { + echo "in kde-i18n_src_compile, single function" + make install DESTDIR=${D} || die +} + + diff --git a/eclass/kde.eclass b/eclass/kde.eclass new file mode 100644 index 000000000000..35fcf249883c --- /dev/null +++ b/eclass/kde.eclass @@ -0,0 +1,72 @@ +# Copyright 1999-2000 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Dan Armak <danarmak@gentoo.org> +# $Header: /var/cvsroot/gentoo-x86/eclass/kde.eclass,v 1.4 2001/09/29 12:35:38 danarmak Exp $ +# This is the kde ebuild for std. kde-dependant apps which follow configure/make/make install +# procedures and have std. configure options. +. /usr/portage/eclass/inherit.eclass || die +inherit c autoconf base || die +ECLASS=kde + +DESCRIPTION="Based on the $ECLASS eclass" +HOMEPAGE="http://www.kde.org/" + +DEPEND="${DEPEND} kde-base/kdelibs dev-util/objprelink x11-libs/qt-x11" +RDEPEND="${RDEPEND} kde-base/kdelibs x11-libs/qt-x11" + +kde_src_compile() { + + [ -z "$1" ] && kde_src_compile all + + while [ "$1" ]; do + + case $1 in + myconf) + use qtmt && myconf="$myconf --enable-mt" + use mitshm && myconf="$myconf --enable-mitshm" + use objprelink && myconf="$myconf --enable-objprelink" + ;; + configure) + ./configure --host=${CHOST} --with-x \ + ${myconf} --with-xinerama || die + ;; + make) + make || die + ;; + all) + kde_src_compile myconf configure make + ;; + esac + + shift + done + +} + +kde_src_install() { + + [ -z "$1" ] && kde_src_install all + + while [ "$1" ]; do + + case $1 in + make) + make install DESTDIR=${D} || die + ;; + dodoc) + dodoc AUTHORS ChangeLog README* + ;; + all) + kde_src_install make dodoc + ;; + esac + + shift + done + +} + + +EXPORT_FUNCTIONS src_compile src_install + + diff --git a/eclass/notes.txt b/eclass/notes.txt new file mode 100644 index 000000000000..3d02ac14479c --- /dev/null +++ b/eclass/notes.txt @@ -0,0 +1,32 @@ +Notes about moving deps from ebuilds into eclasses +-------------------------------------------------- + +1. eclasses may define depends, but they sually do so without mentioning specific versions. The kde eclass depends on +x11-libs/qt-x11. howevr kde 2.2.1 depends on >=qt-x11-2.3.0, whih will have to be specified in the kdelibs ebuild. +The same applies to dependnig on kdelibs. the kde eclass includes a kdelibs dep, yet nearly all kde apps inheriting from +it are forced to specify it again with a minimal version. Expect a kde-base eclass in the near future which will inherit from +kde and be better suited for kde-base/* ebuilds of a specific kde version. + +2. More about depends of eclasses. Since kdelibs depends on qt and kde app foo depends on kdelibs, there is no need for foo +to explicitly require qt, just kdelibs. However we now move the qt depend from the kdelibs ebuild to the kde eclass, which is +inherited by both kdelibs and foo. So that they both depend on qt explicitly. This shouldn't be a problem, but it is a +change from the current situation. + +3. Most euilds don't define deps which they need such as gcc, glibc, ld.so, autoconf/make, gzip/bzip2/unzip/tar for extracting +the source archives. It'd be nice to have eclasses defnie all these common deps, but it will make some unneeded deps show up +in some cases. For now I have the c eclass and the autoonf eclass, but these are more for testing of multiple inheritance +than for any real use. + + +Notes for writig inheritig eclasses +----------------------------------- +1. Make sure to extend your variables and functions, not relpace them. In particular always use DEPEND=$DEPEND"..." +and the same for RDEPEND. +2. Remember to inherit virtual first, to EXPORT_FUNCTIONS and then to extend your functions. +3. Problem: +kde originally inherited base,c,autoconf. Of these three only base defines any functions, so you'd think the base functions +are the ones kde gets by default. However, because base, c and autoconf all inherit from virtual, they do, in fact, +implement empty funcions. So, if kde inherits base,c,autoconf in that order, it gets the virtual functions. This isn't +what we want, so kde should inherit base last. +In fact, kde should also inheit virtual first, like all eclasses, but that's a formality. +BEWARE OF MULTIPLE INHERITANCE, ESPECIALLY IN EBUILDS! diff --git a/eclass/virtual.eclass b/eclass/virtual.eclass new file mode 100644 index 000000000000..49bdc1a16483 --- /dev/null +++ b/eclass/virtual.eclass @@ -0,0 +1,58 @@ +# Copyright 1999-2000 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# Author Dan Armak <danarmak@gentoo.org> +# $Header: /var/cvsroot/gentoo-x86/eclass/virtual.eclass,v 1.3 2001/09/29 12:35:38 danarmak Exp $ +# All other eclasses, and thus ebuilds, inherit from this. It defines the EXPORT_FUNCTIONS +# string, which (should) be eval'd by all other eclasses. + +# Used by the EXPORT_FUNCTIONS code, and placed at the beginning of the eclass +# for elegancy's sake. +# Someday the code that processes an ebuild's name and extracts $PN from it +# can be adapted to automatically calculate $ECLASS from the filename. +# Note that this must come after any inherit lines. +ECLASS=virtual + +DESCRIPTION="Based on the $ECLASS eclass." + +virtual_src_unpack() { +return +} +virtual_src_compile() { +return +} +virtual_src_install() { +return +} +virtual_pkg_preinst() { +return +} +virtual_pkg_postinst() { +return +} +virtual_pkg_prerm() { +return +} +virtual_pkg_postrm() { +return +} + +# EXPORT_FUNCTIONS trick +# This is the global part, defined here only. + +EXPORT_FUNCTIONS() { + + while [ "$1" ]; do + #debug - if you use it, make sure to touch /1 /2 first + #mv /1 /2 + #echo "$1() { ${ECLASS}_$1 ; }" | cat /2 - > /1 + eval "$1() { ${ECLASS}_$1 ; }" > /dev/null + + shift + done + +} + + +# This part should be repeated for every eclass inheriting from here. +EXPORT_FUNCTIONS src_unpack src_compile src_install pkg_preinst pkg_postinst pkg_prerm pkg_postrm + |