blob: c9c73aaf9a7e49b702b9e36003fb50641d25b41f (
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
47
|
# Maintainer: Adam Perkowski <adas1per@protonmail.com>
# https://github.com/adamperkowski/PKGBUILDs
pkgname=cloudip
pkgver=0.6.0
pkgrel=1
pkgdesc='CLI tool for identifying cloud providers'
arch=('x86_64')
url="https://github.com/jongwoo328/$pkgname"
license=('Apache-2.0')
source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('e2f1ba8ea8757197a70650a2f1afe2df06fc99ff70e0687a8841222f1a77f266')
makedepends=('go')
depends=('glibc')
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 GOPATH="$srcdir"
export GOFLAGS='-buildmode=pie -mod=readonly -modcacherw'
go build \
-ldflags "-X 'cloudip/cmd.Version=$pkgver'" \
-o "build/$pkgname" \
.
}
check() {
cd "$pkgname-$pkgver"
go test .
}
package() {
cd "$pkgname-$pkgver"
install -Dm0755 "build/$pkgname" -t "$pkgdir/usr/bin"
install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
install -Dm644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
}
# vim: ts=2 sw=2 et:
|