# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=ilbc
pkgver=0.0.1
pkgrel=0
pkgdesc="Internet Low Bitrate Codec - FreeSwitch"
url="https://freeswitch.org/stash/projects/SD/repos/libilbc/browse"
arch="all"
license="BSD"
depends=""
makedepends="autoconf automake libtool"
install=""
subpackages="$pkgname-dev"
source="http://files.freeswitch.org/downloads/libs/ilbc-$pkgver.tar.gz"

_builddir="$srcdir"/ilbc-$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
	sh bootstrap.sh || return 1
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		|| return 1
	make || return 1
}

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

sha512sums="35ab51c5fe7cc4e820375bd9d991168119ecf0160024da0ad7191f27b4827e3958471724238e4bc940435c1fc9e33b2c82bb6d20943c00599f297039669ce237  ilbc-0.0.1.tar.gz"
