Gentoo Archives: gentoo-commits

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