summaryrefslogtreecommitdiff
blob: 41728830952b499a6b1196e02a186881cefe906f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# 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.4 2001/10/01 13:54: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.
inherit debug || die

# 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() {
debug-print-function virtual_src_unpack $*
}
virtual_src_compile() {
debug-print-function virtual_src_compile $*
}
virtual_src_install() {
debug-print-function virtual_src_install $*
}
virtual_pkg_preinst() {
debug-print-function virtual_pkg_preinst $*
}
virtual_pkg_postinst() {
debug-print-function virtual_pkg_postinst $*
}
virtual_pkg_prerm() {
debug-print-function virtual_pkg_prerm $*
}
virtual_pkg_postrm() {
debug-print-function virtual_pkg_postrm $*
}

# EXPORT_FUNCTIONS trick
# This is the global part, defined here only.

EXPORT_FUNCTIONS() {

	while [ "$1" ]; do
	    debug-print "EXPORT_FUNCTIONS: ${1} -> ${ECLASS}_${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