/[gentoo-x86]/eclass/base.eclass
Gentoo

Diff of /eclass/base.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.13 Revision 1.34
1# Copyright 1999-2000 Gentoo Technologies, Inc. 1# Copyright 1999-2008 Gentoo Foundation
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# Author Dan Armak <danarmak@gentoo.org>
4# $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.13 2002/03/30 12:52:14 danarmak Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.34 2008/07/17 09:49:14 pva Exp $
5# The base eclass defines some default functions and variables. Nearly everything
6# else inherits from here.
7[ -n "$COMPAT" ] && inherit functions
8ECLASS=base
9 4
10S=${WORKDIR}/${P} 5# @ECLASS: base.eclass
6# @MAINTAINER:
7# ???
8#
9# Original author Dan Armak <danarmak@gentoo.org>
10# @BLURB: The base eclass defines some default functions and variables.
11# @DESCRIPTION:
12# The base eclass defines some default functions and variables. Nearly
13# everything else inherits from here.
14
15
16inherit eutils
17
11DESCRIPTION="Based on the $ECLASS eclass" 18DESCRIPTION="Based on the $ECLASS eclass"
12 19
20# @FUNCTION: base_src_unpack
21# @USAGE: [ unpack ] [ patch ] [ autopatch ] [ all ]
22# @DESCRIPTION:
23# The base src_unpack function, which is exported. If no argument is given,
24# "all" is assumed.
13base_src_unpack() { 25base_src_unpack() {
14 26
15 debug-print-function $FUNCNAME $* 27 debug-print-function $FUNCNAME $*
16 [ -z "$1" ] && base_src_unpack all 28 [ -z "$1" ] && base_src_unpack all
17 29
18 cd ${WORKDIR} 30 cd "${WORKDIR}"
19 31
20 while [ "$1" ]; do 32 while [ "$1" ]; do
21 33
22 case $1 in 34 case $1 in
23 unpack) 35 unpack)
24 debug-print-section unpack 36 debug-print-section unpack
25 unpack ${A} 37 unpack ${A}
26 ;; 38 ;;
27 patch) 39 patch)
28 debug-print-section patch 40 debug-print-section patch
29 cd ${S} 41 cd "${S}"
30 patch -p0 < ${FILESDIR}/${P}-gentoo.diff 42 epatch "${FILESDIR}/${P}-gentoo.diff"
31 ;; 43 ;;
32 all) 44 autopatch)
45 debug-print-section autopatch
46 debug-print "$FUNCNAME: autopatch: PATCHES=$PATCHES, PATCHES1=$PATCHES1"
47 cd "${S}"
48 if [[ ${#PATCHES[@]} -gt 1 ]]; then
49 for x in "${PATCHES[@]}"; do
50 debug-print "$FUNCNAME: autopatch: patching from ${x}"
51 epatch "${x}"
52 done
53 else
54 for x in ${PATCHES} ${PATCHES1}; do
55 debug-print "$FUNCNAME: autopatch: patching from ${x}"
56 epatch "${x}"
57 done
58 fi
59 ;;
60 all)
33 debug-print-section all 61 debug-print-section all
34 base_src_unpack unpack 62 base_src_unpack unpack autopatch
35 ;; 63 ;;
36 esac 64 esac
37 65
38 shift 66 shift
39 done 67 done
40 68
41} 69}
42 70
71# @FUNCTION: base_src_compile
72# @USAGE: [ configure ] [ make ] [ all ]
73# @DESCRIPTION:
74# The base src_compile function, which is exported. If no argument is given,
75# "all" is asasumed.
43base_src_compile() { 76base_src_compile() {
44 77
45 debug-print-function $FUNCNAME $* 78 debug-print-function $FUNCNAME $*
46 [ -z "$1" ] && base_src_compile all 79 [ -z "$1" ] && base_src_compile all
47 80
48 cd ${S} 81 cd "${S}"
49 82
50 while [ "$1" ]; do 83 while [ "$1" ]; do
51 84
52 case $1 in 85 case $1 in
53 configure) 86 configure)
54 debug-print-section configure 87 debug-print-section configure
55 econf || die "died running econf, $FUNCNAME:configure" 88 econf || die "died running econf, $FUNCNAME:configure"
56 ;; 89 ;;
57 make) 90 make)
58 debug-print-section make 91 debug-print-section make
59 emake || die "died running emake, $FUNCNAME:make" 92 emake || die "died running emake, $FUNCNAME:make"
60 ;; 93 ;;
61 all) 94 all)
62 debug-print-section all 95 debug-print-section all
63 base_src_compile configure make 96 base_src_compile configure make
64 ;; 97 ;;
65 esac 98 esac
66 99
67 shift 100 shift
68 done 101 done
69 102
70} 103}
71 104
105# @FUNCTION: base_src_install
106# @USAGE: [ make ] [ all ]
107# @DESCRIPTION:
108# The base src_install function, which is exported. If no argument is given,
109# "all" is assumed.
72base_src_install() { 110base_src_install() {
73 111
74 debug-print-function $FUNCNAME $* 112 debug-print-function $FUNCNAME $*
75 [ -z "$1" ] && base_src_install all 113 [ -z "$1" ] && base_src_install all
76 114
77 cd ${S} 115 cd "${S}"
78 116
79 while [ "$1" ]; do 117 while [ "$1" ]; do
80 118
81 case $1 in 119 case $1 in
82 make) 120 make)
83 debug-print-section make 121 debug-print-section make
84 make DESTDIR=${D} install || die "died running make install, $FUNCNAME:make" 122 make DESTDIR="${D}" install || die "died running make install, $FUNCNAME:make"
85 ;; 123 ;;
86 all) 124 all)
87 debug-print-section all 125 debug-print-section all
88 base_src_install make 126 base_src_install make
89 ;; 127 ;;
90 esac 128 esac
91 129

Legend:
Removed from v.1.13  
changed lines
  Added in v.1.34

  ViewVC Help
Powered by ViewVC 1.1.20