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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (show annotations) (download)
Thu May 31 22:34:38 2012 UTC (2 years, 6 months ago) by zmedico
Branch: MAIN
Changes since 1.6: +2 -2 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-r1.ebuild,v 1.6 2012/01/21 20:49:13 slyfox 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 epatch "${FILESDIR}"/${P}-init_MUTEX.patch
45 epatch "${FILESDIR}"/${P}-remove-smp_lock.patch #368439
46 }
47
48 src_compile() {
49 filter-flags -fpie -fstack-protector -ftracer #263837
50
51 ./configure --kernel-path="${KV_DIR}" \
52 --cc="$(tc-getCC)" \
53 --host-cc="$(tc-getBUILD_CC)" \
54 --extra-cflags="${CFLAGS}" \
55 --extra-ldflags="${LDFLAGS}" \
56 || die "could not configure"
57
58 make || die "Make failed"
59 }
60
61 src_install() {
62 linux-mod_src_install
63
64 # udev rule
65 dodir /etc/udev/rules.d/
66 echo 'KERNEL=="kqemu*", GROUP="qemu", MODE="0660"' > ${D}/etc/udev/rules.d/48-qemu.rules
67
68 # Module doc
69 dodoc "${S}/README"
70 dohtml "${S}/kqemu-doc.html"
71
72 # module params
73 dodir /etc/modprobe.d
74 echo "options kqemu major=0" > ${D}/etc/modprobe.d/kqemu.conf
75 }
76
77 pkg_preinst() {
78 linux-mod_pkg_preinst
79 local old1="${ROOT}/etc/modprobe.d/kqemu"
80 local old2="${ROOT}/etc/modules.d/kqemu"
81 local new="${ROOT}/etc/modprobe.d/kqemu.conf"
82 if [[ ! -a "${new}" ]]; then
83 if [[ -a "${old1}" ]]; then
84 elog "Renaming /etc/modprobe.d/kqemu to /etc/modprobe.d/kqemu.conf"
85 mv "${old1}" "${new}"
86 elif [[ -a "${old2}" ]]; then
87 elog "Moving old kqemu configuration in /etc/modules.d to new"
88 elog "location in /etc/modprobe.d"
89 mv "${old2}" "${new}"
90 fi
91 fi
92 }
93
94 pkg_postinst() {
95 linux-mod_pkg_postinst
96 enewgroup qemu
97 elog "Make sure you have the kernel module loaded before running qemu"
98 elog "and your user is in the 'qemu' group"
99 }

  ViewVC Help
Powered by ViewVC 1.1.20