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

Contents of /eclass/base.eclass

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.34 - (hide annotations) (download)
Thu Jul 17 09:49:14 2008 UTC (6 years, 5 months ago) by pva
Branch: MAIN
Changes since 1.33: +27 -6 lines
Make eclass ready for eclass-manpages, bug #210363, thank mren for all work.

1 pva 1.34 # Copyright 1999-2008 Gentoo Foundation
2 vapier 1.18 # Distributed under the terms of the GNU General Public License v2
3 pva 1.34 # $Header: $
4    
5     # @ECLASS: base.eclass
6     # @MAINTAINER:
7     # ???
8 vapier 1.20 #
9 pva 1.34 # 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 vapier 1.18
16 flameeyes 1.29 inherit eutils
17    
18 vapier 1.22 DESCRIPTION="Based on the $ECLASS eclass"
19 danarmak 1.1
20 pva 1.34 # @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.
25 danarmak 1.1 base_src_unpack() {
26 danarmak 1.6
27 danarmak 1.8 debug-print-function $FUNCNAME $*
28 danarmak 1.6 [ -z "$1" ] && base_src_unpack all
29    
30 betelgeuse 1.32 cd "${WORKDIR}"
31 danarmak 1.12
32 danarmak 1.6 while [ "$1" ]; do
33    
34 danarmak 1.1 case $1 in
35 danarmak 1.17 unpack)
36 danarmak 1.6 debug-print-section unpack
37     unpack ${A}
38     ;;
39 danarmak 1.17 patch)
40 danarmak 1.6 debug-print-section patch
41 betelgeuse 1.32 cd "${S}"
42     epatch "${FILESDIR}/${P}-gentoo.diff"
43 danarmak 1.6 ;;
44 danarmak 1.17 autopatch)
45 danarmak 1.15 debug-print-section autopatch
46 danarmak 1.23 debug-print "$FUNCNAME: autopatch: PATCHES=$PATCHES, PATCHES1=$PATCHES1"
47 betelgeuse 1.32 cd "${S}"
48 betelgeuse 1.33 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 danarmak 1.15 ;;
60 george 1.30 all)
61 danarmak 1.6 debug-print-section all
62 danarmak 1.15 base_src_unpack unpack autopatch
63 danarmak 1.6 ;;
64 danarmak 1.17 esac
65 danarmak 1.6
66     shift
67     done
68 swegener 1.27
69 danarmak 1.1 }
70    
71 pva 1.34 # @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.
76 danarmak 1.1 base_src_compile() {
77 danarmak 1.4
78 danarmak 1.17 debug-print-function $FUNCNAME $*
79     [ -z "$1" ] && base_src_compile all
80 danarmak 1.6
81 betelgeuse 1.32 cd "${S}"
82 danarmak 1.12
83 danarmak 1.17 while [ "$1" ]; do
84 danarmak 1.6
85 danarmak 1.1 case $1 in
86 danarmak 1.17 configure)
87 george 1.30 debug-print-section configure
88     econf || die "died running econf, $FUNCNAME:configure"
89     ;;
90 danarmak 1.17 make)
91 george 1.30 debug-print-section make
92     emake || die "died running emake, $FUNCNAME:make"
93     ;;
94 danarmak 1.17 all)
95 george 1.30 debug-print-section all
96     base_src_compile configure make
97     ;;
98 danarmak 1.1 esac
99 swegener 1.27
100 danarmak 1.17 shift
101     done
102 swegener 1.27
103 danarmak 1.1 }
104    
105 pva 1.34 # @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.
110 danarmak 1.1 base_src_install() {
111    
112 danarmak 1.8 debug-print-function $FUNCNAME $*
113 danarmak 1.6 [ -z "$1" ] && base_src_install all
114    
115 betelgeuse 1.32 cd "${S}"
116 danarmak 1.12
117 danarmak 1.6 while [ "$1" ]; do
118 danarmak 1.4
119 danarmak 1.1 case $1 in
120 danarmak 1.17 make)
121 danarmak 1.6 debug-print-section make
122 betelgeuse 1.32 make DESTDIR="${D}" install || die "died running make install, $FUNCNAME:make"
123 danarmak 1.6 ;;
124 danarmak 1.17 all)
125 danarmak 1.11 debug-print-section all
126 danarmak 1.6 base_src_install make
127     ;;
128 danarmak 1.1 esac
129 danarmak 1.6
130     shift
131     done
132    
133 danarmak 1.1 }
134    
135 danarmak 1.4 EXPORT_FUNCTIONS src_unpack src_compile src_install

  ViewVC Help
Powered by ViewVC 1.1.20