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

Contents of /eclass/base.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.33 - (hide annotations) (download)
Sat Feb 16 20:12:58 2008 UTC (6 years, 4 months ago) by betelgeuse
Branch: MAIN
Changes since 1.32: +12 -5 lines
Add possibility to use bash arrays for PATCHES.

1 vapier 1.24 # Copyright 1999-2004 Gentoo Foundation
2 vapier 1.18 # Distributed under the terms of the GNU General Public License v2
3 betelgeuse 1.33 # $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.32 2008/02/12 23:51:51 betelgeuse Exp $
4 vapier 1.20 #
5 betelgeuse 1.31 # Author Dan Armak <danarmak@gentoo.org> (nowadays retired)
6 vapier 1.20 #
7 danarmak 1.1 # The base eclass defines some default functions and variables. Nearly everything
8     # else inherits from here.
9 vapier 1.18
10 flameeyes 1.29 inherit eutils
11    
12 vapier 1.22 DESCRIPTION="Based on the $ECLASS eclass"
13 danarmak 1.1
14     base_src_unpack() {
15 danarmak 1.6
16 danarmak 1.8 debug-print-function $FUNCNAME $*
17 danarmak 1.6 [ -z "$1" ] && base_src_unpack all
18    
19 betelgeuse 1.32 cd "${WORKDIR}"
20 danarmak 1.12
21 danarmak 1.6 while [ "$1" ]; do
22    
23 danarmak 1.1 case $1 in
24 danarmak 1.17 unpack)
25 danarmak 1.6 debug-print-section unpack
26     unpack ${A}
27     ;;
28 danarmak 1.17 patch)
29 danarmak 1.6 debug-print-section patch
30 betelgeuse 1.32 cd "${S}"
31     epatch "${FILESDIR}/${P}-gentoo.diff"
32 danarmak 1.6 ;;
33 danarmak 1.17 autopatch)
34 danarmak 1.15 debug-print-section autopatch
35 danarmak 1.23 debug-print "$FUNCNAME: autopatch: PATCHES=$PATCHES, PATCHES1=$PATCHES1"
36 betelgeuse 1.32 cd "${S}"
37 betelgeuse 1.33 if [[ ${#PATCHES[@]} -gt 1 ]]; then
38     for x in "${PATCHES[@]}"; do
39     debug-print "$FUNCNAME: autopatch: patching from ${x}"
40     epatch "${x}"
41     done
42     else
43     for x in ${PATCHES} ${PATCHES1}; do
44     debug-print "$FUNCNAME: autopatch: patching from ${x}"
45     epatch "${x}"
46     done
47     fi
48 danarmak 1.15 ;;
49 george 1.30 all)
50 danarmak 1.6 debug-print-section all
51 danarmak 1.15 base_src_unpack unpack autopatch
52 danarmak 1.6 ;;
53 danarmak 1.17 esac
54 danarmak 1.6
55     shift
56     done
57 swegener 1.27
58 danarmak 1.1 }
59    
60     base_src_compile() {
61 danarmak 1.4
62 danarmak 1.17 debug-print-function $FUNCNAME $*
63     [ -z "$1" ] && base_src_compile all
64 danarmak 1.6
65 betelgeuse 1.32 cd "${S}"
66 danarmak 1.12
67 danarmak 1.17 while [ "$1" ]; do
68 danarmak 1.6
69 danarmak 1.1 case $1 in
70 danarmak 1.17 configure)
71 george 1.30 debug-print-section configure
72     econf || die "died running econf, $FUNCNAME:configure"
73     ;;
74 danarmak 1.17 make)
75 george 1.30 debug-print-section make
76     emake || die "died running emake, $FUNCNAME:make"
77     ;;
78 danarmak 1.17 all)
79 george 1.30 debug-print-section all
80     base_src_compile configure make
81     ;;
82 danarmak 1.1 esac
83 swegener 1.27
84 danarmak 1.17 shift
85     done
86 swegener 1.27
87 danarmak 1.1 }
88    
89     base_src_install() {
90    
91 danarmak 1.8 debug-print-function $FUNCNAME $*
92 danarmak 1.6 [ -z "$1" ] && base_src_install all
93    
94 betelgeuse 1.32 cd "${S}"
95 danarmak 1.12
96 danarmak 1.6 while [ "$1" ]; do
97 danarmak 1.4
98 danarmak 1.1 case $1 in
99 danarmak 1.17 make)
100 danarmak 1.6 debug-print-section make
101 betelgeuse 1.32 make DESTDIR="${D}" install || die "died running make install, $FUNCNAME:make"
102 danarmak 1.6 ;;
103 danarmak 1.17 all)
104 danarmak 1.11 debug-print-section all
105 danarmak 1.6 base_src_install make
106     ;;
107 danarmak 1.1 esac
108 danarmak 1.6
109     shift
110     done
111    
112 danarmak 1.1 }
113    
114 danarmak 1.4 EXPORT_FUNCTIONS src_unpack src_compile src_install

  ViewVC Help
Powered by ViewVC 1.1.20