Gentoo Archives: gentoo-commits

From: Patrice Clement <monsieurp@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/openntpd/
Date: Fri, 21 Jul 2017 09:34:47
Message-Id: 1500629679.e8c7b6e9e05dd80983f8aa086dffd5c7eba40556.monsieurp@gentoo
1 commit: e8c7b6e9e05dd80983f8aa086dffd5c7eba40556
2 Author: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jul 21 09:34:27 2017 +0000
4 Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 21 09:34:39 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e8c7b6e9
7
8 net-misc/openntpd: version bump and EAPI 6 bump.
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.1
11
12 net-misc/openntpd/Manifest | 1 +
13 net-misc/openntpd/openntpd-6.2_p1.ebuild | 101 +++++++++++++++++++++++++++++++
14 2 files changed, 102 insertions(+)
15
16 diff --git a/net-misc/openntpd/Manifest b/net-misc/openntpd/Manifest
17 index fd848b42e86..d875748d908 100644
18 --- a/net-misc/openntpd/Manifest
19 +++ b/net-misc/openntpd/Manifest
20 @@ -1 +1,2 @@
21 DIST openntpd-6.0p1.tar.gz 432696 SHA256 b1ab80094788912adb12b33cb1f251cc58db39294c1b5c6376972f5f7ba577e8 SHA512 a71c516dbe7596cbcb3a385112a59a82185b7e3d93a52eda695cea5a0a599ba7fbf58daa81da55d608255cb6950398123fa7d71663604a4c3bcbee949711296d WHIRLPOOL 75b82a07920eb7c3825a37725a81615871b728e9543ec43cb20c9e61a64f523293aa7e1fbbb92ebb8d6417d13f377213ffbcba1c77c7b3c68b64e26e30222a0b
22 +DIST openntpd-6.2p1.tar.gz 437376 SHA256 05e1668f89969a6ae064f411cb1d864ca3acb27ebd8fac963e6443ea0788d0bc SHA512 99ad2c8e42de159b1122fe30385eff2f6311202b8526828dacd52db6ec36ce14785131b0576ac5b08d3ed9cadffc142c9146e395da29409b3227c4a77187d31e WHIRLPOOL 4b1d9bc09deda1550182876f36a251c0a07fd5967db6256f420c9933c4bb275108ebf65031f6e8452aa80fed8b31ac490d7b076db47ca110df4f73d54475243f
23
24 diff --git a/net-misc/openntpd/openntpd-6.2_p1.ebuild b/net-misc/openntpd/openntpd-6.2_p1.ebuild
25 new file mode 100644
26 index 00000000000..ccf131fee0d
27 --- /dev/null
28 +++ b/net-misc/openntpd/openntpd-6.2_p1.ebuild
29 @@ -0,0 +1,101 @@
30 +# Copyright 1999-2017 Gentoo Foundation
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=6
34 +
35 +inherit systemd user
36 +
37 +NTP_HOME="${NTP_HOME:=/var/lib/openntpd/chroot}"
38 +MY_P="${P/_p/p}"
39 +
40 +DESCRIPTION="Lightweight NTP server ported from OpenBSD"
41 +HOMEPAGE="http://www.openntpd.org/"
42 +SRC_URI="mirror://openbsd/OpenNTPD/${MY_P}.tar.gz"
43 +
44 +LICENSE="BSD GPL-2"
45 +SLOT="0"
46 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
47 +IUSE="libressl selinux"
48 +
49 +DEPEND="
50 + !<=net-misc/ntp-4.2.0-r2
51 + !net-misc/ntp[-openntpd]
52 + libressl? ( dev-libs/libressl:0= )"
53 +
54 +RDEPEND="
55 + ${DEPEND}
56 + selinux? ( sec-policy/selinux-ntp )"
57 +
58 +S="${WORKDIR}/${MY_P}"
59 +
60 +pkg_setup() {
61 + enewgroup ntp
62 + enewuser ntp -1 -1 "${NTP_HOME}" ntp
63 +
64 + # make sure user has correct HOME as flipping between the standard ntp pkg
65 + # and this one was possible in the past
66 + if [[ $(egethome ntp) != ${NTP_HOME} ]]; then
67 + ewarn "From this version on, the homedir of the ntp user cannot be changed"
68 + ewarn "dynamically after the installation. For homedir different from"
69 + ewarn "/var/lib/openntpd/chroot set NTP_HOME in your make.conf and re-emerge."
70 + esethome ntp "${NTP_HOME}"
71 + fi
72 +}
73 +
74 +src_prepare() {
75 + default
76 +
77 + # fix /run path
78 + sed -i 's:/var/run/ntpd:/run/ntpd:g' src/ntpctl.8 src/ntpd.8 || die
79 + sed -i 's:LOCALSTATEDIR "/run/ntpd:"/run/ntpd:' src/ntpd.h || die
80 +
81 + # fix ntpd.drift path
82 + sed -i 's:/var/db/ntpd.drift:/var/lib/openntpd/ntpd.drift:g' src/ntpd.8 || die
83 + sed -i 's:"/db/ntpd.drift":"/openntpd/ntpd.drift":' src/ntpd.h || die
84 +
85 + # fix default config to use gentoo pool
86 + sed -i 's:servers pool.ntp.org:#servers pool.ntp.org:' ntpd.conf || die
87 + printf "\n# Choose servers announced from Gentoo NTP Pool\nservers 0.gentoo.pool.ntp.org\nservers 1.gentoo.pool.ntp.org\nservers 2.gentoo.pool.ntp.org\nservers 3.gentoo.pool.ntp.org\n" >> ntpd.conf || die
88 +}
89 +
90 +src_configure() {
91 + econf \
92 + --with-privsep-user=ntp \
93 + --with-privsep-path=${NTP_HOME} \
94 + $(use_enable libressl https-constraint)
95 +}
96 +
97 +src_install() {
98 + default
99 +
100 + rm -r "${ED}"/var || die
101 +
102 + newinitd "${FILESDIR}/${PN}.init.d-20080406-r6" ntpd
103 + newconfd "${FILESDIR}/${PN}.conf.d-20080406-r6" ntpd
104 + keepdir "${NTP_HOME}"
105 +
106 + systemd_newunit "${FILESDIR}/${PN}.service-20080406-r4" ntpd.service
107 +}
108 +
109 +pkg_postinst() {
110 + # Clean up chroot localtime copy from older versions
111 + if [[ -d "${EROOT%/}${NTP_HOME}"/etc ]]; then
112 + if [[ -f "${EROOT%/}${NTP_HOME}"/etc/localtime ]]; then
113 + rm -v "${EROOT%/}${NTP_HOME}"/etc/localtime || die
114 + fi
115 +
116 + rmdir "${EROOT%/}${NTP_HOME}"/etc ||
117 + ewarn "Unable to remove legacy ${EROOT%/}${NTP_HOME}/etc directory"
118 + fi
119 +
120 + # Fix permissions on home directory
121 + chown root:root "${EROOT%/}${NTP_HOME}" || die
122 +
123 + [[ -f ${EROOT}var/log/ntpd.log ]] && \
124 + ewarn "Logfile '${EROOT}var/log/ntpd.log' might be orphaned, please remove it if not in use via syslog."
125 +
126 + if [[ -f ${EROOT}var/lib/ntpd.drift ]]; then
127 + einfo "Moving ntpd.drift file to new location."
128 + mv "${EROOT}var/lib/ntpd.drift" "${EROOT}var/lib/openntpd/ntpd.drift" || die
129 + fi
130 +}