# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=farstream0.1
pkgver=0.1.2
pkgrel=2
pkgdesc="Libraries for videoconferencing"
url="http://www.freedesktop.org/wiki/Software/Farstream"
arch="all"
license="LGPL-2.0-or-later"
depends=""
depends_dev="libnice-dev gstreamer0.10-dev gst-plugins-base0.10-dev"
makedepends="$depends_dev gobject-introspection-dev py-gobject-dev python2-dev
	py-gst0.10"
install=""
replaces="farstream"
subpackages="$pkgname-dev $pkgname-doc py-$pkgname:py"
source="http://freedesktop.org/software/farstream/releases/farstream/farstream-$pkgver.tar.gz
	gtk-doc.patch"

_builddir="$srcdir"/farstream-$pkgver
prepare() {
	local i
	cd "$_builddir"
	update_config_sub || return 1
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--enable-python \
		|| return 1
	make -C farstream -j1 || return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
}

py() {
	pkgdesc="Python binding for farstream"
	mkdir -p "$subpkgdir"/usr/lib/
	mv "$pkgdir"/usr/lib/python* "$subpkgdir"/usr/lib/
}

sha512sums="7d9ddde5d17205752a17298fb90cf855a828b2ae58746fbdc7e47749cee5e5eac4fd56f97f58251a5d253901cdd555e9cfade6016b6d92df99daefbe850e2910  farstream-0.1.2.tar.gz
197f8fb222a3588bb5831c723adaa09f56149ced995fe17d7527ec17504613ed6d8c3df6349e9f9e516cc1be955add4c3c851e93d5dc4a95b6424279cafcbbe4  gtk-doc.patch"
