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

Diff of /eclass/base.eclass

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

Revision 1.35 Revision 1.40
1# Copyright 1999-2008 Gentoo Foundation 1# Copyright 1999-2008 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.35 2008/11/09 15:47:47 loki_val Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.40 2010/01/03 21:07:32 mr_bones_ Exp $
4 4
5# @ECLASS: base.eclass 5# @ECLASS: base.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# Peter Alfredsen <loki_val@gentoo.org> 7# Peter Alfredsen <loki_val@gentoo.org>
8# 8#
36# "all" is assumed if EAPI!=2, "unpack" if EAPI=2. 36# "all" is assumed if EAPI!=2, "unpack" if EAPI=2.
37base_src_unpack() { 37base_src_unpack() {
38 38
39 debug-print-function $FUNCNAME "$@" 39 debug-print-function $FUNCNAME "$@"
40 40
41 if [ -z "$1" ] 41 if [ -z "$1" ] ; then
42 then
43 case "${EAPI:-0}" in 42 case "${EAPI:-0}" in
44 2) 43 2)
45 base_src_util unpack 44 base_src_util unpack
46 ;; 45 ;;
47 *) 46 *)
68# @USAGE: [ unpack ] [ patch ] [ autopatch ] [ all ] 67# @USAGE: [ unpack ] [ patch ] [ autopatch ] [ all ]
69# @DESCRIPTION: 68# @DESCRIPTION:
70# The base_src_util function is the grunt function for base src_unpack 69# The base_src_util function is the grunt function for base src_unpack
71# and base src_prepare. 70# and base src_prepare.
72base_src_util() { 71base_src_util() {
72 local x
73 73
74 debug-print-function $FUNCNAME "$@" 74 debug-print-function $FUNCNAME "$@"
75 75
76 cd "${WORKDIR}" 76 cd "${WORKDIR}"
77 77
78 while [ "$1" ]; do 78 while [ "$1" ]; do
79 79
80 case $1 in 80 case $1 in
81 unpack) 81 unpack)
82 debug-print-section unpack 82 debug-print-section unpack
83 if [ ! -z "$A" ] ; then
83 unpack ${A} 84 unpack ${A}
85 fi
84 ;; 86 ;;
85 patch) 87 patch)
86 debug-print-section patch 88 debug-print-section patch
87 cd "${S}" 89 cd "${S}"
88 epatch "${FILESDIR}/${P}-gentoo.diff" 90 epatch "${FILESDIR}/${P}-gentoo.diff"
89 ;; 91 ;;
90 autopatch) 92 autopatch)
91 debug-print-section autopatch 93 debug-print-section autopatch
92 debug-print "$FUNCNAME: autopatch: PATCHES=$PATCHES, PATCHES1=$PATCHES1" 94 debug-print "$FUNCNAME: autopatch: PATCHES=$PATCHES, PATCHES1=$PATCHES1"
93 cd "${S}" 95 cd "${S}"
94 if [[ ${#PATCHES[@]} -gt 1 ]]; then 96 if [[ ${#PATCHES[@]} -gt 1 ]] ; then
95 for x in "${PATCHES[@]}"; do 97 for x in "${PATCHES[@]}"; do
96 debug-print "$FUNCNAME: autopatch: patching from ${x}" 98 debug-print "$FUNCNAME: autopatch: patching from ${x}"
97 epatch "${x}" 99 epatch "${x}"
98 done 100 done
99 else 101 else
147 else 149 else
148 base_src_work $@ 150 base_src_work $@
149 fi 151 fi
150} 152}
151 153
154# placeholder for future api so eclasses can be migrated now.
155base_src_make() {
156 debug-print-function $FUNCNAME "$@"
157 base_src_work make
158}
159
152# @FUNCTION: base_src_work 160# @FUNCTION: base_src_work
153# @USAGE: [ configure ] [ make ] [ all ] 161# @USAGE: [ configure ] [ make ] [ all ]
154# @DESCRIPTION: 162# @DESCRIPTION:
155# The base_src_work function is the grunt function for base src_configure 163# The base_src_work function is the grunt function for base src_configure
156# and base src_compile. 164# and base src_compile.
163 while [ "$1" ]; do 171 while [ "$1" ]; do
164 172
165 case $1 in 173 case $1 in
166 configure) 174 configure)
167 debug-print-section configure 175 debug-print-section configure
176 if [[ -x ${ECONF_SOURCE:-.}/configure ]]
177 then
168 econf || die "died running econf, $FUNCNAME:configure" 178 econf || die "died running econf, $FUNCNAME:configure"
179 fi
169 ;; 180 ;;
170 make) 181 make)
171 debug-print-section make 182 debug-print-section make
183 if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]
184 then
172 emake || die "died running emake, $FUNCNAME:make" 185 emake || die "died running emake, $FUNCNAME:make"
186 fi
173 ;; 187 ;;
174 all) 188 all)
175 debug-print-section all 189 debug-print-section all
176 base_src_work configure make 190 base_src_work configure make
177 ;; 191 ;;

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.40

  ViewVC Help
Powered by ViewVC 1.1.20