summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Kovetskiy2018-12-25 23:22:07 +0300
committerEgor Kovetskiy2018-12-25 23:22:07 +0300
commitd65b3af47866fee1a65186344505710d90af8c47 (patch)
tree92885c18a5fcec2fefbdfda41b38e42e74073a77
downloadaur-sink-git.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..000e39c37c8
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+# Generated by mksrcinfo v8
+# Tue Dec 25 20:22:05 UTC 2018
+pkgbase = sink-git
+ pkgdesc = two way synchronizer
+ pkgver = autogenerated
+ pkgrel = 1
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = go
+ makedepends = git
+ source = sink::git://github.com/kovetskiy/sink#branch=master
+ md5sums = SKIP
+
+pkgname = sink-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..3a7734b4b49
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,74 @@
+# Maintainer: Egor Kovetskiy <e.kovetskiy@gmail.com>
+pkgname=sink-git
+_pkgname=sink
+pkgver=${PKGVER:-autogenerated}
+pkgrel=${PKGREL:-1}
+pkgdesc="two way synchronizer"
+arch=('i686' 'x86_64')
+license=('GPL')
+depends=(
+)
+makedepends=(
+ 'go'
+ 'git'
+)
+
+source=(
+ "$_pkgname::git://github.com/kovetskiy/sink#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/sink/systemd/sink.service" "$pkgdir/usr/lib/systemd/user/sink.service"
+}