diff options
author | Marcell Meszaros | 2022-07-04 02:59:43 +0200 |
---|---|---|
committer | Marcell Meszaros | 2022-07-04 02:59:43 +0200 |
commit | 878482cec9ed4527e73f705fecaa8c9c2f52f879 (patch) | |
tree | 73c5af3a2d0bbd36ca0991126d4a2588d9ffb243 | |
parent | c67e1a13aa690dfc095c5051d33e61843387ce42 (diff) | |
download | aur-python2-cachecontrol.tar.gz |
0.12.6-7: refactor depends and PKGBULD format
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | PKGBUILD | 41 |
2 files changed, 34 insertions, 23 deletions
@@ -1,22 +1,22 @@ pkgbase = python2-cachecontrol pkgdesc = httplib2 caching for requests (legacy Python 2 version) pkgver = 0.12.6 - pkgrel = 6 + pkgrel = 7 url = https://pypi.org/project/cachecontrol/0.12.6/ arch = any license = Apache makedepends = python2-setuptools - depends = python2 - depends = python2-msgpack - depends = python2-requests optdepends = python2-lockfile: for the FileCache - optdepends = python2-cherrypy: for check() function during build - optdepends = python2-lockfile: for check() function during build - optdepends = python2-mock: for check() function during build - optdepends = python2-pytest: for check() function during build + optdepends = python2-cherrypy: needed for check() during build + optdepends = python2-lockfile: needed for check() during build + optdepends = python2-mock: needed for check() during build + optdepends = python2-pytest: needed for check() during build source = cachecontrol-0.12.6.tar.gz::https://github.com/ionrock/cachecontrol/archive/refs/tags/v0.12.6.tar.gz source = 0001-Remove-unnecessary-console-script.patch sha256sums = 2ec120838f445bff473cd8b8206ddae3650679142976927179743fabb876f3e3 sha256sums = a2c93d4852887152027140bdd54030d5363876b02e5eabee6a018d4e946a87b1 pkgname = python2-cachecontrol + depends = python2 + depends = python2-msgpack + depends = python2-requests @@ -1,28 +1,27 @@ # Contributor: Marcell Meszaros < marcell.meszaros AT runbox.eu > # Contributor: Eli Schwartz <eschwartz@archlinux.org> -_name=cachecontrol pkgname='python2-cachecontrol' +_name="${pkgname#python2-}" pkgver=0.12.6 -pkgrel=6 +pkgrel=7 pkgdesc="httplib2 caching for requests (legacy Python 2 version)" arch=('any') url="https://pypi.org/project/${_name}/${pkgver}/" license=('Apache') -depends=( - 'python2' +makedepends=('python2-setuptools') +optdepends=('python2-lockfile: for the FileCache') +_depends_that_are_checkdepends=( 'python2-msgpack' 'python2-requests' ) -optdepends=('python2-lockfile: for the FileCache') -makedepends=('python2-setuptools') -_checkdepends_optional=( +_checkdepends_needed=( 'python2-cherrypy' 'python2-lockfile' 'python2-mock' 'python2-pytest' ) -optdepends+=("${_checkdepends_optional[@]/%/: for check() function during build}") +optdepends+=("${_checkdepends_needed[@]/%/: needed for check() during build}") _tarname="${_name}-${pkgver}" source=("${_tarname}.tar.gz::https://github.com/ionrock/${_name}/archive/refs/tags/v${pkgver}.tar.gz" "0001-Remove-unnecessary-console-script.patch") @@ -30,12 +29,12 @@ sha256sums=('2ec120838f445bff473cd8b8206ddae3650679142976927179743fabb876f3e3' 'a2c93d4852887152027140bdd54030d5363876b02e5eabee6a018d4e946a87b1') _checkinstalled() { - pacman --deptest $1 + pacman --deptest $@ } prepare() { cd "${_tarname}" - patch -p1 -i '../0001-Remove-unnecessary-console-script.patch' + patch --verbose -p1 -i '../0001-Remove-unnecessary-console-script.patch' } build() { @@ -44,16 +43,28 @@ build() { } check() { - ( _checkinstalled "${_checkdepends_optional[@]}" > /dev/null ) \ - || echo "Skipping testing: checkdepends not installed: $(_checkinstalled ${_checkdepends_optional[*]})"; \ + ( _checkinstalled "${_checkdepends_needed[@]}" "${_depends_that_are_checkdepends[@]}" > /dev/null ) \ + || echo "Skipping testing: checkdepends not installed:"; \ + ( _checkinstalled "${_checkdepends_needed[@]}" "${_depends_that_are_checkdepends[@]}" ) || \ return 0 cd "${_tarname}" - python2 -m pytest + ( + echo '-- Using LC_ALL=C.UTF-8 locale to ensure UTF-8 filesystem encoding is used in Python 2' + export LC_ALL=C.UTF-8 + export PYTHONDONTWRITEBYTECODE=1 + export PYTHONPATH="${PWD}/build/lib:${PYTHONPATH}" + python2 -m pytest -v + ) } package() { + depends=( + 'python2' + "${_depends_that_are_checkdepends[@]}" + ) - cd "${srcdir}"/${_name}-${pkgver} - python2 setup.py install --root="${pkgdir}" --optimize=1 --skip-build + cd "${_tarname}" + python2 setup.py install --root="${pkgdir}" --prefix='/usr' --optimize=1 --skip-build + install --verbose -Dm 644 'README.rst' -t "${pkgdir}/usr/share/doc/${pkgname}" } |