# Template file for 'python-cryptography'
pkgname=python-cryptography
version=1.8.2
revision=1
wrksrc="cryptography-${version}"
build_style=python-module
hostmakedepends="python-setuptools python3-setuptools libressl-devel
 python-enum34 python-ipaddress python-six python3-six python-asn1crypto
 python3-asn1crypto python-cffi python3-cffi python-idna python3-idna"
makedepends="libressl-devel python-devel python3-devel"
depends="python-setuptools python-cffi python-asn1crypto python-six
 python-enum34 python-idna python-ipaddress"
pycompile_module="cryptography"
short_desc="Python2 library that provides cryptographic recipes and primitives"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="https://github.com/pyca/cryptography"
license="3-clause-BSD, Apache-2.0"
distfiles="${PYPI_SITE}/c/cryptography/cryptography-${version}.tar.gz"
checksum=8e88ebac371a388024dab3ccf393bf3c1790d21bc3c299d5a6f9f83fb823beda

pre_build() {
	sed -i '/packaging/d' setup.py
	sed -i 's/packaging.version/pkg_resources.extern.\0/' src/cryptography/utils.py
}
post_install() {
	vlicense LICENSE
}

python3-cryptography_package() {
	depends="python3-setuptools python3-cffi python3-asn1crypto
	 python3-six python3-idna"
	pycompile_module="cryptography"
	replaces="python3.4-cryptography>=0"
	short_desc="${short_desc/Python2/Python3}"
	pkg_install() {
		vmove usr/lib/python3*
		vlicense LICENSE
	}
}
python3.4-cryptography_package() {
	build_style=meta
	short_desc="${short_desc/Python2/Python3.4} (transitional dummy package)"
	depends="python3-cryptography>=${version}_${revision}"
}
