1 |
cardoe 13/12/03 18:35:31 |
2 |
|
3 |
Modified: libvirt-9999.ebuild ChangeLog |
4 |
Added: libvirt-1.2.0.ebuild |
5 |
Log: |
6 |
Version bump. Python bindings are now in their own package called dev-python/libvirt-python. Update the live ebuild to the latest changes from 1.2.0. |
7 |
|
8 |
(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key D7DFA8D318FA9AEF!) |
9 |
|
10 |
Revision Changes Path |
11 |
1.54 app-emulation/libvirt/libvirt-9999.ebuild |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/libvirt-9999.ebuild?rev=1.54&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/libvirt-9999.ebuild?rev=1.54&content-type=text/plain |
15 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/libvirt-9999.ebuild?r1=1.53&r2=1.54 |
16 |
|
17 |
Index: libvirt-9999.ebuild |
18 |
=================================================================== |
19 |
RCS file: /var/cvsroot/gentoo-x86/app-emulation/libvirt/libvirt-9999.ebuild,v |
20 |
retrieving revision 1.53 |
21 |
retrieving revision 1.54 |
22 |
diff -u -r1.53 -r1.54 |
23 |
--- libvirt-9999.ebuild 11 Nov 2013 03:41:44 -0000 1.53 |
24 |
+++ libvirt-9999.ebuild 3 Dec 2013 18:35:31 -0000 1.54 |
25 |
@@ -1,17 +1,15 @@ |
26 |
# Copyright 1999-2013 Gentoo Foundation |
27 |
# Distributed under the terms of the GNU General Public License v2 |
28 |
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/libvirt-9999.ebuild,v 1.53 2013/11/11 03:41:44 floppym Exp $ |
29 |
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/libvirt-9999.ebuild,v 1.54 2013/12/03 18:35:31 cardoe Exp $ |
30 |
|
31 |
EAPI=5 |
32 |
|
33 |
-#BACKPORTS=864bcb0e |
34 |
+#BACKPORTS=062ad8b2 |
35 |
AUTOTOOLIZE=yes |
36 |
|
37 |
MY_P="${P/_rc/-rc}" |
38 |
|
39 |
-PYTHON_COMPAT=( python{2_6,2_7} ) |
40 |
- |
41 |
-inherit eutils python-single-r1 user autotools linux-info systemd |
42 |
+inherit eutils user autotools linux-info systemd readme.gentoo |
43 |
|
44 |
if [[ ${PV} = *9999* ]]; then |
45 |
inherit git-2 |
46 |
@@ -24,7 +22,7 @@ |
47 |
ftp://libvirt.org/libvirt/${MY_P}.tar.gz |
48 |
${BACKPORTS:+ |
49 |
http://dev.gentoo.org/~cardoe/distfiles/${MY_P}-${BACKPORTS}.tar.xz}" |
50 |
- KEYWORDS="amd64 ~x86" |
51 |
+ KEYWORDS="~amd64 ~x86" |
52 |
fi |
53 |
S="${WORKDIR}/${P%_rc*}" |
54 |
|
55 |
@@ -33,7 +31,7 @@ |
56 |
LICENSE="LGPL-2.1" |
57 |
SLOT="0" |
58 |
IUSE="audit avahi +caps firewalld fuse iscsi +libvirtd lvm lxc +macvtap nfs \ |
59 |
- nls numa openvz parted pcap phyp policykit python +qemu rbd sasl \ |
60 |
+ nls numa openvz parted pcap phyp policykit +qemu rbd sasl \ |
61 |
selinux +udev uml +vepa virtualbox virt-network xen elibc_glibc \ |
62 |
systemd" |
63 |
REQUIRED_USE="libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) ) |
64 |
@@ -45,8 +43,7 @@ |
65 |
virtualbox? ( libvirtd ) |
66 |
xen? ( libvirtd ) |
67 |
virt-network? ( libvirtd ) |
68 |
- firewalld? ( virt-network ) |
69 |
- python? ( ${PYTHON_REQUIRED_USE} )" |
70 |
+ firewalld? ( virt-network )" |
71 |
|
72 |
# gettext.sh command is used by the libvirt command wrappers, and it's |
73 |
# non-optional, so put it into RDEPEND. |
74 |
@@ -85,7 +82,6 @@ |
75 |
) |
76 |
pcap? ( >=net-libs/libpcap-1.0.0 ) |
77 |
policykit? ( >=sys-auth/polkit-0.9 ) |
78 |
- python? ( ${PYTHON_DEPS} ) |
79 |
qemu? ( |
80 |
>=app-emulation/qemu-0.13.0 |
81 |
dev-libs/yajl |
82 |
@@ -112,6 +108,16 @@ |
83 |
dev-lang/perl |
84 |
dev-libs/libxslt" |
85 |
|
86 |
+DOC_CONTENTS="For the basic networking support (bridged and routed networks) |
87 |
+you don't need any extra software. For more complex network modes |
88 |
+including but not limited to NATed network, you can enable the |
89 |
+'virt-network' USE flag.\n\n |
90 |
+If you are using dnsmasq on your system, you will have |
91 |
+to configure /etc/dnsmasq.conf to enable the following settings:\n\n |
92 |
+ bind-interfaces\n |
93 |
+ interface or except-interface\n\n |
94 |
+Otherwise you might have issues with your existing DNS server." |
95 |
+ |
96 |
LXC_CONFIG_CHECK=" |
97 |
~CGROUPS |
98 |
~CGROUP_FREEZER |
99 |
@@ -129,10 +135,12 @@ |
100 |
~IPC_NS |
101 |
~PID_NS |
102 |
~NET_NS |
103 |
+ ~USER_NS |
104 |
~DEVPTS_MULTIPLE_INSTANCES |
105 |
~VETH |
106 |
~MACVLAN |
107 |
~POSIX_MQUEUE |
108 |
+ ~SECURITYFS |
109 |
~!GRKERNSEC_CHROOT_MOUNT |
110 |
~!GRKERNSEC_CHROOT_DOUBLE |
111 |
~!GRKERNSEC_CHROOT_PIVOT |
112 |
@@ -153,6 +161,8 @@ |
113 |
|
114 |
LVM_CONFIG_CHECK=" ~BLK_DEV_DM ~DM_SNAPSHOT ~DM_MULTIPATH" |
115 |
|
116 |
+ERROR_USER_NS="Optional depending on LXC configuration." |
117 |
+ |
118 |
pkg_setup() { |
119 |
enewgroup qemu 77 |
120 |
enewuser qemu 77 -1 -1 qemu kvm |
121 |
@@ -165,8 +175,6 @@ |
122 |
gpasswd -a qemu kvm |
123 |
fi |
124 |
|
125 |
- use python && python-single-r1_pkg_setup |
126 |
- |
127 |
# Handle specific kernel versions for different features |
128 |
kernel_is lt 3 6 && LXC_CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR" |
129 |
kernel_is ge 3 6 && LXC_CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM" |
130 |
@@ -209,7 +217,7 @@ |
131 |
local iscsi_init= |
132 |
local rbd_init= |
133 |
local firewalld_init= |
134 |
- cp "${FILESDIR}/libvirtd.init-r12" "${S}/libvirtd.init" |
135 |
+ cp "${FILESDIR}/libvirtd.init-r13" "${S}/libvirtd.init" |
136 |
use avahi && avahi_init='avahi-daemon' |
137 |
use iscsi && iscsi_init='iscsid' |
138 |
use rbd && rbd_init='ceph' |
139 |
@@ -283,7 +291,6 @@ |
140 |
|
141 |
## other |
142 |
myconf="${myconf} $(use_enable nls)" |
143 |
- myconf="${myconf} $(use_with python)" |
144 |
|
145 |
# user privilege bits fir qemu/kvm |
146 |
if use caps; then |
147 |
@@ -359,10 +366,11 @@ |
148 |
|
149 |
newinitd "${S}/libvirtd.init" libvirtd || die |
150 |
newconfd "${FILESDIR}/libvirtd.confd-r4" libvirtd || die |
151 |
+ newinitd "${FILESDIR}/virtlockd.init" virtlockd || die |
152 |
|
153 |
keepdir /var/lib/libvirt/images |
154 |
|
155 |
- use python && python_optimize |
156 |
+ readme.gentoo_create_doc |
157 |
} |
158 |
|
159 |
pkg_preinst() { |
160 |
@@ -409,20 +417,7 @@ |
161 |
use libvirtd || return 0 |
162 |
# From here, only libvirtd-related instructions, be warned! |
163 |
|
164 |
- elog |
165 |
- elog "For the basic networking support (bridged and routed networks)" |
166 |
- elog "you don't need any extra software. For more complex network modes" |
167 |
- elog "including but not limited to NATed network, you can enable the" |
168 |
- elog "'virt-network' USE flag." |
169 |
- elog |
170 |
- if has_version net-dns/dnsmasq; then |
171 |
- ewarn "If you have a DNS server setup on your machine, you will have" |
172 |
- ewarn "to configure /etc/dnsmasq.conf to enable the following settings: " |
173 |
- ewarn " bind-interfaces" |
174 |
- ewarn " interface or except-interface" |
175 |
- ewarn |
176 |
- ewarn "Otherwise you might have issues with your existing DNS server." |
177 |
- fi |
178 |
+ readme.gentoo_print_elog |
179 |
|
180 |
if use caps && use qemu; then |
181 |
elog "libvirt will now start qemu/kvm VMs with non-root privileges." |
182 |
|
183 |
|
184 |
|
185 |
1.342 app-emulation/libvirt/ChangeLog |
186 |
|
187 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/ChangeLog?rev=1.342&view=markup |
188 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/ChangeLog?rev=1.342&content-type=text/plain |
189 |
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/ChangeLog?r1=1.341&r2=1.342 |
190 |
|
191 |
Index: ChangeLog |
192 |
=================================================================== |
193 |
RCS file: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v |
194 |
retrieving revision 1.341 |
195 |
retrieving revision 1.342 |
196 |
diff -u -r1.341 -r1.342 |
197 |
--- ChangeLog 11 Nov 2013 03:41:44 -0000 1.341 |
198 |
+++ ChangeLog 3 Dec 2013 18:35:31 -0000 1.342 |
199 |
@@ -1,6 +1,13 @@ |
200 |
# ChangeLog for app-emulation/libvirt |
201 |
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 |
202 |
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.341 2013/11/11 03:41:44 floppym Exp $ |
203 |
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.342 2013/12/03 18:35:31 cardoe Exp $ |
204 |
+ |
205 |
+*libvirt-1.2.0 (03 Dec 2013) |
206 |
+ |
207 |
+ 03 Dec 2013; Doug Goldstein <cardoe@g.o> +libvirt-1.2.0.ebuild, |
208 |
+ libvirt-9999.ebuild: |
209 |
+ Version bump. Python bindings are now in their own package called dev-python |
210 |
+ /libvirt-python. Update the live ebuild to the latest changes from 1.2.0. |
211 |
|
212 |
11 Nov 2013; Mike Gilbert <floppym@g.o> libvirt-1.1.4.ebuild, |
213 |
libvirt-9999.ebuild: |
214 |
|
215 |
|
216 |
|
217 |
1.1 app-emulation/libvirt/libvirt-1.2.0.ebuild |
218 |
|
219 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/libvirt-1.2.0.ebuild?rev=1.1&view=markup |
220 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/libvirt-1.2.0.ebuild?rev=1.1&content-type=text/plain |
221 |
|
222 |
Index: libvirt-1.2.0.ebuild |
223 |
=================================================================== |
224 |
# Copyright 1999-2013 Gentoo Foundation |
225 |
# Distributed under the terms of the GNU General Public License v2 |
226 |
# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/libvirt-1.2.0.ebuild,v 1.1 2013/12/03 18:35:31 cardoe Exp $ |
227 |
|
228 |
EAPI=5 |
229 |
|
230 |
#BACKPORTS=062ad8b2 |
231 |
AUTOTOOLIZE=yes |
232 |
|
233 |
MY_P="${P/_rc/-rc}" |
234 |
|
235 |
inherit eutils user autotools linux-info systemd readme.gentoo |
236 |
|
237 |
if [[ ${PV} = *9999* ]]; then |
238 |
inherit git-2 |
239 |
EGIT_REPO_URI="git://libvirt.org/libvirt.git" |
240 |
AUTOTOOLIZE=yes |
241 |
SRC_URI="" |
242 |
KEYWORDS="" |
243 |
else |
244 |
SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz |
245 |
ftp://libvirt.org/libvirt/${MY_P}.tar.gz |
246 |
${BACKPORTS:+ |
247 |
http://dev.gentoo.org/~cardoe/distfiles/${MY_P}-${BACKPORTS}.tar.xz}" |
248 |
KEYWORDS="~amd64 ~x86" |
249 |
fi |
250 |
S="${WORKDIR}/${P%_rc*}" |
251 |
|
252 |
DESCRIPTION="C toolkit to manipulate virtual machines" |
253 |
HOMEPAGE="http://www.libvirt.org/" |
254 |
LICENSE="LGPL-2.1" |
255 |
SLOT="0" |
256 |
IUSE="audit avahi +caps firewalld fuse iscsi +libvirtd lvm lxc +macvtap nfs \ |
257 |
nls numa openvz parted pcap phyp policykit +qemu rbd sasl \ |
258 |
selinux +udev uml +vepa virtualbox virt-network xen elibc_glibc \ |
259 |
systemd" |
260 |
REQUIRED_USE="libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) ) |
261 |
lxc? ( caps libvirtd ) |
262 |
openvz? ( libvirtd ) |
263 |
qemu? ( libvirtd ) |
264 |
uml? ( libvirtd ) |
265 |
vepa? ( macvtap ) |
266 |
virtualbox? ( libvirtd ) |
267 |
xen? ( libvirtd ) |
268 |
virt-network? ( libvirtd ) |
269 |
firewalld? ( virt-network )" |
270 |
|
271 |
# gettext.sh command is used by the libvirt command wrappers, and it's |
272 |
# non-optional, so put it into RDEPEND. |
273 |
# We can use both libnl:1.1 and libnl:3, but if you have both installed, the |
274 |
# package will use 3 by default. Since we don't have slot pinning in an API, |
275 |
# we must go with the most recent |
276 |
RDEPEND="sys-libs/readline |
277 |
sys-libs/ncurses |
278 |
>=net-misc/curl-7.18.0 |
279 |
dev-libs/libgcrypt |
280 |
>=dev-libs/libxml2-2.7.6 |
281 |
dev-libs/libnl:3 |
282 |
>=net-libs/gnutls-1.0.25 |
283 |
net-libs/libssh2 |
284 |
sys-apps/dmidecode |
285 |
>=sys-apps/util-linux-2.17 |
286 |
sys-devel/gettext |
287 |
>=net-analyzer/netcat6-1.0-r2 |
288 |
app-misc/scrub |
289 |
audit? ( sys-process/audit ) |
290 |
avahi? ( >=net-dns/avahi-0.6[dbus] ) |
291 |
caps? ( sys-libs/libcap-ng ) |
292 |
fuse? ( >=sys-fs/fuse-2.8.6 ) |
293 |
iscsi? ( sys-block/open-iscsi ) |
294 |
lxc? ( sys-power/pm-utils ) |
295 |
lvm? ( >=sys-fs/lvm2-2.02.48-r2 ) |
296 |
nfs? ( net-fs/nfs-utils ) |
297 |
numa? ( |
298 |
>sys-process/numactl-2.0.2 |
299 |
sys-process/numad |
300 |
) |
301 |
openvz? ( sys-kernel/openvz-sources ) |
302 |
parted? ( |
303 |
>=sys-block/parted-1.8[device-mapper] |
304 |
sys-fs/lvm2 |
305 |
) |
306 |
pcap? ( >=net-libs/libpcap-1.0.0 ) |
307 |
policykit? ( >=sys-auth/polkit-0.9 ) |
308 |
qemu? ( |
309 |
>=app-emulation/qemu-0.13.0 |
310 |
dev-libs/yajl |
311 |
sys-power/pm-utils |
312 |
) |
313 |
rbd? ( sys-cluster/ceph ) |
314 |
sasl? ( dev-libs/cyrus-sasl ) |
315 |
selinux? ( >=sys-libs/libselinux-2.0.85 ) |
316 |
virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) ) |
317 |
xen? ( app-emulation/xen-tools app-emulation/xen ) |
318 |
udev? ( virtual/udev >=x11-libs/libpciaccess-0.10.9 ) |
319 |
virt-network? ( net-dns/dnsmasq |
320 |
>=net-firewall/iptables-1.4.10 |
321 |
net-misc/radvd |
322 |
net-firewall/ebtables |
323 |
sys-apps/iproute2[-minimal] |
324 |
firewalld? ( net-firewall/firewalld ) |
325 |
) |
326 |
elibc_glibc? ( || ( >=net-libs/libtirpc-0.2.2-r1 <sys-libs/glibc-2.14 ) )" |
327 |
# one? ( dev-libs/xmlrpc-c ) |
328 |
DEPEND="${RDEPEND} |
329 |
virtual/pkgconfig |
330 |
app-text/xhtml1 |
331 |
dev-lang/perl |
332 |
dev-libs/libxslt" |
333 |
|
334 |
DOC_CONTENTS="For the basic networking support (bridged and routed networks) |
335 |
you don't need any extra software. For more complex network modes |
336 |
including but not limited to NATed network, you can enable the |
337 |
'virt-network' USE flag.\n\n |
338 |
If you are using dnsmasq on your system, you will have |
339 |
to configure /etc/dnsmasq.conf to enable the following settings:\n\n |
340 |
bind-interfaces\n |
341 |
interface or except-interface\n\n |
342 |
Otherwise you might have issues with your existing DNS server." |
343 |
|
344 |
LXC_CONFIG_CHECK=" |
345 |
~CGROUPS |
346 |
~CGROUP_FREEZER |
347 |
~CGROUP_DEVICE |
348 |
~CGROUP_CPUACCT |
349 |
~CGROUP_SCHED |
350 |
~CGROUP_PERF |
351 |
~BLK_CGROUP |
352 |
~NET_CLS_CGROUP |
353 |
~NETPRIO_CGROUP |
354 |
~CPUSETS |
355 |
~RESOURCE_COUNTERS |
356 |
~NAMESPACES |
357 |
~UTS_NS |
358 |
~IPC_NS |
359 |
~PID_NS |
360 |
~NET_NS |
361 |
~USER_NS |
362 |
~DEVPTS_MULTIPLE_INSTANCES |
363 |
~VETH |
364 |
~MACVLAN |
365 |
~POSIX_MQUEUE |
366 |
~SECURITYFS |
367 |
~!GRKERNSEC_CHROOT_MOUNT |
368 |
~!GRKERNSEC_CHROOT_DOUBLE |
369 |
~!GRKERNSEC_CHROOT_PIVOT |
370 |
~!GRKERNSEC_CHROOT_CHMOD |
371 |
~!GRKERNSEC_CHROOT_CAPS |
372 |
" |
373 |
|
374 |
VIRTNET_CONFIG_CHECK=" |
375 |
~BRIDGE_NF_EBTABLES |
376 |
~BRIDGE_EBT_MARK_T |
377 |
~NETFILTER_ADVANCED |
378 |
~NETFILTER_XT_TARGET_CHECKSUM |
379 |
~NETFILTER_XT_CONNMARK |
380 |
~NETFILTER_XT_MARK |
381 |
" |
382 |
|
383 |
MACVTAP_CONFIG_CHECK=" ~MACVTAP" |
384 |
|
385 |
LVM_CONFIG_CHECK=" ~BLK_DEV_DM ~DM_SNAPSHOT ~DM_MULTIPATH" |
386 |
|
387 |
ERROR_USER_NS="Optional depending on LXC configuration." |
388 |
|
389 |
pkg_setup() { |
390 |
enewgroup qemu 77 |
391 |
enewuser qemu 77 -1 -1 qemu kvm |
392 |
|
393 |
# Some people used the masked ebuild which was not adding the qemu |
394 |
# user to the kvm group originally. This results in VMs failing to |
395 |
# start for some users. bug #430808 |
396 |
egetent group kvm | grep -q qemu |
397 |
if [[ $? -ne 0 ]]; then |
398 |
gpasswd -a qemu kvm |
399 |
fi |
400 |
|
401 |
# Handle specific kernel versions for different features |
402 |
kernel_is lt 3 6 && LXC_CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR" |
403 |
kernel_is ge 3 6 && LXC_CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM" |
404 |
|
405 |
CONFIG_CHECK="" |
406 |
use fuse && CONFIG_CHECK+=" ~FUSE_FS" |
407 |
use lvm && CONFIG_CHECK+="${LVM_CONFIG_CHECK}" |
408 |
use lxc && CONFIG_CHECK+="${LXC_CONFIG_CHECK}" |
409 |
use macvtap && CONFIG_CHECK+="${MACVTAP_CONFIG_CHECK}" |
410 |
use virt-network && CONFIG_CHECK+="${VIRTNET_CONFIG_CHECK}" |
411 |
if [[ -n ${CONFIG_CHECK} ]]; then |
412 |
linux-info_pkg_setup |
413 |
fi |
414 |
} |
415 |
|
416 |
src_prepare() { |
417 |
touch "${S}/.mailmap" |
418 |
[[ -n ${BACKPORTS} ]] && \ |
419 |
EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \ |
420 |
epatch |
421 |
|
422 |
if [[ ${PV} = *9999* ]]; then |
423 |
|
424 |
# git checkouts require bootstrapping to create the configure script. |
425 |
# Additionally the submodules must be cloned to the right locations |
426 |
# bug #377279 |
427 |
./bootstrap || die "bootstrap failed" |
428 |
( |
429 |
git submodule status | sed 's/^[ +-]//;s/ .*//' |
430 |
git hash-object bootstrap.conf |
431 |
) >.git-module-status |
432 |
fi |
433 |
|
434 |
epatch_user |
435 |
|
436 |
[[ -n ${AUTOTOOLIZE} ]] && eautoreconf |
437 |
|
438 |
# Tweak the init script |
439 |
local avahi_init= |
440 |
local iscsi_init= |
441 |
local rbd_init= |
442 |
local firewalld_init= |
443 |
cp "${FILESDIR}/libvirtd.init-r13" "${S}/libvirtd.init" |
444 |
use avahi && avahi_init='avahi-daemon' |
445 |
use iscsi && iscsi_init='iscsid' |
446 |
use rbd && rbd_init='ceph' |
447 |
use firewalld && firewalld_init='need firewalld' |
448 |
|
449 |
sed -e "s/USE_FLAG_FIREWALLD/${firewalld_init}/" -i "${S}/libvirtd.init" |
450 |
sed -e "s/USE_FLAG_AVAHI/${avahi_init}/" -i "${S}/libvirtd.init" |
451 |
sed -e "s/USE_FLAG_ISCSI/${iscsi_init}/" -i "${S}/libvirtd.init" |
452 |
sed -e "s/USE_FLAG_RBD/${rbd_init}/" -i "${S}/libvirtd.init" |
453 |
} |
454 |
|
455 |
src_configure() { |
456 |
local myconf="" |
457 |
|
458 |
## enable/disable daemon, otherwise client only utils |
459 |
myconf="${myconf} $(use_with libvirtd)" |
460 |
|
461 |
## enable/disable the daemon using avahi to find VMs |
462 |
myconf="${myconf} $(use_with avahi)" |
463 |
|
464 |
## hypervisors on the local host |
465 |
myconf="${myconf} $(use_with xen) $(use_with xen xen-inotify)" |
466 |
myconf+=" --without-xenapi" |
467 |
if use xen && has_version ">=app-emulation/xen-tools-4.2.0"; then |
468 |
myconf+=" --with-libxl" |
469 |
else |
470 |
myconf+=" --without-libxl" |
471 |
fi |
472 |
myconf="${myconf} $(use_with openvz)" |
473 |
myconf="${myconf} $(use_with lxc)" |
474 |
if use virtualbox && has_version app-emulation/virtualbox-ose; then |
475 |
myconf="${myconf} --with-vbox=/usr/lib/virtualbox-ose/" |
476 |
else |
477 |
myconf="${myconf} $(use_with virtualbox vbox)" |
478 |
fi |
479 |
myconf="${myconf} $(use_with uml)" |
480 |
myconf="${myconf} $(use_with qemu)" |
481 |
myconf="${myconf} $(use_with qemu yajl)" # Use QMP over HMP |
482 |
myconf="${myconf} $(use_with phyp)" |
483 |
myconf="${myconf} --with-esx" |
484 |
myconf="${myconf} --with-vmware" |
485 |
|
486 |
## additional host drivers |
487 |
myconf="${myconf} $(use_with virt-network network)" |
488 |
myconf="${myconf} --with-storage-fs" |
489 |
myconf="${myconf} $(use_with lvm storage-lvm)" |
490 |
myconf="${myconf} $(use_with iscsi storage-iscsi)" |
491 |
myconf="${myconf} $(use_with parted storage-disk)" |
492 |
myconf="${myconf} $(use_with lvm storage-mpath)" |
493 |
myconf="${myconf} $(use_with rbd storage-rbd)" |
494 |
myconf="${myconf} $(use_with numa numactl)" |
495 |
myconf="${myconf} $(use_with numa numad)" |
496 |
myconf="${myconf} $(use_with selinux)" |
497 |
myconf="${myconf} $(use_with fuse)" |
498 |
|
499 |
# udev for device support details |
500 |
myconf="${myconf} $(use_with udev)" |
501 |
|
502 |
# linux capability support so we don't need privileged accounts |
503 |
myconf="${myconf} $(use_with caps capng)" |
504 |
|
505 |
## auth stuff |
506 |
myconf="${myconf} $(use_with policykit polkit)" |
507 |
myconf="${myconf} $(use_with sasl)" |
508 |
|
509 |
# network bits |
510 |
myconf="${myconf} $(use_with macvtap)" |
511 |
myconf="${myconf} $(use_with pcap libpcap)" |
512 |
myconf="${myconf} $(use_with vepa virtualport)" |
513 |
myconf="${myconf} $(use_with firewalld)" |
514 |
|
515 |
## other |
516 |
myconf="${myconf} $(use_enable nls)" |
517 |
|
518 |
# user privilege bits fir qemu/kvm |
519 |
if use caps; then |
520 |
myconf="${myconf} --with-qemu-user=qemu" |
521 |
myconf="${myconf} --with-qemu-group=qemu" |
522 |
else |
523 |
myconf="${myconf} --with-qemu-user=root" |
524 |
myconf="${myconf} --with-qemu-group=root" |
525 |
fi |
526 |
|
527 |
# audit support |
528 |
myconf="${myconf} $(use_with audit)" |
529 |
|
530 |
## stuff we don't yet support |
531 |
myconf="${myconf} --without-netcf" |
532 |
|
533 |
# we use udev over hal |
534 |
myconf="${myconf} --without-hal" |
535 |
|
536 |
# locking support |
537 |
myconf="${myconf} --without-sanlock" |
538 |
|
539 |
# systemd unit files |
540 |
use systemd && myconf="${myconf} --with-init-script=systemd" |
541 |
|
542 |
# this is a nasty trick to work around the problem in bug |
543 |
# #275073. The reason why we don't solve this properly is that |
544 |
# it'll require us to rebuild autotools (and we don't really want |
545 |
# to do that right now). The proper solution has been sent |
546 |
# upstream and should hopefully land in 0.7.7, in the mean time, |
547 |
# mime the same functionality with this. |
548 |
case ${CHOST} in |
549 |
*cygwin* | *mingw* ) |
550 |
;; |
551 |
*) |
552 |
ac_cv_prog_WINDRES=no |
553 |
;; |
554 |
esac |
555 |
|
556 |
econf \ |
557 |
${myconf} \ |
558 |
--disable-static \ |
559 |
--docdir=/usr/share/doc/${PF} \ |
560 |
--with-remote \ |
561 |
--localstatedir=/var |
562 |
|
563 |
if [[ ${PV} = *9999* ]]; then |
564 |
# Restore gnulib's config.sub and config.guess |
565 |
# bug #377279 |
566 |
(cd .gnulib && git reset --hard > /dev/null) |
567 |
fi |
568 |
} |
569 |
|
570 |
src_test() { |
571 |
# Explicitly allow parallel build of tests |
572 |
export VIR_TEST_DEBUG=1 |
573 |
HOME="${T}" emake check || die "tests failed" |
574 |
} |
575 |
|
576 |
src_install() { |
577 |
emake install \ |
578 |
DESTDIR="${D}" \ |
579 |
HTML_DIR=/usr/share/doc/${PF}/html \ |
580 |
DOCS_DIR=/usr/share/doc/${PF} \ |
581 |
EXAMPLE_DIR=/usr/share/doc/${PF}/examples \ |
582 |
SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)" \ |
583 |
|| die "emake install failed" |
584 |
|
585 |
find "${D}" -name '*.la' -delete || die |
586 |
|
587 |
use libvirtd || return 0 |
588 |
# From here, only libvirtd-related instructions, be warned! |
589 |
|
590 |
newinitd "${S}/libvirtd.init" libvirtd || die |
591 |
newconfd "${FILESDIR}/libvirtd.confd-r4" libvirtd || die |
592 |
newinitd "${FILESDIR}/virtlockd.init" virtlockd || die |
593 |
|
594 |
keepdir /var/lib/libvirt/images |
595 |
|
596 |
readme.gentoo_create_doc |
597 |
} |
598 |
|
599 |
pkg_preinst() { |
600 |
# we only ever want to generate this once |
601 |
if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then |
602 |
rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml |
603 |
fi |
604 |
|
605 |
# We really don't want to use or support old PolicyKit cause it |
606 |
# screws with the new polkit integration |
607 |
if has_version sys-auth/policykit; then |
608 |
rm -rf "${D}"/usr/share/PolicyKit/policy/org.libvirt.unix.policy |
609 |
fi |
610 |
|
611 |
# Only sysctl files ending in .conf work |
612 |
dodir /etc/sysctl.d |
613 |
mv "${D}"/usr/lib/sysctl.d/libvirtd.conf "${D}"/etc/sysctl.d/libvirtd.conf |
614 |
} |
615 |
|
616 |
pkg_postinst() { |
617 |
if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then |
618 |
touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml |
619 |
fi |
620 |
|
621 |
# support for dropped privileges |
622 |
if use qemu; then |
623 |
fperms 0750 "${EROOT}/var/lib/libvirt/qemu" |
624 |
fperms 0750 "${EROOT}/var/cache/libvirt/qemu" |
625 |
fi |
626 |
|
627 |
if use caps && use qemu; then |
628 |
fowners -R qemu:qemu "${EROOT}/var/lib/libvirt/qemu" |
629 |
fowners -R qemu:qemu "${EROOT}/var/cache/libvirt/qemu" |
630 |
elif use qemu; then |
631 |
fowners -R root:root "${EROOT}/var/lib/libvirt/qemu" |
632 |
fowners -R root:root "${EROOT}/var/cache/libvirt/qemu" |
633 |
fi |
634 |
|
635 |
if ! use policykit; then |
636 |
elog "To allow normal users to connect to libvirtd you must change the" |
637 |
elog "unix sock group and/or perms in /etc/libvirt/libvirtd.conf" |
638 |
fi |
639 |
|
640 |
use libvirtd || return 0 |
641 |
# From here, only libvirtd-related instructions, be warned! |
642 |
|
643 |
readme.gentoo_print_elog |
644 |
|
645 |
if use caps && use qemu; then |
646 |
elog "libvirt will now start qemu/kvm VMs with non-root privileges." |
647 |
elog "Ensure any resources your VMs use are accessible by qemu:qemu" |
648 |
fi |
649 |
} |