| 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.38 2009/05/17 09:25:55 loki_val 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. |
| 37 | base_src_unpack() { |
37 | base_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. |
| 72 | base_src_util() { |
71 | base_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 |
| … | |
… | |
| 163 | while [ "$1" ]; do |
165 | while [ "$1" ]; do |
| 164 | |
166 | |
| 165 | case $1 in |
167 | case $1 in |
| 166 | configure) |
168 | configure) |
| 167 | debug-print-section configure |
169 | debug-print-section configure |
|
|
170 | if [[ -x ${ECONF_SOURCE:-.}/configure ]] |
|
|
171 | then |
| 168 | econf || die "died running econf, $FUNCNAME:configure" |
172 | econf || die "died running econf, $FUNCNAME:configure" |
|
|
173 | fi |
| 169 | ;; |
174 | ;; |
| 170 | make) |
175 | make) |
| 171 | debug-print-section make |
176 | debug-print-section make |
|
|
177 | if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ] |
|
|
178 | then |
| 172 | emake || die "died running emake, $FUNCNAME:make" |
179 | emake || die "died running emake, $FUNCNAME:make" |
|
|
180 | fi |
| 173 | ;; |
181 | ;; |
| 174 | all) |
182 | all) |
| 175 | debug-print-section all |
183 | debug-print-section all |
| 176 | base_src_work configure make |
184 | base_src_work configure make |
| 177 | ;; |
185 | ;; |