#Maintainer: George Vlahavas (vlahavas~at~gmail~dot~com)

pkgname=gcolor2
pkgver=0.4
pkgrel=2gv
arch=i486
source=("http://downloads.sourceforge.net/gcolor2/gcolor2-0.4.tar.bz2" "gcolor2.desktop" "icons.tar.gz")
docs=("readme" "install" "copying" "changelog" "authors" "news" "todo" "maintainers")
url=http://gcolor2.sourceforge.net/

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"gcolor2 (color selector)"
"Gcolor2 is a GTK2 color selector to provide a quick and easy way to"
"find colors for whatever task is at hand. It was originally based on" 
"gcolor, ported to use GTK+2, and now has a completely new UI."
)


build() {
	cd $startdir/src/$pkgname-$pkgver
	sed -i -e "s/-O2/$CFLAGS/" configure
	./configure --prefix=/usr --libdir=/usr/lib${LIBDIRSUFFIX} --localstatedir=/var --sysconfdir=/etc --disable-static
	make || return 1
	make install DESTDIR=$startdir/pkg

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

	# 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;
		mv $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
	mv $startdir/src/$pkgname.svg $startdir/pkg/usr/share/icons/hicolor/scalable/apps/$pkgname.svg
}