summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorAdam Goldsmith2024-03-23 16:52:29 -0400
committerAdam Goldsmith2024-03-23 16:52:29 -0400
commita6cab99ee7c560b529dfe89ed0065e5719bcaa37 (patch)
tree3eac3157cc31832c4948a09696cc1b1659958e28 /PKGBUILD
parentf199d5bc0be03cffdc0a48847ee44ae78e0a3962 (diff)
downloadaur-rtlamr-git.tar.gz
Update to use current Go package guidelines
per https://wiki.archlinux.org/title/Go_package_guidelines
Diffstat (limited to 'PKGBUILD')
-rwxr-xr-xPKGBUILD38
1 files changed, 18 insertions, 20 deletions
diff --git a/PKGBUILD b/PKGBUILD
index b076f9321777..1d94813f00a7 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,52 +1,50 @@
# Maintainer: Adam Goldsmith <contact@adamgoldsmith.name>
# Former Maintainer: bemasher <bemasher@gmail.com>
-_pkgname=rtlamr
pkgname=rtlamr-git
-pkgver=v0.9.3.r5.g3965b5c5
+_pkgname=${pkgname%%-git}
+pkgver=0.9.3.r16.gdcdddc5
pkgrel=1
pkgdesc="An rtl-sdr receiver for Itron ERT compatible smart meters operating in the 900MHz ISM band."
-arch=('any')
+arch=('i686' 'x86_64')
url="https://github.com/bemasher/rtlamr"
-source=("git+https://github.com/bemasher/rtlamr.git")
-md5sums=('SKIP')
license=('AGPL3')
depends=('rtl-sdr')
makedepends=('go' 'git')
provides=('rtlamr')
conflicts=('rtlamr')
-options=('!strip' '!emptydirs')
-_gourl=github.com/bemasher/rtlamr
+source=("git+https://github.com/bemasher/rtlamr.git")
+md5sums=('SKIP')
pkgver() {
cd "$_pkgname"
- git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+ git describe --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare(){
- mkdir -p gopath/src/${_gourl%/*}
- ln -rTsf $_pkgname gopath/src/$_gourl
+ cd "$_pkgname"
+ mkdir -p build
}
build() {
- export GOPATH="$srcdir"/gopath
- cd gopath/src/$_gourl
- go install \
- -trimpath \
- -modcacherw \
- -ldflags "-extldflags $LDFLAGS" \
- -v ./...
+ cd "$_pkgname"
+ 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 -o build .
}
check() {
- export GOPATH="$srcdir"/gopath
- cd gopath/src/$_gourl
+ cd "$_pkgname"
go test ./...
}
package() {
- install -p -Dm755 gopath/bin/rtlamr "$pkgdir/usr/bin/rtlamr"
+ cd "$_pkgname"
+ install -p -Dm755 build/$_pkgname "$pkgdir"/usr/bin/$_pkgname
}
# vim:set ts=2 sw=2 et: