diff options
author | Konstantin Shalygin | 2015-06-08 19:53:54 +0600 |
---|---|---|
committer | Konstantin Shalygin | 2015-06-08 19:53:54 +0600 |
commit | 2cc0b33b543df451a8374dae183d59d807f0dd5c (patch) | |
tree | 619b756fc9ccfc92370493d966510d242432146f | |
download | aur-2cc0b33b543df451a8374dae183d59d807f0dd5c.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 30 | ||||
-rw-r--r-- | PKGBUILD | 52 | ||||
-rw-r--r-- | ovirt-guest-agent.install | 36 | ||||
-rw-r--r-- | ovirt-guest-agent.service | 14 |
4 files changed, 132 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..461c6f99980f --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,30 @@ +pkgbase = ovirt-guest-agent + pkgdesc = The oVirt Guest Agent + pkgver = 1.0.10 + pkgrel = 3 + url = http://wiki.ovirt.org/Category:Ovirt_guest_agent + install = ovirt-guest-agent.install + arch = any + license = ASL 2.0 + makedepends = pam + makedepends = libtool + makedepends = python2 + makedepends = python2-pep8 + makedepends = pep8 + depends = systemd + depends = python2 + depends = python2-dbus + depends = python2-gobject2 + depends = dbus-glib + depends = python2-ethtool + depends = usermode + backup = etc/ovirt-guest-agent.conf + source = ovirt-guest-agent.install + source = ovirt-guest-agent.service + source = https://evilissimo.fedorapeople.org/releases/ovirt-guest-agent/1.0.10/ovirt-guest-agent-1.0.10.3.tar.bz2 + sha256sums = 10c5dc2fa265e6944d9316003fb04163ff005debddd3e86ad4ce3e4ec00ee893 + sha256sums = 545235630d6da51b547c1e8c177ddbf9f57aa81017b8683274a449d46e765cc4 + sha256sums = d11e1a6a9a36a2e318cfc7f063f22a30b29594284f31e5a5903bbd3984c1070b + +pkgname = ovirt-guest-agent + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..afff5d2144c4 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,52 @@ +# Maintainer: Konstantin Shalygin (k0ste@opentech.ru) + +pkgname='ovirt-guest-agent' +pkgver='1.0.10' +pkgrel='3' +pkgdesc='The oVirt Guest Agent' +arch=('any') +url='http://wiki.ovirt.org/Category:Ovirt_guest_agent' +depends=('systemd' 'python2' 'python2-dbus' 'python2-gobject2' 'dbus-glib' 'python2-ethtool' 'usermode') +makedepends=('pam' 'libtool' 'python2' 'python2-pep8' 'pep8') +license='ASL 2.0' +install='ovirt-guest-agent.install' +source=('ovirt-guest-agent.install' + 'ovirt-guest-agent.service' + 'https://evilissimo.fedorapeople.org/releases/ovirt-guest-agent/1.0.10/ovirt-guest-agent-1.0.10.3.tar.bz2') +sha256sums=('10c5dc2fa265e6944d9316003fb04163ff005debddd3e86ad4ce3e4ec00ee893' + '545235630d6da51b547c1e8c177ddbf9f57aa81017b8683274a449d46e765cc4' + 'd11e1a6a9a36a2e318cfc7f063f22a30b29594284f31e5a5903bbd3984c1070b') +backup=('etc/ovirt-guest-agent.conf') + +build() { + cd "$pkgname-$pkgver.$pkgrel" + PYTHON=/usr/bin/python2 ./configure \ + --prefix=/usr \ + --bindir=/usr/bin \ + --sbindir=/usr/bin \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --libdir=/usr/lib \ + --datarootdir=/usr/share \ + --datadir=/usr/share \ + --infodir=/usr/share/info \ + --includedir=/usr/include/security \ + --with-systemdsystemunitdir=/usr/lib/systemd/system \ + --with-pam-prefix=/etc \ + --without-gdm \ + --without-kdm \ + --enable-securedir=/usr/lib/security + make +} + +package() { + pushd "$pkgname-$pkgver.$pkgrel" + make DESTDIR="$pkgdir" install + popd + install -dm775 -o 175 -g 175 "$pkgdir/var/log/ovirt-guest-agent" + rm "$pkgdir/usr/lib/systemd/system/ovirt-guest-agent.service" + install -Dm644 "ovirt-guest-agent.service" "$pkgdir/usr/lib/systemd/system/ovirt-guest-agent.service" + sed -i 's/bin\/python/bin\/python2/g' "$pkgdir/usr/share/ovirt-guest-agent/ovirt-guest-agent.py" + sed -i 's/env python/env python2/g' "$pkgdir/usr/share/ovirt-guest-agent/diskmapper" + sed -i 's/bin\/python/bin\/python2/g' "$pkgdir/usr/share/ovirt-guest-agent/LockActiveSession.py" +} diff --git a/ovirt-guest-agent.install b/ovirt-guest-agent.install new file mode 100644 index 000000000000..6dad0bb42a34 --- /dev/null +++ b/ovirt-guest-agent.install @@ -0,0 +1,36 @@ +pre_install() { +getent group ovirtagent >/dev/null || groupadd -r -g 175 ovirtagent +getent passwd ovirtagent > /dev/null || \ + /usr/bin/useradd -u 175 -g 175 -o -r ovirtagent \ + -c "oVirt Guest Agent" -d /usr/share/ovirt-guest-agent -s /usr/bin/nologin +exit 0 +} + +post_install() { +/usr/bin/udevadm trigger --subsystem-match="virtio-ports" \ + --attr-match="name=com.redhat.rhevm.vdsm" + +/usr/bin/systemctl daemon-reload +} + +pre_remove() { + /usr/bin/systemctl stop ovirt-guest-agent.service > /dev/null 2>&1 + # Send an "uninstalled" notification to vdsm. + VIRTIO=`grep "^device" /etc/ovirt-guest-agent.conf | awk '{ print $3; }'` + if [ -w $VIRTIO ] + then + # Non blocking uninstalled notification + echo -e '{"__name__": "uninstalled"}\n' | dd of=$VIRTIO \ + oflag=nonblock status=noxfer conv=nocreat 1>& /dev/null || : + fi +} +post_remove() { + /usr/bin/systemctl daemon-reload + # Let udev clear access rights + /usr/bin/udevadm trigger --subsystem-match="virtio-ports" \ + --attr-match="name=com.redhat.rhevm.vdsm" +} + +post_upgrade() { + /usr/bin/systemctl try-restart ovirt-guest-agent.service >/dev/null 2>&1 || : +} diff --git a/ovirt-guest-agent.service b/ovirt-guest-agent.service new file mode 100644 index 000000000000..3676992ca53a --- /dev/null +++ b/ovirt-guest-agent.service @@ -0,0 +1,14 @@ +[Unit] +Description=oVirt Guest Agent +After=network.target + +[Service] +Type=simple +PIDFile=/tmp/ovirt-guest-agent.pid +User=ovirtagent +Group=ovirtagent +ExecStartPre=/usr/bin/modprobe virtio_console +ExecStart=/usr/bin/python2 /usr/share/ovirt-guest-agent/ovirt-guest-agent.py -p /tmp/ovirt-guest-agent.pid + +[Install] +WantedBy=multi-user.target |