### this file is sourced not run
PKGVER=2.32.0
PKGBUILD=1
PKGARCH=x86_64

# BLFS 2013-08-01 - this is the latest build that runs on GTK2
TARBALL=evince-2.32.0.tar.bz2
MD5SUM=ebc3ce6df8dcbf29cb9492f8dd031319 
SRC_URL=http://ftp.gnome.org/pub/gnome/sources/evince/2.32/$TARBALL
BUNDLE=

SLACKREQ='libspectre libdjvulibre poppler gtk2 libxml2'
SLACKDESC='evince: evince 2.32.0 (Document Viewer)  
evince:  
evince: Evince is a versatile document viewer capable of viewing PDF, 
evince: Postscript, and Djvu documents.  
evince: 
evince: 
evince: 
evince: 
evince: 
evince: 
evince: 
'
SLACKINSTALL='glib-compile-schemas ./usr/share/glib-2.0/schemas'

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	
	# apply patches from Arch
	cd tmp/evince* &&
	patch -Np1 -i ../pkg/0001-tiff-fix-compile-warning.patch &&
	patch -Np1 -i ../pkg/kill-missing-gconf-complaints.patch &&
	patch -Np1 -i ../pkg/libview-crash.patch &&
	patch -Np1 -i ../pkg/update-poppler.patch
}

### default pkg_package
### build
pkg_build() {
#	return 1
	CONFFLAGS="$CONFFLAGS --enable-pixbuf \
	--without-gconf --without-keyring \
	--disable-nautilus --disable-help  --disable-scrollkeeper \
	--disable-schemas-compile \
	--disable-dbus --disable-static"
	
	cd /tmp/evince* &&
	autoreconf -fi &&
	pkg_build_autoconf &&
	pkg_build_slackdesc &&
	rm -f /usr/share/icons/hicolor/icon-theme.cache &&
	
	## Add ROX links
	mkdir -p /etc/xdg/rox.sourceforge.net &&
	cd /etc/xdg/rox.sourceforge.net &&
	mkdir -p SendTo MIME-types SendTo/.application_pdf &&
	ln -sfv /usr/share/applications/evince.desktop SendTo/evince &&
	ln -sfv /usr/share/applications/evince.desktop SendTo/.application_pdf/Open-with-Evince &&
	ln -sfv /usr/bin/evince MIME-types/application_postscript &&
	ln -sfv /usr/bin/evince MIME-types/image_vnd.djvu &&
	ln -sfv /usr/bin/evince MIME-types/application_pdf &&
	ln -sfv /usr/bin/evince MIME-types/application_x-cb7 &&
	ln -sfv /usr/bin/evince MIME-types/application_x-cbr &&
	ln -sfv /usr/bin/evince MIME-types/application_x-cbt &&
	ln -sfv /usr/bin/evince MIME-types/application_x-cbz &&
	
	# enable desktop file
	sed -i -e '/^NoDisplay/d; s/^Categories.*/Categories=X-DocumentUtility;/' /usr/share/applications/evince.desktop
}


