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

pkgname=xvkbd
pkgver=3.0
pkgrel=1gv
arch=i486
source=("http://homepage3.nifty.com/tsato/xvkbd/xvkbd-$pkgver.tar.gz" "xvkbd.desktop" "icons.tar.gz")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo")
url=http://homepage3.nifty.com/tsato/xvkbd/
options=('noautodotnew')

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"xvkbd (virtual keyboard for the X window system)"
"xvkbd is a virtual (graphical) keyboard program for X Window System"
"which provides facility to enter characters onto other clients"
"(softwares) by clicking on a keyboard displayed on the screen. This"
"may be used for systems without a hardware keyboard such as kiosk"
"terminals or handheld devices. This program also has facility to send"
"characters specified as the command line option to another client."
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	xmkmf
	sed -i "s/-O2/$CFLAGS/" Makefile
	sed -i "s|/usr/lib$|/usr/lib${LIBDIRSUFFIX}|" Makefile
	make || return 1
	make install install.man DESTDIR=$startdir/pkg

	# Copy icons to the right place
	ICONSIZES="48 32 24 22 16"
	for i in $ICONSIZES; do
		mkdir -p $startdir/pkg/usr/share/icons/hicolor/$i\x$i/apps;
		cp $startdir/src/$pkgname-$i.png $startdir/pkg/usr/share/icons/hicolor/$i\x$i/apps/$pkgname.png;
	done;
	mkdir -p $startdir/pkg/usr/share/icons/hicolor/scalable/apps
	cp $startdir/src/$pkgname.svg $startdir/pkg/usr/share/icons/hicolor/scalable/apps

	mkdir -p $startdir/pkg/usr/share/applications
	cp $startdir/src/xvkbd.desktop $startdir/pkg/usr/share/applications/
}