aboutsummaryrefslogtreecommitdiffstats
path: root/main/py3-docutils/APKBUILD
blob: 5ee8c669477d0e0a4766885935eccdff78310018 (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
56
57
58
59
# Contributor: Matt Smith <mcs@darkregion.net>
# Maintainer: Matt Smith <mcs@darkregion.net>
pkgname=py3-docutils
pkgver=0.16
pkgrel=3
pkgdesc="Documentation Utilities for Python3"
url="https://pypi.python.org/pypi/docutils"
arch="noarch"
license="BSD-2-Clause AND GPL-3.0-or-later AND Python-2.0"
depends="python3"
makedepends="py3-setuptools"
subpackages="$pkgname-doc::noarch"
source="https://files.pythonhosted.org/packages/source/d/docutils/docutils-$pkgver.tar.gz"
builddir="$srcdir/docutils-$pkgver"

replaces="py-docutils" # Backwards compatibility
provides="py-docutils=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	python3 setup.py build
}

check() {
	python3 test/alltests.py
}

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

	# Remove .py extension and add version suffix to executable files.
	local path; for path in "$pkgdir"/usr/bin/*.py; do
		mv "$path" "${path/.py/-3}"
	done

	cd "$pkgdir"/usr/bin
	local bin; for bin in *-3; do
		ln -s "$bin" "$pkgdir"/usr/bin/"${bin/-3/}"
	done
}

doc() {
	replaces=""
	provides=""
	pkgdesc="$pkgdesc (documentation)"
	local docdir="$subpkgdir/usr/share/doc/$pkgname"
	local licdir="$subpkgdir/usr/share/licenses/$pkgname"

	cd "$builddir"

	mkdir -p "$docdir"
	cp -R docs/* "$docdir"/
	cp ./*.txt "$docdir"/

	mkdir -p "$licdir"
	rm -f licenses/docutils.conf
	cp licenses/* "$licdir"/
}

sha512sums="4e0c6662924cac6b8f28bb77a4f50eafd637c1083990a23dbd905d8a05362a18dae96e63408ed43b595b693ca755c7961d1282129d3215ed3774af0dddcc0466  docutils-0.16.tar.gz"