From b4db62ba18622b4093c92617b6d0ad2df07830df Mon Sep 17 00:00:00 2001 From: ayhanyalcinsoy Date: Thu, 31 Dec 2015 13:29:55 +0200 Subject: [PATCH] libvirt:moved into main repo for pisi 2.0 --- hardware/virtualization/libvirt/actions.py | 69 ++++++++ .../virtualization/libvirt/comar/package.py | 39 +++++ .../virtualization/libvirt/comar/service.py | 43 +++++ .../libvirt/files/libvirt.confd | 17 ++ .../libvirt/files/pisilinux-qemu.patch | 19 +++ .../libvirt/files/tmpfiles.conf | 4 + hardware/virtualization/libvirt/pspec.xml | 155 ++++++++++++++++++ .../virtualization/libvirt/translations.xml | 13 ++ 8 files changed, 359 insertions(+) create mode 100644 hardware/virtualization/libvirt/actions.py create mode 100644 hardware/virtualization/libvirt/comar/package.py create mode 100644 hardware/virtualization/libvirt/comar/service.py create mode 100644 hardware/virtualization/libvirt/files/libvirt.confd create mode 100644 hardware/virtualization/libvirt/files/pisilinux-qemu.patch create mode 100644 hardware/virtualization/libvirt/files/tmpfiles.conf create mode 100644 hardware/virtualization/libvirt/pspec.xml create mode 100644 hardware/virtualization/libvirt/translations.xml diff --git a/hardware/virtualization/libvirt/actions.py b/hardware/virtualization/libvirt/actions.py new file mode 100644 index 0000000000..8934d25471 --- /dev/null +++ b/hardware/virtualization/libvirt/actions.py @@ -0,0 +1,69 @@ +#!/usr/bin/python +# -*- coding: utf-8 -*- +# +# Licensed under the GNU General Public License, version 3. +# See the file http://www.gnu.org/licenses/gpl.txt + +from pisi.actionsapi import get +from pisi.actionsapi import autotools +from pisi.actionsapi import pisitools +from pisi.actionsapi import shelltools + +def setup(): + for f in ["src/Makefile.am", "src/Makefile.in", "daemon/Makefile.am", "daemon/Makefile.in"]: + pisitools.dosed(f, "\$\(localstatedir\)(\/run\/libvirt)", "\\1") + for f in ["daemon/libvirtd.c", "daemon/libvirtd.conf", "daemon/test_libvirtd.aug.in"]: + pisitools.dosed(f, "\/var(\/run\/libvirt)", "\\1") + for f in ["src/locking/virtlockd.pod.in", "src/virtlockd.8.in", "daemon/libvirtd.8.in", "daemon/libvirtd.pod.in", ]: + pisitools.dosed(f, "LOCALSTATEDIR(\/run\/libvirt)", "\\1") + autotools.configure("--with-init-script=none \ + --with-remote-pid-file=/run/libvirtd.pid \ + --with-qemu-user=qemu \ + --with-qemu-group=qemu \ + --with-lxc \ + --with-udev \ + --with-qemu \ + --with-sasl \ + --with-audit \ + --with-numactl \ + --with-yajl \ + --with-avahi \ + --with-netcf \ + --with-libssh2=/usr/lib \ + --with-capng \ + --with-polkit \ + --with-python \ + --with-network \ + --with-libvirtd \ + --with-storage-fs \ + --with-storage-scsi \ + --with-storage-mpath \ + --with-storage-disk \ + --with-storage-lvm \ + --without-vbox \ + --without-vmware \ + --without-esx \ + --without-storage-iscsi \ + --without-hal \ + --without-xen \ + --without-phyp \ + --without-uml \ + --without-openvz \ + --without-selinux \ + --without-apparmor \ + --disable-static") + +def build(): + autotools.make() + +#def check(): + # for v in ["XDG_HOME", "XDG_CACHE_HOME", "XDG_CONFIG_HOME"]: + # shelltools.export(v, get.workDIR()) + # autotools.make("check") + + +def install(): + autotools.rawInstall("DESTDIR=%s" % get.installDIR()) + pisitools.removeDir("/usr/share/gtk-doc") + + pisitools.dodoc("AUTHORS", "NEWS", "README*", "ChangeLog") diff --git a/hardware/virtualization/libvirt/comar/package.py b/hardware/virtualization/libvirt/comar/package.py new file mode 100644 index 0000000000..0bc29534ac --- /dev/null +++ b/hardware/virtualization/libvirt/comar/package.py @@ -0,0 +1,39 @@ +#/usr/bin/python + +import os + +permissions = { + "/etc/libvirt" : ["0700", "root:root"], + "/etc/libvirt/qemu" : ["0700", "root:root"], + "/etc/libvirt/nwfilter" : ["0700", "root:root"], + "/etc/libvirt/qemu/networks" : ["0700", "root:root"], + "/etc/libvirt/qemu/networks/autostart" : ["0700", "root:root"], + "/var/log/libvirt" : ["0700", "root:root"], + "/var/log/libvirt/qemu" : ["0700", "root:root"], + "/var/log/libvirt/lxc" : ["0700", "root:root"], + "/var/log/libvirt/uml" : ["0700", "root:root"], + "/var/lib/libvirt" : ["0755", "root:root"], + "/var/lib/libvirt/images" : ["0711", "root:root"], + "/var/lib/libvirt/boot" : ["0711", "root:root"], + "/var/lib/libvirt/qemu" : ["0750", "qemu:qemu"], + "/var/lib/libvirt/lxc" : ["0700", "root:root"], + "/var/lib/libvirt/uml" : ["0700", "root:root"], + "/var/lib/libvirt/network" : ["0700", "root:root"], + "/var/lib/libvirt/dnsmasq" : ["0755", "root:root"], + "/var/cache/libvirt/qemu" : ["0750", "qemu:qemu"], + "/var/cache/libvirt" : ["0700", "root:root"], + "/run/libvirt" : ["0755", "root:root"], + "/run/libvirt/qemu" : ["0700", "qemu:qemu"], + "/run/libvirt/uml" : ["0700", "root:root"], + "/usr/libexec/libvirt_proxy" : ["4755", "root:root"], + } + + +def postInstall(fromVersion, fromRelease, toVersion, toRelease): + for _file, perms in permissions.items(): + # The list above is general, some paths may not exist depending on the configuration + if os.path.exists(_file): + os.system("/bin/chown -R %s %s" % (perms[1], _file)) + os.system("/bin/chmod %s %s" % (perms[0], _file)) + os.system("groupadd libvirt") + os.system("usermod -G libvirt %s" % os.getusername()) diff --git a/hardware/virtualization/libvirt/comar/service.py b/hardware/virtualization/libvirt/comar/service.py new file mode 100644 index 0000000000..f994f4fb8c --- /dev/null +++ b/hardware/virtualization/libvirt/comar/service.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +from comar.service import * +import os + +serviceType = "local" +serviceDesc = _({"en": "libvirt virtualization API daemon", + "tr": "libvirt sanallaştırma hizmeti"}) +serviceDefault = "on" + +PIDFILE = "/run/libvirt/libvirtd.pid" +KRB5_KTNAME = "/etc/libvirt/krb5.tab" +LIBVIRTD_CONFIG = "/etc/libvirt/libvirtd.conf" + +@synchronized +def start(): + os.environ["KRB5_KTNAME"] = config.get("KRB5_KTNAME", KRB5_KTNAME) + os.environ["PATH"] = "/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/sbin:/usr/local/bin" + + if os.path.exists(PIDFILE): + os.unlink(PIDFILE) + + startService(command="/usr/sbin/libvirtd", + args="--daemon --config %s %s --pid-file %s" % ( + config.get("LIBVIRTD_ARGS", ""), + config.get("LIBVIRTD_CONFIG", LIBVIRTD_CONFIG), + PIDFILE, + ), + donotify=True) + +@synchronized +def stop(): + stopService(pidfile="/run/libvirt/libvirtd.pid", + donotify=True) + if os.path.exists(PIDFILE): + os.unlink(PIDFILE) + +@synchronized +def reload(): + if os.path.exists(PIDFILE): + os.kill(int(open(PIDFILE, "r").read().strip()), 1) + +def status(): + return isServiceRunning(pidfile=PIDFILE) diff --git a/hardware/virtualization/libvirt/files/libvirt.confd b/hardware/virtualization/libvirt/files/libvirt.confd new file mode 100644 index 0000000000..28080a0e37 --- /dev/null +++ b/hardware/virtualization/libvirt/files/libvirt.confd @@ -0,0 +1,17 @@ +# Override the default config file +#LIBVIRTD_CONFIG=/etc/libvirt/libvirtd.conf + +# Listen for TCP/IP connections +# NB. must setup TLS/SSL keys prior to using this +#LIBVIRTD_ARGS="--listen" + +# Override Kerberos service keytab for SASL/GSSAPI +#KRB5_KTNAME=/etc/libvirt/krb5.tab + +# Override the QEMU/SDL default audio driver probing when +# starting virtual machines using SDL graphics +# +# NB these have no effect for VMs using VNC +#QEMU_AUDIO_DRV=sdl +# +#SDL_AUDIODRIVER=pulse diff --git a/hardware/virtualization/libvirt/files/pisilinux-qemu.patch b/hardware/virtualization/libvirt/files/pisilinux-qemu.patch new file mode 100644 index 0000000000..155bc3125d --- /dev/null +++ b/hardware/virtualization/libvirt/files/pisilinux-qemu.patch @@ -0,0 +1,19 @@ +--- src/qemu/qemu_capabilities.c~ 2014-01-10 20:27:38.383264024 +0100 ++++ src/qemu/qemu_capabilities.c 2014-01-10 20:28:02.696597278 +0100 +@@ -638,14 +638,14 @@ virQEMUCapsFindBinaryForArch(virArch hos + if (guestarch == VIR_ARCH_I686 && + !ret && + hostarch == VIR_ARCH_X86_64) { +- ret = virFindFileInPath("qemu-system-x86_64"); ++ ret = virFindFileInPath("qemu-kvm"); + if (ret && !virFileIsExecutable(ret)) + VIR_FREE(ret); + } + + if (guestarch == VIR_ARCH_I686 && + !ret) { +- ret = virFindFileInPath("qemu"); ++ ret = virFindFileInPath("qemu-kvm"); + if (ret && !virFileIsExecutable(ret)) + VIR_FREE(ret); + } diff --git a/hardware/virtualization/libvirt/files/tmpfiles.conf b/hardware/virtualization/libvirt/files/tmpfiles.conf new file mode 100644 index 0000000000..f39f6a9f2d --- /dev/null +++ b/hardware/virtualization/libvirt/files/tmpfiles.conf @@ -0,0 +1,4 @@ +d /run/libvirt/qemu 0700 qemu qemu - - +d /run/libvirt/lxc 0755 root root - - +d /run/libvirt/uml 0755 root root - - +d /run/libvirt/network 0755 root root - - diff --git a/hardware/virtualization/libvirt/pspec.xml b/hardware/virtualization/libvirt/pspec.xml new file mode 100644 index 0000000000..e7c896846e --- /dev/null +++ b/hardware/virtualization/libvirt/pspec.xml @@ -0,0 +1,155 @@ + + + + + libvirt + http://www.libvirt.org/ + + PisiLinux Community + admins@pisilinux.org + + LGPLv2.1 + app:console + Library providing a simple API to several virtualization systems + libvirt is a toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes). libvirt supports Xen hypervisor, QEMU emulator, KVM hypervisor, LXC Linux container system, OpenVZ Linux container system, User Mode Linux paravirtualized kernel and VirtualBox hypervisor together with remote management possibilities. + http://libvirt.org/sources/libvirt-1.3.0.tar.gz + + qemu + lvm2-devel + attr-devel + audit-devel + avahi-devel + netcf-devel + numactl-devel + libpciaccess-devel + yajl-devel + polkit-devel + dbus-devel + util-linux + gnutls-devel + parted-devel + device-mapper-devel + libnl-devel + python-devel + cyrus-sasl-devel + libcap-ng-devel + readline-devel + + + + + + + + libvirt + + dbus + yajl + audit + eudev + libnl + netcf + gnutls + parted + libcap + libxml2 + numactl + readline + libcap-ng + avahi-libs + cyrus-sasl + libpciaccess + device-mapper + libutil-linux + + + /etc + /usr/lib/tmpfiles.d/libvirt.conf + /usr/bin + /usr/libexec + /usr/sbin + /usr/lib + /usr/share/doc + /usr/share/augeas + /usr/share/polkit-1 + /usr/share/libvirt + /usr/share/systemtap + /usr/share/man + /var + /run + /usr/share/locale + + + tmpfiles.conf + libvirt.confd + + + System.Service + System.Package + + + + + libvirt-devel + Development files for libvirt + + libvirt + + + /usr/include/libvirt + /usr/lib/pkgconfig + + + + + + 2015-12-31 + 1.3.0 + Version bump + Ayhan Yalçınsoy + ayhanyalcinsoy@pisilinux.org + + + 2014-07-02 + 1.2.6 + Version bump and bug fixes. + Vedat Demir + vedat@pisilinux.org + + + 2014-05-14 + 1.2.3 + Rebuild + Aydın Demirel + aydin.demirel@pisilinux.org + + + 2014-05-08 + 1.2.3 + Version bump. + Aydın Demirel + aydin.demirel@pisilinux.org + + + 2014-01-10 + 1.2.0 + Version bump. + Marcin Bojara + marcin@pisilinux.org + + + 2013-05-26 + 1.0.5 + Version bump and fixed compiling errors + Aydın Demirel + aydin@demirel.web.tr + + + 2013-01-14 + 1.0.5 + First release + Marcin Bojara + marcin@pisilinux.org + + + diff --git a/hardware/virtualization/libvirt/translations.xml b/hardware/virtualization/libvirt/translations.xml new file mode 100644 index 0000000000..50ee8c6c5f --- /dev/null +++ b/hardware/virtualization/libvirt/translations.xml @@ -0,0 +1,13 @@ + + + + libvirt + Birçok sanallaştırma sistemine kolay erişim sağlayan bir kütüphane + libvirt yeni linux sürümlerinin sunduğu sanallaştırma özellikleriyle etkileşimi kolaylaştıran bir kütüphanedir. Xen, KVM ve VirtualBox hipervizorleri, QEMU emulatörü, LXC linux konteyner sistemi, User Mode Linux paravirtual sanallaştırma sistemi gibi sistemlerle birlikte çalışabilir ve tüm bu sistemlerin uzaktan yönetimi için de kullanılabilir. + + + + libvirt-devel + libvirt için geliştirme dosyaları + +