From 317b394dff065bb00384b2dbdf551643635eb420 Mon Sep 17 00:00:00 2001 From: Eldar Tsraev Date: Sun, 15 Mar 2015 15:53:24 +1300 Subject: [PATCH] Added Arch Linux PKGBUILD file --- PKGBUILD | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 PKGBUILD diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000..047d1bf0c --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,42 @@ +# Maintainer: Eldar Tsraev +pkgname=restic-git +pkgver= +pkgrel=1 +pkgdesc="Restic is a program that does backups right." +arch=('i686' 'x86_64') +url="https://github.com/restic/restic" +license=('BSD') +depends=('glibc') +makedepends=('git' 'go') +provides=('restic') +conflicts=('restic') +source=('restic-git::git+https://github.com/restic/restic') +md5sums=('SKIP') #generate with 'makepkg -g' + +pkgver() { + cd "$srcdir/$pkgname" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"; +} + +prepare() { + # git repo fetched by makepkg and it is possible to calculate a fancy version number. + # On the other hand we don't need to re-download source code with go-get... + export GOPATH="$srcdir" + export gorepo="github.com/restic/restic" + mkdir -p $GOPATH/src/github.com/restic + rm -rf $GOPATH/src/$gorepo + mv $srcdir/$pkgname $GOPATH/src/$gorepo +} + +build() { + go get -v $gorepo/cmd/restic +} + +package() { + # Copying file(s) + install -Dm755 $GOPATH/bin/restic $pkgdir/usr/bin/restic + # Copying LICENCE file + install -Dm644 $GOPATH/src/$gorepo/LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE +} + +# vim:set ts=2 sw=2 et: