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

pkgname=gslapt
pkgver=0.5.3f
pkgrel=2gv
source=("http://software.jaos.org/source/gslapt/gslapt-$pkgver.tar.gz") 
url=http://software.jaos.org/

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"gslapt (a GTK version of slapt-get)"
"gslapt is a graphical package manager for slackware and slackware"
"based distributions that uses the slapt-get command line interface"
"package management tool."
""
"Homepage: http://software.jaos.org/"
""
"Please translate:"
"http://software.jaos.org/git/gslapt/tree/po"
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	./configure --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} --localstatedir=/var --sysconfdir=/etc --docdir=/usr/doc/$pkgname-$pkgver
	make || return 1
	make install DESTDIR=$startdir/pkg
	mkdir -p $startdir/pkg/usr/share/icons/hicolor/48x48/apps
	mv $startdir/pkg/usr/share/pixmaps/gslapt.png $startdir/pkg/usr/share/icons/hicolor/48x48/apps/
	rmdir $startdir/pkg/usr/share/pixmaps
	sed -i "s/Icon=.*/Icon=gslapt/" $startdir/pkg/usr/share/applications/*.desktop
	sed -i "s/Exec=.*/Exec=gksu \/usr\/sbin\/gslapt/" $startdir/pkg/usr/share/applications/gslapt.desktop
	sed -i "s/Exec=.*/Exec=kdesu \/usr\/sbin\/gslapt/" $startdir/pkg/usr/share/applications/gslapt-kde.desktop
	sed -i "s/Settings;//" $startdir/pkg/usr/share/applications/gslapt.desktop
	sed -i "s/PackageManager;//" $startdir/pkg/usr/share/applications/gslapt.desktop

	# --docdir doesn't really work
	mkdir -p $startdir/pkg/usr/doc
	mv $startdir/pkg/usr/share/doc/gslapt $startdir/pkg/usr/doc/gslapt-$pkgver
	rm -rf $startdir/pkg/usr/share/doc
}