summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@gentoo.org>2009-06-09 12:48:52 +0000
committerDoug Goldstein <cardoe@gentoo.org>2009-06-09 12:48:52 +0000
commiteb76f51e67446699e64928f7c2bf3e8f6ca4f7aa (patch)
treefdf4900571b2521ba48798c0e8a61e38db148da1 /app-emulation
parentslot move of app-antivirus/klamav to 3.5 (diff)
downloadhistorical-eb76f51e67446699e64928f7c2bf3e8f6ca4f7aa.tar.gz
historical-eb76f51e67446699e64928f7c2bf3e8f6ca4f7aa.tar.bz2
historical-eb76f51e67446699e64928f7c2bf3e8f6ca4f7aa.zip
version bump. use v2 of my kvm-img patch
Package-Manager: portage-2.1.6.13/cvs/Linux x86_64
Diffstat (limited to 'app-emulation')
-rw-r--r--app-emulation/libvirt/ChangeLog9
-rw-r--r--app-emulation/libvirt/Manifest12
-rw-r--r--app-emulation/libvirt/files/libvirt-0.6.4-kvm-img.patch260
-rw-r--r--app-emulation/libvirt/files/libvirt-0.6.4-qemu-img-logic-fix.patch12
-rw-r--r--app-emulation/libvirt/libvirt-0.6.4.ebuild114
5 files changed, 402 insertions, 5 deletions
diff --git a/app-emulation/libvirt/ChangeLog b/app-emulation/libvirt/ChangeLog
index 3b5c55f1fc13..2bdede6cf35e 100644
--- a/app-emulation/libvirt/ChangeLog
+++ b/app-emulation/libvirt/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-emulation/libvirt
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.26 2009/05/28 21:57:26 cardoe Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.27 2009/06/09 12:48:52 cardoe Exp $
+
+*libvirt-0.6.4 (09 Jun 2009)
+
+ 09 Jun 2009; Doug Goldstein <cardoe@gentoo.org> +libvirt-0.6.4.ebuild,
+ +files/libvirt-0.6.4-kvm-img.patch,
+ +files/libvirt-0.6.4-qemu-img-logic-fix.patch:
+ version bump. use v2 of my kvm-img patch
*libvirt-0.6.3-r3 (28 May 2009)
diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest
index 570ce79c2dec..fd6f44651540 100644
--- a/app-emulation/libvirt/Manifest
+++ b/app-emulation/libvirt/Manifest
@@ -18,12 +18,15 @@ AUX libvirt-0.6.3-kvm-85-argv-detection.patch 2965 RMD160 2da23e5716286923d8b6ee
AUX libvirt-0.6.3-kvm-img.patch 9798 RMD160 f656b7a23c03f40d4f19ef9d02b531cca2d6d01b SHA1 407fbcf9278f4624a273f28ad07faa480c6a29a2 SHA256 58fc0f213e326220842759a46bca9242bf11b0acf0d54dd314062767c05dcd6e
AUX libvirt-0.6.3-print-ascii-uuid.patch 755 RMD160 07483a7786db905808d395880ffc306298043111 SHA1 103b297df087a31a5a69864be3df69fd59370ef9 SHA256 02c3cab750cb27667209ab1a909207c68e0cb768121a48640a9599d6caf108b0
AUX libvirt-0.6.3-refresh-qemu-caps.patch 2456 RMD160 0ead0b48db4f9d242fdc8b7669f019bd7cf88531 SHA1 7b53245b4f8c6d015ff81463f709207702e597a8 SHA256 5080be32e2ecfe00fac2cff36036b1d3b05028c39677b2840b87d6ab10213b20
+AUX libvirt-0.6.4-kvm-img.patch 7985 RMD160 6b47a6a330903022e7b0ee6fb90349c8da528316 SHA1 7662a99dcb175377a19f104c79d6f9ebf227ac3c SHA256 bd258616dfff0f53404d16c26d1191232388e053c807f42c074183b5c7caee44
+AUX libvirt-0.6.4-qemu-img-logic-fix.patch 714 RMD160 22e0b891c046d6d40ae0ebc81af47bba4eb81be7 SHA1 2c4528d057c0abefb20eb459d0613715b4604182 SHA256 36a1a7b30405f0f0359147a90b11dbee51b37f6b578a553d98b79036d8246a5e
AUX libvirtd.confd 476 RMD160 63b92da0cf0d589c1c6e76551982deb6b5fc8f9a SHA1 5b76082bb28705606758880c19af922dde1ccb01 SHA256 ff2c94d2a64058152be669256d8d2e241cde4356a77bd653eac9fa3b084666f6
AUX libvirtd.init 2045 RMD160 b544578c242c6f84e2cf07682a06ce261bf40b8a SHA1 81976137c43f6b507e27ac926a6d7947e1a329d3 SHA256 96cbdf8e68a171d170f91167a4217a366325ca668b9e2621ec6800fd35d42c5c
DIST libvirt-0.4.6.tar.gz 5255397 RMD160 7a59cf7b678148c380e20e57f4d5d323f5aeb6b6 SHA1 dd6994e09789e19679cae4bdd65f2d7aea9cf8d0 SHA256 70049e309632718af75cd11116063ade45eb2879eb9e7ac7c6106559d344a37a
DIST libvirt-0.5.1.tar.gz 6086100 RMD160 76044df25d2b17f8da237e127b5eed3e2518a041 SHA1 f229c17b91aa4580a328e8109659e8c1dff0da14 SHA256 951f4c4fac929bab1968680dfcd45fb1053df7d2e3a916e2df13f1d11fe53512
DIST libvirt-0.6.2.tar.gz 6681651 RMD160 9f7c4f4154150df997f23e63500d743451b73945 SHA1 afcc2826f812ec68a78371c6ff8dd41d92e71a3c SHA256 46ec16388b84afad5f906db997f67ca3cbe4870364577028c272bc407e17d04b
DIST libvirt-0.6.3.tar.gz 6999742 RMD160 2552878017665498013ca132f45ab3f6af0c82f7 SHA1 652bee1955558d47ce779a08c7e4aefc1905f217 SHA256 fd990f312900e6f371d889044e77f6c13ba76b5af07f0e9567a742e76240f721
+DIST libvirt-0.6.4.tar.gz 7148934 RMD160 4520b24c950d7d16de76798ca70204aba42087e5 SHA1 226c1ae968f7a3b1900c8b2f9d1a5c503bd4a961 SHA256 c7d0bcc56d8b9d53847e3044f9abd25d9a650686d5bccceffa75cb50ac5b621e
EBUILD libvirt-0.4.6-r1.ebuild 2426 RMD160 5bbf66a700ad57ea137b9ace65d6acc6b5efb64c SHA1 df87f8027d84059a199f98a87c4c7400f6ae91b0 SHA256 693c8facf12519b3423cbe197de1f35fa58a25bd8d6cce912ec1a01e363cab7b
EBUILD libvirt-0.5.1.ebuild 2905 RMD160 6733abae4fbaf18cc20dd9bef5b40e752b9deefa SHA1 d22071db59b07bc0ce1f29cde6a6403ca5a5d68f SHA256 e4a746ae4aeb4f4590b38226acaee9df9ec84590b7b40eb17c3fc11d8bddc801
EBUILD libvirt-0.6.2.ebuild 2849 RMD160 8141f7fdb011bb429835d7cbc3a06edcb989168e SHA1 b35409b28d0ec4a083f0ce7eb8781c061ede7f45 SHA256 aa03f0f69c23602034a895c0ba485b36b67174c0c9ce9987a4775f832e7c54ba
@@ -31,12 +34,13 @@ EBUILD libvirt-0.6.3-r1.ebuild 2987 RMD160 4493936640e06682a80c41bded9eabfc77ebc
EBUILD libvirt-0.6.3-r2.ebuild 3713 RMD160 2f096a98706147aa4524a50190db3603fdab3831 SHA1 17e30f16be072f54e023825431a0b5e3129064cc SHA256 7afab22c8571f9ed626b7c4832b88cf83c2d38cfbcf8bcc18f117a25ba2e25ea
EBUILD libvirt-0.6.3-r3.ebuild 3823 RMD160 ad581388122243e3c9769239e8671305f48e0756 SHA1 1ba3110c41faea6100a4e512310bb3afc8655416 SHA256 febffabbc7db7ad1f57d7d5b91d0426dd5db095113cf0ff044ce62a1d00613a2
EBUILD libvirt-0.6.3.ebuild 2869 RMD160 13feccad2c48a8c8a2fd31f700390accbe0132e3 SHA1 88ed24d66d0081bcba9e73190b1bea8d1c1a4aa6 SHA256 f9a369c53414c0b0b8f0c536a6d277be419ead42e955eefd2e6b173b05a981eb
-MISC ChangeLog 6632 RMD160 98e12692c5aa11747ea4ead5da82f6f69a433709 SHA1 4956794cf9ae97d49a12aceb2110140e5fd32ba8 SHA256 933d54026c7a05d8a14087d4979bd4dc87c29ba8c189230375b8a8414493909c
+EBUILD libvirt-0.6.4.ebuild 3348 RMD160 a8cb4100deb9b4a7083494462e7c4ab9b3d5e993 SHA1 54deb4cd63c6fdb47a65699c031fe43749a06cda SHA256 ab811c7c96c25a37c6a4098bd9dcca36c1faa11d4cae35734951d7fd459812b8
+MISC ChangeLog 6866 RMD160 e013bec27257fb22b4f79b176468f81670a558d9 SHA1 3e0c810f43a89a468f7ace3f07e9fa62140d0fd8 SHA256 c9360d835e4ba3143e56b0560da8cf6bd202c92e604291d68c27ad78ddaec005
MISC metadata.xml 1449 RMD160 0336423f85fef23bc6c85866649eeb089ad5010d SHA1 159a4f62926dcdfdc09d646d7854741d3dc7bb24 SHA256 f3a5571f781eb774cd57d873b24c8058704ab4fb2c63ce25ae7caee87ed9db12
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
-iEYEARECAAYFAkofCOAACgkQoeSe8B0zEfwWFwCfVTxTHrOzDNv69s6iz7HA8Sg8
-YKcAn24ZqSVy+NsMcfJxYs23dKPzQ1rK
-=OWpt
+iEYEARECAAYFAkouWpsACgkQoeSe8B0zEfzeWwCaAj8mSKxIL3SKu6CstsOJOuVS
+IRAAnjhnohy04XmXWMsSzw0pM9ZHTPvP
+=/i8J
-----END PGP SIGNATURE-----
diff --git a/app-emulation/libvirt/files/libvirt-0.6.4-kvm-img.patch b/app-emulation/libvirt/files/libvirt-0.6.4-kvm-img.patch
new file mode 100644
index 000000000000..c0ad9c1d3d01
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-0.6.4-kvm-img.patch
@@ -0,0 +1,260 @@
+diff --git a/configure.in b/configure.in
+index 5c0575c..552c761 100644
+--- a/configure.in
++++ b/configure.in
+@@ -889,21 +889,6 @@ if test "$with_storage_fs" = "yes"; then
+ [Location or name of the showmount program])
+ fi
+
+-AC_PATH_PROG([QEMU_IMG], [qemu-img], [], [$PATH:/sbin:/usr/sbin:/bin:/usr/bin])
+-if test -n "$QEMU_IMG" ; then
+- AC_DEFINE_UNQUOTED([HAVE_QEMU_IMG], 1, [whether qemu-img is available for non-raw files])
+- AC_DEFINE_UNQUOTED([QEMU_IMG],["$QEMU_IMG"],
+- [Location or name of the qemu-img program])
+-fi
+-
+-AC_PATH_PROG([QCOW_CREATE], [qcow-create], [], [$PATH:/sbin:/usr/sbin:/bin:/usr/bin])
+-if test -n "$QCOW_CREATE" ; then
+- AC_DEFINE_UNQUOTED([HAVE_QCOW_CREATE], 1, [whether qcow-create is available for non-raw files])
+- AC_DEFINE_UNQUOTED([QCOW_CREATE],["$QCOW_CREATE"],
+- [Location or name of the qcow-create program])
+-fi
+-
+-
+ if test "$with_storage_lvm" = "yes" -o "$with_storage_lvm" = "check"; then
+ AC_PATH_PROG([PVCREATE], [pvcreate], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([VGCREATE], [vgcreate], [], [$PATH:/sbin:/usr/sbin])
+diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
+index b39216f..0c55684 100644
+--- a/src/libvirt_private.syms
++++ b/src/libvirt_private.syms
+@@ -330,6 +330,7 @@ virFormatMacAddr;
+ virGetHostname;
+ virParseMacAddr;
+ virFileDeletePid;
++virFindFileInPath;
+ virFileExists;
+ virFileHasSuffix;
+ virFileLinkPointsTo;
+diff --git a/src/storage_backend_fs.c b/src/storage_backend_fs.c
+index be6d011..ea5de7f 100644
+--- a/src/storage_backend_fs.c
++++ b/src/storage_backend_fs.c
+@@ -1183,11 +1183,12 @@ static int createFileDir(virConnectPtr conn,
+ return 0;
+ }
+
+-#if HAVE_QEMU_IMG
+ static int createQemuImg(virConnectPtr conn,
+ virStorageVolDefPtr vol,
+ virStorageVolDefPtr inputvol) {
+ char size[100];
++ char *create_tool;
++ short use_kvmimg;
+
+ const char *type = virStorageVolFormatFileSystemTypeToString(vol->target.format);
+ const char *backingType = vol->backingStore.path ?
+@@ -1203,24 +1204,27 @@ static int createQemuImg(virConnectPtr conn,
+
+ const char **imgargv;
+ const char *imgargvnormal[] = {
+- QEMU_IMG, "create",
++ NULL, "create",
+ "-f", type,
+ vol->target.path,
+ size,
+ NULL,
+ };
+- /* XXX including "backingType" here too, once QEMU accepts
+- * the patches to specify it. It'll probably be -F backingType */
++ /* Extra NULL fields are for including "backingType" when using
++ * kvm-img. It's -F backingType
++ */
+ const char *imgargvbacking[] = {
+- QEMU_IMG, "create",
++ NULL, "create",
+ "-f", type,
+ "-b", vol->backingStore.path,
+ vol->target.path,
+ size,
+ NULL,
++ NULL,
++ NULL
+ };
+ const char *convargv[] = {
+- QEMU_IMG, "convert",
++ NULL, "convert",
+ "-f", inputType,
+ "-O", type,
+ inputPath,
+@@ -1228,14 +1232,6 @@ static int createQemuImg(virConnectPtr conn,
+ NULL,
+ };
+
+- if (inputvol) {
+- imgargv = convargv;
+- } else if (vol->backingStore.path) {
+- imgargv = imgargvbacking;
+- } else {
+- imgargv = imgargvnormal;
+- }
+-
+ if (type == NULL) {
+ virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("unknown storage vol type %d"),
+@@ -1277,17 +1273,45 @@ static int createQemuImg(virConnectPtr conn,
+ }
+ }
+
++ if ((create_tool = virFindFileInPath("kvm-img")) != NULL)
++ use_kvmimg = 1;
++ else if ((create_tool = virFindFileInPath("qemu-img")) != NULL)
++ use_kvmimg = 0;
++ else
++ virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
++ _("unable to find kvm-img or qemu-img"));
++
++ if (inputvol) {
++ convargv[0] = create_tool;
++ imgargv = convargv;
++ } else if (vol->backingStore.path) {
++ imgargvbacking[0] = create_tool;
++ if (use_kvmimg) {
++ imgargvbacking[6] = "-F";
++ imgargvbacking[7] = backingType;
++ imgargvbacking[8] = vol->target.path;
++ imgargvbacking[9] = size;
++ }
++ imgargv = imgargvbacking;
++ } else {
++ imgargvnormal[0] = create_tool;
++ imgargv = imgargvnormal;
++ }
++
++
+ /* Size in KB */
+ snprintf(size, sizeof(size), "%llu", vol->capacity/1024);
+
+ if (virRun(conn, imgargv, NULL) < 0) {
++ VIR_FREE(imgargv[0]);
+ return -1;
+ }
+
++ VIR_FREE(imgargv[0]);
++
+ return 0;
+ }
+
+-#elif HAVE_QCOW_CREATE
+ /*
+ * Xen removed the fully-functional qemu-img, and replaced it
+ * with a partially functional qcow-create. Go figure ??!?
+@@ -1321,18 +1345,20 @@ static int createQemuCreate(virConnectPtr conn,
+ /* Size in MB - yes different units to qemu-img :-( */
+ snprintf(size, sizeof(size), "%llu", vol->capacity/1024/1024);
+
+- imgargv[0] = QCOW_CREATE;
++ imgargv[0] = virFindFileInPath("qcow-create");
+ imgargv[1] = size;
+ imgargv[2] = vol->target.path;
+ imgargv[3] = NULL;
+
+ if (virRun(conn, imgargv, NULL) < 0) {
++ VIR_FREE(imgargv[0]);
+ return -1;
+ }
+
++ VIR_FREE(imgargv[0]);
++
+ return 0;
+ }
+-#endif /* HAVE_QEMU_IMG, elif HAVE_QCOW_CREATE */
+
+ static int
+ _virStorageBackendFileSystemVolBuild(virConnectPtr conn,
+@@ -1341,6 +1367,7 @@ _virStorageBackendFileSystemVolBuild(virConnectPtr conn,
+ {
+ int fd;
+ createFile create_func;
++ char *create_tool;
+
+ if (vol->target.format == VIR_STORAGE_VOL_FILE_RAW &&
+ (!inputvol ||
+@@ -1353,17 +1380,20 @@ _virStorageBackendFileSystemVolBuild(virConnectPtr conn,
+ create_func = createRaw;
+ } else if (vol->target.format == VIR_STORAGE_VOL_FILE_DIR) {
+ create_func = createFileDir;
+- } else {
+-#if HAVE_QEMU_IMG
++ } else if ((create_tool = virFindFileInPath("kvm-img")) != NULL) {
++ VIR_FREE(create_tool);
++ create_func = createQemuImg;
++ } else if ((create_tool = virFindFileInPath("qemu-img")) != NULL) {
++ VIR_FREE(create_tool);
+ create_func = createQemuImg;
+-#elif HAVE_QCOW_CREATE
++ } else if ((create_tool = virFindFileInPath("qcow-create")) != NULL) {
++ VIR_FREE(create_tool);
+ create_func = createQemuCreate;
+-#else
++ } else {
+ virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("creation of non-raw images "
+ "is not supported without qemu-img"));
+ return -1;
+-#endif
+ }
+
+ if (create_func(conn, vol, inputvol) < 0)
+diff --git a/src/util.c b/src/util.c
+index 3a8c105..487349a 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -1073,7 +1073,34 @@ int virFileResolveLink(const char *linkpath,
+ #endif
+ }
+
++/*
++ * Finds a requested file in the PATH env. e.g.:
++ * "kvm-img" will return "/usr/bin/kvm-img"
++ *
++ * You must free the result
++ */
++char *virFindFileInPath(const char *file)
++{
++ char pathenv[PATH_MAX];
++ char *pathseg;
++ char fullpath[PATH_MAX];
++
++ /* copy PATH env so we can tweak it */
++ strncpy(pathenv, getenv("PATH"), PATH_MAX);
++ pathenv[PATH_MAX - 1] = '\0';
++
+
++ /* for each path segment, append the file to search for and test for
++ * it. return it if found
++ */
++ while ((pathseg = strsep(&pathenv, ":")) != NULL) {
++ snprintf(fullpath, PATH_MAX, "%s/%s", pathseg, file);
++ if (virFileExists(fullpath))
++ return strdup(fullpath);
++ }
++
++ return NULL;
++}
+ int virFileExists(const char *path)
+ {
+ struct stat st;
+diff --git a/src/util.h b/src/util.h
+index 61e1eb5..e6e8010 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -101,6 +101,8 @@ int virFileLinkPointsTo(const char *checkLink,
+ int virFileResolveLink(const char *linkpath,
+ char **resultpath);
+
++char *virFindFileInPath(const char *file);
++
+ int virFileExists(const char *path);
+
+ int virFileMakePath(const char *path);
diff --git a/app-emulation/libvirt/files/libvirt-0.6.4-qemu-img-logic-fix.patch b/app-emulation/libvirt/files/libvirt-0.6.4-qemu-img-logic-fix.patch
new file mode 100644
index 000000000000..6462de326ea6
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-0.6.4-qemu-img-logic-fix.patch
@@ -0,0 +1,12 @@
+diff -Nur libvirt-0.6.4/src/storage_backend_fs.c libvirt-0.6.4-qemu-img/src/storage_backend_fs.c
+--- libvirt-0.6.4/src/storage_backend_fs.c 2009-05-20 02:02:59.000000000 -0500
++++ libvirt-0.6.4-qemu-img/src/storage_backend_fs.c 2009-06-08 14:38:36.000000000 -0500
+@@ -1255,7 +1255,7 @@
+ * backing store, not really sure what use it serves though, and it
+ * may cause issues with lvm. Untested essentially.
+ */
+- if (!inputBackingPath ||
++ if (inputBackingPath &&
+ !STREQ(inputBackingPath, vol->backingStore.path)) {
+ virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("a different backing store can not "
diff --git a/app-emulation/libvirt/libvirt-0.6.4.ebuild b/app-emulation/libvirt/libvirt-0.6.4.ebuild
new file mode 100644
index 000000000000..b235bb41d78f
--- /dev/null
+++ b/app-emulation/libvirt/libvirt-0.6.4.ebuild
@@ -0,0 +1,114 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/libvirt-0.6.4.ebuild,v 1.1 2009/06/09 12:48:52 cardoe Exp $
+
+EAPI="2"
+
+inherit eutils autotools confutils
+
+DESCRIPTION="C toolkit to manipulate virtual machines"
+HOMEPAGE="http://www.libvirt.org/"
+SRC_URI="http://libvirt.org/sources/${P}.tar.gz"
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="avahi iscsi hal kvm lvm +lxc +network nls numa openvz policykit \
+ parted qemu sasl selinux uml virtualbox xen"
+# devicekit isn't in portage
+
+RDEPEND="sys-libs/readline
+ sys-libs/ncurses
+ >=dev-libs/libxml2-2.5
+ >=net-libs/gnutls-1.0.25
+ dev-lang/python
+ sys-fs/sysfsutils
+ net-analyzer/netcat
+ avahi? ( >=net-dns/avahi-0.6 )
+ iscsi? ( sys-block/open-iscsi )
+ kvm? ( app-emulation/kvm )
+ lvm? ( sys-fs/lvm2 )
+ network? ( net-misc/bridge-utils net-dns/dnsmasq net-firewall/iptables )
+ numa? ( sys-process/numactl )
+ openvz? ( sys-kernel/openvz-sources )
+ parted? ( >=sys-apps/parted-1.8 )
+ policykit? ( >=sys-auth/policykit-0.6 )
+ qemu? ( >=app-emulation/qemu-0.10.0 )
+ sasl? ( dev-libs/cyrus-sasl )
+ selinux? ( sys-libs/libselinux )
+ virtualbox? ( >=app-emulation/virtualbox-bin-2.2.0 )
+ xen? ( app-emulation/xen-tools app-emulation/xen )"
+DEPEND="${RDEPEND}
+ dev-util/pkgconfig"
+
+src_prepare() {
+ # Patch sent upstream for working with kvm-img
+ epatch "${FILESDIR}/${P}-kvm-img.patch"
+ # upstream patch. fix shared/read-only disk labeling
+ epatch "${FILESDIR}/${PN}-0.6.2-shared-readonly-label.patch"
+ # upstream patch. don't try to label a disk with no path (empty cdrom)
+ epatch "${FILESDIR}/${PN}-0.6.2-fix-nosource-label.patch"
+ # Fix logic error when using qemu-img
+ epatch "${FILESDIR}/${P}-qemu-img-logic-fix.patch"
+
+ eautoreconf
+}
+
+pkg_setup() {
+ confutils_require_any lxc kvm openvz qemu uml virtualbox xen
+}
+
+src_configure() {
+ local my_conf=""
+ if use qemu || use kvm ; then
+ my_conf="--with-qemu"
+ else
+ my_conf="--without-qemu"
+ fi
+
+ econf \
+ $(use_with iscsi storage-iscsi) \
+ $(use_with lvm storage-lvm) \
+ $(use_with parted storage-disk) \
+ $(use_with lxc) \
+ $(use_with openvz) \
+ $(use_with uml) \
+ $(use_with virtualbox vbox) \
+ $(use_with xen) \
+ $(use_with xen xen-inotify) \
+ $(use_with avahi) \
+ $(use_with hal) \
+ $(use_with sasl) \
+ $(use_with network) \
+ $(use_with policykit polkit) \
+ $(use_with selinux) \
+ $(use_enable nls) \
+ $(use_with numa numactl) \
+ ${my_conf} \
+ --without-devkit \
+ --with-remote \
+ --disable-iptables-lokkit \
+ --localstatedir=/var \
+ --with-remote-pid-file=/var/run/libvirtd.pid
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake instal lfailed"
+ mv "${D}"/usr/share/doc/{${PN}-python*,${P}/python}
+
+ newinitd "${FILESDIR}/libvirtd.init" libvirtd
+ newconfd "${FILESDIR}/libvirtd.confd" libvirtd
+
+ keepdir /var/lib/libvirt/images
+}
+
+pkg_postinst() {
+ elog "To allow normal users to connect to libvirtd you must change the"
+ elog " unix sock group and/or perms in /etc/libvirt/libvirtd.conf"
+ elog
+ ewarn "If you have a DNS server setup on your machine, you will have"
+ ewarn "to configure /etc/dnsmasq.conf to enable the following settings: "
+ ewarn " bind-interfaces"
+ ewarn " interface or except-interface"
+ elog
+ ewarn "Otherwise you might have issues with your existing DNS server."
+}