# $Id: PKGBUILD 79954 2012-11-15 02:34:24Z arodseth $
# Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Contributor: Chris Brannon <cmbrannon79@gmail.com>
# Contributor: Geoffroy Carrier <geoffroy.carrier@aur.archlinux.org>
# Contributor: Erol V. Aktay <e.aktay@gmail.com>

pkgname=python2-webpy
pkgver=0.37
pkgrel=4
pkgdesc='Simple but powerful web framework for python'
arch=('any')
url='http://webpy.org/'
license=('custom:public domain')
depends=('python2')
optdepends=('python2-flup: deploy web applications via FastCGI (recommended)'
            'python2-psycopg2: use PostgreSQL as the backing database'
            'mysql-python: use MySQL as the backing database'
            'python2-mako: alternative templating engine')
source=("http://webpy.org/static/web.py-$pkgver.tar.gz")
sha256sums=('748c7e99ad9e36f62ea19f7965eb7dd7860b530e8f563ed60ce3e53e7409a550')

build() {
  cd "$srcdir/web.py-$pkgver"

  echo 'web.py is in the public domain; you can use it for whatever purpose with absolutely no restrictions.' > LICENSE 
}

package() {
  cd "$srcdir/web.py-$pkgver"

  python2 setup.py install --root="$pkgdir" --optimize=1
  find "$pkgdir" -name '*.py' -print0 |xargs -0 \
    sed -i -e 's,^#!/usr/bin/env python$,#!/usr/bin/env python2,' \
    -e 's,^#!/usr/bin/python$,#!/usr/bin/python2,'
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

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