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

Contents of /eclass/base.eclass

Parent Directory Parent Directory | Revision Log Revision Log


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

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

  ViewVC Help
Powered by ViewVC 1.1.20