/[gentoo-x86]/app-emulation/kqemu/kqemu-1.4.0_pre1.ebuild
Gentoo

Contents of /app-emulation/kqemu/kqemu-1.4.0_pre1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Thu May 31 22:34:38 2012 UTC (2 years, 5 months ago) by zmedico
Branch: MAIN
Changes since 1.4: +3 -3 lines
inherit user for enewgroup

(Portage version: 2.2.0_alpha108_p9/cvs/Linux i686)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-emulation/kqemu/kqemu-1.4.0_pre1.ebuild,v 1.4 2009/05/25 10:00:31 lu_zero Exp $
4
5 inherit eutils flag-o-matic linux-mod toolchain-funcs user
6
7 MY_PV=${PV/_/}
8 MY_P=${PN}-${MY_PV}
9
10 DESCRIPTION="Multi-platform & multi-targets cpu emulator and dynamic translator kernel fast execution module"
11 HOMEPAGE="http://bellard.org/qemu/"
12 SRC_URI="http://bellard.org/qemu/${MY_P}.tar.gz"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="-* ~amd64 ~x86"
17 RESTRICT="strip"
18 IUSE=""
19
20 S="${WORKDIR}/${MY_P}"
21
22 DEPEND=""
23 RDEPEND=""
24
25 pkg_setup() {
26 MODULE_NAMES="kqemu(misc:${S})"
27 linux-mod_pkg_setup
28 }
29
30 src_unpack() {
31 unpack ${A}
32 cd "${S}"
33 sed -i 's:MODULE_PARM(\([^,]*\),"i");:module_param(\1, int, 0);:' kqemu-linux.c
34 sed -e 's:-Werror::' -i common/Makefile #260876
35 sed -e '/^CC/d;/^HOST_CC/d;' \
36 -e 's/\(^MON_CC=\).*/\1$(CC)/' \
37 -e "s/\(^MON_LD=\).*/\1$(tc-getLD)/" \
38 -e 's/^\(TOOLS_CFLAGS.*\)/\1 $(CFLAGS)/' \
39 -e 's/^\(MON_CFLAGS.*\)/\1 $(CFLAGS)/' \
40 -e 's/^\(KERNEL_CFLAGS.*\)/\1 $(CFLAGS)/' \
41 -e 's/^CFLAGS=\(.*\)/CFLAGS+=\1/' \
42 -i common/Makefile
43 epatch "${FILESDIR}/${P}-missing-sched-header.patch"
44 }
45
46 src_compile() {
47 filter-flags -fpie -fstack-protector
48
49 ./configure --kernel-path="${KV_DIR}" \
50 --cc="$(tc-getCC)" \
51 --host-cc="$(tc-getBUILD_CC)" \
52 --extra-cflags="${CFLAGS}" \
53 --extra-ldflags="${LDFLAGS}" \
54 || die "could not configure"
55
56 make || die "Make failed"
57 }
58
59 src_install() {
60 linux-mod_src_install
61
62 # udev rule
63 dodir /etc/udev/rules.d/
64 echo 'KERNEL=="kqemu*", NAME="%k", GROUP="qemu", MODE="0660"' > ${D}/etc/udev/rules.d/48-qemu.rules
65
66 # Module doc
67 dodoc "${S}/README"
68 dohtml "${S}/kqemu-doc.html"
69
70 # module params
71 dodir /etc/modprobe.d
72 echo "options kqemu major=0" > ${D}/etc/modprobe.d/kqemu
73 }
74
75 pkg_postinst() {
76 linux-mod_pkg_postinst
77 enewgroup qemu
78 elog "Make sure you have the kernel module loaded before running qemu"
79 elog "and your user is in the 'qemu' group"
80 }

  ViewVC Help
Powered by ViewVC 1.1.20