49 lines
1.6 KiB
Bash
49 lines
1.6 KiB
Bash
# Template file for 'python-requests'
|
|
pkgname=python-requests
|
|
version=2.12.1
|
|
revision=1
|
|
noarch=yes
|
|
wrksrc="requests-${version}"
|
|
build_style="python-module"
|
|
hostmakedepends="python-setuptools python3-setuptools python-chardet python3-chardet
|
|
python-urllib3 python3-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"
|
|
checksum=2109ecea94df90980be040490ff1d879971b024861539abb00054062388b612e
|
|
|
|
pre_build() {
|
|
# remove bundled cacerts
|
|
rm -f requests/cacert.pem
|
|
}
|
|
post_install() {
|
|
# replace bundled copy of chardet and urllib3
|
|
for pyver in $py2_ver $py3_ver; 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-requests_package() {
|
|
noarch=yes
|
|
pycompile_module="requests"
|
|
replaces="python3.4-requests>=0"
|
|
depends="python3-chardet python3-urllib3 ca-certificates"
|
|
short_desc="${short_desc/Python2/Python3}"
|
|
pkg_install() {
|
|
vmove usr/lib/python3*
|
|
}
|
|
}
|
|
python3.4-requests_package() {
|
|
noarch=yes
|
|
build_style=meta
|
|
short_desc="${short_desc/Python2/Python3.4} (transitional dummy package)"
|
|
depends="python3-requests>=${version}_${revision}"
|
|
}
|