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