blob: 5e9ad1427583240cc589fdb26a81e320c8617633 (
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
|
# Maintainer: Filip Andersson <filip@artifact.se>
_pkgname=mal-toolbox
pkgname='python-mal-toolbox-git'
pkgver=0.0.0.r0.g0000000
pkgrel=1
pkgdesc="A collection of tools used to create MAL models and attack graphs."
arch=('any')
url=https://github.com/mal-lang/"${_pkgname}"
license=('Apache-2.0')
depends=(
'python>=3.10'
'python-antlr4'
'python-docopt'
'python-yaml'
)
provides=("python-mal-toolbox")
conflicts=("python-mal-toolbox")
makedepends=('python-build' 'python-installer' 'python-wheel' 'git')
source=("${_pkgname}::git+https://github.com/mal-lang/${_pkgname}.git")
sha256sums=('SKIP')
pkgver() {
cd "${srcdir}/${_pkgname}"
# Try to describe with tags: v1.0.0 -> 1.0.0.r5.gabcdef
git describe --tags --long 2>/dev/null \
| sed 's/^v//;s/-/./g' \
|| printf "0.0.0.r%s.g%s" \
"$(git rev-list --count HEAD)" \
"$(git rev-parse --short HEAD)"
}
prepare() {
cd "${srcdir}/${_pkgname}"
}
build() {
cd "${srcdir}/${_pkgname}"
python -m build --wheel --no-isolation
}
package() {
cd "${srcdir}/${_pkgname}"
python -m installer --destdir="$pkgdir" dist/*.whl
# License
if [ -f LICENSE ]; then
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
elif [ -f COPYING ]; then
install -Dm644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
fi
# Documentation
if [ -f README.md ]; then
install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
fi
}
check() {
cd "${srcdir}/${_pkgname}"
}
|