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