diff options
author | George Rawlinson | 2021-05-13 09:55:03 +0000 |
---|---|---|
committer | George Rawlinson | 2021-05-13 09:56:49 +0000 |
commit | 04392ee7ec47f15003d4257fd79fe3b4165b1d13 (patch) | |
tree | d0d1cf75acf7239c16e055c099929d32e08e998d | |
download | aur-04392ee7ec47f15003d4257fd79fe3b4165b1d13.tar.gz |
addpkg: ghosts 0.2.2-1
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | PKGBUILD | 55 |
2 files changed, 70 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..ad2effd4fb7f --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = ghosts + pkgdesc = Tool to evaluate, compare & format host files + pkgver = 0.2.2 + pkgrel = 1 + url = https://github.com/StevenBlack/ghosts + arch = x86_64 + license = MIT + makedepends = go + makedepends = git + noextract = ghosts-0.2.2.tar.gz + source = ghosts-0.2.2.tar.gz::https://github.com/StevenBlack/ghosts/archive/v0.2.2.tar.gz + b2sums = 21ec1aebc679a17e52c65ea77ca68ceb94429ae18e6734682525e958ecbd66d72a3777816989d3e5616355e59b5e920eb734235723085024423c4b4017a60bfa + +pkgname = ghosts + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..639f9d62f939 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,55 @@ +# Maintainer: George Rawlinson <george@rawlinson.net.nz> + +pkgname=ghosts +pkgver=0.2.2 +pkgrel=1 +pkgdesc="Tool to evaluate, compare & format host files" +arch=('x86_64') +url="https://github.com/StevenBlack/ghosts" +license=('MIT') +makedepends=('go' 'git') +source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz") +b2sums=('21ec1aebc679a17e52c65ea77ca68ceb94429ae18e6734682525e958ecbd66d72a3777816989d3e5616355e59b5e920eb734235723085024423c4b4017a60bfa') +noextract=("$pkgname-$pkgver.tar.gz") + +prepare() { + bsdtar -xf "$pkgname-$pkgver.tar.gz" \ + --exclude "$pkgname-$pkgver/dist" \ + --exclude "$pkgname-$pkgver/$pkgname" + + # download dependencies + cd "$pkgname-$pkgver" + go mod init "${url#https://}" + go mod tidy + + # create build directory + 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 -v -o build ./... +} + +check() { + cd "$pkgname-$pkgver" + go test ./... +} + +package() { + cd "$pkgname-$pkgver" + + # binary + install -vDm755 -t "$pkgdir/usr/bin" "build/$pkgname" + + # license + install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" license.txt + + # documentation + install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md +} |