summaryrefslogtreecommitdiff
path: root/net-misc/chrony
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/chrony')
-rw-r--r--net-misc/chrony/Manifest4
-rw-r--r--net-misc/chrony/chrony-3.5-r4.ebuild172
-rw-r--r--net-misc/chrony/chrony-4.0_pre1-r2.ebuild175
-rw-r--r--net-misc/chrony/chrony-4.0_pre2.ebuild175
4 files changed, 526 insertions, 0 deletions
diff --git a/net-misc/chrony/Manifest b/net-misc/chrony/Manifest
index ecc4a7a50280..e730d743e275 100644
--- a/net-misc/chrony/Manifest
+++ b/net-misc/chrony/Manifest
@@ -7,9 +7,13 @@ AUX chronyd.init 1634 BLAKE2B f67d3e2b8aaca19e1c9f86434e8a1ba757babebe8b39fe26be
AUX chronyd.init-r2 1694 BLAKE2B 5ee55954c8afc2df09291dd7df4c3f1b3a01f97079ae19799a87c0217118c02b24ace0422b1f355fb67d1a0224eacf2104f3b984035f4ac9fa6b41624187d009 SHA512 63d9816017bb13b57c28de4a9d5b8061139d4aea1db5800ec7a4d9e8b2a8f5c5109b556ae5bec5c6d1cc7c4839bd49f12a0046c74fe4d1d11049ead00f1407da
DIST chrony-3.5.tar.gz 458226 BLAKE2B 611f21e36c6e745208e00eba988519fcd912c6c0c3518c953591f43224dc3da79f627027a6cd4bf9c4227e9f8659a69adbdb634252ff3920d2ef677e32012456 SHA512 c4f6376a44d71b6ac2b6d86e3d6fb4348642faeef7f3f3a4d6431627b5645efcc868b005cc398c8292bc3b63a1161fbd1a042c6ac2a0595843f908fe32eed90c
DIST chrony-4.0-pre1.tar.gz 506735 BLAKE2B f06afaa0ae653b549760e3b8e2e8a33f70450895cda99773e49fa70358bea637434fd18e55a73e53a2f8ccd92ae9ee4555dcea98afbcae9317b122bf1e1cb5b3 SHA512 0b850d57fded23ac3cfe5907edb2a2b8441397a37575ce3b4af54f3b8f28ae7ae74f92926f619e4907a24d9bc10bb6b416bfe3ccc9d567720e3511d7f9513c59
+DIST chrony-4.0-pre2.tar.gz 512765 BLAKE2B bfcac8564b05ed3cb6a67230746ec83d3f00192bd1d5e623ee12068bf3b7ca55e169a0228a13b62339be6a1c237199cd73186b1962ba51b445a56040560917fb SHA512 be3ca7c57c62c9ecf8d20d0b8d7b5a34ac455fb333be0587eabd5dfd7eebbcb3a3601ad161554a62098a9ca8d6530bee2900e9e7476bf477c3cb11907091dbd2
EBUILD chrony-3.5-r2.ebuild 3035 BLAKE2B 3567ca621e71777dc34c90b77005e192f564bb8dba5f0705711eaa720262bebafde656da678b2d47130dee19caf8d2e52106ae27a0ee81e292b2defe1dadf5fa SHA512 2c8799bc3ac6e1759e048e37e6e4765d5a199fff043954e19a2640a060609c6281b397dc2834d10ecb34e5bb09b7b80c55b5bc96d0fa10a43b451799a1d53f3a
EBUILD chrony-3.5-r3.ebuild 3651 BLAKE2B a2ec4dc2e05214e1e61ecc256e17b14c842f8c8c62da916e3bcacae1f3089fd9057a68ec82e141758929ab2d1dba463a339d506572ede8636e3858ff8e82eb25 SHA512 35237e6f351ec77c44c7437bc0a53b0dbcaa6a19ed2e8969e6fb3e6c6fb603878eccef91ab23555b77d64f61c2d22dae85826658e23abf93b71097f3e3577e5e
+EBUILD chrony-3.5-r4.ebuild 4204 BLAKE2B a1ad1b37a923d1906c674845d02ad8d98f03aab15289a25434ebdb96caea353eb86f44db15117796c0af5cb49456cfced817f62de3bc2c2f5afda65c418744a1 SHA512 47aed654b6622fc8ca7c7da7e379ae976a20f94d7e0680b2d198a3eefb3a597534c32ec50fdbdaad5be0d8b05cefa173b57f4ef160a8155eb2d022a008da0b12
EBUILD chrony-4.0_pre1-r1.ebuild 3774 BLAKE2B c631e7b12e294c70158f789711630774dcdb9272b370ff48ef6b215b4cd83a5b56c48d0e51d73622c382382d60192da31d6b7f55f47149049827a0e7c968b8d7 SHA512 6d45e89cf89fcd804fc1a1712a3c57a3098270bab932c8ce9c06a6f46f4524c259926b58dffc7578f1e07b18510d245bb4aefc1fa8da5df61db55165130d46dd
+EBUILD chrony-4.0_pre1-r2.ebuild 4327 BLAKE2B 54b7782fd9308616854671f883591c2e522a32db6341ac993806ae52b58f22ae04818d723cd9dd26c2261ede98cb03db0e8e40887ee0464889d8333325a5e8ef SHA512 f5fc438d0334dbce3724e8861410062aad276b097ebbdad39b02e3c99e94dd4d3b4e7362e288a4c3dda01b483e1ea31ae14c349dbbf36b2473ce7c757c684b04
EBUILD chrony-4.0_pre1.ebuild 3165 BLAKE2B 2cfc0aa1e9a15db8ab1f7e9b6da1a25c0bcacc91158ab654109b5c5f4b89a4934ca382ca5be9605f266c06a8b01a2dabf83d65fe3362712bc8664bd2cb570f7d SHA512 9fd7e540db1f7a8161010c8a84d0aa658046c124d0df798827a1913bbdebb426b1c0b144793194fac6df1a49bfd4954b4ee1b816db344790f314f9141784f7d2
+EBUILD chrony-4.0_pre2.ebuild 4327 BLAKE2B 54b7782fd9308616854671f883591c2e522a32db6341ac993806ae52b58f22ae04818d723cd9dd26c2261ede98cb03db0e8e40887ee0464889d8333325a5e8ef SHA512 f5fc438d0334dbce3724e8861410062aad276b097ebbdad39b02e3c99e94dd4d3b4e7362e288a4c3dda01b483e1ea31ae14c349dbbf36b2473ce7c757c684b04
EBUILD chrony-9999.ebuild 3536 BLAKE2B 8f2ff768eeb09b12197ea48b330c77eb415c43f6b498f98de9eb5f66637fd04dc653095afa5a7e6783832bfe4234e8ba82c3d70f39c0a7f61fff1f4c3963c3b1 SHA512 66030f49f80ea862fa18891572fc4dd231898f879790867a239878b46cefb647a2017d70a3aa3f8055b94337b0e06c251bacc1e816cf6b4e07877eca926b4eca
MISC metadata.xml 1712 BLAKE2B 61db049bb8b0a659d24e10a25e9b36662607af7437a550615220a789342296a204d0e5c1240c8a5176f8eb2b98a5565956860ebb22c92cdb9b280ee817e68074 SHA512 c568b728b8939d8bca8809bfffed71c8e0cd57dcb5eed33d6d7af0ac2cfebbc2189568ef41bf0c8541b984c38b5351f040e0ac3fbeccf4f329d02c988177c9a2
diff --git a/net-misc/chrony/chrony-3.5-r4.ebuild b/net-misc/chrony/chrony-3.5-r4.ebuild
new file mode 100644
index 000000000000..ae752af2fb58
--- /dev/null
+++ b/net-misc/chrony/chrony-3.5-r4.ebuild
@@ -0,0 +1,172 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit systemd tmpfiles toolchain-funcs
+
+DESCRIPTION="NTP client and server programs"
+HOMEPAGE="https://chrony.tuxfamily.org/"
+SRC_URI="https://download.tuxfamily.org/${PN}/${P/_/-}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="
+ +adns +caps +cmdmon html ipv6 libedit +ntp +phc pps readline +refclock +rtc
+ +seccomp selinux
+"
+REQUIRED_USE="
+ ?? ( libedit readline )
+"
+
+CDEPEND="
+ caps? ( acct-group/ntp acct-user/ntp sys-libs/libcap )
+ libedit? ( dev-libs/libedit )
+ readline? ( >=sys-libs/readline-4.1-r4:= )
+ seccomp? ( sys-libs/libseccomp )
+"
+DEPEND="
+ ${CDEPEND}
+ html? ( dev-ruby/asciidoctor )
+ pps? ( net-misc/pps-tools )
+"
+RDEPEND="
+ ${CDEPEND}
+ selinux? ( sec-policy/selinux-chronyd )
+"
+
+RESTRICT=test
+
+S="${WORKDIR}/${P/_/-}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.5-pool-vendor-gentoo.patch
+ "${FILESDIR}"/${PN}-3.5-r3-systemd-gentoo.patch
+)
+
+src_prepare() {
+ default
+ 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() {
+ tc-export CC
+
+ local CHRONY_EDITLINE
+ # ./configure legend:
+ # --disable-readline : disable line editing entirely
+ # --without-readline : do not use sys-libs/readline (enabled by default)
+ # --without-editline : do not use dev-libs/libedit (enabled by default)
+ if ! use readline && ! use libedit; then
+ CHRONY_EDITLINE='--disable-readline'
+ else
+ CHRONY_EDITLINE+=" $(usex readline '' --without-readline)"
+ CHRONY_EDITLINE+=" $(usex libedit '' --without-editline)"
+ fi
+
+ # not an autotools generated script
+ local myconf=(
+ $(use_enable seccomp scfilter)
+ $(usex adns '' --disable-asyncdns)
+ $(usex caps '' --disable-linuxcaps)
+ $(usex cmdmon '' --disable-cmdmon)
+ $(usex ipv6 '' --disable-ipv6)
+ $(usex ntp '' --disable-ntp)
+ $(usex phc '' --disable-phc)
+ $(usex pps '' --disable-pps)
+ $(usex refclock '' --disable-refclock)
+ $(usex rtc '' --disable-rtc)
+ ${CHRONY_EDITLINE}
+ ${EXTRA_ECONF}
+ --chronysockdir="${EPREFIX}/run/chrony"
+ --disable-sechash
+ --docdir="${EPREFIX}/usr/share/doc/${PF}"
+ --mandir="${EPREFIX}/usr/share/man"
+ --prefix="${EPREFIX}/usr"
+ --sysconfdir="${EPREFIX}/etc/chrony"
+ --with-pidfile="${EPREFIX}/run/chrony/chronyd.pid"
+ --without-nss
+ --without-tomcrypt
+ )
+
+ # print the ./configure call to aid in future debugging
+ echo bash ./configure "${myconf[@]}" >&2
+ bash ./configure "${myconf[@]}" || die
+}
+
+src_compile() {
+ emake all docs $(usex html '' 'ADOC=true')
+}
+
+src_install() {
+ default
+
+ newinitd "${FILESDIR}"/chronyd.init-r2 chronyd
+ newconfd "${T}"/chronyd.conf chronyd
+
+ insinto /etc/${PN}
+ newins examples/chrony.conf.example1 chrony.conf
+
+ docinto examples
+ dodoc examples/*.example*
+
+ newtmpfiles - chronyd.conf <<<"d /run/chrony 0750 $(usex caps 'ntp ntp' 'root root')"
+
+ if use html; then
+ docinto html
+ dodoc doc/*.html
+ fi
+
+ keepdir /var/{lib,log}/chrony
+
+ if use caps; then
+ # Prepare a directory for the chrony.drift file (a la ntpsec)
+ # Ensures the environment is sane on new installs
+ fowners ntp:ntp /var/{lib,log}/chrony
+ fperms 770 /var/lib/chrony
+ fi
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/chrony-2.4-r1.logrotate chrony
+
+ systemd_dounit "${T}"/chronyd.service
+ systemd_dounit examples/chrony-wait.service
+ systemd_enable_ntpunit 50-chrony chronyd.service
+}
+
+pkg_preinst() {
+ HAD_CAPS=false
+
+ if has_version 'net-misc/chrony[caps]'; then
+ HAD_CAPS=true
+ fi
+}
+
+pkg_postinst() {
+ tmpfiles_process chronyd.conf
+
+ if use caps && ! ${HAD_CAPS}; then
+ ewarn "Please adjust permissions on ${EROOT}/var/{lib,log}/chrony to be owned by ntp:ntp"
+ ewarn "e.g. chown -R ntp:ntp ${EROOT}/var/{lib,log}/chrony"
+ ewarn "This is necessary for chrony to drop privileges"
+ fi
+}
diff --git a/net-misc/chrony/chrony-4.0_pre1-r2.ebuild b/net-misc/chrony/chrony-4.0_pre1-r2.ebuild
new file mode 100644
index 000000000000..c4c8a13c29a9
--- /dev/null
+++ b/net-misc/chrony/chrony-4.0_pre1-r2.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit systemd tmpfiles toolchain-funcs
+
+DESCRIPTION="NTP client and server programs"
+HOMEPAGE="https://chrony.tuxfamily.org/"
+SRC_URI="https://download.tuxfamily.org/${PN}/${P/_/-}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="
+ +adns +caps +cmdmon html ipv6 libedit +nettle +ntp +phc pps readline +refclock +rtc
+ +seccomp +sechash selinux
+"
+REQUIRED_USE="
+ ?? ( libedit readline )
+ sechash? ( nettle )
+"
+
+CDEPEND="
+ caps? ( acct-group/ntp acct-user/ntp sys-libs/libcap )
+ libedit? ( dev-libs/libedit )
+ nettle? ( dev-libs/nettle )
+ readline? ( >=sys-libs/readline-4.1-r4:= )
+ seccomp? ( sys-libs/libseccomp )
+"
+DEPEND="
+ ${CDEPEND}
+ html? ( dev-ruby/asciidoctor )
+ pps? ( net-misc/pps-tools )
+"
+RDEPEND="
+ ${CDEPEND}
+ selinux? ( sec-policy/selinux-chronyd )
+"
+
+RESTRICT=test
+
+S="${WORKDIR}/${P/_/-}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.5-pool-vendor-gentoo.patch
+ "${FILESDIR}"/${PN}-3.5-r3-systemd-gentoo.patch
+)
+
+src_prepare() {
+ default
+ 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() {
+ tc-export CC
+
+ local CHRONY_EDITLINE
+ # ./configure legend:
+ # --disable-readline : disable line editing entirely
+ # --without-readline : do not use sys-libs/readline (enabled by default)
+ # --without-editline : do not use dev-libs/libedit (enabled by default)
+ if ! use readline && ! use libedit; then
+ CHRONY_EDITLINE='--disable-readline'
+ else
+ CHRONY_EDITLINE+=" $(usex readline '' --without-readline)"
+ CHRONY_EDITLINE+=" $(usex libedit '' --without-editline)"
+ fi
+
+ # not an autotools generated script
+ local myconf=(
+ $(use_enable seccomp scfilter)
+ $(usex adns '' --disable-asyncdns)
+ $(usex caps '' --disable-linuxcaps)
+ $(usex cmdmon '' --disable-cmdmon)
+ $(usex ipv6 '' --disable-ipv6)
+ $(usex nettle '' --without-nettle)
+ $(usex ntp '' --disable-ntp)
+ $(usex phc '' --disable-phc)
+ $(usex pps '' --disable-pps)
+ $(usex refclock '' --disable-refclock)
+ $(usex rtc '' --disable-rtc)
+ $(usex sechash '' --disable-sechash)
+ ${CHRONY_EDITLINE}
+ ${EXTRA_ECONF}
+ --chronysockdir="${EPREFIX}/run/chrony"
+ --docdir="${EPREFIX}/usr/share/doc/${PF}"
+ --mandir="${EPREFIX}/usr/share/man"
+ --prefix="${EPREFIX}/usr"
+ --sysconfdir="${EPREFIX}/etc/chrony"
+ --with-pidfile="${EPREFIX}/run/chrony/chronyd.pid"
+ --without-nss
+ --without-tomcrypt
+ )
+
+ # print the ./configure call to aid in future debugging
+ echo bash ./configure "${myconf[@]}" >&2
+ bash ./configure "${myconf[@]}" || die
+}
+
+src_compile() {
+ emake all docs $(usex html '' 'ADOC=true')
+}
+
+src_install() {
+ default
+
+ newinitd "${FILESDIR}"/chronyd.init-r2 chronyd
+ newconfd "${T}"/chronyd.conf chronyd
+
+ insinto /etc/${PN}
+ newins examples/chrony.conf.example1 chrony.conf
+
+ docinto examples
+ dodoc examples/*.example*
+
+ newtmpfiles - chronyd.conf <<<"d /run/chrony 0750 $(usex caps 'ntp ntp' 'root root')"
+
+ if use html; then
+ docinto html
+ dodoc doc/*.html
+ fi
+
+ keepdir /var/{lib,log}/chrony
+
+ if use caps; then
+ # Prepare a directory for the chrony.drift file (a la ntpsec)
+ # Ensures the environment is sane on new installs
+ fowners ntp:ntp /var/{lib,log}/chrony
+ fperms 770 /var/lib/chrony
+ fi
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/chrony-2.4-r1.logrotate chrony
+
+ systemd_dounit "${T}"/chronyd.service
+ systemd_dounit examples/chrony-wait.service
+ systemd_enable_ntpunit 50-chrony chronyd.service
+}
+
+pkg_preinst() {
+ HAD_CAPS=false
+
+ if has_version 'net-misc/chrony[caps]'; then
+ HAD_CAPS=true
+ fi
+}
+
+pkg_postinst() {
+ tmpfiles_process chronyd.conf
+
+ if use caps && ! ${HAD_CAPS}; then
+ ewarn "Please adjust permissions on ${EROOT}/var/{lib,log}/chrony to be owned by ntp:ntp"
+ ewarn "e.g. chown -R ntp:ntp ${EROOT}/var/{lib,log}/chrony"
+ ewarn "This is necessary for chrony to drop privileges"
+ fi
+}
diff --git a/net-misc/chrony/chrony-4.0_pre2.ebuild b/net-misc/chrony/chrony-4.0_pre2.ebuild
new file mode 100644
index 000000000000..c4c8a13c29a9
--- /dev/null
+++ b/net-misc/chrony/chrony-4.0_pre2.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit systemd tmpfiles toolchain-funcs
+
+DESCRIPTION="NTP client and server programs"
+HOMEPAGE="https://chrony.tuxfamily.org/"
+SRC_URI="https://download.tuxfamily.org/${PN}/${P/_/-}.tar.gz"
+LICENSE="GPL-2"
+SLOT="0"
+
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE="
+ +adns +caps +cmdmon html ipv6 libedit +nettle +ntp +phc pps readline +refclock +rtc
+ +seccomp +sechash selinux
+"
+REQUIRED_USE="
+ ?? ( libedit readline )
+ sechash? ( nettle )
+"
+
+CDEPEND="
+ caps? ( acct-group/ntp acct-user/ntp sys-libs/libcap )
+ libedit? ( dev-libs/libedit )
+ nettle? ( dev-libs/nettle )
+ readline? ( >=sys-libs/readline-4.1-r4:= )
+ seccomp? ( sys-libs/libseccomp )
+"
+DEPEND="
+ ${CDEPEND}
+ html? ( dev-ruby/asciidoctor )
+ pps? ( net-misc/pps-tools )
+"
+RDEPEND="
+ ${CDEPEND}
+ selinux? ( sec-policy/selinux-chronyd )
+"
+
+RESTRICT=test
+
+S="${WORKDIR}/${P/_/-}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-3.5-pool-vendor-gentoo.patch
+ "${FILESDIR}"/${PN}-3.5-r3-systemd-gentoo.patch
+)
+
+src_prepare() {
+ default
+ 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() {
+ tc-export CC
+
+ local CHRONY_EDITLINE
+ # ./configure legend:
+ # --disable-readline : disable line editing entirely
+ # --without-readline : do not use sys-libs/readline (enabled by default)
+ # --without-editline : do not use dev-libs/libedit (enabled by default)
+ if ! use readline && ! use libedit; then
+ CHRONY_EDITLINE='--disable-readline'
+ else
+ CHRONY_EDITLINE+=" $(usex readline '' --without-readline)"
+ CHRONY_EDITLINE+=" $(usex libedit '' --without-editline)"
+ fi
+
+ # not an autotools generated script
+ local myconf=(
+ $(use_enable seccomp scfilter)
+ $(usex adns '' --disable-asyncdns)
+ $(usex caps '' --disable-linuxcaps)
+ $(usex cmdmon '' --disable-cmdmon)
+ $(usex ipv6 '' --disable-ipv6)
+ $(usex nettle '' --without-nettle)
+ $(usex ntp '' --disable-ntp)
+ $(usex phc '' --disable-phc)
+ $(usex pps '' --disable-pps)
+ $(usex refclock '' --disable-refclock)
+ $(usex rtc '' --disable-rtc)
+ $(usex sechash '' --disable-sechash)
+ ${CHRONY_EDITLINE}
+ ${EXTRA_ECONF}
+ --chronysockdir="${EPREFIX}/run/chrony"
+ --docdir="${EPREFIX}/usr/share/doc/${PF}"
+ --mandir="${EPREFIX}/usr/share/man"
+ --prefix="${EPREFIX}/usr"
+ --sysconfdir="${EPREFIX}/etc/chrony"
+ --with-pidfile="${EPREFIX}/run/chrony/chronyd.pid"
+ --without-nss
+ --without-tomcrypt
+ )
+
+ # print the ./configure call to aid in future debugging
+ echo bash ./configure "${myconf[@]}" >&2
+ bash ./configure "${myconf[@]}" || die
+}
+
+src_compile() {
+ emake all docs $(usex html '' 'ADOC=true')
+}
+
+src_install() {
+ default
+
+ newinitd "${FILESDIR}"/chronyd.init-r2 chronyd
+ newconfd "${T}"/chronyd.conf chronyd
+
+ insinto /etc/${PN}
+ newins examples/chrony.conf.example1 chrony.conf
+
+ docinto examples
+ dodoc examples/*.example*
+
+ newtmpfiles - chronyd.conf <<<"d /run/chrony 0750 $(usex caps 'ntp ntp' 'root root')"
+
+ if use html; then
+ docinto html
+ dodoc doc/*.html
+ fi
+
+ keepdir /var/{lib,log}/chrony
+
+ if use caps; then
+ # Prepare a directory for the chrony.drift file (a la ntpsec)
+ # Ensures the environment is sane on new installs
+ fowners ntp:ntp /var/{lib,log}/chrony
+ fperms 770 /var/lib/chrony
+ fi
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/chrony-2.4-r1.logrotate chrony
+
+ systemd_dounit "${T}"/chronyd.service
+ systemd_dounit examples/chrony-wait.service
+ systemd_enable_ntpunit 50-chrony chronyd.service
+}
+
+pkg_preinst() {
+ HAD_CAPS=false
+
+ if has_version 'net-misc/chrony[caps]'; then
+ HAD_CAPS=true
+ fi
+}
+
+pkg_postinst() {
+ tmpfiles_process chronyd.conf
+
+ if use caps && ! ${HAD_CAPS}; then
+ ewarn "Please adjust permissions on ${EROOT}/var/{lib,log}/chrony to be owned by ntp:ntp"
+ ewarn "e.g. chown -R ntp:ntp ${EROOT}/var/{lib,log}/chrony"
+ ewarn "This is necessary for chrony to drop privileges"
+ fi
+}