aboutsummaryrefslogtreecommitdiffstats
path: root/testing/libspectre/APKBUILD
blob: 58a4b848bf24bb5fd4fbad9726d8211cc0435aeb (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
# 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=0
pkgdesc="A small library for rendering Postscript documents"
url="http://www.freedesktop.org/wiki/Software/libspectre"
arch="all"
license="GPL2"
depends_dev=""
# file, cairo-dev for tests only
makedepends="$depends_dev ghostscript-dev doxygen graphviz cairo-dev file"
subpackages="$pkgname-dev $pkgname-doc"
source="http://libspectre.freedesktop.org/releases/libspectre-$pkgver.tar.gz
	test.ps"

builddir="$srcdir/libspectre-$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
}

md5sums="97ad2c8188db6bdc77fd742522b0bbdf  libspectre-0.2.8.tar.gz
dabc20a5e57ac6ae5b7b017f9e27b2e5  test.ps"
sha256sums="65256af389823bbc4ee4d25bfd1cc19023ffc29ae9f9677f2d200fa6e98bc7a8  libspectre-0.2.8.tar.gz
5ef0ee544b834a47864b1228b253be4c5b1811f8630cc970bcfec3f7c06d113c  test.ps"
sha512sums="ebbe7f6adcbc7f7d6af61f24e23b114116c878755dbe90f1163546c1284a005b4d539be01986c1f940611e84141ca19768b8effc2abf1013606da7c93547da86  libspectre-0.2.8.tar.gz
c5148d38da69ebd125f66bb92204f2c7c79797d60a137d431122792c4e4cdcdb3a6a20cfadadd2821536449b1d638258f4596e43154e1ad2307bffa97af4908b  test.ps"