summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Kovetskiy2016-11-30 16:16:21 +0700
committerEgor Kovetskiy2016-11-30 16:16:57 +0700
commitad21e5088bba9c53eb4d775c8bdc8d32f9842aef (patch)
treeb21dad4623fa6258fce285f52715ef2625bddf66
downloadaur-poke-git.tar.gz
initial commit
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD69
2 files changed, 85 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..08c876d2c29
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+# Generated by mksrcinfo v8
+# Wed Nov 30 09:16:54 UTC 2016
+pkgbase = poke-git
+ pkgdesc = util for converting MySQL slow query log records
+ pkgver = autogenerated
+ pkgrel = 1
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = go
+ makedepends = git
+ source = poke-git::git://github.com/kovetskiy/poke.git#branch=master
+ md5sums = SKIP
+
+pkgname = poke-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..3954d72bc86
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,69 @@
+# Maintainer: Egor Kovetskiy <e.kovetskiy@office.ngs.ru>
+pkgname=poke-git
+pkgver=${PKGVER:-autogenerated}
+pkgrel=${PKGREL:-1}
+pkgdesc="util for converting MySQL slow query log records"
+arch=('i686' 'x86_64')
+license=('GPL')
+depends=(
+)
+makedepends=(
+ 'go'
+ 'git'
+)
+
+source=(
+ "poke-git::git://github.com/kovetskiy/poke.git#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"
+
+ git submodule update --init
+
+ 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/poke"
+ done
+}