summaryrefslogtreecommitdiff
path: root/community/mupdf/PKGBUILD
blob: ac96093719b4c4c2a8c169ed4bd93b108e44f92f (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
# $Id: PKGBUILD 67364 2012-03-10 11:47:55Z bpiotrowski $
# Maintainer:  Bartłomiej Piotrowski
# Contributor: Brad Fanella <bradfanella@archlinux.us>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Pierre-Paul Paquin <pierrepaulpaquin@gmail.com>
# Contributor: xduugu (.desktop and install files)

pkgname=mupdf
pkgver=0.9
pkgrel=2
pkgdesc="lightweight PDF viewer and toolkit written in portable C"
arch=('i686' 'x86_64' 'mips64el')
url="http://mupdf.com"
license=('GPL3')
depends=('freetype2' 'libjpeg' 'jbig2dec' 'openjpeg' 'libxext' 'desktop-file-utils')
install=mupdf.install
source=("http://mupdf.com/download/$pkgname-$pkgver-source.tar.gz")
md5sums=('76640ee16a797a27fe49cc0eaa87ce3a')

build() {
    CFLAGS+=" -fPIC"
    CXXFLAGS+=" -fPIC"

	cd "$srcdir/$pkgname-$pkgver"
	make build=release prefix="$pkgdir/usr"
}

package() {
	# Install
	cd "$srcdir/$pkgname-$pkgver"
	make build=release prefix="${pkgdir}/usr" install

	# Rename executables
	msg "Renaming executables"
	cd "${pkgdir}/usr/bin"
	for i in pdf*; do 
		mv "$i" "$i-mupdf";
	done

	# Fix mupdf.desktop
	cd "$srcdir/$pkgname-$pkgver"
	sed -i "s/mupdf.xpm/mupdf/" debian/mupdf.desktop
  	sed -i "s/application\/x-pdf/application\/x-pdf/" debian/mupdf.desktop

	# Install other stuff
	cd "$srcdir/$pkgname-$pkgver/debian"
	install -Dm644 mupdf.desktop "$pkgdir/usr/share/applications/mupdf.desktop"
  	install -Dm644 mupdf.xpm "$pkgdir/usr/share/pixmaps/mupdf.xpm"

  	# Fix permissions
    chmod 644 $pkgdir/usr/lib/{libmuxps.a,libfitz.a,libmupdf.a}
}