Gentoo Archives: gentoo-commits

From: Jeroen Roovers <jer@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/chrony/
Date: Thu, 20 Aug 2020 07:32:03
Message-Id: 1597908713.151b33bc43ba47d284b0aa711abd7e3b62f31ea4.jer@gentoo
1 commit: 151b33bc43ba47d284b0aa711abd7e3b62f31ea4
2 Author: Jeroen Roovers <jer <AT> gentoo <DOT> org>
3 AuthorDate: Thu Aug 20 07:31:33 2020 +0000
4 Commit: Jeroen Roovers <jer <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 20 07:31:53 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=151b33bc
7
8 net-misc/chrony: Version 3.5.1
9
10 Package-Manager: Portage-3.0.4, Repoman-3.0.1
11 Bug: https://bugs.gentoo.org/738154
12 Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>
13
14 net-misc/chrony/Manifest | 1 +
15 net-misc/chrony/chrony-3.5.1.ebuild | 172 ++++++++++++++++++++++++++++++++++++
16 2 files changed, 173 insertions(+)
17
18 diff --git a/net-misc/chrony/Manifest b/net-misc/chrony/Manifest
19 index 4736c96cfbc..5920dce58e8 100644
20 --- a/net-misc/chrony/Manifest
21 +++ b/net-misc/chrony/Manifest
22 @@ -1,2 +1,3 @@
23 +DIST chrony-3.5.1.tar.gz 459902 BLAKE2B 503402c0dd68a340eb5ecd8b57dcb83d90124f31e8deb6e20bd1e9ed19b5dc952fa7f40a697d0d0cb77c349c9f3297dcd32265d77670a71836ba8709dcc83053 SHA512 489cf614bfb2c1e024343af1316c339b287ed5c7b6cec15b44ef3d90512036fb1da3fd627d291a193c59d9c5c095afa66c529eeb6fd0c1bbc8256ed8873b7984
24 DIST chrony-3.5.tar.gz 458226 BLAKE2B 611f21e36c6e745208e00eba988519fcd912c6c0c3518c953591f43224dc3da79f627027a6cd4bf9c4227e9f8659a69adbdb634252ff3920d2ef677e32012456 SHA512 c4f6376a44d71b6ac2b6d86e3d6fb4348642faeef7f3f3a4d6431627b5645efcc868b005cc398c8292bc3b63a1161fbd1a042c6ac2a0595843f908fe32eed90c
25 DIST chrony-4.0-pre2.tar.gz 512765 BLAKE2B bfcac8564b05ed3cb6a67230746ec83d3f00192bd1d5e623ee12068bf3b7ca55e169a0228a13b62339be6a1c237199cd73186b1962ba51b445a56040560917fb SHA512 be3ca7c57c62c9ecf8d20d0b8d7b5a34ac455fb333be0587eabd5dfd7eebbcb3a3601ad161554a62098a9ca8d6530bee2900e9e7476bf477c3cb11907091dbd2
26
27 diff --git a/net-misc/chrony/chrony-3.5.1.ebuild b/net-misc/chrony/chrony-3.5.1.ebuild
28 new file mode 100644
29 index 00000000000..fa28cf69009
30 --- /dev/null
31 +++ b/net-misc/chrony/chrony-3.5.1.ebuild
32 @@ -0,0 +1,172 @@
33 +# Copyright 1999-2020 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +inherit systemd tmpfiles toolchain-funcs
38 +
39 +DESCRIPTION="NTP client and server programs"
40 +HOMEPAGE="https://chrony.tuxfamily.org/"
41 +SRC_URI="https://download.tuxfamily.org/${PN}/${P/_/-}.tar.gz"
42 +LICENSE="GPL-2"
43 +SLOT="0"
44 +
45 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
46 +IUSE="
47 + +adns +caps +cmdmon html ipv6 libedit +ntp +phc pps readline +refclock +rtc
48 + +seccomp selinux
49 +"
50 +REQUIRED_USE="
51 + ?? ( libedit readline )
52 +"
53 +
54 +CDEPEND="
55 + caps? ( acct-group/ntp acct-user/ntp sys-libs/libcap )
56 + libedit? ( dev-libs/libedit )
57 + readline? ( >=sys-libs/readline-4.1-r4:= )
58 + seccomp? ( sys-libs/libseccomp )
59 +"
60 +DEPEND="
61 + ${CDEPEND}
62 + html? ( dev-ruby/asciidoctor )
63 + pps? ( net-misc/pps-tools )
64 +"
65 +RDEPEND="
66 + ${CDEPEND}
67 + selinux? ( sec-policy/selinux-chronyd )
68 +"
69 +
70 +RESTRICT=test
71 +
72 +S="${WORKDIR}/${P/_/-}"
73 +
74 +PATCHES=(
75 + "${FILESDIR}"/${PN}-3.5-pool-vendor-gentoo.patch
76 + "${FILESDIR}"/${PN}-3.5-r3-systemd-gentoo.patch
77 +)
78 +
79 +src_prepare() {
80 + default
81 + sed -i \
82 + -e 's:/etc/chrony\.conf:/etc/chrony/chrony.conf:g' \
83 + doc/* examples/* || die
84 +
85 + # Copy for potential user fixup
86 + cp "${FILESDIR}"/chronyd.conf-r1 "${T}"/chronyd.conf
87 + cp examples/chronyd.service "${T}"/chronyd.service
88 +
89 + # Set config for privdrop
90 + if ! use caps; then
91 + sed -i \
92 + -e 's/-u ntp//' \
93 + "${T}"/chronyd.conf "${T}"/chronyd.service || die
94 + fi
95 +
96 + if ! use seccomp; then
97 + sed -i \
98 + -e 's/-F 1//' \
99 + "${T}"/chronyd.conf "${T}"/chronyd.service || die
100 + fi
101 +}
102 +
103 +src_configure() {
104 + tc-export CC
105 +
106 + local CHRONY_EDITLINE
107 + # ./configure legend:
108 + # --disable-readline : disable line editing entirely
109 + # --without-readline : do not use sys-libs/readline (enabled by default)
110 + # --without-editline : do not use dev-libs/libedit (enabled by default)
111 + if ! use readline && ! use libedit; then
112 + CHRONY_EDITLINE='--disable-readline'
113 + else
114 + CHRONY_EDITLINE+=" $(usex readline '' --without-readline)"
115 + CHRONY_EDITLINE+=" $(usex libedit '' --without-editline)"
116 + fi
117 +
118 + # not an autotools generated script
119 + local myconf=(
120 + $(use_enable seccomp scfilter)
121 + $(usex adns '' --disable-asyncdns)
122 + $(usex caps '' --disable-linuxcaps)
123 + $(usex cmdmon '' --disable-cmdmon)
124 + $(usex ipv6 '' --disable-ipv6)
125 + $(usex ntp '' --disable-ntp)
126 + $(usex phc '' --disable-phc)
127 + $(usex pps '' --disable-pps)
128 + $(usex refclock '' --disable-refclock)
129 + $(usex rtc '' --disable-rtc)
130 + ${CHRONY_EDITLINE}
131 + ${EXTRA_ECONF}
132 + --chronysockdir="${EPREFIX}/run/chrony"
133 + --disable-sechash
134 + --docdir="${EPREFIX}/usr/share/doc/${PF}"
135 + --mandir="${EPREFIX}/usr/share/man"
136 + --prefix="${EPREFIX}/usr"
137 + --sysconfdir="${EPREFIX}/etc/chrony"
138 + --with-pidfile="${EPREFIX}/run/chrony/chronyd.pid"
139 + --without-nss
140 + --without-tomcrypt
141 + )
142 +
143 + # print the ./configure call to aid in future debugging
144 + echo bash ./configure "${myconf[@]}" >&2
145 + bash ./configure "${myconf[@]}" || die
146 +}
147 +
148 +src_compile() {
149 + emake all docs $(usex html '' 'ADOC=true')
150 +}
151 +
152 +src_install() {
153 + default
154 +
155 + newinitd "${FILESDIR}"/chronyd.init-r2 chronyd
156 + newconfd "${T}"/chronyd.conf chronyd
157 +
158 + insinto /etc/${PN}
159 + newins examples/chrony.conf.example1 chrony.conf
160 +
161 + docinto examples
162 + dodoc examples/*.example*
163 +
164 + newtmpfiles - chronyd.conf <<<"d /run/chrony 0750 $(usex caps 'ntp ntp' 'root root')"
165 +
166 + if use html; then
167 + docinto html
168 + dodoc doc/*.html
169 + fi
170 +
171 + keepdir /var/{lib,log}/chrony
172 +
173 + if use caps; then
174 + # Prepare a directory for the chrony.drift file (a la ntpsec)
175 + # Ensures the environment is sane on new installs
176 + fowners ntp:ntp /var/{lib,log}/chrony
177 + fperms 770 /var/lib/chrony
178 + fi
179 +
180 + insinto /etc/logrotate.d
181 + newins "${FILESDIR}"/chrony-2.4-r1.logrotate chrony
182 +
183 + systemd_dounit "${T}"/chronyd.service
184 + systemd_dounit examples/chrony-wait.service
185 + systemd_enable_ntpunit 50-chrony chronyd.service
186 +}
187 +
188 +pkg_preinst() {
189 + HAD_CAPS=false
190 +
191 + if has_version 'net-misc/chrony[caps]'; then
192 + HAD_CAPS=true
193 + fi
194 +}
195 +
196 +pkg_postinst() {
197 + tmpfiles_process chronyd.conf
198 +
199 + if [[ -n ${REPLACING_VERSIONS} ]] && use caps && ! ${HAD_CAPS}; then
200 + ewarn "Please adjust permissions on ${EROOT}/var/{lib,log}/chrony to be owned by ntp:ntp"
201 + ewarn "e.g. chown -R ntp:ntp ${EROOT}/var/{lib,log}/chrony"
202 + ewarn "This is necessary for chrony to drop privileges"
203 + fi
204 +}