summaryrefslogtreecommitdiff
path: root/pcr/python-pyspf/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'pcr/python-pyspf/PKGBUILD')
-rw-r--r--pcr/python-pyspf/PKGBUILD48
1 files changed, 32 insertions, 16 deletions
diff --git a/pcr/python-pyspf/PKGBUILD b/pcr/python-pyspf/PKGBUILD
index f2e5794cd..375f04eff 100644
--- a/pcr/python-pyspf/PKGBUILD
+++ b/pcr/python-pyspf/PKGBUILD
@@ -1,28 +1,44 @@
# Maintainer: Luke Shumaker <lukeshu@parabola.nu>
-# Maintainer (AUR): Rich Li <rich@dranek.com>
-# Contributor (AUR): Samed Beyribey <ras0ir@eventualis.org>
-
-_pkgname=pyspf
-pkgname=python-$_pkgname
-_basever=2.0.12
-_patchver=t
-_pkgver=${_basever}${_patchver}
-pkgver=${_basever}.${_patchver}
+# Maintainer (AUR): Hao Zhang <hao at hao-zhang com>
+# Contributor (AUR): Rich Li <rich at dranek com>
+# Contributor (AUR): Samed Beyribey <ras0ir AT eventualis DOT org>
+
+pkgname=python-pyspf
+pkgver=2.0.14
+pkgrel=1
pkgdesc="Python implementation of the Sender Policy Framework (SPF) protocol"
+arch=('any')
url="https://pypi.python.org/pypi/pyspf"
license=('PSF')
-source=("https://pypi.python.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$_pkgver.tar.gz")
-md5sums=('c83143ad79074bf8c80235748a8a698f')
-pkgrel=5
-arch=('any')
-depends=('python-py3dns')
makedepends=('python-setuptools')
+depends=('python-py3dns' 'python')
optdepends=('python-authres: Return RFC 5451 Authentication Results headers')
-conflicts=(python2-pyspf)
+
+source=("https://files.pythonhosted.org/packages/d4/dc/5b3838ff90474e21fe0914920c53430f73402e07d6598ea228e61b74963e/pyspf-$pkgver.tar.gz")
+sha256sums=('57a7ef01bda090173aafb6af0106251686ed73f03db4e911fcd34c57fc347186')
+
+_version_constraint() # (dep_pkgname)
+{
+ local dep_pkgname=$1
+ local version=$(pacman -S --print-format='%v' ${dep_pkgname} | tail -n 1)
+ version=${version%-*}
+ local version_inc=${version%.*}.$(( ${version##*.} + 1 ))
+
+ echo -n "${dep_pkgname}>=${version}" "${dep_pkgname}<${version_inc}"
+}
+
+
+build() {
+ cd "$srcdir/pyspf-$pkgver"
+
+ python setup.py build
+}
package() {
- cd "$srcdir/$_pkgname-${_basever}"
+ depends+=( $(_version_constraint 'python') )
+
+ cd "$srcdir/pyspf-$pkgver"
python setup.py install --root="$pkgdir" --optimize=1
}