45 lines
1.5 KiB
Bash
45 lines
1.5 KiB
Bash
# Template file for 'python-requests'
|
|
pkgname=python-requests
|
|
version=2.11.1
|
|
revision=1
|
|
noarch=yes
|
|
wrksrc="requests-${version}"
|
|
build_style="python-module"
|
|
python_versions="2.7 3.4"
|
|
hostmakedepends="
|
|
python-setuptools python3.4-setuptools python-chardet python3.4-chardet
|
|
python-urllib3 python3.4-urllib3"
|
|
makedepends="${hostmakedepends}"
|
|
depends="python-chardet python-urllib3 ca-certificates"
|
|
pycompile_module="requests"
|
|
short_desc="Python2 HTTP library for human beings"
|
|
maintainer="Alessio Sergi <al3hex@gmail.com>"
|
|
homepage="http://python-requests.org/"
|
|
license="Apache-2.0"
|
|
# distfiles="${PYPI_SITE}/r/requests/requests-${version}.tar.gz"
|
|
distfiles="https://github.com/kennethreitz/requests/archive/v${version}.tar.gz"
|
|
checksum=e8e5710ae923a00e45631f0e47c30ebfc83b7a8c4a7a818f78bf820f9b607558
|
|
|
|
pre_build() {
|
|
# remove bundled cacerts
|
|
rm -f requests/cacert.pem
|
|
}
|
|
post_install() {
|
|
# replace bundled copy of chardet and urllib3
|
|
for pyver in $python_versions; do
|
|
rm -rf ${DESTDIR}/usr/lib/python${pyver}/site-packages/requests/packages/{chardet,urllib3}
|
|
ln -sf ../../chardet ${DESTDIR}/usr/lib/python${pyver}/site-packages/requests/packages/chardet
|
|
ln -sf ../../urllib3 ${DESTDIR}/usr/lib/python${pyver}/site-packages/requests/packages/urllib3
|
|
done
|
|
}
|
|
|
|
python3.4-requests_package() {
|
|
noarch=yes
|
|
depends="python3.4-chardet python3.4-urllib3 ca-certificates"
|
|
pycompile_version="3.4"
|
|
pycompile_module="requests"
|
|
short_desc="${short_desc/Python2/Python3.4}"
|
|
pkg_install() {
|
|
vmove usr/lib/python3.4
|
|
}
|
|
}
|