# Maintainer: Luke Shumaker <lukeshu@sbcglobal.net>

pkgname='erlehmann-redo'
pkgdesc="Nils Dagsson Moskopp's implmentation of the redo build system (compatible with apenwarr-redo)"
url="http://news.dieweltistgarnichtso.net/bin/redo-sh.html"
license=('AGPL3') # or any later version
pkgver=20150916
_pkgver='commit=bf9bb6121bd232aed847d9d809388b766aa09d0c'

pkgrel=1
arch=(any)
depends=(sh findutils coreutils)
provides=('redo' 'apenwarr-redo')
conflicts=('redo' 'apenwarr-redo')

source=(https://repo.parabola.nu/other/$pkgname/$pkgname-$pkgver.tar.gz)
md5sums=('8243491208be2f98ee2fa9cc9e7cf35a')

mksource=("$pkgname-$pkgver::git+http://news.dieweltistgarnichtso.net/bin.git#${_pkgver}")
mkmd5sums=(SKIP)

mksource() {
  cd "$srcdir/$pkgname-$pkgver"
  find * -not -name 'redo*' -delete
  rm -f -- *.id
}

package() {
  cd "$srcdir/$pkgname-$pkgver"
  install -Dm644 redo-sh              "$pkgdir/usr/share/doc/$pkgname/redo-sh.html"
  install -Dm644 redo-dot-example     "$pkgdir/usr/share/doc/$pkgname/redo-dot-example"
  install -Dm644 redo-dot-example.png "$pkgdir/usr/share/doc/$pkgname/redo-dot-example.png"
  install -Dm644 redo.1               "$pkgdir/usr/share/man/man1/redo.1"
  for file in redo redo-*; do
    if [ -x "$file" ]; then
      install -Dm755 "$file" "$pkgdir/usr/bin/$file"
    fi
  done
}
