Gentoo Archives: gentoo-commits

From: "Daniel Gryniewicz (dang)" <dang@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/kvm: ChangeLog kvm-83.ebuild
Date: Mon, 26 Jan 2009 19:33:29
Message-Id: E1LRXD4-0005QZ-PP@stork.gentoo.org
1 dang 09/01/26 19:33:26
2
3 Modified: ChangeLog
4 Added: kvm-83.ebuild
5 Log:
6 bump kvm to 83
7 (Portage version: 2.1.6.7/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.26 app-emulation/kvm/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/kvm/ChangeLog?rev=1.26&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/kvm/ChangeLog?rev=1.26&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/kvm/ChangeLog?r1=1.25&r2=1.26
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/app-emulation/kvm/ChangeLog,v
19 retrieving revision 1.25
20 retrieving revision 1.26
21 diff -u -r1.25 -r1.26
22 --- ChangeLog 5 Jan 2009 01:30:01 -0000 1.25
23 +++ ChangeLog 26 Jan 2009 19:33:26 -0000 1.26
24 @@ -1,6 +1,11 @@
25 # ChangeLog for app-emulation/kvm
26 # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/kvm/ChangeLog,v 1.25 2009/01/05 01:30:01 dang Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/kvm/ChangeLog,v 1.26 2009/01/26 19:33:26 dang Exp $
29 +
30 +*kvm-83 (26 Jan 2009)
31 +
32 + 26 Jan 2009; Daniel Gryniewicz <dang@g.o> +kvm-83.ebuild:
33 + Bump to kvm-83
34
35 *kvm-82 (05 Jan 2009)
36
37
38
39
40 1.1 app-emulation/kvm/kvm-83.ebuild
41
42 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/kvm/kvm-83.ebuild?rev=1.1&view=markup
43 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-emulation/kvm/kvm-83.ebuild?rev=1.1&content-type=text/plain
44
45 Index: kvm-83.ebuild
46 ===================================================================
47 # Copyright 1999-2009 Gentoo Foundation
48 # Distributed under the terms of the GNU General Public License v2
49 # $Header: /var/cvsroot/gentoo-x86/app-emulation/kvm/kvm-83.ebuild,v 1.1 2009/01/26 19:33:26 dang Exp $
50
51 inherit eutils flag-o-matic toolchain-funcs linux-mod
52
53 EAPI="1"
54
55 # Patchset git repo is at http://github.com/dang/kvm-patches/tree/master
56 PATCHSET="kvm-patches-20090126"
57 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz
58 http://apollo.fprintf.net/downloads/${PATCHSET}.tar.gz"
59
60 DESCRIPTION="Kernel-based Virtual Machine userland tools"
61 HOMEPAGE="http://kvm.qumranet.com/kvmwiki"
62
63 LICENSE="GPL-2"
64 SLOT="0"
65 KEYWORDS="-* ~amd64 ~x86"
66 # Add bios back when it builds again
67 IUSE="alsa esd gnutls havekernel +modules ncurses pulseaudio +sdl test vde"
68 RESTRICT="test"
69
70 RDEPEND="sys-libs/zlib
71 alsa? ( >=media-libs/alsa-lib-1.0.13 )
72 esd? ( media-sound/esound )
73 pulseaudio? ( media-sound/pulseaudio )
74 gnutls? ( net-libs/gnutls )
75 ncurses? ( sys-libs/ncurses )
76 sdl? ( >=media-libs/libsdl-1.2.11 )
77 vde? ( net-misc/vde )"
78
79 # bios? (
80 # sys-devel/dev86
81 # dev-lang/perl
82 # sys-power/iasl
83 # )
84 DEPEND="${RDEPEND}
85 gnutls? ( dev-util/pkgconfig )
86 app-text/texi2html"
87
88 QA_TEXTRELS="usr/bin/kvm"
89
90 pkg_setup() {
91 linux-info_pkg_setup
92 if use havekernel && use modules ; then
93 ewarn "You have the 'havekernel' and 'modules' use flags enabled."
94 ewarn "'havekernel' trumps 'modules'; the kvm modules will not"
95 ewarn "be built. You must ensure you have a compatible kernel"
96 ewarn "with the kvm modules on your own"
97 elif use havekernel ; then
98 ewarn "You have the 'havekernel' use flag set. This means you"
99 ewarn "must ensure you have a compatible kernel on your own."
100 elif use modules ; then
101 if ! linux_chkconfig_present KVM; then
102 eerror "KVM now needs CONFIG_KVM built into your kernel, even"
103 eerror "if you're using the external modules from this package."
104 eerror "Please enable KVM support in your kernel, found at:"
105 eerror
106 eerror " Virtualization"
107 eerror " Kernel-based Virtual Machine (KVM) support"
108 eerror
109 die "KVM support not detected!"
110 fi
111 BUILD_TARGETS="all"
112 MODULE_NAMES="kvm(kvm:${S}/kernel:${S}/kernel/x86)"
113 MODULE_NAMES="${MODULE_NAMES} kvm-intel(kvm:${S}/kernel:${S}/kernel/x86)"
114 MODULE_NAMES="${MODULE_NAMES} kvm-amd(kvm:${S}/kernel:${S}/kernel/x86)"
115 linux-mod_pkg_setup
116 elif kernel_is lt 2 6 25; then
117 eerror "This version of KVM requres a host kernel of 2.6.25 or higher."
118 eerror "Either upgrade your kernel, or enable the 'modules' USE flag."
119 die "kvm version not compatible"
120 elif ! linux_chkconfig_present KVM; then
121 eerror "Please enable KVM support in your kernel, found at:"
122 eerror
123 eerror " Virtualization"
124 eerror " Kernel-based Virtual Machine (KVM) support"
125 eerror
126 eerror "or enable the 'modules' USE flag."
127 die "KVM support not detected!"
128 fi
129
130 if use sdl && ! built_with_use media-libs/libsdl X ; then
131 die "You need to rebuild media-libs/libsdl with the X use flag"
132 fi
133
134 enewgroup kvm
135 }
136
137 src_unpack() {
138 unpack ${A}
139
140 cd "${S}"
141 # prevent docs to get automatically installed
142 sed -i '/$(DESTDIR)$(docdir)/d' qemu/Makefile
143 # Alter target makefiles to accept CFLAGS set via flag-o
144 sed -i 's/^\(C\|OP_C\|HELPER_C\)FLAGS=/\1FLAGS+=/' \
145 qemu/Makefile qemu/Makefile.target
146 [[ -x /sbin/paxctl ]] && \
147 sed -i 's/^VL_LDFLAGS=$/VL_LDFLAGS=-Wl,-z,execheap/' \
148 qemu/Makefile.target
149 # avoid strip
150 sed -i 's/$(INSTALL) -m 755 -s/$(INSTALL) -m 755/' qemu/Makefile
151
152 # apply patchset
153 EPATCH_SOURCE="${WORKDIR}/${PATCHSET}"
154 EPATCH_SUFFIX="patch"
155 epatch
156 }
157
158 src_compile() {
159 local mycc conf_opts audio_opts
160
161 audio_opts="oss"
162 use gnutls || conf_opts="$conf_opts --disable-vnc-tls"
163 use ncurses || conf_opts="$conf_opts --disable-curses"
164 use sdl || conf_opts="$conf_opts --disable-gfx-check --disable-sdl"
165 use vde || conf_opts="$conf_opts --disable-vde"
166 use alsa && audio_opts="alsa $audio_opts"
167 use esd && audio_opts="esd $audio_opts"
168 use pulseaudio && audio_opts="pa $audio_opts"
169 use sdl && audio_opts="sdl $audio_opts"
170 use modules && conf_opts="$conf_opts --kerneldir=$KV_DIR"
171 conf_opts="$conf_opts --prefix=/usr"
172 #conf_opts="$conf_opts --audio-drv-list=\"$audio_opts\""
173
174 ./configure ${conf_opts} --audio-drv-list="$audio_opts" || die "econf failed"
175
176 emake libkvm || die "emake libkvm failed"
177
178 if use test; then
179 emake user || die "emake user failed"
180 fi
181
182 mycc=$(cat qemu/config-host.mak | egrep "^CC=" | cut -d "=" -f 2)
183
184 filter-flags -fpie -fstack-protector
185
186 # If using gentoo's compiler set the SPEC to non-hardened
187 if [ ! -z ${GCC_SPECS} -a -f ${GCC_SPECS} ]; then
188 local myccver=$(${mycc} -dumpversion)
189 local gccver=$($(tc-getBUILD_CC) -dumpversion)
190
191 #Is this a SPEC for the right compiler version?
192 myspec="${GCC_SPECS/${gccver}/${myccver}}"
193 if [ "${myspec}" == "${GCC_SPECS}" ]; then
194 shopt -s extglob
195 GCC_SPECS="${GCC_SPECS/%hardened*specs/vanilla.specs}"
196 shopt -u extglob
197 else
198 unset GCC_SPECS
199 fi
200 fi
201
202 # if use bios; then
203 # emake bios || die "emake bios failed"
204 # emake vgabios || die "emake vgabios failed"
205 # fi
206
207 emake qemu || die "emake qemu failed"
208
209 if use modules && ! use havekernel ; then
210 linux-mod_src_compile
211 fi
212 }
213
214 src_install() {
215 # kcmd so we don't install kernel modules which weren't build
216 emake DESTDIR="${D}" kcmd='#' install || die "make install failed"
217
218 exeinto /usr/bin/
219 doexe "${S}/kvm_stat"
220
221 mv "${D}"/usr/share/man/man1/qemu.1 "${D}"/usr/share/man/man1/kvm.1
222 mv "${D}"/usr/share/man/man1/qemu-img.1 "${D}"/usr/share/man/man1/kvm-img.1
223 mv "${D}"/usr/share/man/man8/qemu-nbd.8 "${D}"/usr/share/man/man8/kvm-nbd.8
224 mv "${D}"/usr/bin/qemu-img "${D}"/usr/bin/kvm-img
225 mv "${D}"/usr/bin/qemu-nbd "${D}"/usr/bin/kvm-nbd
226
227 insinto /etc/udev/rules.d/
228 doins scripts/65-kvm.rules
229
230 insinto /etc/kvm/
231 insopts -m0755
232 newins scripts/qemu-ifup kvm-ifup
233 newins scripts/qemu-ifdown kvm-ifdown
234
235 dodoc qemu/pc-bios/README
236 newdoc qemu/qemu-doc.html kvm-doc.html
237 newdoc qemu/qemu-tech.html kvm-tech.html
238
239 if use modules && ! use havekernel ; then
240 linux-mod_src_install
241 fi
242 }
243
244 pkg_postinst() {
245 elog "If you don't have kvm compiled into the kernel, make sure you have"
246 elog "the kernel module loaded before running kvm. The easiest way to"
247 elog "ensure that the kernel module is loaded is to load it on boot."
248 elog "For AMD CPUs the module is called 'kvm-amd'"
249 elog "For Intel CPUs the module is called 'kvm-intel'"
250 elog "Please review /etc/conf.d/modules for how to load these"
251 elog
252 elog "Make sure your user is in the 'kvm' group"
253 elog "Just run 'gpasswd -a <USER> kvm', then have <USER> re-login."
254 elog
255 elog "You will need the Universal TUN/TAP driver compiled into your"
256 elog "kernel or loaded as a module to use the virtual network device"
257 elog "if using -net tap. You will also need support for 802.1d"
258 elog "Ethernet Bridging and a configured bridge if using the provided"
259 elog "kvm-ifup script from /etc/kvm."
260 echo
261 }