# $Id: PKGBUILD 102107 2013-12-05 10:44:35Z arodseth $
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Vesa Kaihlavirta <vegai@iki.fi>
# Contributor: Philip Nilsson <pnilsson@nullref.se>

pkgname=alex
pkgver=3.1.3
pkgrel=1
pkgdesc='Lexical analyser generator for Haskell'
arch=('x86_64' 'i686')
url='http://hackage.haskell.org/package/alex'
license=('custom:BSD3')
depends=('gmp')
makedepends=('ghc=7.6.3-1' 'haskell-quickcheck>=2' 'happy')
source=("http://hackage.haskell.org/packages/archive/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz")
sha256sums=('8d41a6e72a016155f00c846f7146ab4b27fe9640668a4b592d6a9b856f970a92')

build() {
  cd "$pkgname-$pkgver"

  runghc Setup.lhs configure --prefix=/usr --datasubdir="$pkgname"
  runghc Setup.lhs build
}

package() {
  cd "$pkgname-$pkgver"

  runghc Setup.lhs copy --destdir="$pkgdir"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/alex/BSD3"
  # Doc only contains the license
  rm -rf $pkgdir/usr/share/doc
}

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