# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
setvar pkgname = 'py-requests'
setvar _pkgname = 'requests'
setvar pkgver = '2.18.4'
setvar pkgrel = '0'
setvar pkgdesc = ""A HTTP request library for Python""
setvar url = ""http://www.python-requests.org/""
setvar arch = ""noarch""
setvar license = ""ASL 2.0""
# Requirements for tests are not available in main
setvar options = ""!check""
setvar depends = ""py-chardet py-idna py-certifi py-urllib3""
setvar makedepends = ""python2-dev py-setuptools python3-dev""
setvar subpackages = ""py3-${pkgname#py-}:_py3 py2-${pkgname#py-}:_py2""
setvar source = ""https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz""
setvar builddir = ""$srcdir/$_pkgname-$pkgver""

proc build {
	cd $builddir
	python2 setup.py build
	python3 setup.py build
}

proc package {
	mkdir -p $pkgdir
}

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

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

proc _py2 {
	setvar replaces = "$pkgname"
	setvar depends = "${depends//py-/py2-}"
	_py python2
}

proc _py3 {
	setvar depends = "${depends//py-/py3-}"
	_py python3
}

setvar sha512sums = ""5c59bed82ac1094194f04a973b299f7d783264d372abd7a5229295bccc6b2f7a9f082ee4b0dff348e9c22cf68ddbd7cb67f60fd0b7d9eda41c02e40d075e9472  requests-2.18.4.tar.gz""