summaryrefslogtreecommitdiff
path: root/community/jc/APKBUILD
blob: 3ee8def291be758e15401ce51a19111a8a3c5022 (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
# Contributor: omni <omni+alpine@hack.org>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=jc
pkgver=1.25.3
pkgrel=0
pkgdesc="CLI & python library converting output of common tools, file-types & strings to JSON, YAML or dicts"
url="https://kellyjonbrazil.github.io/jc/"
arch="noarch"
license="MIT"
depends="py3-pygments py3-ruamel.yaml py3-xmltodict"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest tzdata"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	$pkgname-zsh-completion
	$pkgname-pyc
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/kellyjonbrazil/jc/archive/refs/tags/v$pkgver.tar.gz"

build() {
	gpep517 build-wheel --wheel-dir .dist --output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	TZ="America/Los_Angeles" \
		.testenv/bin/python3 -m pytest -k "not test_ip_address_ipv6_6to4"
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl

	install -Dm644 man/"$pkgname".1 "$pkgdir"/usr/share/man/man1/"$pkgname".1
	install -Dm644 -t "$pkgdir"/usr/share/doc/"$pkgname"/ \
		README.md EXAMPLES.md
	cp -r docs "$pkgdir"/usr/share/doc/"$pkgname"/

	install -Dm644 completions/jc_bash_completion.sh \
		"$pkgdir"/usr/share/bash-completion/completions/$pkgname
	install -Dm644 completions/jc_zsh_completion.sh \
		"$pkgdir"/usr/share/zsh/site-functions/_$pkgname
}

sha512sums="
c832e3d81d5deedc12e9d9017a60ee1348c96d748dd13fadced1447c275518716b02376113fff536889549eb8ea1fc2c04cb078fb74f6476e361fd842fd1d488  jc-1.25.3.tar.gz
"