# Template file for 're'
pkgname="re"
version="0.5.9"
revision=1
build_style=gnu-makefile
make_build_args="RELEASE=1 EXTRA_CFLAGS=$CFLAGS
 EXTRA_LFLAGS=$LDFLAGS USE_OPENSSL=yes USE_DTLS=yes USE_DTLS_SRTP=yes"
make_install_args="$make_build_args"
makedepends="libressl-devel"
short_desc="Portable library for real-time communications"
maintainer="JohnZ <johnz@posteo.net>"
license="BSD-3-Clause"
homepage="http://www.creytiv.com/"
distfiles="http://www.creytiv.com/pub/re-${version}.tar.gz"
checksum=882ba05cae77e07099add1d24195863d08fcddfef62d1586d8d07f1721b59612
make_use_env=1
shlib_provides="libre.so"

case $XBPS_TARGET_MACHINE in
	i686*) arch="i686";;
	x86_64*) arch="x86_64";;
	armv6*) arch="arm6";;
	aarch64*) arch="arm64";;
	arm*) arch="arm";;
	mips*) arch="mips";;
esac
make_build_args+=" ARCH=$arch"
make_install_args+=" ARCH=$arch"

pre_build() {
	make ${make_build_args} info
}

post_install() {
	vlicense docs/COPYING
}

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