# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=mitmproxy
pkgver=0.18.2
pkgrel=0
pkgdesc="An interactive SSL-capable intercepting HTTP proxy"
url="http://www.mitmproxy.org/"
arch="noarch"
license="MIT"
depends="python2 py-netlib py-flask py-urwid py-$pkgname py-itsdangerous"
makedepends="python2-dev py-setuptools"
subpackages="py-$pkgname:py"
source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$pkgname-$pkgver"

build() {
	cd "$builddir"
	python2 setup.py build || return 1
}

package() {
	cd "$builddir"
	python2 setup.py install --prefix=/usr --root="$pkgdir" || return 1
}

py() {
	cd "$builddir"
	pkgdesc="$pkgname python bindings"
	install -d "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
}

sha512sums="39836063a041d7fd14bb82ccf2fb53262b8ec14b629197776e27ebfb2fc97103ee5b4af979ffe6db35103e833679e2e5a640295831d55a2cd0f20a602b559064  mitmproxy-0.18.2.tar.gz"
