summaryrefslogtreecommitdiff
path: root/pcr/htmldoc/PKGBUILD
blob: 0c84a3f9423882e9871fb670358611c6aee1d0f9 (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
72
73
74
75
# Contributor: Mariusz Libera <mariusz.libera@gmail.com>
# Contributor: mortdeus <mortdeus@gocos2d.org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: tobias <tobias@archlinux.org>
# Contributor: Simon Rutishauser <simon.rutishauser@gmx.ch>
# Maintainer : Parabola Aurélien DESBRIÈRES <aurelien@hackers.camp>

pkgname=htmldoc
pkgver=1.8.27
pkgrel=4
pkgdesc="Produce PDF or Postscript from HTML documents including TOCs and Indices"
arch=('i686' 'x86_64' 'mips64el')
url="http://www.htmldoc.org"
license=('GPL2')
depends=('libxpm' 'fltk' 'libjpeg' 'openssl' 'shared-mime-info')
conflicts=('htmldoc-svn')
changelog=Changelog
install=$pkgname.install
source=("http://www.msweet.org/files/project1/htmldoc-${pkgver}-source.tar.gz"
	'cve-2009-3050.patch'
	'fortify-fail.patch'
	'libpng15.patch'
	'manpage-fixes.patch'
	'useful-build-info.patch')

prepare() {
	cd $srcdir/$pkgname-$pkgver

	# apply patches
	for patch in ../*.patch ; do
		patch -Np1 -i $patch
	done

	# fix desktop file
	echo "MimeType=application/vnd.htmldoc-book;" >> desktop/htmldoc.desktop
	sed -i 's/X-Red-Hat.*$//' desktop/htmldoc.desktop
	sed -i 's/htmldoc.png/htmldoc/' desktop/htmldoc.desktop
}

build() {
	cd "$srcdir/$pkgname-$pkgver"
	./configure
	make
}

package() {
	cd "$srcdir/$pkgname-$pkgver"
	make install \
		prefix="$pkgdir/usr" \
		bindir="$pkgdir/usr/bin" \
		mandir="$pkgdir/usr/share/man"

	# documentation
	install -m644 \
		CHANGES.txt \
		README.txt \
		"$pkgdir/usr/share/doc/htmldoc"

    # documentation in .ps is way to heavy - this saves ~150M
    rm "$pkgdir/usr/share/doc/htmldoc/htmldoc.ps"

	# desktop file
	install -Dm644 desktop/htmldoc.desktop \
		"$pkgdir/usr/share/applications/htmldoc.desktop"

	# icons
	for s in 16 24 32 48 64 96 128; do
		install -Dm644 desktop/htmldoc-${s}.png \
			"$pkgdir/usr/share/icons/hicolor/${s}x${s}/apps/htmldoc.png"
	done

	# mime
	install -Dm644 desktop/htmldoc.xml \
		"$pkgdir/usr/share/mime/packages/htmldoc.xml"
}