aboutsummaryrefslogtreecommitdiffstats
path: root/community/libspectre/APKBUILD
blob: b8f5c9124a3b598643bbd716e650502bce137d61 (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
# Contributor: Andrew Hills <ahills@ednos.net>
# Contributor: Jean-Louis Fuchs <ganwell@fangorn.ch>
# Maintainer: Jean-Louis Fuchs <ganwell@fangorn.ch>
pkgname=libspectre
pkgver=0.2.8
pkgrel=1
pkgdesc="A small library for rendering Postscript documents"
url="http://www.freedesktop.org/wiki/Software/libspectre"
arch="all"
license="GPL-2.0"
# file, cairo-dev for tests only
makedepends="ghostscript-dev doxygen graphviz cairo-dev file"
subpackages="$pkgname-dev $pkgname-doc"
source="http://libspectre.freedesktop.org/releases/$pkgname-$pkgver.tar.gz
	test.ps"

builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	update_config_sub | true
	default_prepare
}

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var
	make
	make doc
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

doc() {
	mkdir -m 0755 -p "$subpkgdir"/usr/share/doc/libspectre
	install -m 0644 "$builddir"/doc/html/* "$subpkgdir"/usr/share/doc/libspectre/
}

check() {
	cd "$builddir/test"
	make
	mkdir work
	./parser-test "$srcdir/test.ps" work
	./spectre-test "$srcdir/test.ps" work
	file work/output.ps | grep -q "PostScript document text conforming DSC level 3.0, Level 2"
	file work/output.pdf | grep -q "PDF document, version 1.5"
	file work/document.png | grep -q "PNG image data"
	rm -r work
}

sha512sums="ebbe7f6adcbc7f7d6af61f24e23b114116c878755dbe90f1163546c1284a005b4d539be01986c1f940611e84141ca19768b8effc2abf1013606da7c93547da86  libspectre-0.2.8.tar.gz
c5148d38da69ebd125f66bb92204f2c7c79797d60a137d431122792c4e4cdcdb3a6a20cfadadd2821536449b1d638258f4596e43154e1ad2307bffa97af4908b  test.ps"