Gentoo Archives: gentoo-commits

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