summaryrefslogtreecommitdiff
path: root/community/xe-guest-utilities/PKGBUILD
blob: 3fd142e5cec54067390c53cc2fdab2056babf4df (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
# $Id: PKGBUILD 90393 2013-05-12 07:10:12Z dwallace $
# Maintainer: Daniel Wallace <danielwallace at code gtmanfred com>
# Contributor: Phillip Smith <fukawi2@NO-SPAM.gmail.com>
# Contributor: Krzysztof Raczkowski <raczkow@gnu-tech.pl>

pkgbase=xe-guest-utilities
pkgname=('xe-guest-utilities' 'xenstore')
pkgver=6.1.0
pkgrel=5
pkgdesc="Citrix XenServer Tools"
arch=('i686' 'x86_64')
url="http://citrix.com/English/ps2/products/product.asp?contentID=683148&ntref=hp_nav_US"
license=('GPL' 'LGPL')
makedepends=(python2)
source=("ftp://ftp.archlinux.org/other/community/$pkgbase/${pkgbase}_${pkgver}-1033.tar.gz"
      	'ip_address.patch'
        'xe-linux-distribution.service'
        'xe-daemon.service'
        'proc-xen.mount'
        'tmpfile')
md5sums=('26fd52ffc5ddeb7d3e510e6f272c2860'
         '9bd39e95384056069f7faa870a28413a'
         '95064a7d8a32cd3aaca14e3b48c69599'
         '173fed74c76817702b062ed653002db0'
         '3252fa21362fd55246f9d8b923070151'
         'cadad1eb5b1fa6d5fe463a1a0fd82fff')

prepare(){
  patch -d $srcdir/$pkgname-$pkgver -Np1 -i $srcdir/ip_address.patch
  bsdtar xf "$srcdir/$pkgname-$pkgver/xenstore-sources.tar.bz2"
}

build() {
  export CC=gcc
  CFLAGS='-Wall -Wstrict-prototypes -Wno-unused-local-typedefs -Wno-sizeof-pointer-memaccess'
  export CFLAGS
  export PYTHON=python2
  cd "$srcdir/uclibc-sources"
  make -C tools/include
  make -C tools/libxc
  make -C tools/xenstore
}

package_xenstore() {
  depends=(bzip2 lzo2 zlib xz)
  export CFLAGS+='-Wall -Wstrict-prototypes -Wno-unused-local-typedefs -Wno-sizeof-pointer-memaccess'
  if [[ $CARCH == x86_64 ]]; then
    export LIBLEAFDIR_x86_64=lib
  fi
  for f in include libxc xenstore; do
    [[ ! -d "$srcdir"/uclibc-sources/tools/$f ]] && continue
    make -C ""$srcdir"/uclibc-sources/tools/$f" DESTDIR="$pkgdir" SBINDIR=/usr/bin install
  done
  cd "$srcdir/$pkgbase-$pkgver"
  install -Dm644 "COPYING.LGPL" "$pkgdir/usr/share/licenses/$pkgname/COPYING.LGPL"
  install -Dm644 "COPYING" "$pkgdir/usr/share/licenses/$pkgname/COPYING"
  install -Dm644 $srcdir/proc-xen.mount "$pkgdir/usr/lib/systemd/system/proc-xen.mount"
  install -Dm644 $srcdir/tmpfile "$pkgdir/usr/lib/tmpfiles.d/30-xenstored.conf"
  rm -r "$pkgdir"/var
}

package_xe-guest-utilities(){
  cd "$srcdir/$pkgname-$pkgver"
  depends=('xenstore' 'bash')
  install -Dm755 xe-linux-distribution "$pkgdir/usr/bin/xe-linux-distribution"
  install -Dm755 xe-update-guest-attrs "$pkgdir/usr/bin/xe-update-guest-attrs"
  install -Dm755 xe-daemon "$pkgdir/usr/bin/xe-daemon"
  install -Dm644 xen-vcpu-hotplug.rules "$pkgdir/usr/lib/udev/rules.d/10-xen-vcpu-hotplug.rules"
  install -Dm644 COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
  install -Dm644 $srcdir/xe-daemon.service "$pkgdir/usr/lib/systemd/system/xe-daemon.service"
  install -Dm644 $srcdir/xe-linux-distribution.service "$pkgdir/usr/lib/systemd/system/"
}

# vim:set ts=2 sw=2 et: