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

pkgname=netsurf
pkgver=3.9
pkgrel=1gv_salix14.1
source=("http://download.netsurf-browser.org/netsurf/releases/source-full/netsurf-all-$pkgver.tar.gz" "icons.tar.gz")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo")
url=http://www.netsurf-browser.org/

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"netsurf (a lightweight web browser)"
"NetSurf is a free, open source web browser. It is written in C and"
"released under the GNU Public Licence version 2. NetSurf has its own"
"layout and rendering engine entirely written from scratch. It is small"
"and capable of handling many of the web standards in use today."
)


build() {
	cd $startdir/src/netsurf-all-$pkgver
	
	export PREFIX=/usr
	export TARGET=gtk
	make -j $numjobs || exit 1
	make install PREFIX=/usr DESTDIR=$startdir/pkg

	mkdir -p $startdir/pkg/usr/share/applications
	cp ./netsurf/frontends/gtk/res/netsurf-gtk.desktop $startdir/pkg/usr/share/applications/
	#sed -i "s/Exec=netsurf-gtk %u/Exec=netsurf-gtk3 %u/" $startdir/pkg/usr/share/applications/netsurf-gtk.desktop

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