summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2f4fe1232e915db1a186833eca7627142cbb125c (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
# Maintainer: Tony Lambiris <tony@libpcap.net>

pkgname=ffuf-git
pkgver=2.0.0.r6.g5fd821c
pkgrel=1
pkgdesc="A fast web fuzzer written in Go."
arch=('x86_64')
license=('MIT')
depends=()
makedepends=('go' 'git')
optdepends=()
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("${pkgname}::git+https://github.com/ffuf/ffuf.git")
sha256sums=('SKIP')

pkgver() {
    cd "${srcdir}/${pkgname}"

    git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//g'
}

prepare() {
    cd "${srcdir}/${pkgname}"

    mkdir -p "${srcdir}/go/src/github.com/ffuf"
    ln -sf "${srcdir}/${pkgname}" "${srcdir}/go/src/github.com/ffuf/ffuf"
}

build() {
    cd "${srcdir}/go/src/github.com/ffuf/ffuf"

    mkdir -p build

    export GOPATH="${srcdir}/go" GO111MODULE="auto"

    go build -trimpath -modcacherw -ldflags "-s -w" \
        -o build/ffuf .
}

package() {
    cd "${srcdir}/go/src/github.com/ffuf/ffuf"

    install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
    install -Dm755 build/ffuf "${pkgdir}/usr/bin/ffuf"
}