diff options
Diffstat (limited to 'net-misc/chrony/chrony-9999.ebuild')
-rw-r--r-- | net-misc/chrony/chrony-9999.ebuild | 66 |
1 files changed, 47 insertions, 19 deletions
diff --git a/net-misc/chrony/chrony-9999.ebuild b/net-misc/chrony/chrony-9999.ebuild index 9bee3f3276df..7e6fadddffaa 100644 --- a/net-misc/chrony/chrony-9999.ebuild +++ b/net-misc/chrony/chrony-9999.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 @@ -6,7 +6,7 @@ EAPI=7 inherit systemd tmpfiles toolchain-funcs DESCRIPTION="NTP client and server programs" -HOMEPAGE="https://chrony.tuxfamily.org/" +HOMEPAGE="https://chrony.tuxfamily.org/ https://git.tuxfamily.org/chrony/chrony.git" if [[ ${PV} == "9999" ]]; then inherit git-r3 @@ -20,8 +20,17 @@ S="${WORKDIR}/${P/_/-}" LICENSE="GPL-2" SLOT="0" -IUSE="+caps +cmdmon html ipv6 libedit +nettle +ntp +phc pps +refclock +rtc samba +seccomp +sechash selinux" -REQUIRED_USE="sechash? ( nettle )" +IUSE="+caps +cmdmon debug html ipv6 libedit +nettle nss +ntp +phc +nts pps +refclock +rtc samba +seccomp +sechash selinux libtomcrypt" +# nettle > nss > libtomcrypt in configure +REQUIRED_USE=" + sechash? ( || ( nettle nss libtomcrypt ) ) + nettle? ( !nss ) + nss? ( !nettle ) + libtomcrypt? ( !nettle !nss ) + !sechash? ( !nss ) + !sechash? ( !nts? ( !nettle ) ) + nts? ( nettle ) +" RESTRICT="test" BDEPEND="nettle? ( virtual/pkgconfig )" @@ -38,8 +47,10 @@ DEPEND=" acct-user/ntp sys-libs/libcap ) + nts? ( net-libs/gnutls:= ) libedit? ( dev-libs/libedit ) nettle? ( dev-libs/nettle:= ) + nss? ( dev-libs/nss:= ) seccomp? ( sys-libs/libseccomp ) html? ( dev-ruby/asciidoctor ) pps? ( net-misc/pps-tools ) @@ -61,11 +72,6 @@ src_prepare() { -e 's:/etc/chrony\.conf:/etc/chrony/chrony.conf:g' \ doc/* examples/* || die - sed -i \ - -e 's|RELOADDNS||g' \ - -e 's|pkg-config|${PKG_CONFIG}|g' \ - configure || die - cp "${FILESDIR}"/chronyd.conf "${T}"/chronyd.conf || die } @@ -84,24 +90,30 @@ src_configure() { tc-export CC PKG_CONFIG - # Note: ncurses and nss switches are mentioned in the configure script but - # do nothing + # Update from time to time with output from "date +%s" + # on a system that is time-synced. + export SOURCE_DATE_EPOCH=1607976314 + # not an autotools generated script local myconf=( $(use_enable seccomp scfilter) $(usex caps '' --disable-linuxcaps) $(usex cmdmon '' --disable-cmdmon) + $(usex debug '--enable-debug' '') $(usex ipv6 '' --disable-ipv6) $(usex libedit '' --without-editline) $(usex nettle '' --without-nettle) + $(usex nss '' --without-nss) $(usex ntp '' --disable-ntp) + $(usex nts '' --disable-nts) + $(usex nts '' --without-gnutls) $(usex phc '' --disable-phc) $(usex pps '' --disable-pps) $(usex refclock '' --disable-refclock) $(usex rtc '' --disable-rtc) $(usex samba --enable-ntp-signd '') $(usex sechash '' --disable-sechash) - ${EXTRA_ECONF} + $(usex libtomcrypt '' --disable-tomcrypt) --chronysockdir="${EPREFIX}/run/chrony" --docdir="${EPREFIX}/usr/share/doc/${PF}" --mandir="${EPREFIX}/usr/share/man" @@ -109,8 +121,7 @@ src_configure() { --sysconfdir="${EPREFIX}/etc/chrony" --with-hwclockfile="${EPREFIX}/etc/adjtime" --with-pidfile="${EPREFIX}/run/chrony/chronyd.pid" - --without-nss - --without-tomcrypt + ${EXTRA_ECONF} ) # print the ./configure call @@ -165,18 +176,35 @@ src_install() { pkg_preinst() { HAD_CAPS=false + HAD_SECCOMP=false - if has_version 'net-misc/chrony[caps]'; then + if has_version 'net-misc/chrony[caps]' ; then HAD_CAPS=true fi + + if has_version 'net-misc/chrony[seccomp]' ; then + HAD_SECCOMP=true + fi + } pkg_postinst() { tmpfiles_process chronyd.conf - if [[ -n ${REPLACING_VERSIONS} ]] && 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" + if [[ -n "${REPLACING_VERSIONS}" ]] ; then + 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" + elif ! use caps && ! ${HAD_CAPS} ; then + ewarn "Please adjust permissions on ${EROOT}/var/{lib,log}/chrony to be owned by root:root" + fi + fi + + if [[ ! ${HAD_SECCOMP} ]] && use seccomp ; then + elog "To enable seccomp in enforcing mode, please modify:" + elog "- /etc/conf.d/chronyd for OpenRC" + elog "- systemctl edit chronyd for systemd" + elog "to use -F 1 or -F -1 instead of -F 0 (see man chronyd)" fi } |