# Contributor: Limao Luo <luolimao+AUR@gmail.com>
# Contributor: David Campbell <davekong@archlinux.us>
# Contributor: Cilyan Olowen <gaknar@gmail.com>
# Maintainer : Parabola GNU / Linux-libre Aurélien DESBRIÈRES <aurelien@hackers.camp>

_pkgname=PasteDeploy
pkgname=python2-paste-deploy
pkgver=1.5.0
pkgrel=2
pkgdesc="Load, configure, and compose WSGI applications and servers"
arch=(any)
url=http://pythonpaste.org/deploy/
license=(custom)
depends=(python2)
makedepends=(python2-setuptools)
source=(http://pypi.python.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz)

prepare() {
    find $_pkgname-$pkgver -name '*.py' -type f -exec sed -ri 's:^#!/usr/bin/(env )?python$:&2:' '{}' \;
}

build() {
    cd $_pkgname-$pkgver/
    python2 setup.py build
}

package() {
    cd $_pkgname-$pkgver/
    python2 setup.py install --root="$pkgdir" --optimize=1
    install -Dm644 docs/license.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}