Gentoo Archives: gentoo-commits

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