summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a6a7feb02a5731d9fc6835574df30917c7c6213c (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
# Maintainer: BenoƮt Allard <benoit.allard@gnx.de>
pkgname=pwngrid
pkgver=1.10.3
pkgrel=1
pkgdesc="This is the source code of the API server for http://pwnagotchi.ai"
arch=('x86_64')
url="https://github.com/evilsocket/pwngrid"
license=('GPL3')
depends=('libpcap')
source=("$pkgname-$pkgver.tar.gz::https://github.com/evilsocket/${pkgname}/archive/v$pkgver.tar.gz")
md5sums=('250eccce3cfe5745fe1d4aac7e75bb5b')

prepare(){
    cd $pkgname-$pkgver
    mkdir -p build/
}

build() {
    cd $pkgname-$pkgver
    export CGO_CPPFLAGS="${CPPFLAGS}"    
    export CGO_CFLAGS="${CFLAGS}"    
    export CGO_CXXFLAGS="${CXXFLAGS}"    
    export CGO_LDFLAGS="${LDFLAGS}"    
    export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"    
    go build -o build/$pkgname cmd/pwngrid/*.go
}

package() {
    cd $pkgname-$pkgver
    install -Dm755 build/$pkgname "$pkgdir"/usr/bin/$pkgname
    install -Dm644 pwngrid.service "$pkgdir"/usr/lib/systemd/system/pwngrid.service
    install -Dm644 env.example "$pkgdir"/etc/pwngrid/pwngrid.conf
}