summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgor Kovetskiy2019-12-27 14:50:49 +0300
committerEgor Kovetskiy2019-12-27 14:50:49 +0300
commitba37d43c1b44414864b3d747058fb7f9288a945b (patch)
treece63ef7678162807ea873d4b61b45d1f9a15b901
downloadaur-ba37d43c1b44414864b3d747058fb7f9288a945b.tar.gz
sync github.com/kovetskiy/pkgbuilds
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD67
2 files changed, 81 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..41d7ac29a10
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,14 @@
+pkgbase = taskfile-git
+ pkgdesc = A task runner / simpler Make alternative written in Go
+ pkgver = autogenerated
+ pkgrel = 1
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = go
+ makedepends = git
+ source = task::git://github.com/go-task/task#branch=master
+ md5sums = SKIP
+
+pkgname = taskfile-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..0804a2cae8b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,67 @@
+# Maintainer: Egor Kovetskiy <e.kovetskiy@gmail.com>
+pkgname=taskfile-git
+_pkgname=task
+pkgver=${PKGVER:-autogenerated}
+pkgrel=${PKGREL:-1}
+pkgdesc="A task runner / simpler Make alternative written in Go"
+arch=('i686' 'x86_64')
+license=('GPL')
+depends=(
+)
+makedepends=(
+ 'go'
+ 'git'
+)
+
+_goname="github.com/go-task/task"
+source=(
+ "$_pkgname::git://github.com/go-task/task#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/$(dirname $_goname)"
+
+ export GOPATH="$srcdir/go"
+
+ mv "$srcdir/$_pkgname" "$srcdir/go/src/$_goname"
+ cd "$srcdir/go/src/$_goname/"
+
+ echo ":: Building binary"
+ go get -v \
+ -gcflags "-trimpath $GOPATH/src" ./cmd/...
+}
+
+package() {
+ find "$srcdir/go/bin/" -type f -executable | while read filename; do
+ install -DT "$filename" "$pkgdir/usr/bin/$(basename $filename)"
+ done
+}