blob: b5e2777b1e3ea6287b50380095969f4a4dfa9634 (
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: Your name <bros at brocode dot sh>
pkgname=fbmirrors
pkgver=__VERSION__
pkgrel=__PKGREL__
pkgdesc="Arch mirror list generator"
arch=('x86_64')
url="https://github.com/bomgar/fbmirrors"
license=('custom:GPL-3.0')
makedepends=('go')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('__SHA256__')
prepare() {
cd "$pkgname-$pkgver"
go mod download
}
build() {
cd "$pkgname-$pkgver"
go build -o $pkgname -ldflags="-X main.version=$pkgver" main.go
mkdir -p completions
./$pkgname completion bash > completions/$pkgname
./$pkgname completion zsh > completions/_$pkgname
./$pkgname completion fish > completions/$pkgname.fish
}
check() {
cd "$pkgname-$pkgver"
go test -v ./...
}
package() {
cd "$pkgname-$pkgver"
install -Dm 755 "$pkgname" -t "$pkgdir/usr/bin"
install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
install -D -m644 completions/$pkgname "$pkgdir/usr/share/bash-completion/completions/$pkgname"
install -D -m644 completions/_$pkgname "$pkgdir/usr/share/zsh/site-functions/_$pkgname"
install -D -m644 completions/$pkgname.fish "$pkgdir/usr/share/fish/completions/$pkgname.fish"
}
|