blob: f1b823363d55aebfc8858b371975591b9d6fdf55 (
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
|
# Maintainer: Andy Botting <andy@andybotting.com>
_module='shade'
pkgname=('python-shade' 'python2-shade')
pkgver='1.24.0'
pkgrel='1'
pkgdesc='Simple client library for interacting with OpenStack clouds'
arch=('any')
url="http://docs.openstack.org/infra/${_module}"
license=('Apache')
makedepends=('git' 'python-setuptools' 'python2-setuptools')
checkdepends=('python-pbr' 'python2-pbr'
'python-munch' 'python2-munch'
'python2-decorator' 'python-decorator'
'python-jmespath' 'python2-jmespath'
'python-jsonpatch' 'python2-jsonpatch'
'python2-ipaddress' 'python2-futures'
'python-os-client-config' 'python2-os-client-config'
'python-requestsexceptions' 'python2-requestsexceptions'
'python-six' 'python2-six'
'python-keystoneauth1' 'python2-keystoneauth1'
'python-netifaces' 'python2-netifaces'
'python-novaclient' 'python2-novaclient'
'python-keystoneclient' 'python2-keystoneclient'
'python-cinderclient' 'python2-cinderclient'
'python-neutronclient' 'python2-neutronclient'
'python-ironicclient' 'python2-ironicclient'
'python-designateclient' 'python2-designateclient'
'python-dogpile.cache' 'python2-dogpile.cache'
'python-future' 'python2-future'
'python-fixtures' 'python2-fixtures'
'python-mock' 'python2-mock'
'python-subunit' 'python2-subunit'
'python-requests-mock' 'python2-requests-mock'
'python-testtools' 'python2-testtools'
'python-stestr' 'python2-stestr'
'python-oslotest' 'python2-oslotest')
source=("git+https://git.openstack.org/openstack-infra/${_module}#tag=${pkgver}")
sha256sums=('SKIP')
prepare() {
cp -a "${srcdir}/${_module}"{,-py2}
}
build() {
cd "${srcdir}/${_module}"
# Fix test function name for Python 3
sed -i 's/assertItemsEqual/assertCountEqual/g' shade/tests/unit/*.py
# Fix TypeError: a bytes-like object is required, not 'str' for Python 3
sed -i 's/base64.b64encode(user_data)/base64.b64encode(user_data.encode())/g' shade/tests/unit/test_create_server.py
python setup.py build
cd "${srcdir}/${_module}-py2"
python2 setup.py build
}
check() {
cd "${srcdir}/${_module}"
stestr run
cd "${srcdir}/${_module}-py2"
stestr2 run
}
package_python-shade(){
depends=('python-pbr' 'python2-decorator' 'python-jmespath'
'python-jsonpatch' 'python-os-client-config'
'python-requestsexceptions' 'python-six' 'python-keystoneauth1'
'python-netifaces' 'python-novaclient' 'python-keystoneclient'
'python-cinderclient' 'python-neutronclient' 'python-ironicclient'
'python-designateclient' 'python-dogpile.cache')
cd "${srcdir}/${_module}"
python setup.py install --root="${pkgdir}" --optimize=1
}
package_python2-shade() {
depends=('python2-pbr' 'python2-decorator' 'python2-jmespath'
'python2-jsonpatch' 'python2-ipaddress' 'python2-os-client-config'
'python2-requestsexceptions' 'python2-six' 'python2-futures'
'python2-keystoneauth1' 'python2-netifaces' 'python2-novaclient'
'python2-keystoneclient' 'python2-cinderclient'
'python2-neutronclient' 'python2-ironicclient'
'python2-designateclient' 'python2-dogpile.cache')
cd "${srcdir}/${_module}-py2"
python2 setup.py install --root="${pkgdir}" --optimize=1
mv "${pkgdir}"/usr/bin/shade-inventory{,2}
}
# vim:set ts=2 sw=2 et:
|