Gentoo Archives: gentoo-commits

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