summaryrefslogtreecommitdiff
path: root/user/py3-docutils/APKBUILD
blob: 34006c8245c44e0b0155c39d9f4b6b110bac011c (plain) (blame)
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
# Contributor: Max Rees <maxcrees@me.com>
# Maintainer: Max Rees <maxcrees@me.com>
pkgname=py3-docutils
_pkgname=docutils
_p="${_pkgname#?}"
_p="${_pkgname%"$_p"}"
pkgver=0.17.1
pkgrel=0
pkgdesc="Documentation utilities for Python"
url="https://pypi.python.org/pypi/docutils"
arch="noarch"
# Certified net clean
license="Custom"
depends="python3 py3-pillow"
makedepends="python3-dev"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/$_p/$_pkgname/$_pkgname-$pkgver.tar.gz
	py311-test.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	python3 setup.py build
}

check() {
	cd "$builddir/test"
	python3 alltests.py
}

package() {
	python3 setup.py install --prefix=/usr --root="$pkgdir"

	# Remove .py extension from executable files.
	local path; for path in "$pkgdir"/usr/bin/*.py; do
		mv "$path" "${path%.py}"
	done
}

doc() {
	default_doc

	docdir="$subpkgdir/usr/share/doc/$pkgname"
	mkdir -p "$docdir"
	cp -R "$builddir"/docs/* "$docdir"
	cp "$builddir"/*.txt "$docdir"

	licdir="$subpkgdir/usr/share/licenses/$pkgname"
	mkdir -p "$licdir"
	rm -f "$builddir"/licenses/docutils.conf
	cp "$builddir"/licenses/* "$licdir"
}

sha512sums="5ec2087116bd5356fdffc54f07f6b0355aac5fa9d6caeefa77e8d201fd4706c0d419193c4d9a3964ae493da3091fe2c7dc36b74f81a1e1b9282173658b06e71b  py3-docutils-0.17.1.tar.gz
9842be1028d6430c74ba2537eeee151eff459bac52b04934a165cc9776d9a6ad4e602b97d556b337a8f38d46f181878dd325565afb259b481abc3b7648d897ac  py311-test.patch"