summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorStanislav Seletskiy2020-01-18 22:58:27 +0300
committerStanislav Seletskiy2020-01-18 22:58:27 +0300
commit8ddb526771d89a7acd0ba342165a68f75f6578c6 (patch)
tree15e21c2c90327482da0b76c2bf74055624425bb4
downloadaur-8ddb526771d89a7acd0ba342165a68f75f6578c6.tar.gz
initial commit
-rw-r--r--.SRCINFO16
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD72
-rw-r--r--zeusd.service10
4 files changed, 102 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..af2caf792a9
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = zeus-git
+ pkgdesc = zfs backup tool
+ pkgver = 20200118.9_2dd8962
+ pkgrel = 1
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = go
+ makedepends = git
+ source = zeus::git://github.com/reconquest/zeus.git#branch=master
+ source = zeusd.service
+ md5sums = SKIP
+ md5sums = 0e60533305684a378c0abe73a19b8169
+
+pkgname = zeus-git
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..ad6cd65abcd
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/*.pkg.*
+/pkg
+/src
+/zeus
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..7d61d99e571
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,72 @@
+# Maintainer: Stanislav Seletskiy <s.seletskiy@gmail.com>
+pkgname=zeus-git
+_pkgname=zeus
+pkgver=20200118.9_2dd8962
+pkgrel=1
+pkgdesc="zfs backup tool"
+arch=('i686' 'x86_64')
+license=('GPL')
+depends=(
+)
+makedepends=(
+ 'go'
+ 'git'
+)
+
+source=(
+ "$_pkgname::git://github.com/reconquest/zeus.git#branch=${BRANCH:-master}"
+ "zeusd.service"
+)
+
+md5sums=('SKIP'
+ '0e60533305684a378c0abe73a19b8169')
+
+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" ./cmd/...
+}
+
+package() {
+ find "$srcdir/go/bin/" -type f -executable | while read filename; do
+ install -DT "$filename" "$pkgdir/usr/bin/$(basename $filename)"
+ done
+ install -DT -m0755 "$srcdir/zeusd.service" "$pkgdir/usr/lib/systemd/system/zeusd.service"
+}
diff --git a/zeusd.service b/zeusd.service
new file mode 100644
index 00000000000..a01c0dd61b5
--- /dev/null
+++ b/zeusd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=zfs backup tool
+Requires=zfs.target
+
+[Service]
+ExecStart=/usr/bin/zeusd backup
+Type=oneshot
+
+[Install]
+WantedBy=basic.target