| 1 | # Copyright 1999-2000 Gentoo Technologies, Inc. |
1 | # Copyright 1999-2000 Gentoo Technologies, Inc. |
| 2 | # Distributed under the terms of the GNU General Public License, v2 or later |
2 | # Distributed under the terms of the GNU General Public License, v2 or later |
| 3 | # Author Dan Armak <danarmak@gentoo.org> |
3 | # Author Dan Armak <danarmak@gentoo.org> |
| 4 | # $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.7 2001/11/16 12:50:41 danarmak Exp $ |
4 | # $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.13 2002/03/30 12:52:14 danarmak Exp $ |
| 5 | # The base eclass defines some default functions and variables. Nearly everything |
5 | # The base eclass defines some default functions and variables. Nearly everything |
| 6 | # else inherits from here. |
6 | # else inherits from here. |
| 7 | inherit virtual || die |
7 | [ -n "$COMPAT" ] && inherit functions |
| 8 | ECLASS=base |
8 | ECLASS=base |
| 9 | |
9 | |
| 10 | S=${WORKDIR}/${P} |
10 | S=${WORKDIR}/${P} |
| 11 | DESCRIPTION="Based on the $ECLASS eclass" |
11 | DESCRIPTION="Based on the $ECLASS eclass" |
| 12 | |
12 | |
| 13 | base_src_unpack() { |
13 | base_src_unpack() { |
| 14 | |
14 | |
| 15 | debug-print-function base_src_unpack $* |
15 | debug-print-function $FUNCNAME $* |
| 16 | [ -z "$1" ] && base_src_unpack all |
16 | [ -z "$1" ] && base_src_unpack all |
|
|
17 | |
|
|
18 | cd ${WORKDIR} |
| 17 | |
19 | |
| 18 | while [ "$1" ]; do |
20 | while [ "$1" ]; do |
| 19 | |
21 | |
| 20 | case $1 in |
22 | case $1 in |
| 21 | unpack) |
23 | unpack) |
| 22 | debug-print-section unpack |
24 | debug-print-section unpack |
| 23 | unpack ${A} |
25 | unpack ${A} |
| 24 | ;; |
26 | ;; |
| 25 | patch) |
27 | patch) |
| 26 | debug-print-section patch |
28 | debug-print-section patch |
| … | |
… | |
| 29 | ;; |
31 | ;; |
| 30 | all) |
32 | all) |
| 31 | debug-print-section all |
33 | debug-print-section all |
| 32 | base_src_unpack unpack |
34 | base_src_unpack unpack |
| 33 | ;; |
35 | ;; |
| 34 | esac |
36 | esac |
| 35 | |
37 | |
| 36 | shift |
38 | shift |
| 37 | done |
39 | done |
| 38 | |
40 | |
| 39 | } |
41 | } |
| 40 | |
42 | |
| 41 | base_src_compile() { |
43 | base_src_compile() { |
| 42 | |
44 | |
| 43 | debug-print-function base_src_compile $* |
45 | debug-print-function $FUNCNAME $* |
| 44 | [ -z "$1" ] && base_src_compile all |
46 | [ -z "$1" ] && base_src_compile all |
|
|
47 | |
|
|
48 | cd ${S} |
| 45 | |
49 | |
| 46 | while [ "$1" ]; do |
50 | while [ "$1" ]; do |
| 47 | |
51 | |
| 48 | case $1 in |
52 | case $1 in |
| 49 | configure) |
53 | configure) |
| 50 | debug-print-section configure |
54 | debug-print-section configure |
| 51 | ./configure || die |
55 | econf || die "died running econf, $FUNCNAME:configure" |
| 52 | ;; |
56 | ;; |
| 53 | make) |
57 | make) |
| 54 | debug-print-section make |
58 | debug-print-section make |
| 55 | make || die |
59 | emake || die "died running emake, $FUNCNAME:make" |
| 56 | ;; |
60 | ;; |
| 57 | all) |
61 | all) |
| 58 | debug-print-section all |
62 | debug-print-section all |
| 59 | base_src_compile configure make |
63 | base_src_compile configure make |
| 60 | ;; |
64 | ;; |
| … | |
… | |
| 65 | |
69 | |
| 66 | } |
70 | } |
| 67 | |
71 | |
| 68 | base_src_install() { |
72 | base_src_install() { |
| 69 | |
73 | |
| 70 | debug-print-function base_src_install $* |
74 | debug-print-function $FUNCNAME $* |
| 71 | [ -z "$1" ] && base_src_install all |
75 | [ -z "$1" ] && base_src_install all |
|
|
76 | |
|
|
77 | cd ${S} |
| 72 | |
78 | |
| 73 | while [ "$1" ]; do |
79 | while [ "$1" ]; do |
| 74 | |
80 | |
| 75 | case $1 in |
81 | case $1 in |
| 76 | make) |
82 | make) |
| 77 | debug-print-section make |
83 | debug-print-section make |
| 78 | make DESTDIR=${D} install || die |
84 | make DESTDIR=${D} install || die "died running make install, $FUNCNAME:make" |
| 79 | ;; |
85 | ;; |
| 80 | all) |
86 | all) |
| 81 | debug-prnit-section all |
87 | debug-print-section all |
| 82 | base_src_install make |
88 | base_src_install make |
| 83 | ;; |
89 | ;; |
| 84 | esac |
90 | esac |
| 85 | |
91 | |
| 86 | shift |
92 | shift |
| 87 | done |
93 | done |
| 88 | |
94 | |
| 89 | } |
95 | } |
| 90 | |
96 | |
| 91 | EXPORT_FUNCTIONS src_unpack src_compile src_install |
97 | EXPORT_FUNCTIONS src_unpack src_compile src_install |
| 92 | |
|
|
| 93 | # misc helper functions |
|
|
| 94 | # adds all parameters to DEPEND and RDEPEND |
|
|
| 95 | newdepend() { |
|
|
| 96 | |
|
|
| 97 | debug-print-function newdepend $* |
|
|
| 98 | debug-print "newdepend: DEPEND=$DEPEND RDEPEND=$RDEPEND" |
|
|
| 99 | |
|
|
| 100 | while [ -n "$1" ]; do |
|
|
| 101 | DEPEND="$DEPEND $1" |
|
|
| 102 | RDEPEND="$RDEPEND $1" |
|
|
| 103 | shift |
|
|
| 104 | done |
|
|
| 105 | |
|
|
| 106 | } |
|
|
| 107 | |
|
|