summaryrefslogtreecommitdiff
blob: f492fff4d873a7a513aa78e9b336669dcf4338d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/mknbi/mknbi-1.4.4.ebuild,v 1.7 2008/08/31 04:36:02 mr_bones_ Exp $

inherit toolchain-funcs eutils

DESCRIPTION="Utility for making tagged kernel images useful for netbooting"
SRC_URI="mirror://sourceforge/etherboot/${P}.tar.gz"
RESTRICT="mirror"
HOMEPAGE="http://etherboot.sourceforge.net"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86"
IUSE=""

RDEPEND=">=dev-lang/perl-5.6.1
	!sys-boot/netboot"
DEPEND="${RDEPEND}
	dev-lang/nasm"

src_unpack() {
	unpack ${A}
	cd "${S}"
	epatch \
		"${FILESDIR}"/mknbi-1.4.3-nossp.patch \
		"${FILESDIR}"/${P}-gcc4.patch

	sed -i \
		-e "s:\/usr\/local:\/usr:" \
		-e "s:COPYING::" \
		-e "s:\-mcpu:\-march:" Makefile \
		|| die "sed failed"

	#apply modifications to CFLAGS to fix for gcc 3.4: bug #64049
	if [ "`gcc-major-version`" -ge "3" -a "`gcc-minor-version`" -ge "4" ]
	then
		sed -i \
			-e 's:\-mcpu:\-mtune:' \
			-e 's:CFLAGS=:CFLAGS= -minline-all-stringops:' Makefile \
			|| die "sed failed"
	fi
	if [ "`gcc-major-version`" = "4" ]; then
		sed -i \
			-e 's:\-fno-stack-protector-all::' Makefile \
			|| die "sed failed"
	fi
}

src_install() {
	export BUILD_ROOT="${D}"
	emake DESTDIR="${D}" install || die "emake failed"
	prepalldocs
}