# $Id: PKGBUILD 108026 2014-03-21 09:42:16Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>

pkgname=arch-wiki-docs
pkgdesc="Pages from Arch Wiki optimized for offline browsing"
pkgver=20140321
pkgrel=1
arch=('any')
url="https://github.com/lahwaacz/arch-wiki-docs"
license=('FDL')
options=('!strip')
makedepends=('git' 'python' 'python-simplemediawiki' 'python-lxml' 'python-cssselect')
source=('git://github.com/lahwaacz/arch-wiki-docs.git')
md5sums=('SKIP')

pkgver() {
  date "+%Y%m%d"
}

build() {
  cd "$pkgname"
  python arch-wiki-docs.py --output-directory "$srcdir/build_wiki"
}

package() {
  install -dm755 "$pkgdir/usr/share/doc/arch-wiki/html"
  cp -r "$srcdir"/build_wiki/* "$pkgdir/usr/share/doc/arch-wiki/html/"
}
