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

pkgname=ktsuss
pkgver=1.4
pkgrel=9gv
source=("http://download.berlios.de/ktsuss/ktsuss-1.4.tar.gz" "gksu" "ktsuss-l10n.tar.gz")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo" "credits" "readme-pot")
url=http://developer.berlios.de/projects/ktsuss/

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"ktsuss (a graphical version of su)"
"ktsuss stands for \"keep the su simple, stupid\", and as the name says,"
"is a graphical version of su written in C and GTK+ 2. The idea of the"
"project is to remain simple and bug free..."
)


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

	patch -p1 < $startdir/src/ktsuss-l10n/ktsuss-1.4-l10n.patch || exit 1
	
	./configure --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} --localstatedir=/var --sysconfdir=/etc  --build=$arch-slackware-linux
	make || return 1
	make install DESTDIR=$startdir/pkg

	cp $startdir/src/gksu $startdir/pkg/usr/bin
	chmod 755 $startdir/pkg/usr/bin/gksu

	(
	cd $startdir/src/ktsuss-l10n
	./compile-translations.sh
	
	cd po
	for i in `ls *.mo`; do
		LNG=`echo $i|sed "s/\.mo//"`
		mkdir -p $startdir/pkg/usr/share/locale/$LNG/LC_MESSAGES
		cp $i $startdir/pkg/usr/share/locale/$LNG/LC_MESSAGES/ktsuss.mo
	done
	)
}