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

Diff of /eclass/base.eclass

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

Revision 1.4 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.4 2001/09/29 12:35:38 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. /usr/portage/eclass/inherit.eclass || die
8inherit virtual || die
9ECLASS=base
10 4
11S=${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
12DESCRIPTION="Based on the $ECLASS eclass" 18DESCRIPTION="Based on the $ECLASS eclass"
13 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.
14base_src_unpack() { 25base_src_unpack() {
15 26
16 echo "in base_src_unpack, 1st parameter is $1" 27 debug-print-function $FUNCNAME $*
17 [ -z "$1" ] && base_src_unpack all 28 [ -z "$1" ] && base_src_unpack all
18 29
30 cd "${WORKDIR}"
31
19 while [ "$1" ]; do 32 while [ "$1" ]; do
20 33
21 case $1 in 34 case $1 in
22 unpack) 35 unpack)
23 echo "in base_src_unpack, action unpack" 36 debug-print-section unpack
24 unpack ${A} 37 unpack ${A}
25 ;; 38 ;;
26 all) 39 patch)
27 echo "in base_src_unpack, action all" 40 debug-print-section patch
28 base_src_unpack unpack 41 cd "${S}"
42 epatch "${FILESDIR}/${P}-gentoo.diff"
29 ;; 43 ;;
30 esac 44 autopatch)
31 45 debug-print-section autopatch
32 shift 46 debug-print "$FUNCNAME: autopatch: PATCHES=$PATCHES, PATCHES1=$PATCHES1"
33 done 47 cd "${S}"
34 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)
61 debug-print-section all
62 base_src_unpack unpack autopatch
63 ;;
64 esac
65
66 shift
67 done
68
35} 69}
36 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.
37base_src_compile() { 76base_src_compile() {
38 77
39 echo "in base_src_compile, 1st parameter is $1" 78 debug-print-function $FUNCNAME $*
40 [ -z "$1" ] && base_src_compile all 79 [ -z "$1" ] && base_src_compile all
41 80
81 cd "${S}"
82
42 while [ "$1" ]; do 83 while [ "$1" ]; do
43 84
44 case $1 in 85 case $1 in
45 configure) 86 configure)
46 echo "in base_src_compile, action configure" 87 debug-print-section configure
47 ./configure || die 88 econf || die "died running econf, $FUNCNAME:configure"
48 ;; 89 ;;
49 make) 90 make)
50 echo "in base_src_compile, action make" 91 debug-print-section make
51 make || die 92 emake || die "died running emake, $FUNCNAME:make"
52 ;; 93 ;;
53 all) 94 all)
54 echo "in base_src_compile, action all" 95 debug-print-section all
55 base_src_compile configure make 96 base_src_compile configure make
56 ;; 97 ;;
57 esac 98 esac
58 99
59 shift 100 shift
60 done 101 done
61 102
62} 103}
63 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.
64base_src_install() { 110base_src_install() {
65 111
66 echo "in base_src_install, 1st parameter is $1" 112 debug-print-function $FUNCNAME $*
67 [ -z "$1" ] && base_src_install all 113 [ -z "$1" ] && base_src_install all
68 114
115 cd "${S}"
116
69 while [ "$1" ]; do 117 while [ "$1" ]; do
70 118
71 case $1 in 119 case $1 in
72 make) 120 make)
73 echo "in base_src_install, action make" 121 debug-print-section make
74 make DESTDIR=${D} install || die 122 make DESTDIR="${D}" install || die "died running make install, $FUNCNAME:make"
75 ;; 123 ;;
76 all) 124 all)
77 echo "in base_src_install, action all" 125 debug-print-section all
78 base_src_install make 126 base_src_install make
79 ;; 127 ;;
80 esac 128 esac
81 129
82 shift 130 shift
83 done 131 done
84 132
85} 133}
86 134
87EXPORT_FUNCTIONS src_unpack src_compile src_install 135EXPORT_FUNCTIONS src_unpack src_compile src_install
88

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

  ViewVC Help
Powered by ViewVC 1.1.20