summaryrefslogtreecommitdiff
path: root/python-oauth2/PKGBUILD
blob: 47da1408102f278efc81461d30fa319b3f3a500b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# Maintainer: Erich Eckner <arch at eckner dot net>
pkgbase=python-oauth2
_pkgname=python-oauth2
pkgname=(python-oauth2 python2-oauth2)
pkgver=1.1.0
pkgrel='2'
pkgdesc='framework that aims at making it easy to provide authentication via OAuth 2.0 within an application stack/'
url='https://github.com/wndhydrnt/python-oauth2/'
arch=('any')
license=('MIT')
_deppy2=(
  'python2>=2.7'
  'python2<2.8'
)
_deppy=(
  'python>=3.7'
  'python<3.8'
)
_depends=(
  'python-mock'
  'python-mysql-connector'
  'python-nose'
  'python-pymongo'
  'python-memcached'
  'python-redis'
  'python-tornado')
_makedepends=(
  'python-setuptools')
_optdepends=(
  'python-memcached'
  'python-pymongo'
  'python-redis'
)
makedepends=(
  "${_deppy[@]}"
  "${_deppy2[@]}"
  "${_depends[@]}"
  "${_depends[@]/python/python2}"
  "${_makedepends[@]}"
  "${_makedepends[@]/python/python2}"
)
source=("$pkgbase-$pkgver.tar.gz::https://github.com/wndhydrnt/python-oauth2/archive/v${pkgver}.tar.gz")
sha512sums=('376fa73711c64a787472b4be4b1e9407311886ed237dbe29399425fb5f92e2b72fab479d694e4acdbaa572aa0c43840e21cfb8fc4f128ee81240a59a3dcdc1b3')

prepare() {
  cp -a python-oauth2-${pkgver}{,-py2}
}

build() {
  echo "Building python..."
  (
    cd python-oauth2-${pkgver}
    python setup.py build
  )
  echo "Building python2..."
  (
    cd python-oauth2-${pkgver}-py2
    python2 setup.py build
  )
}

check() {
  if [ "$(hostname)" = 'rechenknecht' ]; then
    return 0
  fi
  echo "Checking python..."
  (
    cd python-oauth2-${pkgver}
    python setup.py test
  )
  echo "Checking python2..."
  (
    cd python-oauth2-${pkgver}-py2
    python2 setup.py test
  )
}

package_python-oauth2() {
  depends=(
    "${_deppy[@]}"
    "${_depends[@]}"
  )
  optdepends=("${_optdepends[@]}")

  cd python-oauth2-${pkgver}
  python setup.py install --prefix=/usr --root="${pkgdir}" --skip-build
  install -Dm 644 LICENSE -t "${pkgdir}"/usr/share/licenses/${pkgname}
}

package_python2-oauth2() {
  depends=(
    "${_deppy2[@]}"
    "${_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 -t "${pkgdir}"/usr/share/licenses/${pkgname}
}