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

Diff of /eclass/base.eclass

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

Revision 1.23 Revision 1.34
1# Copyright 1999-2003 Gentoo Technologies, Inc. 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.23 2003/04/08 17:48:12 danarmak Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/base.eclass,v 1.34 2008/07/17 09:49:14 pva Exp $
4
5# @ECLASS: base.eclass
6# @MAINTAINER:
7# ???
4# 8#
5# Author Dan Armak <danarmak@gentoo.org> 9# Original author Dan Armak <danarmak@gentoo.org>
6# 10# @BLURB: The base eclass defines some default functions and variables.
11# @DESCRIPTION:
7# The base eclass defines some default functions and variables. Nearly everything 12# The base eclass defines some default functions and variables. Nearly
8# else inherits from here. 13# everything else inherits from here.
9 14
10ECLASS=base 15
11INHERITED="$INHERITED $ECLASS" 16inherit eutils
12S=${WORKDIR}/${P} 17
13DESCRIPTION="Based on the $ECLASS eclass" 18DESCRIPTION="Based on the $ECLASS eclass"
14 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.
15base_src_unpack() { 25base_src_unpack() {
16 26
17 debug-print-function $FUNCNAME $* 27 debug-print-function $FUNCNAME $*
18 [ -z "$1" ] && base_src_unpack all 28 [ -z "$1" ] && base_src_unpack all
19 29
20 cd ${WORKDIR} 30 cd "${WORKDIR}"
21 31
22 while [ "$1" ]; do 32 while [ "$1" ]; do
23 33
24 case $1 in 34 case $1 in
25 unpack) 35 unpack)
26 debug-print-section unpack 36 debug-print-section unpack
27 unpack ${A} 37 unpack ${A}
28 ;; 38 ;;
29 patch) 39 patch)
30 debug-print-section patch 40 debug-print-section patch
31 cd ${S} 41 cd "${S}"
32 patch -p0 < ${FILESDIR}/${P}-gentoo.diff 42 epatch "${FILESDIR}/${P}-gentoo.diff"
33 ;; 43 ;;
34 autopatch) 44 autopatch)
35 debug-print-section autopatch 45 debug-print-section autopatch
36 debug-print "$FUNCNAME: autopatch: PATCHES=$PATCHES, PATCHES1=$PATCHES1" 46 debug-print "$FUNCNAME: autopatch: PATCHES=$PATCHES, PATCHES1=$PATCHES1"
37 cd ${S} 47 cd "${S}"
48 if [[ ${#PATCHES[@]} -gt 1 ]]; then
38 for x in $PATCHES; do 49 for x in "${PATCHES[@]}"; do
39 debug-print "$FUNCNAME: autopatch: patching from ${x}" 50 debug-print "$FUNCNAME: autopatch: patching from ${x}"
40 patch -p0 < ${x} 51 epatch "${x}"
41 done 52 done
53 else
42 for x in $PATCHES1; do 54 for x in ${PATCHES} ${PATCHES1}; do
43 debug-print "$FUNCNAME: autopatch: patching -p1 from ${x}" 55 debug-print "$FUNCNAME: autopatch: patching from ${x}"
44 patch -p1 < ${x} 56 epatch "${x}"
45 done 57 done
58 fi
46 ;; 59 ;;
47 all) 60 all)
48 debug-print-section all 61 debug-print-section all
49 base_src_unpack unpack autopatch 62 base_src_unpack unpack autopatch
50 ;; 63 ;;
51 esac 64 esac
52 65
53 shift 66 shift
54 done 67 done
55 68
56} 69}
57 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.
58base_src_compile() { 76base_src_compile() {
59 77
60 debug-print-function $FUNCNAME $* 78 debug-print-function $FUNCNAME $*
61 [ -z "$1" ] && base_src_compile all 79 [ -z "$1" ] && base_src_compile all
62 80
63 cd ${S} 81 cd "${S}"
64 82
65 while [ "$1" ]; do 83 while [ "$1" ]; do
66 84
67 case $1 in 85 case $1 in
68 configure) 86 configure)
69 debug-print-section configure 87 debug-print-section configure
70 econf || die "died running econf, $FUNCNAME:configure" 88 econf || die "died running econf, $FUNCNAME:configure"
71 ;; 89 ;;
72 make) 90 make)
73 debug-print-section make 91 debug-print-section make
74 emake || die "died running emake, $FUNCNAME:make" 92 emake || die "died running emake, $FUNCNAME:make"
75 ;; 93 ;;
76 all) 94 all)
77 debug-print-section all 95 debug-print-section all
78 base_src_compile configure make 96 base_src_compile configure make
79 ;; 97 ;;
80 esac 98 esac
81 99
82 shift 100 shift
83 done 101 done
84 102
85} 103}
86 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.
87base_src_install() { 110base_src_install() {
88 111
89 debug-print-function $FUNCNAME $* 112 debug-print-function $FUNCNAME $*
90 [ -z "$1" ] && base_src_install all 113 [ -z "$1" ] && base_src_install all
91 114
92 cd ${S} 115 cd "${S}"
93 116
94 while [ "$1" ]; do 117 while [ "$1" ]; do
95 118
96 case $1 in 119 case $1 in
97 make) 120 make)
98 debug-print-section make 121 debug-print-section make
99 make DESTDIR=${D} install || die "died running make install, $FUNCNAME:make" 122 make DESTDIR="${D}" install || die "died running make install, $FUNCNAME:make"
100 ;; 123 ;;
101 all) 124 all)
102 debug-print-section all 125 debug-print-section all
103 base_src_install make 126 base_src_install make
104 ;; 127 ;;

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

  ViewVC Help
Powered by ViewVC 1.1.20