2015-03-15 15:32:43 +00:00
|
|
|
# Maintainer: Florian Daniel <fd@noxa.de>
|
|
|
|
# Contributor: Eldar Tsraev <elts@culab.org>
|
|
|
|
# Contributor: Andreas Guth <andreas.guth@rwth-aachen.de>
|
2015-03-22 12:41:45 +00:00
|
|
|
options=(!strip)
|
2015-03-15 15:32:43 +00:00
|
|
|
pkgname=restic-git
|
2015-03-22 12:41:45 +00:00
|
|
|
pkgver=r360.e1acade
|
2015-03-15 15:32:43 +00:00
|
|
|
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>=1.3')
|
|
|
|
provides=('restic')
|
|
|
|
conflicts=('restic')
|
|
|
|
source=('restic-git::git+https://github.com/restic/restic')
|
|
|
|
md5sums=('SKIP')
|
|
|
|
|
2015-03-22 12:41:45 +00:00
|
|
|
importpath='github.com/restic/restic'
|
|
|
|
|
2015-03-15 15:32:43 +00:00
|
|
|
pkgver() {
|
|
|
|
cd "$srcdir/$pkgname"
|
|
|
|
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)";
|
|
|
|
}
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
# git repo is fetched by makepkg, prepare src so it is not re-downloaded during build()
|
2015-03-22 12:41:45 +00:00
|
|
|
export GOPATH="$srcdir/go"
|
|
|
|
mkdir -p "$GOPATH/src/$(dirname ${importpath})"
|
|
|
|
ln -sf "$srcdir/$pkgname" "$GOPATH/src/${importpath}"
|
2015-03-15 15:32:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
2015-03-22 12:41:45 +00:00
|
|
|
export GOPATH="$srcdir/go"
|
|
|
|
cd "$GOPATH/src/${importpath}/cmd/restic"
|
|
|
|
go get -ldflags -s -v .
|
|
|
|
go install -ldflags -s -v
|
2015-03-15 15:32:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2015-03-22 12:41:45 +00:00
|
|
|
export GOPATH="$srcdir/go"
|
|
|
|
|
2015-03-15 15:32:43 +00:00
|
|
|
# Copying file(s)
|
|
|
|
install -Dm755 $GOPATH/bin/restic $pkgdir/usr/bin/restic
|
2015-03-22 12:41:45 +00:00
|
|
|
install -Dm644 $GOPATH/src/${importpath}/LICENSE $pkgdir/usr/share/licenses/$pkgname/LICENSE
|
|
|
|
install -Dm644 $GOPATH/src/${importpath}/README.md $pkgdir/usr/share/doc/$pkgname/README
|
2015-03-15 15:32:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# vim:set ts=2 sw=2 et:
|