pkgname=arch-wiki-lite-libre
_srcname=arch-wiki-lite
pkgver=20140625
_codever=20140625
_bl_commit=bec016c
pkgrel=1
pkgdesc="The wiki without html.  1/9 as big, easily searched and viewable on console."
arch=('any')
url="http://kmkeen.com/arch-wiki-lite/"
_watch="http://www.archlinux.org/packages/community/any/arch-wiki-docs/"
license=('GPL' 'FDL')
depends=('bash' 'gzip')
makedepends=('python' 'arch-wiki-docs')
conflicts=('arch-wiki-lite')
source=("http://kmkeen.com/$_srcname/$_srcname-$_codever.tar.gz"
        'http://pkgbuild.com/~kkeen/misc/parabolize.py'
        "blacklist.txt::https://projects.parabola.nu/blacklist.git/plain/blacklist.txt?id=$_bl_commit")
md5sums=('e2fc8fe1df6fa5055ba3ffd45865d7a9'
         '70906b11126a96a8595a96849a841f4f'
         'c73e2205a910be34905f6dc4332f2f20')

build() {
  cd "$srcdir/$_srcname"
  LC_ALL=en_US.UTF-8 python3 wiki_lite.py
  mkdir wiki2
  LC_ALL=en_US.UTF-8 python3 ../parabolize.py ../blacklist.txt ./wiki/ ./wiki2/
}

package() {
  cd "$srcdir/$_srcname"
  install -d "$pkgdir/usr/share/doc/arch-wiki/text/"
  install -m 0644 wiki2/* "$pkgdir/usr/share/doc/arch-wiki/text/"
  install -Dm 0755 wiki-search "$pkgdir/usr/bin/wiki-search"
}

