# Template file for 'chrony'
pkgname=chrony
version=1.31
revision=1
build_style=gnu-configure
configure_args="--without-nss"
hostmakedepends="pkg-config"
makedepends="libtomcrypt-devel libcap-devel libedit-devel"
conf_files="/etc/chrony.conf"
system_accounts="chrony"
systemd_services="chrony.service on"
make_dirs="
	/var/log/chrony 0755 chrony chrony
	/var/db/chrony	0755 chrony chrony"
short_desc="Sets your computer's clock from time servers on the Net"
maintainer="Juan RP <xtraeme@gmail.com>"
license="GPL-2"
homepage="http://chrony.tuxfamily.org/"
distfiles="http://download.tuxfamily.org/chrony/$pkgname-$version.tar.gz"
checksum=a35e1cae46ecbe14af2023bb47a72a03d79591b2ff65f0072b3400153224996d

build_options="systemd"

post_install() {
	vinstall ${FILESDIR}/chrony.conf 644 etc
	rm -rf ${DESTDIR}/usr/share/doc

	if [ "$build_option_systemd" ]; then
		vinstall ${FILESDIR}/chrony.service 644 usr/lib/systemd/system
		# for systemd-timedated.
		vmkdir usr/lib/systemd/ntp-units.d
		echo "chrony.service" > ${DESTDIR}/usr/lib/systemd/ntp-units.d/50-chrony.list
	fi
}
