# Contributor:
# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
setvar pkgname = 'py-gnome'
setvar _realname = 'gnome-python'
setvar pkgver = '2.28.1'
setvar _basever = '2.28'
setvar pkgrel = '5'
setvar pkgdesc = ""Python interface to GNOME libraries""
setvar url = ""http://pygtk.org""
setvar arch = ""all""
setvar license = ""LGPL""
setvar depends = ""$pkgname-bonobo $pkgname-gconf $pkgname-libgnome $pkgname-gnomevfs""
setvar depends_dev = ""gtk+2.0-dev libgnome-dev py-gobject-dev py-gtk-dev python2-dev""
setvar makedepends = "$depends_dev"
setvar install = """"
setvar subpackages = ""$pkgname-dev $pkgname-bonobo::noarch $pkgname-gconf $pkgname-libgnome \
	$pkgname-gnomevfs""
setvar source = ""http://ftp.gnome.org/pub/gnome/sources/$_realname/$_basever/$_realname-$pkgver.tar.bz2""

setvar _builddir = ""$srcdir"/$_realname-$pkgver"

proc prepare {
	cd $_builddir
	update_config_sub || return 1
}

proc build {
	cd $_builddir"
	LIBS=$(pkg-config gobject-2.0 --libs)" \
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		|| return 1
        make || return 1
}

proc package {
	cd $_builddir
        make DESTDIR="$pkgdir" install-pkgconfigDATA || return 1
}

proc bonobo {
        setvar pkgdesc = ""Python bindings for interfacing with Bonobo""
	setvar depends = ""py-gtk $pkgname-gnomecanvas""
        cd $_builddir
        make -C bonobo DESTDIR="$subpkgdir" install || return 1
}

proc gconf {
	setvar pkgdesc = ""Python bindings for interfacing with GConf""
	setvar depends = ""gconf py-gtk""
	cd $_builddir
	make -C gconf DESTDIR="$subpkgdir" install || return 1
}

# Temporarily disabled as it does not build
#gnomecanvas() {
#	pkgdesc="Python bindings for the GNOME Canvas"
#	cd "$_builddir"
#	make -C gnomecanvas DESTDIR=$subpkgdir install || return 1
#}

proc gnomevfs {
	setvar pkgdesc = ""Python bindings for interacting with gnome-vfs""
	setvar depends = ""gnome-vfs""
	cd $_builddir
	make -C gnomevfs DESTDIR="$subpkgdir" install || return 1
}

proc libgnome {
	setvar pkgdesc = ""Python bindings for libgnome""
	setvar depends = ""py-gtk $pkgname-bonobo $pkgname-gnomecanvas $pkgname-gnomevfs""
	cd $_builddir
	make -C gnome DESTDIR="$subpkgdir" install || return 1
}

setvar sha512sums = ""632d91d416f8209c2bc8d576d1229069e00f2cfeedb3441a5f151e12973ed740c0bb26d18d5c16cfeeb64ca35933537997277450001cffd96d8d5077027d45f2  gnome-python-2.28.1.tar.bz2""