From 623ee73d661e5ed8475cb264511f683407d87365 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sun, 12 Apr 2020 03:41:30 +0100 Subject: gentoo Easter resync : 12.04.2020 --- net-misc/chrony/chrony-9999.ebuild | 39 +++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) (limited to 'net-misc/chrony/chrony-9999.ebuild') diff --git a/net-misc/chrony/chrony-9999.ebuild b/net-misc/chrony/chrony-9999.ebuild index e939129a01ac..543cabf61d5c 100644 --- a/net-misc/chrony/chrony-9999.ebuild +++ b/net-misc/chrony/chrony-9999.ebuild @@ -1,8 +1,8 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 -inherit git-r3 systemd toolchain-funcs +inherit git-r3 tmpfiles systemd toolchain-funcs DESCRIPTION="NTP client and server programs" HOMEPAGE="https://chrony.tuxfamily.org/" @@ -12,8 +12,8 @@ SLOT="0" KEYWORDS="" IUSE=" - +adns caps +cmdmon html ipv6 libedit +ntp +phc pps readline +refclock +rtc - seccomp selinux + +adns +caps +cmdmon html ipv6 libedit +ntp +phc pps readline +refclock +rtc + +seccomp selinux " REQUIRED_USE=" ?? ( libedit readline ) @@ -27,6 +27,7 @@ CDEPEND=" " DEPEND=" ${CDEPEND} + caps? ( acct-group/ntp acct-user/ntp ) dev-ruby/asciidoctor pps? ( net-misc/pps-tools ) " @@ -39,7 +40,7 @@ S="${WORKDIR}/${P/_/-}" PATCHES=( "${FILESDIR}"/${PN}-3.5-pool-vendor-gentoo.patch - "${FILESDIR}"/${PN}-3.5-systemd-gentoo.patch + "${FILESDIR}"/${PN}-3.5-r3-systemd-gentoo.patch ) src_prepare() { @@ -47,6 +48,23 @@ src_prepare() { sed -i \ -e 's:/etc/chrony\.conf:/etc/chrony/chrony.conf:g' \ doc/* examples/* || die + + # Copy for potential user fixup + cp "${FILESDIR}"/chronyd.conf "${T}"/chronyd.conf + cp examples/chronyd.service "${T}"/chronyd.service + + # Set config for privdrop + if ! use caps; then + sed -i \ + -e 's/-u ntp//' \ + "${T}"/chronyd.conf "${T}"/chronyd.service || die + fi + + if ! use seccomp; then + sed -i \ + -e 's/-F 1//' \ + "${T}"/chronyd.conf "${T}"/chronyd.service || die + fi } src_configure() { @@ -102,7 +120,7 @@ src_install() { default newinitd "${FILESDIR}"/chronyd.init-r2 chronyd - newconfd "${FILESDIR}"/chronyd.conf chronyd + newconfd "${T}"/chronyd.conf chronyd insinto /etc/${PN} newins examples/chrony.conf.example1 chrony.conf @@ -110,6 +128,8 @@ src_install() { docinto examples dodoc examples/*.example* + newtmpfiles - chronyd.conf <<<"d /run/chrony 0750 $(usex caps 'ntp ntp' 'root root')" + docinto html dodoc doc/*.html @@ -118,6 +138,11 @@ src_install() { insinto /etc/logrotate.d newins "${FILESDIR}"/chrony-2.4-r1.logrotate chrony - systemd_dounit examples/{chronyd,chrony-wait}.service + systemd_dounit "${T}"/chronyd.service + systemd_dounit examples/chrony-wait.service systemd_enable_ntpunit 50-chrony chronyd.service } + +pkg_postinst() { + tmpfiles_process chronyd.conf +} -- cgit v1.2.3