77 lines
2.9 KiB
Bash
77 lines
2.9 KiB
Bash
# Maintainer: Jesus E. <heckyel@riseup.net>
|
|
|
|
pkgbase=python-requests
|
|
pkgname=('python-requests' 'tauthon-requests')
|
|
pkgver=2.23.0
|
|
_debver=$pkgver
|
|
_debrel=2
|
|
pkgrel=3
|
|
arch=('any')
|
|
url='https://requests.readthedocs.io/'
|
|
license=('Apache-2.0')
|
|
makedepends=('python-setuptools' 'tauthon-setuptools' 'python-chardet' 'tauthon-chardet'
|
|
'python-urllib3' 'tauthon-urllib3' 'python-idna' 'tauthon-idna' 'quilt')
|
|
source=("$pkgbase-$pkgver.tar.gz::https://github.com/psf/requests/archive/v$pkgver.tar.gz"
|
|
"https://repo.hyperbola.info:50000/sources/${pkgbase}/requests_${_debver}+dfsg-${_debrel}.debian.tar.xz"{,.sig}
|
|
"certs.patch"
|
|
"requests-pytest-5.patch")
|
|
sha512sums=('a8e670d928fce3531629a6d73ee6b47882f3eba47684841bfce44376781b2b9c5c97186e1750ee582b0c11fa67c983f340f95eb2a4f19042f4cbc77ae090a69c'
|
|
'16f0f0ed89fa60f1307f51e949e248b9a6ea9c6f0b92e1599f53dfab4e4d9af5712641c1d5bcc18d4ad453cda9d98cf14d62fa62c1a0d2af6fa0401d7a6072e8'
|
|
'SKIP'
|
|
'424a3bb01b23409284f6c9cd2bc22d92df31b85cfd96e1d1b16b5d68adeca670dfed4fff7977d8b10980102b0f780eacc465431021fcd661f3a17168a02a39a3'
|
|
'08dbc23289d8d8afa3e122f63a7eb6c27e9272aa2f8a1bb29896f27f0c5d51d0b6feed57c8d93bced321a0be39d2852194ff8db7ff7af58ab09e91be0ee4e556')
|
|
validpgpkeys=('C92BAA713B8D53D3CAE63FC9E6974752F9704456') # André Silva
|
|
|
|
prepare() {
|
|
cd "$srcdir"/requests-$pkgver
|
|
if [[ ${pkgver%.*} = ${_debver%.*} ]]; then
|
|
# Debian patches
|
|
export QUILT_PATCHES=debian/patches
|
|
export QUILT_REFRESH_ARGS='-p ab --no-timestamps --no-index'
|
|
export QUILT_DIFF_ARGS='--no-timestamps'
|
|
|
|
mv "$srcdir"/debian .
|
|
|
|
quilt push -av
|
|
fi
|
|
patch -p1 -i ../requests-pytest-5.patch
|
|
sed -e '/certifi/d' \
|
|
-e "s/,<.*'/'/" \
|
|
-i setup.py
|
|
patch -p1 -i "$srcdir"/certs.patch
|
|
|
|
cd "$srcdir"
|
|
cp -a requests-$pkgver{,-tauthon}
|
|
find requests-$pkgver-tauthon -name \*.py -exec sed -r 's|^#!(.*)python$|#!\1tauthon|' -i {} +
|
|
}
|
|
|
|
build() {
|
|
cd "$srcdir"/requests-$pkgver
|
|
python setup.py build
|
|
|
|
cd "$srcdir"/requests-$pkgver-tauthon
|
|
tauthon setup.py build
|
|
}
|
|
|
|
package_python-requests() {
|
|
pkgdesc="Python HTTP for Humans"
|
|
depends=('python-urllib3' 'python-chardet' 'python-idna')
|
|
optdepends=('python-pysocks: SOCKS proxy support')
|
|
|
|
cd "$srcdir"/requests-$pkgver
|
|
python setup.py install --skip-build -O1 --root="$pkgdir"
|
|
install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
|
|
}
|
|
|
|
package_tauthon-requests() {
|
|
pkgdesc="Tauthon HTTP for Humans"
|
|
depends=('tauthon-urllib3' 'tauthon-chardet' 'tauthon-idna')
|
|
optdepends=('tauthon-ndg-httpsclient: HTTPS requests with SNI support'
|
|
'tauthon-grequests: asynchronous requests with gevent'
|
|
'tauthon-pysocks: SOCKS proxy support')
|
|
|
|
cd "$srcdir"/requests-$pkgver-tauthon
|
|
tauthon setup.py install --skip-build -O1 --root="$pkgdir"
|
|
install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
|
|
}
|