summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f7eb6eaf0f4b4d57df5c2341d3871f296aaf1c78 (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
# Maintainer: coldBug <coldbug@e.mail.de>
pkgname=rusthound-ce-git
_pkgname=${pkgname%-ce-git}
pkgver=c4e8eb3
pkgrel=1
pkgdesc="BloodHoundCE collector tool written in Rust."
arch=('any')
url="https://github.com/NH-RED-TEAM/RustHound"
license=("MIT")
makedepends=("git" "cargo" "clang" "rustup")
provides=(${_pkgname})
conflicts=(${_pkgname})
source=("${_pkgname}::git+${url}.git#branch=v2")
sha256sums=('SKIP')

pkgver() {
  cd "${_pkgname}"
  git describe --long --tags --always | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "${_pkgname}"
  export RUSTUP_TOOLCHAIN=stable
  cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
  cd "${_pkgname}"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  cargo build --frozen --release 
}

package() {
  install -Dm644 "${_pkgname}/LICENSE" "$pkgdir/usr/share/licenses/${_pkgname}/LICENSE"
  install -Dm755 "${_pkgname}/target/release/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
}