#Maintainer: Dimitris Tzemos <djemos~at~slackel~dot~gr>

pkgname=gramps
pkgver=3.4.1
pkgrel=1dj
source=(http://downloads.sourceforge.net/project/gramps/Stable/$pkgver/gramps-$pkgver.tar.gz)
sourcetemplate=http://people.salixos.org/djemos/salix/$pkgname
docs=("AUTHORS" "COPYING" "FAQ" "INSTALL" "NEWS" "TODO")
url=http://www.gramps-project.org


slackdesc=\
(
 #|-----handy-ruler------------------------------------------------------|
  "GRAMPS (genealogy program)"
  "Genealogical Research and Analysis Management Programming System"
  "GRAMPS is a genealogy program for Linux and other UNIX-like systems."
  "GRAMPS stands for Genealogical Research and Analysis Management"
  "Programming System. GRAMPS helps you track your family tree. It"
  "allows you to store, edit, and research genealogical data."
  ""
  "Homepage: http://www.gramps-project.org/"
)

build() {
        
    cd $startdir/src/$pkgname-$pkgver || return 1
    ./configure --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} --localstatedir=/var --sysconfdir=/etc \
    --mandir=/usr/man \
    --disable-mime-install \
    --build=$arch-slackware-linux \
      PYTHON=python2
                
    make -j $numjobs || return 1
    make install DESTDIR=$startdir/pkg || return 1
    # create icons
    if [ -e "$startdir/pkg/usr/share/icons/hicolor/48x48/apps" ]; then
	echo "perhaps icons already exists?"
	return 1
	fi

    mkdir -p $startdir/pkg/usr/share/icons/hicolor/48x48/apps || return 1
	cp $startdir/pkg/usr/share/pixmaps/gramps.png $startdir/pkg/usr/share/icons/hicolor/48x48/apps || return 1
     
   	sed -i "s/Categories=.*/Categories=GTK;Office;/" $startdir/pkg/usr/share/applications/gramps.desktop || return 1
	sed -i "s/.png//" $startdir/pkg/usr/share/applications/gramps.desktop || return 1  
	chown -R root:root $startdir/pkg         
}



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

if [ -x /usr/bin/update-mime-database ]; then
  /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
fi
}
