summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 684e126c96d7f4090f8c8c22a180e823ce04412f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# Maintainer: Konstantin Shalygin <k0ste@k0ste.ru>
# Contributor: Konstantin Shalygin <k0ste@k0ste.ru>

pkgbase='ovirt-guest-agent'
pkgname=("${pkgbase}" "${pkgbase}-common")
_mainver='1.0.13'
_subrel=''
pkgver="${_mainver}${_subrel}"
pkgrel='2'
pkgdesc='The oVirt Guest Agent'
arch=('x86_64')
url="http://ovirt.org/develop/developer-guide/vdsm/guest-agent"
makedepends=('pam' 'libtool' 'python2' 'python2-pycodestyle' 'patch' 'autoconf')
license=('ASL 2.0')
install="${pkgbase}.install"
source=("https://evilissimo.fedorapeople.org/releases/${pkgbase}/${_mainver}/${pkgbase}-${pkgver}.tar.bz2"
	"python2-arch.patch"
	"${pkgbase}-1.0.13_arch_pycodestyle.patch"
	"39-ovirt-memory-hotplug.rules"
	"console.apps_diskmapper"
	"pam.d_diskmapper"
	"${pkgbase}.tmpfiles"
	"${pkgbase}.sysusers"
	"${pkgbase}.service")
sha256sums=('3b4d429d3e5ca1a369cc0868217910eadc70178156bb62e9d68cb1a9fde8afcc'
            '95c162b584dd137296bcec70d14079d4b93d10d8542a87bd8f1cd6ad01e4b140'
            'ebe724b39b78a3bc21a998884b188e0efdaa2fc3ea3416fb4e4e273629394e24'
            '78994d3cfe8f293aab84692c9d181b2c20caeb47e9854bb9377f2199b45984fb'
            '3575b027e6364d5b0d664cff9f9bc6c27a6a57691f7f188c3cf281663ccc3c0d'
            'f9afb37eb23e77cf59d34f8783d3cacc509ed9400936c3dc95d6db629b3b58a1'
            'f55ea5c26a5b0548ae0dfc1397520d10869f2ca5ff184418dfebaceb7910a43f'
            'fab3d62ecd8f6546d5b193f4ca22919de20451678b4cce2c53aa0977fed4f483'
            '9d80826cb331ecbf1a3f979cbe30de3ae1704322f137e49250ce620eaf64cfc7')
backup=("etc/${pkgbase}.conf")

prepare() {
  cd "${srcdir}/${pkgbase}-${pkgver}"
  
  patch -p1 -i "${srcdir}/${pkgbase}-1.0.13_arch_pycodestyle.patch"
  patch -p1 -i "${srcdir}/python2-arch.patch"

  autoreconf -fvi
  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 \
    --enable-securedir=/usr/lib/security \
    --with-systemdsystemunitdir=/usr/lib/systemd/system \
    --with-pam-prefix=/etc \
    --without-gdm \
    --without-kdm
}

build() {
  cd "${srcdir}/${pkgbase}-${pkgver}"
  make
}

package_ovirt-guest-agent() {
  depends=('qemu-guest-agent' 'python2-dbus' 'python2-gobject2' 'dbus-glib' 'python2-ethtool')
  pkgdesc='The oVirt Guest Agent'
  conflicts=("${pkgbase}-common")

  cd "${srcdir}/${pkgbase}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  install -Dm0644 "${srcdir}/${pkgbase}.service" "${pkgdir}/usr/lib/systemd/system/${pkgbase}.service"
  install -Dm0644 "${srcdir}/${pkgbase}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgbase}.conf"
  install -Dm0644 "${srcdir}/${pkgbase}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgbase}.conf"
  install -Dm0644 "${srcdir}/39-ovirt-memory-hotplug.rules" "${pkgdir}/usr/lib/udev/rules.d/39-ovirt-memory-hotplug.rules"
  mv "${pkgdir}/etc/udev/rules.d/"* "${pkgdir}/usr/lib/udev/rules.d/"
  rm -rf "${pkgdir}/etc/udev"
}

package_ovirt-guest-agent-common() {
  depends=('qemu-guest-agent' 'python2' 'python2-dbus' 'python2-gobject2' 'dbus-glib' 'python2-ethtool' 'usermode')
  pkgdesc='The oVirt Guest Agent (with X support)'
  conflicts=("${pkgbase}")

  cd "${srcdir}/${pkgbase}-${pkgver}"
  make DESTDIR="${pkgdir}" install

  install -Dm0644 "${srcdir}/${pkgbase}.service" "${pkgdir}/usr/lib/systemd/system/${pkgbase}.service"
  install -Dm0644 "${srcdir}/${pkgbase}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgbase}.conf"
  install -Dm0644 "${srcdir}/${pkgbase}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgbase}.conf"
  install -Dm0644 "${srcdir}/39-ovirt-memory-hotplug.rules" "${pkgdir}/usr/lib/udev/rules.d/39-ovirt-memory-hotplug.rules"
  mv "${pkgdir}/etc/udev/rules.d/"* "${pkgdir}/usr/lib/udev/rules.d/"
  rm -rf "${pkgdir}/etc/udev"

# EL7 Magic
  cp "${srcdir}/console.apps_diskmapper" "${pkgdir}/etc/security/console.apps/diskmapper"
  cp "${srcdir}/pam.d_diskmapper" "${pkgdir}/etc/pam.d/diskmapper"
  mv "${pkgdir}/usr/share/${pkgbase}/diskmapper" "${pkgdir}/usr/share/${pkgbase}/diskmapper.script"
  ln -s "/usr/bin/consolehelper" "${pkgdir}/usr/share/${pkgbase}/diskmapper"
}