aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ed41151fd5f3d691c80d6c8ab99f7c91223aa809 (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
# Maintainer: Kevin Hilton <>
pkgname=('xe-guest-utilities-git' 'xenstore-git')
pkgrel=1
pkgver=20190927.2f5d2e4
pkgdesc="Citrix XenServer Tools"
arch=('x86_64')
url="https://github.com/xenserver/xe-guest-utilities"
license=('BSD-2')
makedepends=('go-pie' 'git')
source=('git+https://github.com/xenserver/xe-guest-utilities.git')
sha1sums=('SKIP')

pkgver() {
  cd "${srcdir}/${pkgbase%-git}"
  git log -1 --format='%cd.%h' --date=short | tr -d -
}

prepare() {
  cd "${srcdir}/${pkgbase%-git}"
  export GOPATH="${srcdir}/${pkgbase%-git}"
  go get golang.org/x/sys/unix
}

build() {
  cd "${srcdir}/${pkgbase%-git}"
  export GOPATH="${srcdir}/${pkgbase%-git}"
  export CGO_LDFLAGS="${LDFLAGS}"
  export GOFLAGS="-trimpath"
  make
}

package_xe-guest-utilities-git() {
  pkgdesc="Writes distribution version information and IP address to XenStore"
  depends=('lsb-release')
  provides=("${pkgname%-git}")
  conflicts=("${pkgname%-git}")
  cd "$srcdir/${pkgbase%-git}"
  install -D -m0644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -D -m0755 build/obj/xe-daemon "${pkgdir}/usr/share/oem/xs/xe-daemon"
  install -D -m0755 mk/xe-linux-distribution "${pkgdir}/usr/share/oem/xs/xe-linux-distribution"
  install -D -m0644 mk/xen-vcpu-hotplug.rules "${pkgdir}/usr/lib/udev/rules.d/10-xen-vcpu-hotplug.rules"
  install -D -m0644 mk/xe-linux-distribution.service "${pkgdir}/usr/lib/systemd/system/xe-guest-utilities.service"

}

package_xenstore-git(){
  pkgdesc="Utilities for interacting with XenStore from within a Xen virtual machine"

  provides=("${pkgname%-git}")
  conflicts=("${pkgname%-git}")

  cd "$srcdir/${pkgbase%-git}"
  install -D -m0644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -D -m0755 build/obj/xenstore "${pkgdir}/usr/bin/xenstore"
  ln -s xenstore "${pkgdir}/usr/bin/xenstore-exists"
  ln -s xenstore "${pkgdir}/usr/bin/xenstore-read"
  ln -s xenstore "${pkgdir}/usr/bin/xenstore-rm"
  ln -s xenstore "${pkgdir}/usr/bin/xenstore-write"
}