1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 inherit systemd toolchain-funcs
7 DESCRIPTION="NTP client and server programs"
8 HOMEPAGE="https://chrony.tuxfamily.org/"
9 SRC_URI="https://download.tuxfamily.org/${PN}/${P/_/-}.tar.gz"
13 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~ppc64 ~sparc ~x86"
14 IUSE="caps +cmdmon html ipv6 libedit +ntp +phc pps readline +refclock +rtc seccomp selinux +adns"
16 ?? ( libedit readline )
20 caps? ( sys-libs/libcap )
21 libedit? ( dev-libs/libedit )
22 readline? ( >=sys-libs/readline-4.1-r4:= )
23 seccomp? ( sys-libs/libseccomp )
27 html? ( dev-ruby/asciidoctor )
28 pps? ( net-misc/pps-tools )
32 selinux? ( sec-policy/selinux-chronyd )
37 S="${WORKDIR}/${P/_/-}"
40 "${FILESDIR}"/${PN}-3.5-systemd-gentoo.patch
46 -e 's:/etc/chrony\.conf:/etc/chrony/chrony.conf:g' \
47 doc/* examples/* || die
55 # --disable-readline : disable line editing entirely
56 # --without-readline : do not use sys-libs/readline (enabled by default)
57 # --without-editline : do not use dev-libs/libedit (enabled by default)
58 if ! use readline && ! use libedit; then
59 CHRONY_EDITLINE='--disable-readline'
61 CHRONY_EDITLINE+=" $(usex readline '' --without-readline)"
62 CHRONY_EDITLINE+=" $(usex libedit '' --without-editline)"
65 # not an autotools generated script
66 local CHRONY_CONFIGURE="
68 $(use_enable seccomp scfilter) \
69 $(usex adns '' --disable-asyncdns) \
70 $(usex caps '' --disable-linuxcaps) \
71 $(usex cmdmon '' --disable-cmdmon) \
72 $(usex ipv6 '' --disable-ipv6) \
73 $(usex ntp '' --disable-ntp) \
74 $(usex phc '' --disable-phc) \
75 $(usex pps '' --disable-pps) \
76 $(usex refclock '' --disable-refclock) \
77 $(usex rtc '' --disable-rtc) \
80 --chronysockdir=/run/chrony \
82 --docdir=/usr/share/doc/${PF} \
83 --mandir=/usr/share/man \
85 --sysconfdir=/etc/chrony \
86 --with-pidfile="${EPREFIX}/run/chrony/chronyd.pid"
91 # print the ./configure call to aid in future debugging
92 einfo ${CHRONY_CONFIGURE}
93 bash ${CHRONY_CONFIGURE} || die
97 emake all docs $(usex html '' 'ADOC=true')
103 newinitd "${FILESDIR}"/chronyd.init-r2 chronyd
104 newconfd "${FILESDIR}"/chronyd.conf chronyd
107 newins examples/chrony.conf.example1 chrony.conf
110 dodoc examples/*.example*
117 keepdir /var/{lib,log}/chrony
119 insinto /etc/logrotate.d
120 newins "${FILESDIR}"/chrony-2.4-r1.logrotate chrony
122 systemd_dounit examples/chronyd.service