# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libnice
pkgver=0.1.14
pkgrel=2
pkgdesc="GLib ICE implementation"
url="https://nice.freedesktop.org/wiki/"
arch="all"
license="LGPL-2.0 and MPL-1.1"
makedepends="glib-dev gnutls-dev gstreamer-dev gst-plugins-base-dev
	gstreamer0.10-dev gst-plugins-base0.10-dev
	gobject-introspection-dev"
subpackages="$pkgname-dbg $pkgname-dev $pkgname-doc
	$pkgname-gstreamer0.10:_gst010 $pkgname-gstreamer:_gst"
source="http://nice.freedesktop.org/releases/libnice-$pkgver.tar.gz"
builddir="$srcdir"/$pkgname-$pkgver

build() {
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--enable-introspection
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

_gst010() {
	pkgdesc="Gstreamer-0.10 plugin for libnice"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/gstreamer-0.10 "$subpkgdir"/usr/lib/
}

_gst() {
	pkgdesc="Gstreamer 1.0 plugin for libnice"
	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/gstreamer-1.0 "$subpkgdir"/usr/lib/
}

sha512sums="58bd0e0f630f4f14fe4765f2dab24215d71d61a4e7dc260cdb34eb0254b3dcdc9ce3b6fb010800250fb85f91e06b1c48cfcdd6e18867324609ead17a9106d4dd  libnice-0.1.14.tar.gz"
