summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3ad1f3608fe4b1b0ad14409eea3d8ff224d37419 (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
# Maintainer: Undercat037 <deltacatdeveloper@gmail.com>
pkgname=aura-emerge
pkgver=2.14.0
pkgrel=1
pkgdesc="A standalone Gentoo-style emerge for Arch Linux - installs from official repos, the AUR, and ABS, scans PKGBUILDs for supply-chain red flags before building, and runs untrusted build steps inside a bwrap sandbox."
arch=('x86_64')
url="https://undercat037.github.io/aura-emerge/"
# Github repo: https://github.com/Undercat037/aura-emerge
# Gitlab repo: https://gitlab.com/Undercat037/aura-emerge
license=('GPL-3.0-only')
depends=('git' 'sudo')
optdepends=('devtools: for --abs support (pkgctl repo clone)'
  'gnupg: for PGP verification when building from ABS'
  'bubblewrap: sandboxed builds (falls back to unsandboxed with --no-sandbox)')
makedepends=('rust' 'cargo')
conflicts=('portage' 'portage-git' 'aura-emerge-git')
provides=('portageq')
install=aura-emerge.install
backup=('etc/portage/world')
source=("$pkgname::git+https://github.com/Undercat037/aura-emerge.git#tag=v$pkgver")
sha256sums=('54c0130cd6cd9eb8f40204983057f6363e5d2c7ebf7947f57c794c6a156dd40f')

build() {
  cd "aura-emerge"
  cargo build --release
}

package() {
  cd "aura-emerge"
  local bin="target/release/aura-emerge"

  _gen_or_die() {
    local out="$1"
    shift
    if ! "$bin" "$@" >"$out" || [ ! -s "$out" ]; then
      error "\"$bin $*\" produced no output - refusing to package an empty file"
      return 1
    fi
  }

  install -Dm755 target/release/aura-emerge "$pkgdir/usr/bin/emerge"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 README.MD "$pkgdir/usr/share/doc/$pkgname/README.md"
  install -Dm644 UA-README.MD "$pkgdir/usr/share/doc/$pkgname/UA-README.md"

  _gen_or_die man.1 --gen-manpage
  install -Dm644 man.1 "$pkgdir/usr/share/man/man1/emerge.1"

  install -dm755 "$pkgdir/etc/portage"
  install -dm755 "$pkgdir/etc/portage/sets"
  install -Dm644 /dev/null "$pkgdir/etc/portage/world"

  _gen_or_die comp.bash --gen-completions bash
  install -Dm644 comp.bash "$pkgdir/usr/share/bash-completion/completions/emerge"
  _gen_or_die comp.zsh --gen-completions zsh
  install -Dm644 comp.zsh "$pkgdir/usr/share/zsh/site-functions/_emerge"
  _gen_or_die comp.fish --gen-completions fish
  install -Dm644 comp.fish "$pkgdir/usr/share/fish/vendor_completions.d/emerge.fish"
}