summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 98ff03352660fc8208ffae12e70ab2d642e41153 (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
# Maintainer: Chocobo1 <chocobo1 AT archlinux DOT net>

pkgbase=bubblewrap-git
pkgname=('bubblewrap-git' 'bubblewrap-suid-git')
pkgver=0.11.0.r8.g0c408e1
pkgrel=1
pkgdesc="Low-level unprivileged sandboxing tool"
arch=('i686' 'x86_64')
url="https://github.com/containers/bubblewrap"
license=('LGPL-2.0-or-later')
depends=('glibc' 'libgcc' 'libcap')
makedepends=('git' 'bash-completion' 'docbook-xsl' 'libxslt' 'meson')
provides=("bubblewrap=$pkgver")
conflicts=('bubblewrap')
options=('staticlibs')
source=("git+https://github.com/containers/bubblewrap.git")
sha256sums=('SKIP')


pkgver() {
  cd "bubblewrap"

  _tag=$(git tag -l --sort -v:refname | grep -E '^v?[0-9\.]+$' | head -n1)
  _rev=$(git rev-list --count "$_tag"..HEAD)
  _hash=$(git rev-parse --short HEAD)
  printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash" | sed 's/^v//'
}

build() {
  cd "bubblewrap"

  meson setup \
    --buildtype=plain \
    --prefix="/usr" \
    --sbindir="bin" \
    -Ddefault_library="both" \
    -Dselinux="disabled" \
    "_build"
  meson compile -C "_build"
}

check() {
  cd "bubblewrap"

  #meson test -C "_build"
}

package_bubblewrap-git() {
  cd "bubblewrap"

  meson install -C "_build" --destdir "$pkgdir"
}

package_bubblewrap-suid-git() {
  pkgdesc+=" (setuid variant)"
  provides=("bubblewrap-suid=$pkgver")
  conflicts=('bubblewrap-suid')

  cd "bubblewrap"

  meson install -C "_build" --destdir "$pkgdir"
  chmod u+s "$pkgdir/usr/bin/bwrap"
}