| 1 |
# Copyright 1999-2011 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/dev-util/elfkickers/elfkickers-2.0a-r5.ebuild,v 1.2 2011/08/21 16:11:12 xarthisius Exp $
|
| 4 |
|
| 5 |
inherit eutils multilib toolchain-funcs
|
| 6 |
|
| 7 |
MY_PN=${PN/elf/ELF}
|
| 8 |
S=${WORKDIR}/${MY_PN}
|
| 9 |
|
| 10 |
DESCRIPTION="collection of programs to manipulate ELF files: sstrip, rebind, elfls, elftoc"
|
| 11 |
HOMEPAGE="http://www.muppetlabs.com/~breadbox/software/elfkickers.html"
|
| 12 |
SRC_URI="http://www.muppetlabs.com/~breadbox/pub/software/${MY_PN}-${PV}.tar.gz
|
| 13 |
mirror://gentoo/elfkickers-2.0a-r5.patch.bz2"
|
| 14 |
|
| 15 |
LICENSE="GPL-2"
|
| 16 |
SLOT="0"
|
| 17 |
KEYWORDS="~amd64 ~arm ~hppa ~mips ~sparc ~x86 ~x86-fbsd"
|
| 18 |
IUSE="doc"
|
| 19 |
|
| 20 |
DEPEND="app-misc/pax-utils"
|
| 21 |
RDEPEND=""
|
| 22 |
|
| 23 |
src_unpack() {
|
| 24 |
unpack ${A}
|
| 25 |
cd "${S}"
|
| 26 |
epatch "${WORKDIR}"/elfkickers-2.0a-r5.patch
|
| 27 |
|
| 28 |
sed -i -e '/^SUBDIRS/s:tiny::' Makefile
|
| 29 |
use x86 || sed -i -e '/^SUBDIRS/s:ebfc::' Makefile
|
| 30 |
use x86 && sed -i -e 's:linux/elf.h:elf.h:' ebfc/*.c
|
| 31 |
(cd tiny && make clean)
|
| 32 |
}
|
| 33 |
|
| 34 |
src_compile() {
|
| 35 |
for bits in 32 64; do
|
| 36 |
emake CC=$(tc-getCC) CFLAGS="-DELF_CLASS=ELFCLASS${bits} ${CFLAGS}" clean all
|
| 37 |
for x in elfls elftoc rebind sstrip; do
|
| 38 |
mv ${x}/$x{,${bits}} || die "moving failed of ${x}{,${bits}"
|
| 39 |
done
|
| 40 |
done
|
| 41 |
}
|
| 42 |
|
| 43 |
src_install() {
|
| 44 |
for d in elfls elftoc rebind sstrip ; do
|
| 45 |
newdoc ${d}/README README.${d} || die
|
| 46 |
dobin ${d}/${d}{32,64} || die
|
| 47 |
for i in ${d}/*.1; do
|
| 48 |
[ -e ${i} ] && doman ${i}
|
| 49 |
done
|
| 50 |
case $(get_libdir) in
|
| 51 |
lib64) dosym /usr/bin/${d}64 /usr/bin/${d};;
|
| 52 |
lib|lib32) dosym /usr/bin/${d}32 /usr/bin/${d};;
|
| 53 |
esac
|
| 54 |
done
|
| 55 |
dodoc Changelog README || die
|
| 56 |
}
|