# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=farstream
pkgver=0.2.8
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 gstreamer-dev gst-plugins-base-dev"
makedepends="$depends_dev gobject-introspection-dev py-gobject-dev python2-dev"
install=""
subpackages="$pkgname-dev $pkgname-doc"
source="http://freedesktop.org/software/farstream/releases/farstream/farstream-$pkgver.tar.gz"

_builddir="$srcdir"/farstream-$pkgver
prepare() {
	local i
	cd "$_builddir"
	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 \
		--disable-static \
	|| 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/
}

md5sums="a40d4c4bd0812c270069b9f97d74009b  farstream-0.2.8.tar.gz"
sha256sums="2b3b9c6b4f64ace8c83e03d1da5c5a2884c1cae10b35471072b574201ab38908  farstream-0.2.8.tar.gz"
sha512sums="7ec5c57f8778f4107cb628dbf411e38b726152cf78920127dff4423239ff7e4980b6b4f938abba2aa21ab984b1e3053e7e648611322a0ce94df0af576df99a7e  farstream-0.2.8.tar.gz"
