blob: a1cb528b55bc724de2c5d2416e659d8eb07e6203 (
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
|
# Contributor: Johannes Dewender arch at JonnyJD dot net
pkgname=python-rtslib-fb
_pkgname=rtslib-fb
pkgver=2.2.3
pkgrel=1
pkgdesc="free branch version of the LIO target API"
arch=('any')
url="https://github.com/open-iscsi/${_pkgname}"
license=('Apache')
options=()
depends=('python' 'python-pyudev')
makedepends=('python' 'python-build' 'python-pip' 'python-pyudev')
provides=('python-rtslib')
conflicts=('python-rtslib')
source=("git+${url}.git#tag=v${pkgver}")
sha512sums=('c3d249d2b965d155860fbf77b57b99cb5f78fd325ae38ba65fbecb7853cf03a48e983e16ba23e4e8c5f33fac8fd29d58b11e3305e563d380c632bc96f32b17a7')
_pydep1() {
if which python >/dev/null 2>&1; then
python -c 'import sys; major, minor = sys.version.split(".")[:2]; print(f"python>={major}.{minor}")'
else
echo "python"
fi
}
_pydep2() {
if which python >/dev/null 2>&1; then
python -c 'import sys; major, minor = sys.version.split(".")[:2]; print(f"python<{major}.{int(minor)+1}")'
else
echo "python"
fi
}
build() {
cd "$srcdir/$_pkgname"
python -m build
}
package() {
depends=("$(_pydep1)" "$(_pydep2)" "${depends[@]:1}")
cd "$srcdir/$_pkgname"
python -m pip install --no-deps --ignore-installed --root="$pkgdir/" dist/${_pkgname/-fb/_fb}-${pkgver}-py3-none-any.whl
}
# vim:set ts=2 sw=2 et:
|