summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: eacd0944706aa1a90878e2a24b6af8bb9371d757 (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
# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=bettercap-git
pkgver=2.1.849.b63c20b
pkgrel=1
pkgdesc='Swiss army knife for network attacks and monitoring'
url='https://github.com/bettercap/bettercap'
arch=('x86_64')
license=('GPL3')
depends=('libpcap')
makedepends=('go-pie' 'git')
provides=('bettercap')
conflicts=('bettercap')
source=(${pkgname}::git+https://github.com/bettercap/bettercap)
sha512sums=('SKIP')

pkgver() {
  cd ${pkgname}
  printf "%s.%s.%s" "$(git describe --tags --abbrev=0|cut -dv -f2)" \
    "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare(){
  export GOPATH="${srcdir}"
  mkdir -p src/github.com/bettercap
  ln -rTsf ${pkgname} src/github.com/bettercap/bettercap
}

build() {
  cd src/github.com/bettercap/bettercap
  export GOPATH="${srcdir}"
  go get -v
  go build -o bettercap
}

package() {
  cd ${pkgname}
  install -Dm 755 ../bin/bettercap -t "${pkgdir}/usr/bin"
  install -Dm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et: