# Template file for 'libgsm'
pkgname=libgsm
version=1.0.24
revision=1
short_desc="GSM 06.10 lossy speech compression"
maintainer="Orphaned <orphan@voidlinux.org>"
license="TU-Berlin-2.0"
homepage="http://www.quut.com/gsm/"
distfiles="http://www.quut.com/gsm/gsm-${version}.tar.gz"
checksum=a3c40c6471928383f4abfcb2e8f24012a1f562be2f17b8d672145d5986681a92

do_build() {
	make CC=$CC LD=$CC AR=$AR CCFLAGS="$CFLAGS"
}

do_install() {
	vmkdir usr/bin
	vmkdir usr/lib
	vmkdir usr/include/gsm
	vmkdir usr/share/man/man3
	vmkdir usr/share/man/man1

	make INSTALL_ROOT="${DESTDIR}"/usr \
		GSM_INSTALL_INC="${DESTDIR}"/usr/include/gsm \
		GSM_INSTALL_MAN="${DESTDIR}"/usr/share/man/man3 \
		TOAST_INSTALL_MAN="${DESTDIR}"/usr/share/man/man1 \
		install

	vcopy "lib/libgsm.so*" usr/lib

	ln -sfr ${DESTDIR}/usr/include/gsm/gsm.h ${DESTDIR}/usr/include/gsm.h

	vlicense COPYRIGHT
}

libgsm-devel_package() {
	depends="${sourcepkg}>=${version}_${revision}"
	short_desc+=" - development files"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/*.a
		vmove usr/lib/*.so
		vmove usr/share/man/man3
	}
}
