diff options
author | Luke Shumaker <lukeshu@parabola.nu> | 2022-09-26 17:50:40 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@parabola.nu> | 2024-01-08 09:50:55 -0700 |
commit | 49ff6428650cd63580e6499533c3f5d08f8893ed (patch) | |
tree | c654d760720c485638c6a2621057898b225262fb /pcr | |
parent | b1dd1c7517288b138e8770f5a18dea752abe7039 (diff) |
pcr/python-py3dns: Build for newer Python, clean up
Diffstat (limited to 'pcr')
-rw-r--r-- | pcr/python-py3dns/PKGBUILD | 68 |
1 files changed, 10 insertions, 58 deletions
diff --git a/pcr/python-py3dns/PKGBUILD b/pcr/python-py3dns/PKGBUILD index b6a5dae11..e04625965 100644 --- a/pcr/python-py3dns/PKGBUILD +++ b/pcr/python-py3dns/PKGBUILD @@ -3,15 +3,14 @@ # Contributor: Samed Beyribey <ras0ir AT eventualis DOT org> pkgname=python-py3dns -_pkgname=py3dns +_pkgname=${pkgname#python-} pkgver=3.2.1 -pkgrel=2 +pkgrel=3 pkgdesc="A module for looking up DNS entries in Python applications" arch=('any') -url="https://launchpad.net/py3dns" -license=('custom:PSF') +url="https://launchpad.net/${_pkgname}" +license=('custom:PSF-like') -depends=('python') makedepends=('python-setuptools') source=("https://launchpad.net/${_pkgname}/trunk/${pkgver}/+download/${_pkgname}-${pkgver}.tar.gz"{,.asc}) @@ -19,63 +18,16 @@ md5sums=('35a441081a1acfa0cf78e7ccc2ff9449' 'SKIP') validpgpkeys=('E7729BFFBE85400FEEEE23B178D7DEFB9AD59AF1') # Donald Scott Kitterman - -_version_constraint() # (dep_pkgname [precision]) -{ - Log() { [[ "${FUNCNAME[2]}" == package ]] && echo "$@" >&2 || : ; } - - - local dep_pkgname=$1 - declare -i req_precision=$2 - local full_version=$(pacman -S --print-format='%v' ${dep_pkgname} 2> /dev/null | tail -n 1) - local n_dots=$(tmp=${full_version%-*} ; tmp=${tmp//[^\.]} ; echo "${#tmp}" ;) - local def_precision=$(( n_dots + 1 )) - local is_prec_valid=$(( req_precision > 0 && req_precision <= def_precision )) - local precision=$((( is_prec_valid )) && echo ${req_precision} || echo ${def_precision}) - local pkgver_rx='[0-9A-Za-z_]+' - pkgver_rx=$(sed 's|\]|\+]|' <<<${pkgver_rx}) # according to the wiki, '+' is not allowed, - # but some pkgver have it (eg: 5.15.10+kde+r130) - local subver_rx='\.'${pkgver_rx} - local pkgrel_rx='[0-9]+' - local garbage_rx='[^0-9].*' - local capture_rx=${pkgver_rx} - for (( n_dots=1 ; n_dots < precision ; ++n_dots )) ; do capture_rx+=${subver_rx} ; done ; - local version pkgrel has_dot_char version_min version_max constraint_string - declare -i subver subver_inc pkgrel_inc - - if [[ "${full_version}" =~ ^(${capture_rx})(${subver_rx})*-(${pkgrel_rx}).*$ ]] - then version=${BASH_REMATCH[1]} # pkgver cut to the requested precision - #unused=${BASH_REMATCH[2]} # discarded pkgver segments - pkgrel=${BASH_REMATCH[3]} # pkgrel with non-numerics right-trimmed - has_dot_char=$([[ "${version}" =~ \. ]] ; echo $(( ! $? )) ; ) - subver=$(sed "s|${garbage_rx}||" <<<${version##*.}) # right-trim from any non-numeric - version=$( (( has_dot_char )) && echo ${version%.*}.${subver} || echo ${subver} ) - subver_inc=$(( subver + 1 )) - pkgrel_inc=$(( pkgrel + 1 )) - version_min=$( (( ! is_prec_valid )) && echo ${full_version%-*}-${pkgrel} || \ - echo ${version} ) - version_max=$( ( (( ! is_prec_valid )) && echo ${full_version%-*}-${pkgrel_inc} ) || \ - ( [[ "${version}" =~ \. ]] && echo ${version%.*}.${subver_inc} ) || \ - echo ${subver_inc} ) - constraint_string="${dep_pkgname}>=${version_min} ${dep_pkgname}<${version_max}" - - Log "Applied version constraint: '${constraint_string}'" - else Log "ERROR: in _version_constraint() parsing: dep_pkgname='${dep_pkgname}' full_version='${full_version}'" - exit 1 - fi - - unset -f Log - - echo -n "${constraint_string}" +build() { + cd "$_pkgname-$pkgver" + python setup.py build } - package() { - # pin to strongly-coupled dependency versions - depends=( ${depends[*]/python/} $(_version_constraint python 2) ) - - cd "$srcdir"/$_pkgname-$pkgver + _python_version=$(pacman -S --print-format='%v' python|cut -d- -f1|cut -d. -f1,2) + depends=("python>=${_python_version}" "python<${_python_version%.*}.$(( ${_python_version##*.} + 1 ))") + cd "$_pkgname-$pkgver" python setup.py install --root="$pkgdir/" --optimize=1 install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" } |