summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 29c080df4296b2d8aa1e030642a698a4a4d18fa0 (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
# Maintainer:  dreieck (https://aur.archlinux.org/account/dreieck)
# Contributor: Stephanie Wilde-Hobbs
# Contributor: Radostin Stoyanov
pkgname=libvirt-sandbox
pkgver=0.8.0
pkgrel=7
pkgdesc="An application sandbox toolkit"
arch=('i686' 'x86_64')
url="http://sandbox.libvirt.org/"
license=('LGPL-2.1-or-later')
depends=(
  'libvirt-glib'
  'libselinux'
  'libcap-ng'
  'cpio'
)
makedepends=(
  'gobject-introspection'
  'intltool'
  # 'pod2man'  # According to https://aur.archlinux.org/packages/libvirt-sandbox#comment-1081670, this is not needed.
  'rpcsvc-proto'
  'zlib-static' # Needs 'libz.a' static library for '--with-zlib'.
)
optdepends=('dhclient: for sandbox network configuration using DHCP')
source=(
    https://libvirt.org/sources/sandbox/$pkgname-$pkgver.tar.gz{,.asc}
    '0001-builder-Use-prefix-to-identify-lib-path.patch'
    '0002-Use-boot-vmlinuz-linux-as-default-kernel-path.patch'
)

md5sums=('c8b4393ec3ea78cd77af826e478f34f9'
         'd714f9f47f4322d5e702694f0b9f2c19'
         'f1b8ba0a173499b6fbe5ea24d542047b'
         'd854d27d11b2d6cf8184667cae920839'
)

validpgpkeys=('DAF3A6FDB26B62912D0E8E3FBE86EBB415104FDF')
# Daniel P. Berrange <dan@berrange.com>

prepare() {
  cd "$srcdir/$pkgname-$pkgver"
  patch -Np1 -i "${srcdir}/0001-builder-Use-prefix-to-identify-lib-path.patch"
  patch -Np1 -i "${srcdir}/0002-Use-boot-vmlinuz-linux-as-default-kernel-path.patch"
  sed -i 's/as_fn_error $? "static LZMA is required/###/' 'configure' # See https://aur.archlinux.org/packages/libvirt-sandbox#comment-927182.
}

build() {
  cd "$srcdir/$pkgname-$pkgver"

  # This disable showing all warning
  export CFLAGS+=" -w"
  export CXXFLAGS+=" -w"

  # --without-lzma: LZMA would need 'xz-static' ('liblzma.a') as make dependency, but having this leads to linking error 'libvirt-sandbox-init-qemu.c:(.text.startup+0x250): undefined reference to `lzma_stream_decoder'', so leaving it disabled.
  ./configure \
      --prefix=/usr \
      --libexecdir=/usr/lib/$pkgname \
      --sysconfdir=/etc \
      --enable-shared \
      --disable-static \
      --disable-werror \
      --disable-gtk-doc \
      --enable-gtk-doc-html \
      --disable-gtk-doc-pdf \
      --enable-introspection \
      --with-zlib \
      --without-lzma \
      --with-capng
  make
}

check() {
  cd "$srcdir/$pkgname-$pkgver"

  make -k check
}

package() {
  cd "$srcdir/$pkgname-$pkgver"

  make DESTDIR="$pkgdir/" install
}

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