From 615e485c85ef60fed4327dade9b9dd533a68ff4c Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Mon, 9 Oct 2017 11:54:04 +0200 Subject: python-oauth2 neu --- python-oauth2/PKGBUILD | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 python-oauth2/PKGBUILD (limited to 'python-oauth2') diff --git a/python-oauth2/PKGBUILD b/python-oauth2/PKGBUILD new file mode 100644 index 00000000..b2477fc5 --- /dev/null +++ b/python-oauth2/PKGBUILD @@ -0,0 +1,77 @@ +# Maintainer: Erich Eckner +pkgbase=python-oauth2 +pkgname=(python-oauth2 python2-oauth2) +pkgver=1.9 +pkgrel=1 +pkgdesc='library for OAuth' +url='https://pypi.python.org/pypi/oauth2/' +arch=('any') +license=('MIT') +_depends=() +_optdepends=() +makedepends=( + 'python' 'python2' 'python-setuptools' 'python2-setuptools' + "${_depends[@]}" + "${_depends[@]/python/python2}" +) +source=("https://github.com/joestump/python-oauth2/archive/v${pkgver}.tar.gz") +sha512sums=('ba3183aa4e5512920fa540955321646c167d23dfd4bc2fad4d5426e1b71e35e91fe11f6cd919a7913015f9bf33c43849659cb97c862a57b5c2e288ace29ad452') + +prepare() { + cp -a python-oauth2-${pkgver}{,-py2} +} + +build() { + msg2 "Building python..." + ( + cd python-oauth2-${pkgver} + python setup.py build + ) + msg2 "Building python2..." + ( + cd python-oauth2-${pkgver}-py2 + python2 setup.py build + ) +} + +check() { + msg2 "Checking python..." + ( + cd python-oauth2-${pkgver} + python setup.py test + ) + msg2 "Checking python2..." + ( + cd python-oauth2-${pkgver}-py2 + python2 setup.py test + ) +} + +package_python-oauth2() { + _pyVer=$(python -V 2>&1 | cut -d' ' -f2 | cut -d. -f2) + depends=( + "python>=3.${_pyVer}" + "python<3.$((_pyVer+1))" + "${_depends[@]}" + ) + optdepends=("${_optdepends[@]}") + + cd python-oauth2-${pkgver} + python setup.py install --prefix=/usr --root="${pkgdir}" --skip-build + install -Dm 644 LICENSE.txt -t "${pkgdir}"/usr/share/licenses/${pkgname} +} + +package_python2-oauth2() { + _pyVer=$(python2 -V 2>&1 | cut -d' ' -f2 | cut -d. -f2) + depends=( + "python2>=2.${_pyVer}" + "python2<2.$((_pyVer+1))" + "${_depends[@]}" + "${_depends[@]/python/python2}" + ) + optdepends=("${_optdepends[@]/python/python2}") + + cd python-oauth2-${pkgver}-py2 + python2 setup.py install --prefix=/usr --root="${pkgdir}" --skip-build + install -Dm 644 LICENSE.txt -t "${pkgdir}"/usr/share/licenses/${pkgname} +} -- cgit v1.2.3-54-g00ecf