aboutsummaryrefslogtreecommitdiffstats
path: root/main/py-pygments/APKBUILD
blob: 0f36ab64c6d6b922bf4848cba087225fac0e2095 (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
63
64
65
66
67
68
69
70
71
# Contributor: Peter Bui <pnutzh4x0r@gmail.com>
# Maintainer: Matt Smith <mcs@darkregion.net>
pkgname=py-pygments
_pkgname=Pygments
pkgver=2.0.2
pkgrel=3
pkgdesc="A syntax highlighting package written in Python."
url="http://pygments.org/"
arch="noarch"
license="BSD"
depends="python2 py-setuptools"
makedepends=""
install=""
subpackages="$pkgname-doc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz
	CVE-2015-8557.patch
	"

_builddir="$srcdir"/$_pkgname-$pkgver

prepare() {
	cd "$_builddir"
	for i in $source; do
		case "$i" in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	python setup.py build || return 1
}

package() {
	cd "$_builddir"
	python setup.py install --root "$pkgdir" || return 1
}

doc() {
	cd "$_builddir"

	mkdir -p "$subpkgdir"/usr/share/doc/$pkgname || return 1
	for _doc in AUTHORS CHANGES LICENSE TODO; do
		install -Dm644 $_doc "$subpkgdir"/usr/share/doc/$pkgname/$_doc \
			|| return 1
	done

	install -Dm644 doc/pygmentize.1 \
		"$subpkgdir"/usr/share/man/man1/pygmentize.1 || return 1

	# Note: The documentation in the doc directory needs to be generated
	# by py-sphinx
	mkdir -p "$subpkgdir"/usr/share/doc/$pkgname/docs || return 1
	cp -R ./doc/* "$subpkgdir"/usr/share/doc/$pkgname/docs/ || return 1
	chmod -R 644 "$subpkgdir"/usr/share/doc/$pkgname/docs/ || return 1
	rm -f "$subpkgdir"/usr/share/doc/$pkgname/docs/make.bat || return 1
	rm -f "$subpkgdir"/usr/share/doc/$pkgname/docs/pygmentize.1 || return 1

	# Fix subdir perms
	find "$subpkgdir"/usr/share/doc/$pkgname/ -type d \
		-exec chmod 755 '{}' \; || return 1
	default_doc
}

md5sums="238587a1370d62405edabd0794b3ec4a  Pygments-2.0.2.tar.gz
3e5190427dd4ac1a52f27c1f7d1b1d90  CVE-2015-8557.patch"
sha256sums="7320919084e6dac8f4540638a46447a3bd730fca172afc17d2c03eed22cf4f51  Pygments-2.0.2.tar.gz
c56bc3b911ece2d79bb1b7dd4d952d0139216161a0f7f95ff6143daccd24daf6  CVE-2015-8557.patch"
sha512sums="b58e2cc535ba3f1fda7cb147e12af128bc2755de56cf465f8f1d642730eaef50c06551cc4cc44f25f726b00f3f1c9c2078977233b11c0b6a7e1add6a4069c27e  Pygments-2.0.2.tar.gz
14d0fe27195cae53dd6b998fd05c32938078bf4de0845ce388b22729e5633e5f810b738ce672de0d023099b54ac7ca44ab4273d46313e2e30138a2fb023e5add  CVE-2015-8557.patch"