summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorcaltlgin2020-10-09 17:53:25 +1300
committercaltlgin2020-10-09 17:53:25 +1300
commit564fc5be8d101b496d932732935cfb1969c6f2c4 (patch)
treeed23179eb6d56603132ac449f66f82b2a59d9fc6
downloadaur-librespeed-cli-git.tar.gz
Add to AUR
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD43
2 files changed, 62 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..02fb035668e7
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = librespeed-cli-git
+ pkgdesc = Command line client for LibreSpeed
+ pkgver = 1.0.7.r3.geb7f5cb
+ pkgrel = 1
+ url = https://github.com/librespeed/speedtest-cli
+ arch = x86_64
+ arch = armv6h
+ arch = armv7h
+ arch = aarch64
+ license = LGPL3
+ makedepends = git
+ makedepends = go
+ provides = librespeed-cli
+ conflicts = librespeed-cli
+ source = librespeed-cli::git+https://github.com/librespeed/speedtest-cli.git
+ sha256sums = SKIP
+
+pkgname = librespeed-cli-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..b95afa151dea
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,43 @@
+# Maintainer: Caltlgin Stsodaat <contact@fossdaily.xyz>
+
+_pkgname='librespeed-cli'
+pkgname="${_pkgname}-git"
+pkgver=1.0.7.r3.geb7f5cb
+pkgrel=1
+pkgdesc='Command line client for LibreSpeed'
+arch=('x86_64' 'armv6h' 'armv7h' 'aarch64')
+url='https://github.com/librespeed/speedtest-cli'
+license=('LGPL3')
+makedepends=('git' 'go')
+provides=("${_pkgname}")
+conflicts=("${_pkgname}")
+source=("${_pkgname}::git+${url}.git")
+sha256sums=('SKIP')
+
+prepare() {
+ export GOPATH="${srcdir}/gopath"
+ go clean -modcache
+}
+
+pkgver() {
+ git -C "${_pkgname}" describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+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"
+
+ cd "${_pkgname}"
+ go build -v -o "${_pkgname}"
+}
+
+package() {
+ cd "${_pkgname}"
+ install -Dm755 -t "${pkgdir}/usr/bin" "${_pkgname}"
+ install -Dm644 -t "${pkgdir}/usr/share/doc/${_pkgname}" 'README.md'
+}
+
+# vim: ts=2 sw=2 et: