1 |
commit: 4361974d8345e9d7f576a1b8524e9b0eefcea0ea |
2 |
Author: Matthias Maier <tamiko <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 3 04:13:47 2016 +0000 |
4 |
Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 3 04:13:47 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4361974d |
7 |
|
8 |
app-emulation/libvirt: Version bump to 1.3.1, bug 573000 |
9 |
|
10 |
Package-Manager: portage-2.2.26 |
11 |
|
12 |
app-emulation/libvirt/Manifest | 1 + |
13 |
.../libvirt-1.2.17-fix_paths_for_apparmor.patch | 15 - |
14 |
... => libvirt-1.3.1-fix_paths_for_apparmor.patch} | 54 +-- |
15 |
app-emulation/libvirt/libvirt-1.3.1.ebuild | 384 +++++++++++++++++++++ |
16 |
4 files changed, 404 insertions(+), 50 deletions(-) |
17 |
|
18 |
diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest |
19 |
index a7622e1..16ca1d0 100644 |
20 |
--- a/app-emulation/libvirt/Manifest |
21 |
+++ b/app-emulation/libvirt/Manifest |
22 |
@@ -2,3 +2,4 @@ DIST libvirt-1.2.21-20151222.tar.xz 1684 SHA256 6c97f288470ec58bcbe98507563c6a19 |
23 |
DIST libvirt-1.2.21.tar.gz 29848954 SHA256 8d406582f5fe88d739d1d83e0ba7ac7f91f5a8da4be82162ab85631744d8925b SHA512 5c15d0ba5d75c13f735c6a60dfdbad007426f77e113f95894d520f7fc358fa4361d5cce7bb9a548a436f323b845f13b8940abbad568b8b146418430068bb970e WHIRLPOOL d53bbb07c85b3aa2d9b0f38ff2edd3cd0a2a5300627f3e2f0a82bc057303617cab9d6f1d8a9a771bd968b0496d38d3a39a0154f88bdca44dda359a65fdc2c650 |
24 |
DIST libvirt-1.3.0-20151222.tar.xz 1684 SHA256 3628c3398862eae2966ccf0e55822e4cb8f47e6e8c1b0d17b6fdb9f69dc5490b SHA512 71c8dabc9cb8ead2858bf2d77d3831db59ac34076c99a4ae607c7bb4678b0af28a9f31fdca047ee174237f0e91fbb8db3a843e605256514e1d0ad527fc412275 WHIRLPOOL 47ebd21dd7d17812b8e97ebb70453574550cac18b0cf88cd38c152565d1e01f725a6da90878c41c7836a59318c1294859870e5bb523981954618fdde6704360e |
25 |
DIST libvirt-1.3.0.tar.gz 30114683 SHA256 ebcf5645fa565e3fe2fe94a86e841db9b768cf0e0a7e6cf395c6327f9a23bd64 SHA512 e252390a05b76e9cd9ed02caadd0ee0d674505f60940bb6ced955e17f69c7dd55fe5b38204ae5c25b6e5703415a0f6a12fc545d138d0e8b016457a85dc8fa2b8 WHIRLPOOL 852c592b27be86d3fb2ec75ca5debf9a1e0ac5de6d1ab06c55c2d70e83de125d10c2fc967b7578fba9137ed7a30b7a7e195f4e5f8d35708deeeddc97424d5e40 |
26 |
+DIST libvirt-1.3.1.tar.gz 29900143 SHA256 a5d43fbed34d31eeffc641d2ac9b6026a57bf1a4fa74d0fa19a9891d9ec2c21a SHA512 a109c09d947f7c5e924fdbc9c9b6c0a9d6ff64d9411aedd9a3e710d20f749b088ff9895e882dd888b88bfea7724a8933534be4078f16cb9d2047da761515e804 WHIRLPOOL 62fb8486bfa53d55b397d9a90750d32a83f0a73cf2e6685f296489390abf9c62efc69fecd6d011fc51e9f562f75f5b8ce03208c350e98d20de0a5560721c675e |
27 |
|
28 |
diff --git a/app-emulation/libvirt/files/libvirt-1.2.17-fix_paths_for_apparmor.patch b/app-emulation/libvirt/files/libvirt-1.2.17-fix_paths_for_apparmor.patch |
29 |
index 8e19c0f..c608295 100644 |
30 |
--- a/app-emulation/libvirt/files/libvirt-1.2.17-fix_paths_for_apparmor.patch |
31 |
+++ b/app-emulation/libvirt/files/libvirt-1.2.17-fix_paths_for_apparmor.patch |
32 |
@@ -1,18 +1,3 @@ |
33 |
-From bde898de482645f6963b673e8ff0b486a0a6db25 Mon Sep 17 00:00:00 2001 |
34 |
-From: Matthias Maier <tamiko@××××××××××.org> |
35 |
-Date: Tue, 28 Jul 2015 11:10:59 -0500 |
36 |
-Subject: [PATCH] adapt paths for gentoo's fs layout |
37 |
- |
38 |
-https://bugs.gentoo.org/show_bug.cgi?id=554628 |
39 |
---- |
40 |
- examples/apparmor/Makefile.am | 4 +- |
41 |
- examples/apparmor/usr.lib.libvirt.virt-aa-helper | 48 ------------------------ |
42 |
- examples/apparmor/usr.libexec.virt-aa-helper | 48 ++++++++++++++++++++++++ |
43 |
- examples/apparmor/usr.sbin.libvirtd | 4 +- |
44 |
- 4 files changed, 52 insertions(+), 52 deletions(-) |
45 |
- delete mode 100644 examples/apparmor/usr.lib.libvirt.virt-aa-helper |
46 |
- create mode 100644 examples/apparmor/usr.libexec.virt-aa-helper |
47 |
- |
48 |
diff --git a/examples/apparmor/Makefile.am b/examples/apparmor/Makefile.am |
49 |
index 7a20e16..c3c67b6 100644 |
50 |
--- a/examples/apparmor/Makefile.am |
51 |
|
52 |
diff --git a/app-emulation/libvirt/files/libvirt-1.2.17-fix_paths_for_apparmor.patch b/app-emulation/libvirt/files/libvirt-1.3.1-fix_paths_for_apparmor.patch |
53 |
similarity index 74% |
54 |
copy from app-emulation/libvirt/files/libvirt-1.2.17-fix_paths_for_apparmor.patch |
55 |
copy to app-emulation/libvirt/files/libvirt-1.3.1-fix_paths_for_apparmor.patch |
56 |
index 8e19c0f..990fbac 100644 |
57 |
--- a/app-emulation/libvirt/files/libvirt-1.2.17-fix_paths_for_apparmor.patch |
58 |
+++ b/app-emulation/libvirt/files/libvirt-1.3.1-fix_paths_for_apparmor.patch |
59 |
@@ -1,36 +1,23 @@ |
60 |
-From bde898de482645f6963b673e8ff0b486a0a6db25 Mon Sep 17 00:00:00 2001 |
61 |
-From: Matthias Maier <tamiko@××××××××××.org> |
62 |
-Date: Tue, 28 Jul 2015 11:10:59 -0500 |
63 |
-Subject: [PATCH] adapt paths for gentoo's fs layout |
64 |
- |
65 |
-https://bugs.gentoo.org/show_bug.cgi?id=554628 |
66 |
---- |
67 |
- examples/apparmor/Makefile.am | 4 +- |
68 |
- examples/apparmor/usr.lib.libvirt.virt-aa-helper | 48 ------------------------ |
69 |
- examples/apparmor/usr.libexec.virt-aa-helper | 48 ++++++++++++++++++++++++ |
70 |
- examples/apparmor/usr.sbin.libvirtd | 4 +- |
71 |
- 4 files changed, 52 insertions(+), 52 deletions(-) |
72 |
- delete mode 100644 examples/apparmor/usr.lib.libvirt.virt-aa-helper |
73 |
- create mode 100644 examples/apparmor/usr.libexec.virt-aa-helper |
74 |
- |
75 |
-diff --git a/examples/apparmor/Makefile.am b/examples/apparmor/Makefile.am |
76 |
-index 7a20e16..c3c67b6 100644 |
77 |
---- a/examples/apparmor/Makefile.am |
78 |
-+++ b/examples/apparmor/Makefile.am |
79 |
-@@ -19,13 +19,13 @@ EXTRA_DIST= \ |
80 |
- TEMPLATE.lxc \ |
81 |
- libvirt-qemu \ |
82 |
- libvirt-lxc \ |
83 |
-- usr.lib.libvirt.virt-aa-helper \ |
84 |
-+ usr.libexec.virt-aa-helper \ |
85 |
- usr.sbin.libvirtd |
86 |
- |
87 |
+diff --git a/examples/Makefile.am b/examples/Makefile.am |
88 |
+index 2adcefb..cdee23b 100644 |
89 |
+--- a/examples/Makefile.am |
90 |
++++ b/examples/Makefile.am |
91 |
+@@ -23,7 +23,7 @@ EXTRA_DIST = \ |
92 |
+ apparmor/TEMPLATE.lxc \ |
93 |
+ apparmor/libvirt-qemu \ |
94 |
+ apparmor/libvirt-lxc \ |
95 |
+- apparmor/usr.lib.libvirt.virt-aa-helper \ |
96 |
++ apparmor/usr.libexec.virt-aa-helper \ |
97 |
+ apparmor/usr.sbin.libvirtd \ |
98 |
+ lxcconvert/virt-lxc-convert \ |
99 |
+ polkit/libvirt-acl.rules \ |
100 |
+@@ -55,7 +55,7 @@ rename_rename_SOURCES = rename/rename.c |
101 |
if WITH_APPARMOR_PROFILES |
102 |
apparmordir = $(sysconfdir)/apparmor.d/ |
103 |
apparmor_DATA = \ |
104 |
-- usr.lib.libvirt.virt-aa-helper \ |
105 |
-+ usr.libexec.virt-aa-helper \ |
106 |
- usr.sbin.libvirtd \ |
107 |
+- apparmor/usr.lib.libvirt.virt-aa-helper \ |
108 |
++ apparmor/usr.libexec.virt-aa-helper \ |
109 |
+ apparmor/usr.sbin.libvirtd \ |
110 |
$(NULL) |
111 |
|
112 |
diff --git a/examples/apparmor/usr.lib.libvirt.virt-aa-helper b/examples/apparmor/usr.lib.libvirt.virt-aa-helper |
113 |
@@ -89,7 +76,7 @@ index b34fb35..0000000 |
114 |
-} |
115 |
diff --git a/examples/apparmor/usr.libexec.virt-aa-helper b/examples/apparmor/usr.libexec.virt-aa-helper |
116 |
new file mode 100644 |
117 |
-index 0000000..b34fb35 |
118 |
+index 0000000..08b871a |
119 |
--- /dev/null |
120 |
+++ b/examples/apparmor/usr.libexec.virt-aa-helper |
121 |
@@ -0,0 +1,48 @@ |
122 |
@@ -142,7 +129,7 @@ index 0000000..b34fb35 |
123 |
+ /**/disk{,.*} r, |
124 |
+} |
125 |
diff --git a/examples/apparmor/usr.sbin.libvirtd b/examples/apparmor/usr.sbin.libvirtd |
126 |
-index 5d606e6..ab2f1a9 100644 |
127 |
+index 5d606e6..b2cd8c6 100644 |
128 |
--- a/examples/apparmor/usr.sbin.libvirtd |
129 |
+++ b/examples/apparmor/usr.sbin.libvirtd |
130 |
@@ -58,8 +58,10 @@ |
131 |
@@ -158,6 +145,3 @@ index 5d606e6..ab2f1a9 100644 |
132 |
/etc/libvirt/hooks/** rmix, |
133 |
/etc/xen/scripts/** rmix, |
134 |
|
135 |
--- |
136 |
-2.3.6 |
137 |
- |
138 |
|
139 |
diff --git a/app-emulation/libvirt/libvirt-1.3.1.ebuild b/app-emulation/libvirt/libvirt-1.3.1.ebuild |
140 |
new file mode 100644 |
141 |
index 0000000..d1be49b |
142 |
--- /dev/null |
143 |
+++ b/app-emulation/libvirt/libvirt-1.3.1.ebuild |
144 |
@@ -0,0 +1,384 @@ |
145 |
+# Copyright 1999-2016 Gentoo Foundation |
146 |
+# Distributed under the terms of the GNU General Public License v2 |
147 |
+# $Id$ |
148 |
+ |
149 |
+EAPI=5 |
150 |
+ |
151 |
+inherit eutils user autotools-utils linux-info systemd readme.gentoo |
152 |
+ |
153 |
+BACKPORTS="" |
154 |
+ |
155 |
+if [[ ${PV} = *9999* ]]; then |
156 |
+ inherit git-r3 |
157 |
+ EGIT_REPO_URI="git://libvirt.org/libvirt.git" |
158 |
+ SRC_URI="" |
159 |
+ KEYWORDS="" |
160 |
+ SLOT="0" |
161 |
+else |
162 |
+ # Versions with 4 numbers are stable updates: |
163 |
+ if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then |
164 |
+ SRC_URI="http://libvirt.org/sources/stable_updates/${P}.tar.gz" |
165 |
+ else |
166 |
+ SRC_URI="http://libvirt.org/sources/${P}.tar.gz" |
167 |
+ fi |
168 |
+ SRC_URI+=" ${BACKPORTS:+ |
169 |
+ https://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz |
170 |
+ https://dev.gentoo.org/~tamiko/distfiles/${P}-${BACKPORTS}.tar.xz}" |
171 |
+ KEYWORDS="~amd64 ~x86" |
172 |
+ SLOT="0/${PV}" |
173 |
+fi |
174 |
+ |
175 |
+DESCRIPTION="C toolkit to manipulate virtual machines" |
176 |
+HOMEPAGE="http://www.libvirt.org/" |
177 |
+LICENSE="LGPL-2.1" |
178 |
+IUSE="apparmor audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm \ |
179 |
+ lxc +macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \ |
180 |
+ selinux systemd +udev uml +vepa virtualbox virt-network wireshark-plugins \ |
181 |
+ xen" |
182 |
+ |
183 |
+REQUIRED_USE=" |
184 |
+ firewalld? ( virt-network ) |
185 |
+ libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) ) |
186 |
+ lxc? ( caps libvirtd ) |
187 |
+ openvz? ( libvirtd ) |
188 |
+ qemu? ( libvirtd ) |
189 |
+ uml? ( libvirtd ) |
190 |
+ vepa? ( macvtap ) |
191 |
+ virt-network? ( libvirtd ) |
192 |
+ virtualbox? ( libvirtd ) |
193 |
+ xen? ( libvirtd )" |
194 |
+ |
195 |
+# gettext.sh command is used by the libvirt command wrappers, and it's |
196 |
+# non-optional, so put it into RDEPEND. |
197 |
+# We can use both libnl:1.1 and libnl:3, but if you have both installed, the |
198 |
+# package will use 3 by default. Since we don't have slot pinning in an API, |
199 |
+# we must go with the most recent |
200 |
+RDEPEND=" |
201 |
+ app-misc/scrub |
202 |
+ dev-libs/libgcrypt:0 |
203 |
+ dev-libs/libnl:3 |
204 |
+ >=dev-libs/libxml2-2.7.6 |
205 |
+ >=net-analyzer/netcat6-1.0-r2 |
206 |
+ >=net-libs/gnutls-1.0.25 |
207 |
+ net-libs/libssh2 |
208 |
+ >=net-misc/curl-7.18.0 |
209 |
+ sys-apps/dmidecode |
210 |
+ >=sys-apps/util-linux-2.17 |
211 |
+ sys-devel/gettext |
212 |
+ sys-libs/ncurses:0= |
213 |
+ sys-libs/readline:= |
214 |
+ apparmor? ( sys-libs/libapparmor ) |
215 |
+ audit? ( sys-process/audit ) |
216 |
+ avahi? ( >=net-dns/avahi-0.6[dbus] ) |
217 |
+ caps? ( sys-libs/libcap-ng ) |
218 |
+ firewalld? ( net-firewall/firewalld ) |
219 |
+ fuse? ( >=sys-fs/fuse-2.8.6 ) |
220 |
+ glusterfs? ( >=sys-cluster/glusterfs-3.4.1 ) |
221 |
+ iscsi? ( sys-block/open-iscsi ) |
222 |
+ lvm? ( >=sys-fs/lvm2-2.02.48-r2 ) |
223 |
+ lxc? ( !systemd? ( sys-power/pm-utils ) ) |
224 |
+ nfs? ( net-fs/nfs-utils ) |
225 |
+ numa? ( |
226 |
+ >sys-process/numactl-2.0.2 |
227 |
+ sys-process/numad |
228 |
+ ) |
229 |
+ openvz? ( sys-kernel/openvz-sources:* ) |
230 |
+ parted? ( |
231 |
+ >=sys-block/parted-1.8[device-mapper] |
232 |
+ sys-fs/lvm2 |
233 |
+ ) |
234 |
+ pcap? ( >=net-libs/libpcap-1.0.0 ) |
235 |
+ policykit? ( >=sys-auth/polkit-0.9 ) |
236 |
+ qemu? ( |
237 |
+ >=app-emulation/qemu-0.13.0 |
238 |
+ dev-libs/yajl |
239 |
+ !systemd? ( sys-power/pm-utils ) |
240 |
+ ) |
241 |
+ rbd? ( sys-cluster/ceph ) |
242 |
+ sasl? ( dev-libs/cyrus-sasl ) |
243 |
+ selinux? ( >=sys-libs/libselinux-2.0.85 ) |
244 |
+ systemd? ( sys-apps/systemd ) |
245 |
+ virt-network? ( |
246 |
+ net-dns/dnsmasq[script] |
247 |
+ net-firewall/ebtables |
248 |
+ >=net-firewall/iptables-1.4.10[ipv6] |
249 |
+ net-misc/radvd |
250 |
+ sys-apps/iproute2[-minimal] |
251 |
+ ) |
252 |
+ virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) ) |
253 |
+ wireshark-plugins? ( net-analyzer/wireshark:= ) |
254 |
+ xen? ( |
255 |
+ app-emulation/xen |
256 |
+ app-emulation/xen-tools:= |
257 |
+ ) |
258 |
+ udev? ( |
259 |
+ virtual/udev |
260 |
+ >=x11-libs/libpciaccess-0.10.9 |
261 |
+ )" |
262 |
+ |
263 |
+DEPEND="${RDEPEND} |
264 |
+ app-text/xhtml1 |
265 |
+ dev-lang/perl |
266 |
+ dev-libs/libxslt |
267 |
+ dev-perl/XML-XPath |
268 |
+ virtual/pkgconfig" |
269 |
+ |
270 |
+pkg_setup() { |
271 |
+ enewgroup qemu 77 |
272 |
+ enewuser qemu 77 -1 -1 qemu kvm |
273 |
+ |
274 |
+ # Some people used the masked ebuild which was not adding the qemu |
275 |
+ # user to the kvm group originally. This results in VMs failing to |
276 |
+ # start for some users. bug #430808 |
277 |
+ egetent group kvm | grep -q qemu |
278 |
+ if [[ $? -ne 0 ]]; then |
279 |
+ gpasswd -a qemu kvm |
280 |
+ fi |
281 |
+ |
282 |
+ # Check kernel configuration: |
283 |
+ CONFIG_CHECK="" |
284 |
+ use fuse && CONFIG_CHECK+=" |
285 |
+ ~FUSE_FS" |
286 |
+ |
287 |
+ use lvm && CONFIG_CHECK+=" |
288 |
+ ~BLK_DEV_DM |
289 |
+ ~DM_MULTIPATH |
290 |
+ ~DM_SNAPSHOT" |
291 |
+ |
292 |
+ use lxc && CONFIG_CHECK+=" |
293 |
+ ~BLK_CGROUP |
294 |
+ ~CGROUP_CPUACCT |
295 |
+ ~CGROUP_DEVICE |
296 |
+ ~CGROUP_FREEZER |
297 |
+ ~CGROUP_NET_PRIO |
298 |
+ ~CGROUP_PERF |
299 |
+ ~CGROUPS |
300 |
+ ~CGROUP_SCHED |
301 |
+ ~CPUSETS |
302 |
+ ~DEVPTS_MULTIPLE_INSTANCES |
303 |
+ ~IPC_NS |
304 |
+ ~MACVLAN |
305 |
+ ~NAMESPACES |
306 |
+ ~NET_CLS_CGROUP |
307 |
+ ~NET_NS |
308 |
+ ~PID_NS |
309 |
+ ~POSIX_MQUEUE |
310 |
+ ~SECURITYFS |
311 |
+ ~USER_NS |
312 |
+ ~UTS_NS |
313 |
+ ~VETH |
314 |
+ ~!GRKERNSEC_CHROOT_MOUNT |
315 |
+ ~!GRKERNSEC_CHROOT_DOUBLE |
316 |
+ ~!GRKERNSEC_CHROOT_PIVOT |
317 |
+ ~!GRKERNSEC_CHROOT_CHMOD |
318 |
+ ~!GRKERNSEC_CHROOT_CAPS" |
319 |
+ # Handle specific kernel versions for different features |
320 |
+ kernel_is lt 3 6 && CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR" |
321 |
+ kernel_is ge 3 6 && CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM" |
322 |
+ |
323 |
+ use macvtap && CONFIG_CHECK+=" |
324 |
+ ~MACVTAP" |
325 |
+ |
326 |
+ use virt-network && CONFIG_CHECK+=" |
327 |
+ ~BRIDGE_EBT_MARK_T |
328 |
+ ~BRIDGE_NF_EBTABLES |
329 |
+ ~NETFILTER_ADVANCED |
330 |
+ ~NETFILTER_XT_CONNMARK |
331 |
+ ~NETFILTER_XT_MARK |
332 |
+ ~NETFILTER_XT_TARGET_CHECKSUM" |
333 |
+ # Bandwidth Limiting Support |
334 |
+ use virt-network && CONFIG_CHECK+=" |
335 |
+ ~BRIDGE_EBT_T_NAT |
336 |
+ ~NET_ACT_POLICE |
337 |
+ ~NET_CLS_FW |
338 |
+ ~NET_CLS_U32 |
339 |
+ ~NET_SCH_HTB |
340 |
+ ~NET_SCH_INGRESS |
341 |
+ ~NET_SCH_SFQ" |
342 |
+ |
343 |
+ ERROR_USER_NS="Optional depending on LXC configuration." |
344 |
+ |
345 |
+ if [[ -n ${CONFIG_CHECK} ]]; then |
346 |
+ linux-info_pkg_setup |
347 |
+ fi |
348 |
+} |
349 |
+ |
350 |
+src_prepare() { |
351 |
+ touch "${S}/.mailmap" |
352 |
+ |
353 |
+ if [[ ${PV} = *9999* ]]; then |
354 |
+ # git checkouts require bootstrapping to create the configure script. |
355 |
+ # Additionally the submodules must be cloned to the right locations |
356 |
+ # bug #377279 |
357 |
+ ./bootstrap || die "bootstrap failed" |
358 |
+ ( |
359 |
+ git submodule status | sed 's/^[ +-]//;s/ .*//' |
360 |
+ git hash-object bootstrap.conf |
361 |
+ ) >.git-module-status |
362 |
+ fi |
363 |
+ |
364 |
+ epatch \ |
365 |
+ "${FILESDIR}"/${PN}-1.3.0-do_not_use_sysconf.patch \ |
366 |
+ "${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch \ |
367 |
+ "${FILESDIR}"/${P}-fix_paths_for_apparmor.patch |
368 |
+ |
369 |
+ [[ -n ${BACKPORTS} ]] && |
370 |
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" \ |
371 |
+ EPATCH_SOURCE="${WORKDIR}/patches" epatch |
372 |
+ |
373 |
+ epatch_user |
374 |
+ |
375 |
+ # Tweak the init script: |
376 |
+ cp "${FILESDIR}/libvirtd.init-r16" "${S}/libvirtd.init" || die |
377 |
+ sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \ |
378 |
+ -e "s/USE_FLAG_AVAHI/$(usex avahi 'use avahi-daemon' '')/" \ |
379 |
+ -e "s/USE_FLAG_ISCSI/$(usex iscsi 'use iscsid' '')/" \ |
380 |
+ -e "s/USE_FLAG_RBD/$(usex rbd 'use ceph' '')/" \ |
381 |
+ -i "${S}/libvirtd.init" || die "sed failed" |
382 |
+ |
383 |
+ AUTOTOOLS_AUTORECONF=true |
384 |
+ autotools-utils_src_prepare |
385 |
+} |
386 |
+ |
387 |
+src_configure() { |
388 |
+ local myeconfargs=( |
389 |
+ $(use_with apparmor) |
390 |
+ $(use_with apparmor apparmor-profiles) |
391 |
+ $(use_with audit) |
392 |
+ $(use_with avahi) |
393 |
+ $(use_with caps capng) |
394 |
+ $(use_with firewalld) |
395 |
+ $(use_with fuse) |
396 |
+ $(use_with glusterfs) |
397 |
+ $(use_with glusterfs storage-gluster) |
398 |
+ $(use_with iscsi storage-iscsi) |
399 |
+ $(use_with libvirtd) |
400 |
+ $(use_with lvm storage-lvm) |
401 |
+ $(use_with lvm storage-mpath) |
402 |
+ $(use_with lxc) |
403 |
+ $(use_with macvtap) |
404 |
+ $(use_enable nls) |
405 |
+ $(use_with numa numactl) |
406 |
+ $(use_with numa numad) |
407 |
+ $(use_with openvz) |
408 |
+ $(use_with parted storage-disk) |
409 |
+ $(use_with pcap libpcap) |
410 |
+ $(use_with phyp) |
411 |
+ $(use_with policykit polkit) |
412 |
+ $(use_with qemu) |
413 |
+ $(use_with qemu yajl) |
414 |
+ $(use_with rbd storage-rbd) |
415 |
+ $(use_with sasl) |
416 |
+ $(use_with selinux) |
417 |
+ $(use_with systemd systemd-daemon) |
418 |
+ $(usex systemd --with-init-script=systemd '') |
419 |
+ $(use_with udev) |
420 |
+ $(use_with uml) |
421 |
+ $(use_with vepa virtualport) |
422 |
+ $(use_with virt-network network) |
423 |
+ $(use_with wireshark-plugins wireshark-dissector) |
424 |
+ $(use_with xen) |
425 |
+ $(use_with xen xen-inotify) |
426 |
+ $(usex xen --with-libxl '') |
427 |
+ |
428 |
+ --without-hal |
429 |
+ --without-netcf |
430 |
+ --without-sanlock |
431 |
+ --without-xenapi |
432 |
+ --with-esx |
433 |
+ --with-qemu-group=$(usex caps qemu root) |
434 |
+ --with-qemu-user=$(usex caps qemu root) |
435 |
+ --with-remote |
436 |
+ --with-storage-fs |
437 |
+ --with-vmware |
438 |
+ |
439 |
+ --disable-static |
440 |
+ --disable-werror |
441 |
+ |
442 |
+ --with-html-subdir=${PF}/html |
443 |
+ --localstatedir=/var |
444 |
+ ) |
445 |
+ |
446 |
+ if use virtualbox && has_version app-emulation/virtualbox-ose; then |
447 |
+ myeconfargs+=( --with-vbox=/usr/lib/virtualbox-ose/ ) |
448 |
+ else |
449 |
+ myeconfargs+=( $(use_with virtualbox vbox) ) |
450 |
+ fi |
451 |
+ |
452 |
+ autotools-utils_src_configure |
453 |
+ |
454 |
+ if [[ ${PV} = *9999* ]]; then |
455 |
+ # Restore gnulib's config.sub and config.guess |
456 |
+ # bug #377279 |
457 |
+ (cd .gnulib && git reset --hard > /dev/null) |
458 |
+ fi |
459 |
+ |
460 |
+ # Workaround: Sometimes this subdirectory is missing and leads to a |
461 |
+ # build failure. |
462 |
+ mkdir -p "${BUILD_DIR}"/docs/internals |
463 |
+} |
464 |
+ |
465 |
+src_test() { |
466 |
+ # Explicitly allow parallel build of tests |
467 |
+ export VIR_TEST_DEBUG=1 |
468 |
+ HOME="${T}" emake check || die "tests failed" |
469 |
+} |
470 |
+ |
471 |
+src_install() { |
472 |
+ autotools-utils_src_compile install \ |
473 |
+ DESTDIR="${D}" \ |
474 |
+ SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)" |
475 |
+ |
476 |
+ find "${D}" -name '*.la' -delete || die |
477 |
+ |
478 |
+ # Remove bogus, empty directories. They are either not used, or |
479 |
+ # libvirtd is able to create them on demand |
480 |
+ rm -rf "${D}"/etc/sysconfig |
481 |
+ rm -rf "${D}"/var/cache |
482 |
+ rm -rf "${D}"/var/run |
483 |
+ rm -rf "${D}"/var/log |
484 |
+ |
485 |
+ use libvirtd || return 0 |
486 |
+ # From here, only libvirtd-related instructions, be warned! |
487 |
+ |
488 |
+ use systemd && systemd_install_serviced \ |
489 |
+ "${FILESDIR}"/libvirtd.service.conf libvirtd.service |
490 |
+ |
491 |
+ systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf |
492 |
+ |
493 |
+ newinitd "${S}/libvirtd.init" libvirtd || die |
494 |
+ newinitd "${FILESDIR}/libvirt-guests.init-r1" libvirt-guests || die |
495 |
+ newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die |
496 |
+ newinitd "${FILESDIR}/virtlogd.init-r1" virtlogd || die |
497 |
+ |
498 |
+ newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd || die |
499 |
+ newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests || die |
500 |
+ |
501 |
+ DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1") |
502 |
+ DISABLE_AUTOFORMATTING=true |
503 |
+ readme.gentoo_create_doc |
504 |
+} |
505 |
+ |
506 |
+pkg_preinst() { |
507 |
+ # we only ever want to generate this once |
508 |
+ if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then |
509 |
+ rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml |
510 |
+ fi |
511 |
+} |
512 |
+ |
513 |
+pkg_postinst() { |
514 |
+ if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then |
515 |
+ touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml |
516 |
+ fi |
517 |
+ |
518 |
+ use libvirtd || return 0 |
519 |
+ # From here, only libvirtd-related instructions, be warned! |
520 |
+ |
521 |
+ if [[ -n ${REPLACING_VERSIONS} ]] && ! version_is_at_least 1.2.18-r2 ${REPLACING_VERSIONS} ]]; then |
522 |
+ FORCE_PRINT_ELOG=true |
523 |
+ fi |
524 |
+ |
525 |
+ DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1") |
526 |
+ DISABLE_AUTOFORMATTING=true |
527 |
+ readme.gentoo_print_elog |
528 |
+} |