diff options
Diffstat (limited to 'net-misc/chrony')
-rw-r--r-- | net-misc/chrony/Manifest | 2 | ||||
-rw-r--r-- | net-misc/chrony/chrony-3.5.1.ebuild | 172 |
2 files changed, 174 insertions, 0 deletions
diff --git a/net-misc/chrony/Manifest b/net-misc/chrony/Manifest index 678b5184d5a3..3aeed31b4c50 100644 --- a/net-misc/chrony/Manifest +++ b/net-misc/chrony/Manifest @@ -6,10 +6,12 @@ AUX chronyd.conf 378 BLAKE2B b5c07f873640d78e26d23206b253b8c85ceb2a3d89f1dfb3686 AUX chronyd.conf-r1 389 BLAKE2B 12ce24ef0455876ca9b74c5fb03000d720526c4da7dabf1dffb3c959861d5b0f677e2efb96bb5c00f7cc26b79cc77c0b6dfa161551bda5506a5eaac8d16dc46e SHA512 81400fb47fdac472c7508bb301e0dd662429c6ac3243e13d2719b1d237057a8b996163fbc14fa85a498144728d9ddf78275251d630e6800b0144a43792d8c414 AUX chronyd.init 1634 BLAKE2B f67d3e2b8aaca19e1c9f86434e8a1ba757babebe8b39fe26be98b7d1d40b259fde5313dcb840c86a7d409ac811a5d854178af66ab82d851b66d27a2acf5f7575 SHA512 1712775c133c4e7f1e869806be2a0723d171c344fc18473606397c74103bb70990302b475ed3629adb5277deed8e892f1ad48d5ee339cf112f425d9209cc3872 AUX chronyd.init-r2 1694 BLAKE2B 5ee55954c8afc2df09291dd7df4c3f1b3a01f97079ae19799a87c0217118c02b24ace0422b1f355fb67d1a0224eacf2104f3b984035f4ac9fa6b41624187d009 SHA512 63d9816017bb13b57c28de4a9d5b8061139d4aea1db5800ec7a4d9e8b2a8f5c5109b556ae5bec5c6d1cc7c4839bd49f12a0046c74fe4d1d11049ead00f1407da +DIST chrony-3.5.1.tar.gz 459902 BLAKE2B 503402c0dd68a340eb5ecd8b57dcb83d90124f31e8deb6e20bd1e9ed19b5dc952fa7f40a697d0d0cb77c349c9f3297dcd32265d77670a71836ba8709dcc83053 SHA512 489cf614bfb2c1e024343af1316c339b287ed5c7b6cec15b44ef3d90512036fb1da3fd627d291a193c59d9c5c095afa66c529eeb6fd0c1bbc8256ed8873b7984 DIST chrony-3.5.tar.gz 458226 BLAKE2B 611f21e36c6e745208e00eba988519fcd912c6c0c3518c953591f43224dc3da79f627027a6cd4bf9c4227e9f8659a69adbdb634252ff3920d2ef677e32012456 SHA512 c4f6376a44d71b6ac2b6d86e3d6fb4348642faeef7f3f3a4d6431627b5645efcc868b005cc398c8292bc3b63a1161fbd1a042c6ac2a0595843f908fe32eed90c 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-r4.ebuild 4241 BLAKE2B c56c8d39161dec4ce49c3685e191c70efa5b0b9d82f42066cdcb41345126782e7c1ecaadba13967d6364b5b00bc949cb1e8cf2c2ebd57525b24c0f68ae022442 SHA512 617ab48f3792344be704e90808b53d1af30829678fa9644de03a43bcc693d54979010d30415d6ef5c9dc626fa55554bc3b0a4a9ef0a41151b1a3a7925aee5fd6 +EBUILD chrony-3.5.1.ebuild 4241 BLAKE2B c56c8d39161dec4ce49c3685e191c70efa5b0b9d82f42066cdcb41345126782e7c1ecaadba13967d6364b5b00bc949cb1e8cf2c2ebd57525b24c0f68ae022442 SHA512 617ab48f3792344be704e90808b53d1af30829678fa9644de03a43bcc693d54979010d30415d6ef5c9dc626fa55554bc3b0a4a9ef0a41151b1a3a7925aee5fd6 EBUILD chrony-4.0_pre2-r1.ebuild 4636 BLAKE2B 39a67901f7237c0c91653f14038fdd4d8fb5739d4760d970559264c32a93cd02d61163002da7149b0dec6c9d36ceaa52bcf29954391087854d33d39ded9bb109 SHA512 10a5183f3351677bdcb4f6c54b23267e51f8053b8eacb8876e288b806cbfea31b83f8fd29b2e4747d218355876fc787a0a3158ba1f5efc567df97a4a8d6909ef EBUILD chrony-9999.ebuild 4636 BLAKE2B 39a67901f7237c0c91653f14038fdd4d8fb5739d4760d970559264c32a93cd02d61163002da7149b0dec6c9d36ceaa52bcf29954391087854d33d39ded9bb109 SHA512 10a5183f3351677bdcb4f6c54b23267e51f8053b8eacb8876e288b806cbfea31b83f8fd29b2e4747d218355876fc787a0a3158ba1f5efc567df97a4a8d6909ef MISC metadata.xml 1798 BLAKE2B c301fd829833515a78800677c498632a46ea968ad82f726b288ee3ec6bf79c733fcaea0b9a1777cf93e2a858da40beb105a301dca580e37e01b91111a38bdc17 SHA512 8609f9cb055d5de0a293cc78060101cbc30be4d3db6d7a8d751fa2bf416758e4c9d6509ce1890861c87d2e863e325051e68aadb4d621937f586e83ef585145e7 diff --git a/net-misc/chrony/chrony-3.5.1.ebuild b/net-misc/chrony/chrony-3.5.1.ebuild new file mode 100644 index 000000000000..fa28cf690097 --- /dev/null +++ b/net-misc/chrony/chrony-3.5.1.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-r1 "${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 [[ -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" + fi +} |