diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 62 |
1 files changed, 33 insertions, 29 deletions
@@ -1,40 +1,44 @@ +# Maintainer: Luis Martinez <luis dot martinez at disroot dot org> # Maintainer: Bobby Burden III <bobby@brb3.org> + pkgname=torsniff -pkgver=0.0.9 +pkgver=0.1.0 pkgrel=1 -pkgdesc="A sniffer for fetching torrents from the BitTorrent network" -arch=("x86_64") -url="https://github.com/fanpei91/torsniff" -license=("MIT") -depends=("glibc") -makedepends=("go" "git") -provides=("torsniff") -source=( -"${pkgname}-${pkgver}.tar.gz::https://github.com/fanpei91/torsniff/archive/v${pkgver}.tar.gz" -) -sha256sums=("cd9169604b62f8128a5b12cdfd506c05626802952db4dabbd2917e929c65f8ab") +pkgdesc='Fetches torrents from BitTorrent network' +arch=('x86_64' 'i686') +url='https://github.com/fanpei91/torsniff' +license=('MIT') +depends=('glibc') +makedepends=('go' 'git') +source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz") +sha256sums=('b17668c9d6a41b566bf1630a2163e007fc2277c7db52b6dc5be69c873bbe12e7') -build() { - cd "$pkgname-$pkgver" +prepare() { + cd "$pkgname-$pkgver" + mkdir -p build + go mod init "${url#https://}" + go mod tidy +} - # Go Dependencies - go get go.etcd.io/etcd/pkg/fileutil - go get github.com/mitchellh/go-homedir - go get github.com/marksamman/bencode - go get github.com/spf13/cobra - go get golang.org/x/time/rate - go get github.com/inconshreveable/mousetrap - go get runtime/cgo +build() { + 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" - # Setup Go - export PATH=/usr/lib/go/bin:$PATH + cd "$pkgname-$pkgver" + go build -o build +} - # Build - GOARCH=amd64 GOOS=linux go build -o releases/torsniff +check() { + cd "$pkgname-$pkgver" + go test ./... } package() { - cd "$pkgname-$pkgver" - - install -Dm755 "releases/torsniff" "${pkgdir}/usr/bin/torsniff" + cd "$pkgname-$pkgver" + install -D build/torsniff -t "$pkgdir/usr/bin/" + install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/" + install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname/" } |