#Packager: George Vlahavas <vlahavas~at~gmail~dot~com>

pkgname=atril
pkgver=1.26.1
_mainver=`echo $pkgver | sed "s/\(.*\)\.\(.*\)/\1/"`
pkgrel=2gv
source=("http://pub.mate-desktop.org/releases/${_mainver}/atril-${pkgver}.tar.xz")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo")
options=('noautodotnew')

doinst() {
if [ -x /usr/bin/update-desktop-database ]; then
  /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
fi

if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
  if [ -x /usr/bin/gtk-update-icon-cache ]; then
    /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
  fi
fi

if [ -e usr/share/glib-2.0/schemas ]; then
  if [ -x /usr/bin/glib-compile-schemas ]; then
    /usr/bin/glib-compile-schemas usr/share/glib-2.0/schemas >/dev/null 2>&1
  fi
fi
}

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"atril (simply a document viewer)"
"Atril is a simple multi-page document viewer. It can display and"
"print PostScript (PS), Encapsulated PostScript (EPS), DJVU and"
"Portable Document Format (PDF) files. When supported by the document,"
"it also allows searching for text, copying text to the clipboard,"
"hypertext navigation, and table-of-contents bookmarks."
)


build() {
	cd $startdir/src/atril-$pkgver

	./configure \
		--prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--enable-epub \
		--disable-caja \
		--disable-synctex \
		--disable-dvi \
		--disable-schemas-compile \
		--disable-static \
		--without-keyring \
		--with-gtk=3.0 \
		--build=$arch-slackware-linux
	make -j $numjobs || return 1
	make install DESTDIR=$startdir/pkg
} 
