summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: af6bcf6199bfa60ce60dcbc6e66cfad270ec8db5 (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
# Maintainer: Aaron McDaniel (mcd1992) <'aur' at the domain 'fgthou.se'>

pkgname=libvmi-git
pkgver=0.10.r804.g69b3198
pkgrel=1
pkgdesc='LibVMI is a virtual machine introspection library'
url='http://libvmi.com'
arch=('any')
license=('GPL')
makedepends=('automake' 'autoconf' 'libtool' 'bison' 'flex')
depends=('json-c')
optdepends=('libvirt: required for KVM/libvirt usage')
provides=('libvmi')
conflicts=('libvmi')
source=("${pkgname}::git+https://github.com/libvmi/libvmi.git")
sha256sums=('SKIP')

pkgver() {
  cd ${pkgname}
  # Remove 'v' prefix on tags; prefix revision with 'r'; replace all '-' with '.'
  git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd ${pkgname}

  # Create build env
  ./autogen.sh

  # Create Makefiles
  ./configure --prefix=/usr --disable-xen

  # Enable debugging output
  # sed -i -r 's/\/\/(#define VMI_DEBUG.*)/\1/' libvmi/debug.h
}

build() {
  # Build the config files / headers first (cant parallel build these)
  cd "${srcdir}/${pkgname}/libvmi/config"
  make -j1

  # Make all
  cd "${srcdir}/${pkgname}"
  make
}

package() {
  cd ${pkgname}
  make DESTDIR="$pkgdir/" install
  install -DTm644 COPYING "${pkgdir}"/usr/share/licenses/${pkgname}/LICENSE

  # Copy header files into package (not sure why stuff like libvmi/events.h isn't installed by default)
  cp ${srcdir}/${pkgname}/libvmi/*.h ${pkgdir}/usr/include/libvmi/
}