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

Diff of /eclass/eutils.eclass

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

Revision 1.201 Revision 1.202
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 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.201 2005/09/25 10:08:23 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.202 2005/09/26 21:54:56 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.
1582# $4 == extra LD_LIBRARY_PATH's (make it : delimited) 1582# $4 == extra LD_LIBRARY_PATH's (make it : delimited)
1583# $5 == path for wrapper 1583# $5 == path for wrapper
1584make_wrapper() { 1584make_wrapper() {
1585 local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5 1585 local wrapper=$1 bin=$2 chdir=$3 libdir=$4 path=$5
1586 local tmpwrapper=$(emktemp) 1586 local tmpwrapper=$(emktemp)
1587 # We don't want to quote ${bin} so that people can pass complex
1588 # things as $bin ... "./someprog --args"
1587 cat << EOF > "${tmpwrapper}" 1589 cat << EOF > "${tmpwrapper}"
1588#!/bin/sh 1590#!/bin/sh
1589cd "${chdir:-.}" 1591cd "${chdir:-.}"
1590if [ "\${LD_LIBRARY_PATH+set}" = "set" ] && [ -n "${libdir}" ] ; then 1592if [ "\${LD_LIBRARY_PATH+set}" = "set" ] && [ -n "${libdir}" ] ; then
1591 export LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:${libdir}" 1593 export LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:${libdir}"
1592fi 1594fi
1593exec "${bin}" "\$@" 1595exec ${bin} "\$@"
1594EOF 1596EOF
1595 chmod go+rx "${tmpwrapper}" 1597 chmod go+rx "${tmpwrapper}"
1596 if [[ -n ${path} ]] ; then 1598 if [[ -n ${path} ]] ; then
1597 exeinto "${path}" 1599 exeinto "${path}"
1598 newexe "${tmpwrapper}" "${wrapper}" 1600 newexe "${tmpwrapper}" "${wrapper}"

Legend:
Removed from v.1.201  
changed lines
  Added in v.1.202

  ViewVC Help
Powered by ViewVC 1.1.20