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