/[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.99
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.99 2004/09/07 11:41:29 vapier 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# Wait for the supplied number of seconds. If no argument is supplied, defaults
20# to five seconds. If the EPAUSE_IGNORE env var is set, don't wait. If we're not
21# outputting to a terminal, don't wait. For compatability purposes, the argument
22# must be an integer greater than zero.
23# Bug 62950, Ciaran McCreesh <ciaranm@gentoo.org> (05 Sep 2004)
24epause() {
25 if [ -z "$EPAUSE_IGNORE" ] && [ -t 1 ] ; then
26 sleep ${1:-5}
27 fi
28}
29
30# Beep the specified number of times (defaults to five). If our output
31# is not a terminal, don't beep. If the EBEEP_IGNORE env var is set,
32# don't beep.
33# Bug 62950, Ciaran McCreesh <ciaranm@gentoo.org> (05 Sep 2004)
34ebeep() {
35 local n
36 if [ -z "$EBEEP_IGNORE" ] && [ -t 1 ] ; then
37 for ((n=1 ; n <= ${1:-5} ; n++)) ; do
38 echo -ne "\a"
39 sleep 0.1 &>/dev/null ; sleep 0,1 &>/dev/null
40 echo -ne "\a"
41 sleep 1
42 done
43 fi
44}
45
46# This function simply returns the desired lib directory. With portage
47# 2.0.51, we now have support for installing libraries to lib32/lib64
48# to accomidate the needs of multilib systems. It's no longer a good idea
49# to assume all libraries will end up in lib. Replace any (sane) instances
50# where lib is named directly with $(get_libdir) if possible.
51#
52# Travis Tilley <lv@gentoo.org> (24 Aug 2004)
53get_libdir() {
54 if [ ! -z "${CONF_LIBDIR_OVERRIDE}" ] ; then
55 # if there is an override, we want to use that... always.
56 CONF_LIBDIR="${CONF_LIBDIR_OVERRIDE}"
57 elif portageq has_version / '<sys-apps/portage-2.0.51_pre20' ; then
58 # and if there isnt an override, and we're using a version of
59 # portage without CONF_LIBDIR support, force the use of lib. dolib
60 # and friends from portage 2.0.50 wont be too happy otherwise.
61 CONF_LIBDIR="lib"
62 fi
63 # and of course, default to lib if CONF_LIBDIR isnt set
64 echo ${CONF_LIBDIR:=lib}
65}
66
67# Sometimes you need to override the value returned by get_libdir. A good
68# example of this is xorg-x11, where lib32 isnt a supported configuration,
69# and where lib64 -must- be used on amd64 (for applications that need lib
70# to be 32bit, such as adobe acrobat). Note that this override also bypasses
71# portage version sanity checking.
72# get_libdir_override expects one argument, the result get_libdir should
73# return:
74#
75# get_libdir_override lib64
76#
77# Travis Tilley <lv@gentoo.org> (31 Aug 2004)
78get_libdir_override() {
79 CONF_LIBDIR="$1"
80 CONF_LIBDIR_OVERRIDE="$1"
81}
18 82
19# This function generate linker scripts in /usr/lib for dynamic 83# This function generate linker scripts in /usr/lib for dynamic
20# libs in /lib. This is to fix linking problems when you have 84# 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 85# 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 86# in some cases when linking dynamic, the .a in /usr/lib is used
33# to point to the latest version of the library present. 97# to point to the latest version of the library present.
34# 98#
35# <azarah@gentoo.org> (26 Oct 2002) 99# <azarah@gentoo.org> (26 Oct 2002)
36# 100#
37gen_usr_ldscript() { 101gen_usr_ldscript() {
38
39 # Just make sure it exists 102 # Just make sure it exists
40 dodir /usr/lib 103 dodir /usr/$(get_libdir)
41 104
42 cat > ${D}/usr/lib/$1 <<"END_LDSCRIPT" 105 cat > ${D}/usr/$(get_libdir)/$1 <<"END_LDSCRIPT"
43/* GNU ld script 106/* GNU ld script
44 Because Gentoo have critical dynamic libraries 107 Because Gentoo have critical dynamic libraries
45 in /lib, and the static versions in /usr/lib, we 108 in /lib, and the static versions in /usr/lib, we
46 need to have a "fake" dynamic lib in /usr/lib, 109 need to have a "fake" dynamic lib in /usr/lib,
47 otherwise we run into linking problems. 110 otherwise we run into linking problems.
48 See bug #4411 on http://bugs.gentoo.org/ for 111 See bug #4411 on http://bugs.gentoo.org/ for
49 more info. */ 112 more info. */
50GROUP ( /lib/libxxx )
51END_LDSCRIPT 113END_LDSCRIPT
52 114
115 echo "GROUP ( /$(get_libdir)/libxxx )" >> ${D}/usr/$(get_libdir)/$1
53 dosed "s:libxxx:$1:" /usr/lib/$1 116 dosed "s:libxxx:$1:" /usr/$(get_libdir)/$1
54 117
55 return 0 118 return 0
56} 119}
57 120
58# Simple function to draw a line consisting of '=' the same length as $* 121# Simple function to draw a line consisting of '=' the same length as $*
144 local SINGLE_PATCH="no" 207 local SINGLE_PATCH="no"
145 local x="" 208 local x=""
146 209
147 if [ "$#" -gt 1 ] 210 if [ "$#" -gt 1 ]
148 then 211 then
149 eerror "Invalid arguments to epatch()" 212 local m=""
150 die "Invalid arguments to epatch()" 213 einfo "${#} patches to apply..."
214 for m in "$@" ; do
215 epatch "${m}"
216 done
217 return 0
151 fi 218 fi
152 219
153 if [ -n "$1" -a -f "$1" ] 220 if [ -n "$1" -a -f "$1" ]
154 then 221 then
155 SINGLE_PATCH="yes" 222 SINGLE_PATCH="yes"
809Type=Application 876Type=Application
810Comment=${DESCRIPTION} 877Comment=${DESCRIPTION}
811Exec=${exec} 878Exec=${exec}
812Path=${path} 879Path=${path}
813Icon=${icon} 880Icon=${icon}
814Categories=Application;${type};" > ${desktop} 881Categories=Application;${type};" > "${desktop}"
815 882
816 if [ -d "/usr/share/applications" ] 883 if [ -d "/usr/share/applications" ]
817 then 884 then
818 insinto /usr/share/applications 885 insinto /usr/share/applications
819 doins ${desktop} 886 doins "${desktop}"
820 fi 887 fi
821 888
822 #if [ -d "/usr/share/gnome/apps" ] 889 #if [ -d "/usr/share/gnome/apps" ]
823 #then 890 #then
824 # insinto /usr/share/gnome/apps/Games 891 # insinto /usr/share/gnome/apps/Games
835 #fi 902 #fi
836 903
837 if [ -d "/usr/share/applnk" ] 904 if [ -d "/usr/share/applnk" ]
838 then 905 then
839 insinto /usr/share/applnk/${subdir} 906 insinto /usr/share/applnk/${subdir}
840 doins ${desktop} 907 doins "${desktop}"
841 fi 908 fi
842 909
843 return 0 910 return 0
844} 911}
845 912
1016 tail -n +${skip} ${src} | bzip2 -dc | tar --no-same-owner -xf - 1083 tail -n +${skip} ${src} | bzip2 -dc | tar --no-same-owner -xf -
1017 ;; 1084 ;;
1018 gzip*) 1085 gzip*)
1019 tail -n +${skip} ${src} | tar --no-same-owner -xzf - 1086 tail -n +${skip} ${src} | tar --no-same-owner -xzf -
1020 ;; 1087 ;;
1088 compress*)
1089 tail -n +${skip} ${src} | gunzip | tar --no-same-owner -xf -
1090 ;;
1021 *) 1091 *)
1092 eerror "Unknown filetype \"${filetype}\" ?"
1022 false 1093 false
1023 ;; 1094 ;;
1024 esac 1095 esac
1025 assert "failure unpacking (${filetype}) makeself ${shrtsrc} ('${ver}' +${skip})" 1096 assert "failure unpacking (${filetype}) makeself ${shrtsrc} ('${ver}' +${skip})"
1026} 1097}

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

  ViewVC Help
Powered by ViewVC 1.1.20