summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lambiris2019-01-31 04:54:42 -0500
committerTony Lambiris2019-01-31 04:54:42 -0500
commit13a9aefa6f7c6690a8ac0a9d772120a68eb46583 (patch)
tree689c2470f5ced849f6ce37f27a0035ba43327cce
downloadaur-13a9aefa6f7c6690a8ac0a9d772120a68eb46583.tar.gz
Initial commit
-rw-r--r--.SRCINFO16
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD51
3 files changed, 71 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..d7fdfc5351a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = ghw-git
+ pkgdesc = Golang hardware discovery/inspection library
+ pkgver = 0.3.r0.g032dfb1
+ pkgrel = 1
+ url = https://github.com/jaypipes/ghw
+ arch = x86_64
+ license = Apache
+ makedepends = go>=1.10
+ makedepends = git
+ provides = ghw
+ conflicts = ghw
+ source = ghw-git::git+https://github.com/jaypipes/ghw
+ sha256sums = SKIP
+
+pkgname = ghw-git
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..772a49591d3
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+src
+pkg
+ghw-git
+*pkg.tar.xz
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..a9bf6f525b0
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,51 @@
+# Maintainer: Tony Lambiris <tony@criticalstack.com>
+
+pkgname=ghw-git
+pkgver=0.3.r0.g032dfb1
+pkgrel=1
+pkgdesc="Golang hardware discovery/inspection library"
+arch=('x86_64')
+url="https://github.com/jaypipes/ghw"
+license=('Apache')
+makedepends=('go>=1.10' 'git')
+conflicts=('ghw')
+provides=('ghw')
+source=("${pkgname}::git+${url}")
+sha256sums=('SKIP')
+
+pkgver() {
+ cd "${srcdir}/${pkgname}"
+
+ git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd "${srcdir}/${pkgname}"
+
+ install -m755 -d "${srcdir}/go/src/github.com/jaypipes/"
+ ln -sf "${srcdir}/${pkgname}" "${srcdir}/go/src/github.com/jaypipes/ghw"
+
+ cd "${srcdir}/go/src/github.com/jaypipes/ghw"
+
+ GOROOT="/usr/lib/go" GOPATH="${srcdir}/go" \
+ go get -v -d ./...
+}
+
+build() {
+ cd "${srcdir}/go/src/github.com/jaypipes/ghw"
+
+ mkdir -p build
+
+ GOROOT="/usr/lib/go" GOPATH="${srcdir}/go" \
+ go build \
+ -ldflags "-s -w" \
+ -gcflags="all=-trimpath=${GOPATH}/src" \
+ -asmflags="all=-trimpath=${GOPATH}/src" \
+ -o build/ghwc ./cmd/ghwc
+}
+
+package() {
+ cd "${srcdir}/go/src/github.com/jaypipes/ghw"
+
+ install -Dm755 "./build/ghwc" "${pkgdir}/usr/bin/ghwc"
+}