summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander F. Rødseth2020-01-31 15:27:39 +0100
committerAlexander F. Rødseth2020-01-31 15:27:39 +0100
commit9f293d167ffd2040ab34c5905e0610a9b2dedbf5 (patch)
tree62e33f55cb08f60714ccaa83018e1dbc75f8bff4
downloadaur-9f293d167ffd2040ab34c5905e0610a9b2dedbf5.tar.gz
Initial commit
-rw-r--r--.SRCINFO15
-rw-r--r--PKGBUILD29
2 files changed, 44 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..c140edef718
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,15 @@
+pkgbase = distro
+ pkgdesc = Drop-in replacment for the python-distro utility, written in Go
+ pkgver = 1.2.0
+ pkgrel = 1
+ url = https://github.com/xyproto/distrodetector
+ arch = x86_64
+ license = MIT
+ makedepends = git
+ makedepends = go
+ conflicts = python-distro
+ source = git+https://github.com/xyproto/distrodetector#tag=1.2.0
+ sha256sums = SKIP
+
+pkgname = distro
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..6489f728086
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,29 @@
+# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
+
+pkgname=distro
+pkgver=1.2.0
+pkgrel=1
+pkgdesc='Drop-in replacment for the python-distro utility, written in Go'
+conflicts=(python-distro)
+arch=(x86_64)
+url='https://github.com/xyproto/distrodetector'
+license=(MIT)
+makedepends=(git go)
+source=("git+$url#tag=$pkgver")
+sha256sums=('SKIP')
+
+build() {
+ cd "distrodetector/cmd/$pkgname"
+
+ # Using gccgo gives a smaller size, but forces AUR users to juggle between go and gccgo, which is unfortunate
+ #go build -buildmode=pie -gccgoflags="-s -w $LDFLAGS"
+
+ go build -buildmode=pie -gcflags="all=-trimpath=$PWD" -asmflags "all=-trimpath=$PWD" -ldflags "-s -w -extldflags $LDFLAGS"
+}
+
+package() {
+ install -Dm755 distrodetector/cmd/$pkgname/distro "$pkgdir/usr/bin/distro"
+ install -Dm644 distrodetector/LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
+
+# vim: ts=2 sw=2 et: