| 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.159 2005/03/18 22:50:26 vapier Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.160 2005/03/22 17:33:13 wolf31o2 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. |
| … | |
… | |
| 1755 | insinto /etc/pam.d |
1755 | insinto /etc/pam.d |
| 1756 | # these are the default doins options, but be explicit just in case |
1756 | # these are the default doins options, but be explicit just in case |
| 1757 | insopts -m 0644 -o root -g root |
1757 | insopts -m 0644 -o root -g root |
| 1758 | newins "$1" "$2" || die "failed to install $1 as $2" |
1758 | newins "$1" "$2" || die "failed to install $1 as $2" |
| 1759 | } |
1759 | } |
|
|
1760 | |
|
|
1761 | # make a wrapper script ... |
|
|
1762 | # NOTE: this was originally games_make_wrapper, but I noticed other places where |
|
|
1763 | # this could be used, so I have moved it here and made it not games-specific |
|
|
1764 | # -- wolf31o2 |
|
|
1765 | # $1 == wrapper name |
|
|
1766 | # $2 == binary to run |
|
|
1767 | # $3 == directory to chdir before running binary |
|
|
1768 | # $4 == extra LD_LIBRARY_PATH's (make it : delimited) |
|
|
1769 | make_wrapper() { |
|
|
1770 | local wrapper=$1 bin=$2 chdir=$3 libdir=$4 |
|
|
1771 | local tmpwrapper=$(emktemp) |
|
|
1772 | cat << EOF > "${tmpwrapper}" |
|
|
1773 | #!/bin/sh |
|
|
1774 | cd "${chdir}" |
|
|
1775 | export LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:${libdir}" |
|
|
1776 | exec ${bin} "\$@" |
|
|
1777 | EOF |
|
|
1778 | chmod go+rx "${tmpwrapper}" |
|
|
1779 | newbin "${tmpwrapper}" "${wrapper}" |
|
|
1780 | } |