| 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.9 2002/01/04 12:06:28 danarmak Exp $ |
4 | # $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.11 2002/02/07 18:52:18 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 functions |
| 7 | ECLASS=base |
8 | ECLASS=base |
| 8 | |
9 | |
| 9 | S=${WORKDIR}/${P} |
10 | S=${WORKDIR}/${P} |
| 10 | DESCRIPTION="Based on the $ECLASS eclass" |
11 | DESCRIPTION="Based on the $ECLASS eclass" |
| 11 | |
12 | |
| … | |
… | |
| 15 | [ -z "$1" ] && base_src_unpack all |
16 | [ -z "$1" ] && base_src_unpack all |
| 16 | |
17 | |
| 17 | while [ "$1" ]; do |
18 | while [ "$1" ]; do |
| 18 | |
19 | |
| 19 | case $1 in |
20 | case $1 in |
| 20 | unpack) |
21 | unpack) |
| 21 | debug-print-section unpack |
22 | debug-print-section unpack |
| 22 | unpack ${A} |
23 | unpack ${A} |
| 23 | ;; |
24 | ;; |
| 24 | patch) |
25 | patch) |
| 25 | debug-print-section patch |
26 | debug-print-section patch |
| … | |
… | |
| 28 | ;; |
29 | ;; |
| 29 | all) |
30 | all) |
| 30 | debug-print-section all |
31 | debug-print-section all |
| 31 | base_src_unpack unpack |
32 | base_src_unpack unpack |
| 32 | ;; |
33 | ;; |
| 33 | esac |
34 | esac |
| 34 | |
35 | |
| 35 | shift |
36 | shift |
| 36 | done |
37 | done |
| 37 | |
38 | |
| 38 | } |
39 | } |
| … | |
… | |
| 45 | while [ "$1" ]; do |
46 | while [ "$1" ]; do |
| 46 | |
47 | |
| 47 | case $1 in |
48 | case $1 in |
| 48 | configure) |
49 | configure) |
| 49 | debug-print-section configure |
50 | debug-print-section configure |
| 50 | ./configure || die |
51 | ./configure || die "died running ./configure, $FUNCNAME:configure" |
| 51 | ;; |
52 | ;; |
| 52 | make) |
53 | make) |
| 53 | debug-print-section make |
54 | debug-print-section make |
| 54 | make || die |
55 | make || die "died running make, $FUNCNAME:make" |
| 55 | ;; |
56 | ;; |
| 56 | all) |
57 | all) |
| 57 | debug-print-section all |
58 | debug-print-section all |
| 58 | base_src_compile configure make |
59 | base_src_compile configure make |
| 59 | ;; |
60 | ;; |
| … | |
… | |
| 70 | [ -z "$1" ] && base_src_install all |
71 | [ -z "$1" ] && base_src_install all |
| 71 | |
72 | |
| 72 | while [ "$1" ]; do |
73 | while [ "$1" ]; do |
| 73 | |
74 | |
| 74 | case $1 in |
75 | case $1 in |
| 75 | make) |
76 | make) |
| 76 | debug-print-section make |
77 | debug-print-section make |
| 77 | make DESTDIR=${D} install || die |
78 | make DESTDIR=${D} install || die "died running make install, $FUNCNAME:make" |
| 78 | ;; |
79 | ;; |
| 79 | all) |
80 | all) |
| 80 | debug-prnit-section all |
81 | debug-print-section all |
| 81 | base_src_install make |
82 | base_src_install make |
| 82 | ;; |
83 | ;; |
| 83 | esac |
84 | esac |
| 84 | |
85 | |
| 85 | shift |
86 | shift |
| … | |
… | |
| 87 | |
88 | |
| 88 | } |
89 | } |
| 89 | |
90 | |
| 90 | EXPORT_FUNCTIONS src_unpack src_compile src_install |
91 | EXPORT_FUNCTIONS src_unpack src_compile src_install |
| 91 | |
92 | |
| 92 | # misc helper functions |
|
|
| 93 | # adds all parameters to DEPEND and RDEPEND |
|
|
| 94 | newdepend() { |
|
|
| 95 | |
|
|
| 96 | debug-print-function newdepend $* |
|
|
| 97 | debug-print "newdepend: DEPEND=$DEPEND RDEPEND=$RDEPEND" |
|
|
| 98 | |
|
|
| 99 | while [ -n "$1" ]; do |
|
|
| 100 | DEPEND="$DEPEND $1" |
|
|
| 101 | RDEPEND="$RDEPEND $1" |
|
|
| 102 | shift |
|
|
| 103 | done |
|
|
| 104 | |
|
|
| 105 | } |
|
|
| 106 | |
|
|