# $Id: PKGBUILD 101463 2013-11-26 03:45:03Z fyan $
# Maintainer: Felix Yan <felixonmars@gmail.com>
# Contributor: David Campbell <davekong@archlinux.us>
# Contributor: Cilyan Olowen <gaknar@gmail.com>

pkgname=python2-paste
pkgver=1.7.5.1
pkgrel=4
pkgdesc="Tools for using a Web Server Gateway Interface stack."
arch=('any')
url="http://pythonpaste.org/index.html"
license=('MIT')
depends=('python2')
makedepends=('python2-setuptools')
source=("http://pypi.python.org/packages/source/P/Paste/Paste-${pkgver}.tar.gz")
optdepends=('python2-flup: WSGI utilities'
            'python-openid: Support for OpenID')
md5sums=('7ea5fabed7dca48eb46dc613c4b6c4ed')

prepare() {
  cd Paste-${pkgver}
  sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
         -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
      $(find . -name '*.py')
}

package() {
  cd Paste-${pkgver}
  python2 setup.py install --root="${pkgdir}" --optimize=1

  install -Dm644 docs/license.txt "${pkgdir}/usr/share/licenses/$pkgname/license.txt"
  chmod 644 ${pkgdir}/usr/lib/python*/site-packages/paste/evalexception/media/MochiKit.packed.js
}
