| 1 | # Copyright 1999-2000 Gentoo Technologies, Inc. |
1 | # Copyright 1999-2003 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 |
|
|
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.23 2003/04/08 17:48:12 danarmak Exp $ |
|
|
4 | # |
| 3 | # Author Dan Armak <danarmak@gentoo.org> |
5 | # 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 $ |
6 | # |
| 5 | # The base eclass defines some default functions and variables. Nearly everything |
7 | # The base eclass defines some default functions and variables. Nearly everything |
| 6 | # else inherits from here. |
8 | # else inherits from here. |
| 7 | . /usr/portage/eclass/inherit.eclass || die |
9 | |
| 8 | inherit virtual || die |
|
|
| 9 | ECLASS=base |
10 | ECLASS=base |
| 10 | |
11 | INHERITED="$INHERITED $ECLASS" |
| 11 | S=${WORKDIR}/${P} |
12 | S=${WORKDIR}/${P} |
| 12 | DESCRIPTION="Based on the $ECLASS eclass" |
13 | DESCRIPTION="Based on the $ECLASS eclass" |
| 13 | |
14 | |
| 14 | base_src_unpack() { |
15 | base_src_unpack() { |
| 15 | |
16 | |
|
|
17 | debug-print-function $FUNCNAME $* |
|
|
18 | [ -z "$1" ] && base_src_unpack all |
|
|
19 | |
|
|
20 | cd ${WORKDIR} |
|
|
21 | |
| 16 | while [ "$1" ]; do |
22 | while [ "$1" ]; do |
| 17 | |
23 | |
| 18 | case $1 in |
24 | case $1 in |
| 19 | unpack) |
25 | unpack) |
|
|
26 | debug-print-section unpack |
| 20 | unpack ${A} |
27 | unpack ${A} |
| 21 | ;; |
28 | ;; |
| 22 | all) |
29 | patch) |
| 23 | base_src_unpack unpack |
30 | debug-print-section patch |
|
|
31 | cd ${S} |
|
|
32 | patch -p0 < ${FILESDIR}/${P}-gentoo.diff |
| 24 | ;; |
33 | ;; |
|
|
34 | autopatch) |
|
|
35 | debug-print-section autopatch |
|
|
36 | debug-print "$FUNCNAME: autopatch: PATCHES=$PATCHES, PATCHES1=$PATCHES1" |
|
|
37 | cd ${S} |
|
|
38 | for x in $PATCHES; do |
|
|
39 | debug-print "$FUNCNAME: autopatch: patching from ${x}" |
|
|
40 | patch -p0 < ${x} |
|
|
41 | done |
|
|
42 | for x in $PATCHES1; do |
|
|
43 | debug-print "$FUNCNAME: autopatch: patching -p1 from ${x}" |
|
|
44 | patch -p1 < ${x} |
|
|
45 | done |
|
|
46 | ;; |
|
|
47 | all) |
|
|
48 | debug-print-section all |
|
|
49 | base_src_unpack unpack autopatch |
|
|
50 | ;; |
| 25 | esac |
51 | esac |
| 26 | |
52 | |
| 27 | shift |
53 | shift |
| 28 | done |
54 | done |
| 29 | |
55 | |
| 30 | } |
56 | } |
| 31 | |
57 | |
| 32 | base_src_compile() { |
58 | base_src_compile() { |
| 33 | |
59 | |
|
|
60 | debug-print-function $FUNCNAME $* |
|
|
61 | [ -z "$1" ] && base_src_compile all |
|
|
62 | |
|
|
63 | cd ${S} |
|
|
64 | |
| 34 | while [ "$1" ]; do |
65 | while [ "$1" ]; do |
| 35 | |
66 | |
| 36 | case $1 in |
67 | case $1 in |
| 37 | configure) |
68 | configure) |
| 38 | configure || die |
69 | debug-print-section configure |
|
|
70 | econf || die "died running econf, $FUNCNAME:configure" |
| 39 | ;; |
71 | ;; |
| 40 | make) |
72 | make) |
| 41 | make || die |
73 | debug-print-section make |
|
|
74 | emake || die "died running emake, $FUNCNAME:make" |
| 42 | ;; |
75 | ;; |
| 43 | all) |
76 | all) |
|
|
77 | debug-print-section all |
| 44 | base_src_compile configure make |
78 | base_src_compile configure make |
| 45 | ;; |
79 | ;; |
| 46 | esac |
80 | esac |
| 47 | |
81 | |
| 48 | shift |
82 | shift |
| 49 | done |
83 | done |
| 50 | |
84 | |
| 51 | } |
85 | } |
| 52 | |
86 | |
| 53 | base_src_install() { |
87 | base_src_install() { |
| 54 | |
88 | |
|
|
89 | debug-print-function $FUNCNAME $* |
|
|
90 | [ -z "$1" ] && base_src_install all |
|
|
91 | |
|
|
92 | cd ${S} |
|
|
93 | |
| 55 | while [ "$1" ]; do |
94 | while [ "$1" ]; do |
| 56 | |
95 | |
| 57 | case $1 in |
96 | case $1 in |
| 58 | make) |
97 | make) |
| 59 | make DESTDIR=${D} install || die |
98 | debug-print-section make |
|
|
99 | make DESTDIR=${D} install || die "died running make install, $FUNCNAME:make" |
| 60 | ;; |
100 | ;; |
| 61 | all) |
101 | all) |
|
|
102 | debug-print-section all |
| 62 | base_src_install make |
103 | base_src_install make |
| 63 | ;; |
104 | ;; |
| 64 | esac |
105 | esac |
| 65 | |
106 | |
| 66 | shift |
107 | shift |
| 67 | done |
108 | done |
| 68 | |
109 | |
| 69 | } |
110 | } |
| 70 | |
111 | |
| 71 | EXPORT_FUNCTIONS |
112 | EXPORT_FUNCTIONS src_unpack src_compile src_install |
| 72 | |
|
|