# Template file for 'toxcore-git'
pkgname="toxcore-git"
version="20160131"
revision=1
_commithash="94cc8b11ff473064526737936f64b6f9a19c239d"
short_desc="Encrypted peer-to-peer instant messenger protocol library"
maintainer="Spencer Hill <spencernh77@gmail.com>"
license="GPL-3"
homepage="https://tox.chat"
makedepends="libsodium-devel opus-devel libvpx-devel"
hostmakedepends="autoconf automake libtool pkg-config"
distfiles="https://github.com/irungentoo/toxcore/archive/${_commithash}.tar.gz"
checksum=4df62a3488429f0b1adbf24312dc39eb140bae88774124072400930967888d19
wrksrc="toxcore-${_commithash}"
build_style="gnu-configure"
configure_args="--enable-daemon"
system_accounts="toxbootstrapd"
toxbootstrapd_homedir="/etc/toxbootstrapd"
make_dirs="/etc/toxbootstrapd 0700 toxbootstrapd toxbootstrapd"

pre_configure() {
	./autogen.sh
}

post_install() {
	vsv toxbootstrapd
}

# Development package
toxcore-devel-git_package() {
	short_desc+=" - development files"
	depends="${sourcepkg}>=${version}_${revision}"
	pkg_install() {
		vmove usr/include
		vmove usr/lib/*.a
		vmove usr/lib/pkgconfig
	}
}
