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

pkgname=xxxterm
pkgver=1.339
pkgrel=1gv
source=("http://opensource.conformal.com/snapshots/xxxterm/xxxterm-$pkgver.tgz" "xxxterm-1.339-salix.patch")
url=http://opensource.conformal.com/wiki/XXXTerm

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"xxxterm (a minimalist web browser with vi-like keybindings)"
"XXXTerm is a minimalists web browser. It strives to be vi-like for"
"heavy keyboard users while maintaining traditional web browser"
"behavior. It is ISC licensed."
)


build() {
	cd $startdir/src/$pkgname-$pkgver
		
	patch -p1 < $startdir/src/xxxterm-1.339-salix.patch || exit 1

	cd linux
	PREFIX=/usr make || return 1
	PREFIX=/usr make install DESTDIR=$startdir/pkg
	
	# this is empty
	rmdir $startdir/pkg/usr/lib

	cd ..
	# menu entry and icons
	mkdir -p $startdir/pkg/usr/share/applications
	cp xxxterm.desktop $startdir/pkg/usr/share/applications/
	sed -i "s/^Icon=.*/Icon=xxxterm/" $startdir/pkg/usr/share/applications/xxxterm.desktop
	sed -i "s/^Exec=.*/Exec=xxxterm %u/" $startdir/pkg/usr/share/applications/xxxterm.desktop
	ICONSIZES="128 64 48 32 16"
	for i in $ICONSIZES; do
		mkdir -p $startdir/pkg/usr/share/icons/hicolor/$i\x$i/apps;
		cp xxxtermicon${i}.png $startdir/pkg/usr/share/icons/hicolor/$i\x$i/apps/$pkgname.png;
	done;
}