#Packager: Shador <futur~DOT~andy~AT~googlemail.com>

pkgname=ruby-gtk2
pkgver=0.19.4
pkgrel=1ab
#arch=i486
source=("http://downloads.sourceforge.net/project/ruby-gnome2/ruby-gnome2/ruby-gnome2-$pkgver/ruby-gtk2-$pkgver.tar.gz")
sourcetemplate="http://gaia.homelinux.org/salix/packages/$pkgname/$pkgver/"
docs=("readme" "copying.lib" "changelog" "authors" "news")
url='http://ruby-gnome2.sourceforge.jp/'

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"$pkgname (Ruby language bindings for GTK2)"
"This package contains ruby-gtk2, a part of Ruby-GNOME2."
"Ruby-GNOME2 is a set of Ruby language bindings for the GNOME 2.0"
"development environment. This is the next generation of Ruby-GNOME."
""
"ruby-gtk2 includes the following packages:"
"    Ruby/GLib2, Ruby/ATK, Ruby/GdkPixbuf2, Ruby/Pango, Ruby/GTK2"
)


build() {
	threadcount=$(($(sed -ne '/cpu cores/h;${g;s/[^0-9]*//p}' \
						< /proc/cpuinfo)*2))
	if [ $threadcount -lt 2 ]; then
		threadcount=2
	elif [ $threadcount -gt 8 ]; then
		threadcount=8
	fi
	threads="-j${threadcount}"

	cd $startdir/src/ruby-gtk2-$pkgver/

	ruby extconf.rb \
		--prefix=/usr \
		--libdir=/usr/lib${LIBDIRSUFFIX} \
		--localstatedir=/var \
		--sysconfdir=/etc \
		--mandir=/usr/man || return 1
	make $threads || return 1
	make install DESTDIR=$startdir/pkg || return 1
} 
