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

Diff of /eclass/eutils.eclass

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

Revision 1.92 Revision 1.96
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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/eutils.eclass,v 1.92 2004/08/03 17:24:52 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.96 2004/08/24 11:51:28 lv Exp $
4# 4#
5# Author: Martin Schlemmer <azarah@gentoo.org> 5# Author: Martin Schlemmer <azarah@gentoo.org>
6# 6#
7# This eclass is for general purpose functions that most ebuilds 7# This eclass is for general purpose functions that most ebuilds
8# have to implement themselves. 8# have to implement themselves.
13INHERITED="$INHERITED $ECLASS" 13INHERITED="$INHERITED $ECLASS"
14 14
15DEPEND="!bootstrap? ( sys-devel/patch )" 15DEPEND="!bootstrap? ( sys-devel/patch )"
16 16
17DESCRIPTION="Based on the ${ECLASS} eclass" 17DESCRIPTION="Based on the ${ECLASS} eclass"
18
19# This function simply returns the desired lib directory. With portage
20# 2.0.51, we now have support for installing libraries to lib32/lib64
21# to accomidate the needs of multilib systems. It's no longer a good idea
22# to assume all libraries will end up in lib. Replace any (sane) instances
23# where lib is named directly with $(get_libdir) if possible.
24#
25# Travis Tilley <lv@gentoo.org> (24 Aug 2004)
26get_libdir() {
27 # CONF_LIBDIR wasnt supported until 2.0.51_pre18, so for all versions of
28 # portage prior to that lib would need to be used even if CONF_LIBDIR is
29 # set. dolib and friends will ignore CONF_LIBDIR in <2.0.51_pre20
30 portageq has_version / '<sys-apps/portage-2.0.51_pre20' && CONF_LIBDIR="lib"
31 # and of course, we need to default to lib when CONF_LIBDIR isnt set
32 echo ${CONF_LIBDIR:=lib}
33}
18 34
19# This function generate linker scripts in /usr/lib for dynamic 35# This function generate linker scripts in /usr/lib for dynamic
20# libs in /lib. This is to fix linking problems when you have 36# libs in /lib. This is to fix linking problems when you have
21# the .so in /lib, and the .a in /usr/lib. What happens is that 37# the .so in /lib, and the .a in /usr/lib. What happens is that
22# in some cases when linking dynamic, the .a in /usr/lib is used 38# in some cases when linking dynamic, the .a in /usr/lib is used
33# to point to the latest version of the library present. 49# to point to the latest version of the library present.
34# 50#
35# <azarah@gentoo.org> (26 Oct 2002) 51# <azarah@gentoo.org> (26 Oct 2002)
36# 52#
37gen_usr_ldscript() { 53gen_usr_ldscript() {
38
39 # Just make sure it exists 54 # Just make sure it exists
40 dodir /usr/lib 55 dodir /usr/$(get_libdir)
41 56
42 cat > ${D}/usr/lib/$1 <<"END_LDSCRIPT" 57 cat > ${D}/usr/$(get_libdir)/$1 <<"END_LDSCRIPT"
43/* GNU ld script 58/* GNU ld script
44 Because Gentoo have critical dynamic libraries 59 Because Gentoo have critical dynamic libraries
45 in /lib, and the static versions in /usr/lib, we 60 in /lib, and the static versions in /usr/lib, we
46 need to have a "fake" dynamic lib in /usr/lib, 61 need to have a "fake" dynamic lib in /usr/lib,
47 otherwise we run into linking problems. 62 otherwise we run into linking problems.
48 See bug #4411 on http://bugs.gentoo.org/ for 63 See bug #4411 on http://bugs.gentoo.org/ for
49 more info. */ 64 more info. */
50GROUP ( /lib/libxxx )
51END_LDSCRIPT 65END_LDSCRIPT
52 66
67 echo "GROUP ( /$(get_libdir)/libxxx )" >> ${D}/usr/$(get_libdir)/$1
53 dosed "s:libxxx:$1:" /usr/lib/$1 68 dosed "s:libxxx:$1:" /usr/$(get_libdir)/$1
54 69
55 return 0 70 return 0
56} 71}
57 72
58# Simple function to draw a line consisting of '=' the same length as $* 73# Simple function to draw a line consisting of '=' the same length as $*
144 local SINGLE_PATCH="no" 159 local SINGLE_PATCH="no"
145 local x="" 160 local x=""
146 161
147 if [ "$#" -gt 1 ] 162 if [ "$#" -gt 1 ]
148 then 163 then
149 eerror "Invalid arguments to epatch()" 164 local m=""
150 die "Invalid arguments to epatch()" 165 einfo "${#} patches to apply..."
166 for m in "$@" ; do
167 epatch "${m}"
168 done
169 return 0
151 fi 170 fi
152 171
153 if [ -n "$1" -a -f "$1" ] 172 if [ -n "$1" -a -f "$1" ]
154 then 173 then
155 SINGLE_PATCH="yes" 174 SINGLE_PATCH="yes"
1016 tail -n +${skip} ${src} | bzip2 -dc | tar --no-same-owner -xf - 1035 tail -n +${skip} ${src} | bzip2 -dc | tar --no-same-owner -xf -
1017 ;; 1036 ;;
1018 gzip*) 1037 gzip*)
1019 tail -n +${skip} ${src} | tar --no-same-owner -xzf - 1038 tail -n +${skip} ${src} | tar --no-same-owner -xzf -
1020 ;; 1039 ;;
1040 compress*)
1041 tail -n +${skip} ${src} | gunzip | tar --no-same-owner -xf -
1042 ;;
1021 *) 1043 *)
1044 eerror "Unknown filetype \"${filetype}\" ?"
1022 false 1045 false
1023 ;; 1046 ;;
1024 esac 1047 esac
1025 assert "failure unpacking (${filetype}) makeself ${shrtsrc} ('${ver}' +${skip})" 1048 assert "failure unpacking (${filetype}) makeself ${shrtsrc} ('${ver}' +${skip})"
1026} 1049}

Legend:
Removed from v.1.92  
changed lines
  Added in v.1.96

  ViewVC Help
Powered by ViewVC 1.1.20