summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Kovetskiy2019-01-02 13:44:58 +0300
committerEgor Kovetskiy2019-01-02 13:44:58 +0300
commitc107c181017020d2ccfec86dfc2ca663dc18c21e (patch)
tree9c50d6ece319c749a0eefe823e4375906e95e70c
downloadaur-c107c181017020d2ccfec86dfc2ca663dc18c21e.tar.gz
sync github.com/kovetskiy/pkgbuilds
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD74
2 files changed, 90 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..aca98ce7c27
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+# Generated by mksrcinfo v8
+# Wed Jan 2 10:44:57 UTC 2019
+pkgbase = glod-git
+ pkgdesc = key-value storage with owner by pid
+ pkgver = autogenerated
+ pkgrel = 1
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = go
+ makedepends = git
+ source = glod::git://github.com/kovetskiy/glod#branch=master
+ md5sums = SKIP
+
+pkgname = glod-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..6faafbb0cf6
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,74 @@
+# Maintainer: Egor Kovetskiy <e.kovetskiy@gmail.com>
+pkgname=glod-git
+_pkgname=glod
+pkgver=${PKGVER:-autogenerated}
+pkgrel=${PKGREL:-1}
+pkgdesc="key-value storage with owner by pid"
+arch=('i686' 'x86_64')
+license=('GPL')
+depends=(
+)
+makedepends=(
+ 'go'
+ 'git'
+)
+
+source=(
+ "$_pkgname::git://github.com/kovetskiy/glod#branch=${BRANCH:-master}"
+)
+
+md5sums=(
+ 'SKIP'
+)
+
+backup=(
+)
+
+pkgver() {
+ if [[ "$PKGVER" ]]; then
+ echo "$PKGVER"
+ return
+ fi
+
+ cd "$srcdir/$_pkgname"
+ local date=$(git log -1 --format="%cd" --date=short | sed s/-//g)
+ local count=$(git rev-list --count HEAD)
+ local commit=$(git rev-parse --short HEAD)
+ echo "$date.${count}_$commit"
+}
+
+build() {
+ cd "$srcdir/$_pkgname"
+
+ if [ -L "$srcdir/$_pkgname" ]; then
+ rm "$srcdir/$_pkgname" -rf
+ mv "$srcdir/go/src/$_pkgname/" "$srcdir/$_pkgname"
+ fi
+
+ rm -rf "$srcdir/go/src"
+
+ mkdir -p "$srcdir/go/src"
+
+ export GOPATH="$srcdir/go"
+
+ mv "$srcdir/$_pkgname" "$srcdir/go/src/"
+
+ cd "$srcdir/go/src/$_pkgname/"
+ ln -sf "$srcdir/go/src/$_pkgname/" "$srcdir/$_pkgname"
+
+ echo ":: Updating git submodules"
+ git submodule update --init
+
+ echo ":: Building binary"
+ go get -v \
+ -gcflags "-trimpath $GOPATH/src" \
+ -ldflags="-X main.version=$pkgver-$pkgrel"
+}
+
+package() {
+ find "$srcdir/go/bin/" -type f -executable | while read filename; do
+ install -DT "$filename" "$pkgdir/usr/bin/$(basename $filename)"
+ done
+
+ install -DT "$srcdir/go/src/glod/systemd/glod.service" "$pkgdir/usr/lib/systemd/user/glod.service"
+}