commit:     10cb0d6efa431b8ec909a3379d523ae8fbd9852a
Author:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 14 00:34:30 2023 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Tue Feb 14 00:35:20 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10cb0d6e

net-misc/ntp: use tmpfiles to create /var/lib/ntp

Closes: https://github.com/gentoo/gentoo/pull/29521
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 net-misc/ntp/files/ntp.tmpfiles                                   | 1 +
 net-misc/ntp/{ntp-4.2.8_p15-r5.ebuild => ntp-4.2.8_p15-r6.ebuild} | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/net-misc/ntp/files/ntp.tmpfiles b/net-misc/ntp/files/ntp.tmpfiles
new file mode 100644
index 000000000000..49b0b066e30f
--- /dev/null
+++ b/net-misc/ntp/files/ntp.tmpfiles
@@ -0,0 +1 @@
+d /var/lib/ntp 0755 ntp ntp

diff --git a/net-misc/ntp/ntp-4.2.8_p15-r5.ebuild 
b/net-misc/ntp/ntp-4.2.8_p15-r6.ebuild
similarity index 97%
rename from net-misc/ntp/ntp-4.2.8_p15-r5.ebuild
rename to net-misc/ntp/ntp-4.2.8_p15-r6.ebuild
index 0fc7ccc4e110..64ff48c345f8 100644
--- a/net-misc/ntp/ntp-4.2.8_p15-r5.ebuild
+++ b/net-misc/ntp/ntp-4.2.8_p15-r6.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit autotools flag-o-matic systemd
+inherit autotools flag-o-matic systemd tmpfiles
 
 MY_P=${P/_p/p}
 DESCRIPTION="Network Time Protocol suite/programs"
@@ -112,8 +112,7 @@ src_install() {
        fi
        sed -i "s:/usr/bin:/usr/sbin:" "${ED}"/etc/init.d/ntpd || die
 
-       keepdir /var/lib/ntp
-       use prefix || fowners ntp:ntp /var/lib/ntp
+       newtmpfiles "${FILESDIR}"/ntp.tmpfiles ntp.conf
 
        if use openntpd ; then
                cd "${ED}" || die
@@ -138,6 +137,7 @@ src_install() {
 }
 
 pkg_postinst() {
+       tmpfiles_process ntp.conf
        if grep -qs '^[^#].*notrust' "${EROOT}"/etc/ntp.conf ; then
                eerror "The notrust option was found in your /etc/ntp.conf!"
                ewarn "If your ntpd starts sending out weird responses,"

Reply via email to