# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=py-flask-login
_pkgname=Flask-Login
pkgver=0.4.0
pkgrel=1
pkgdesc="Flask user session management"
url="https://pypi.python.org/pypi/Flask-Login"
arch="noarch"
license="BSD"
depends="py-flask"
depends_dev=""
makedepends="python2-dev python3-dev py-setuptools"
install=""
subpackages="py2-flask-login:py2 py3-flask-login:py3"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"

builddir="$srcdir"/$_pkgname-$pkgver

build() {
	cd "$builddir"
	python2 setup.py build
	python3 setup.py build
}

package() {
	mkdir -p "$pkgdir"
}

_py() {
        local python="$1"
        pkgdesc="$pkgdesc ${python#python}"
        depends="$depends $python"
        install_if="$pkgname=$pkgver-r$pkgrel $python"

        cd "$builddir"
        $python setup.py install --prefix=/usr --root="$subpkgdir"
}

py2() {
	cd "$builddir"
	_py python2
}

py3() {
	cd "$builddir"
	_py python3
}

sha512sums="07f369887f933ca36d4c9935c457b15c2083195f9c05c4fa59a33ed6779664cc1791a7832966296cf81f3218c6b617722fa03c5b019525b143753772a3329f57  Flask-Login-0.4.0.tar.gz"
