| 1 |
# Copyright 1999-2007 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/eclass/emul-linux-x86.eclass,v 1.1 2007/11/14 03:42:12 kingtaco Exp $
|
| 4 |
|
| 5 |
#
|
| 6 |
# Original Author: Mike Doty <kingtaco@gentoo.org>
|
| 7 |
# Adapted from emul-libs.eclass
|
| 8 |
# Purpose: Providing a template for the app-emulation/emul-linux-* packages
|
| 9 |
#
|
| 10 |
|
| 11 |
EXPORT_FUNCTIONS src_unpack src_install
|
| 12 |
|
| 13 |
SRC_URI="mirror://gentoo/${PN}-${PVR}.tar.bz2"
|
| 14 |
|
| 15 |
DESCRIPTION="Provides precompiled 32bit libraries"
|
| 16 |
HOMEPAGE="http://amd64.gentoo.org/emul/content.xml"
|
| 17 |
|
| 18 |
RESTRICT="strip"
|
| 19 |
S="${WORKDIR}"
|
| 20 |
|
| 21 |
SLOT="0"
|
| 22 |
IUSE=""
|
| 23 |
|
| 24 |
DEPEND=">=sys-apps/findutils-4.2.26"
|
| 25 |
RDEPEND=""
|
| 26 |
|
| 27 |
emul-linux-x86_src_unpack() {
|
| 28 |
unpack ${A}
|
| 29 |
cd "${S}"
|
| 30 |
|
| 31 |
ALLOWED=${ALLOWED:-^${S}/etc/env.d}
|
| 32 |
find "${S}" ! -type d ! -name '*.so*' | egrep -v "${ALLOWED}" | xargs -d $'\n' rm -f || die 'failed to remove everything but *.so*'
|
| 33 |
}
|
| 34 |
|
| 35 |
emul-linux-x86_src_install() {
|
| 36 |
for dir in etc/env.d etc/revdep-rebuild ; do
|
| 37 |
if [[ -d "${S}"/${dir} ]] ; then
|
| 38 |
for f in "${S}"/${dir}/* ; do
|
| 39 |
mv -f "$f"{,-emul}
|
| 40 |
done
|
| 41 |
fi
|
| 42 |
done
|
| 43 |
|
| 44 |
# remove void directories
|
| 45 |
find "${S}" -depth -type d -print0 | xargs -0 rmdir 2&>/dev/null
|
| 46 |
|
| 47 |
cp -pPR "${S}"/* "${D}"/ || die "copying files failed!"
|
| 48 |
}
|