# Maintainer: Jeroen Hoekx <jeroen.hoekx AT hamok DOT be>
pkgname=rear-git
pkgver=20120614
pkgrel=1
pkgdesc="Linux Disaster Recovery"
arch=(any)
url="http://relax-and-recover.org/"
license=('GPL')
depends=(lsb-release iproute2 parted cpio openssl gawk)
optdepends=( 'nfs-utils: to save images to NFS shares'
             'cdrkit: to create ISO images'
             'syslinux: to create bootable media')
makedepends=('git' 'asciidoc' 'xmlto')
provides=('rear')
backup=('etc/rear/local.conf')
source=()
md5sums=()

_gitroot=https://github.com/rear/rear.git
_gitname=rear

build() {
  cd "$srcdir"
  msg "Connecting to GIT server...."

  if [[ -d "$_gitname" ]]; then
    cd "$_gitname" && git pull origin
    msg "The local files are updated."
  else
    git clone "$_gitroot" "$_gitname"
  fi

  msg "GIT checkout done or server timeout"
  msg "Starting build..."

  rm -rf "$srcdir/$_gitname-build"
  git clone "$srcdir/$_gitname" "$srcdir/$_gitname-build"
  cd "$srcdir/$_gitname-build"
}

package() {
  cd "$srcdir/$_gitname-build"
  make DESTDIR="$pkgdir/" install
}

# vim:set ts=2 sw=2 et:
