| 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.2 2001/09/28 19:30:09 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 | . /usr/portage/eclass/inherit.eclass || die |
7 | inherit functions |
| 8 | inherit virtual || die |
|
|
| 9 | ECLASS=base |
8 | ECLASS=base |
| 10 | |
9 | |
| 11 | S=${WORKDIR}/${P} |
10 | S=${WORKDIR}/${P} |
| 12 | DESCRIPTION="Based on the $ECLASS eclass" |
11 | DESCRIPTION="Based on the $ECLASS eclass" |
| 13 | |
12 | |
| 14 | base_src_unpack() { |
13 | base_src_unpack() { |
| 15 | |
14 | |
|
|
15 | debug-print-function $FUNCNAME $* |
|
|
16 | [ -z "$1" ] && base_src_unpack all |
|
|
17 | |
| 16 | while [ "$1" ]; do |
18 | while [ "$1" ]; do |
| 17 | |
19 | |
| 18 | case $1 in |
20 | case $1 in |
| 19 | unpack) |
21 | unpack) |
|
|
22 | debug-print-section unpack |
| 20 | unpack ${A} |
23 | unpack ${A} |
| 21 | ;; |
24 | ;; |
|
|
25 | patch) |
|
|
26 | debug-print-section patch |
|
|
27 | cd ${S} |
|
|
28 | patch -p0 < ${FILESDIR}/${P}-gentoo.diff |
|
|
29 | ;; |
| 22 | all) |
30 | all) |
|
|
31 | debug-print-section all |
| 23 | base_src_unpack unpack |
32 | base_src_unpack unpack |
| 24 | ;; |
33 | ;; |
| 25 | esac |
34 | esac |
| 26 | |
35 | |
| 27 | shift |
36 | shift |
| 28 | done |
37 | done |
| 29 | |
38 | |
| 30 | } |
39 | } |
| 31 | |
40 | |
| 32 | base_src_compile() { |
41 | base_src_compile() { |
| 33 | |
42 | |
|
|
43 | debug-print-function $FUNCNAME $* |
|
|
44 | [ -z "$1" ] && base_src_compile all |
|
|
45 | |
| 34 | while [ "$1" ]; do |
46 | while [ "$1" ]; do |
| 35 | |
47 | |
| 36 | case $1 in |
48 | case $1 in |
| 37 | configure) |
49 | configure) |
| 38 | configure || die |
50 | debug-print-section configure |
|
|
51 | ./configure || die "died running ./configure, $FUNCNAME:configure" |
| 39 | ;; |
52 | ;; |
| 40 | make) |
53 | make) |
| 41 | make || die |
54 | debug-print-section make |
|
|
55 | make || die "died running make, $FUNCNAME:make" |
| 42 | ;; |
56 | ;; |
| 43 | all) |
57 | all) |
|
|
58 | debug-print-section all |
| 44 | base_src_compile configure make |
59 | base_src_compile configure make |
| 45 | ;; |
60 | ;; |
| 46 | esac |
61 | esac |
| 47 | |
62 | |
| 48 | shift |
63 | shift |
| … | |
… | |
| 50 | |
65 | |
| 51 | } |
66 | } |
| 52 | |
67 | |
| 53 | base_src_install() { |
68 | base_src_install() { |
| 54 | |
69 | |
|
|
70 | debug-print-function $FUNCNAME $* |
|
|
71 | [ -z "$1" ] && base_src_install all |
|
|
72 | |
| 55 | while [ "$1" ]; do |
73 | while [ "$1" ]; do |
| 56 | |
74 | |
| 57 | case $1 in |
75 | case $1 in |
| 58 | make) |
76 | make) |
| 59 | make DESTDIR=${D} install || die |
77 | debug-print-section make |
|
|
78 | make DESTDIR=${D} install || die "died running make install, $FUNCNAME:make" |
| 60 | ;; |
79 | ;; |
| 61 | all) |
80 | all) |
|
|
81 | debug-print-section all |
| 62 | base_src_install make |
82 | base_src_install make |
| 63 | ;; |
83 | ;; |
| 64 | esac |
84 | esac |
| 65 | |
85 | |
| 66 | shift |
86 | shift |
| 67 | done |
87 | done |
| 68 | |
88 | |
| 69 | } |
89 | } |
| 70 | |
90 | |
| 71 | EXPORT_FUNCTIONS |
91 | EXPORT_FUNCTIONS src_unpack src_compile src_install |
| 72 | |
92 | |