summaryrefslogtreecommitdiff
path: root/net-misc/ntpsec
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-06-29 12:04:12 +0100
commit0f558761aa2dee1017b4751e4017205e015a9560 (patch)
tree037df795519468a25d9362b4e95cdaeb84eb1cf9 /net-misc/ntpsec
parent752d6256e5204b958b0ef7905675a940b5e9172f (diff)
gentoo resync : 29.12.2022
Diffstat (limited to 'net-misc/ntpsec')
-rw-r--r--net-misc/ntpsec/Manifest9
-rw-r--r--net-misc/ntpsec/files/ntpd.rc-r323
-rw-r--r--net-misc/ntpsec/files/ntpsec-1.2.1-seccomp-nsd.patch34
-rw-r--r--net-misc/ntpsec/ntpsec-1.2.1-r3.ebuild2
-rw-r--r--net-misc/ntpsec/ntpsec-1.2.1-r4.ebuild177
-rw-r--r--net-misc/ntpsec/ntpsec-1.2.1-r5.ebuild178
-rw-r--r--net-misc/ntpsec/ntpsec-1.2.1-r6.ebuild169
-rw-r--r--net-misc/ntpsec/ntpsec-9999.ebuild42
8 files changed, 605 insertions, 29 deletions
diff --git a/net-misc/ntpsec/Manifest b/net-misc/ntpsec/Manifest
index e76768f8ff65..ee05d62d41f3 100644
--- a/net-misc/ntpsec/Manifest
+++ b/net-misc/ntpsec/Manifest
@@ -2,14 +2,19 @@ AUX ntp.conf 727 BLAKE2B 1b37cee807c41593ffc44994e390c98406c49154477bc2a603ba403
AUX ntpd-r1.service 613 BLAKE2B 9e0d0fdefa670c2ac25142bfb37880ce4ba0662f70f7cf9acb02f9016bfeabd94a043e92d1b1be11e74b838e9cc91d7d7c1144539917c927537e67f92b45003e SHA512 cdfbc735e157306597ff3c37b5aea34d64c66a69bbb9dbfba6c7eb57d6b201c9d2e86969e5be9b8331e75e1de8eaa17ee4d8f72bed9bc058a6198bf5a2d717c6
AUX ntpd.confd 90 BLAKE2B 980ea88c97b1deff65f53c13410fe46bc1e19a80140776002ae2fdc0a3ad18c9855b74a70f1a89eb31854bbdad6729753c3a199cddb25b58178a79a0ea0a7050 SHA512 a2fdf88f6f55bcf0a6545db77817e3a740dba50bf56b4fdd80d335e8c909d0880fbd962041754d7f5fb3946ed131d9a739ec72008bacab9f1f47ff82dc74c542
AUX ntpd.rc-r2 484 BLAKE2B 826a3ee09486d912525fe6d44b967e25d8b31485d89a80987afcf459ea335058ff8a7835f3931017505aad6c5ba60e546b608ce26a51ad38f5972675d0a47559 SHA512 dc89a58edf6f83878d42522a015f2c3e12db9505ea3d6bc4b04e6e82947a7be6e8d143e8808bb58644641dd754744fd4be20c8b944a4261b460c30b95436fc31
+AUX ntpd.rc-r3 494 BLAKE2B 5ad7e659403b21d35c24011eca17c108bbbf4874f86ad4f9421f5dd633abcfc747444bdcbe840dca14b7b55f3867ddd376626ec40c71bbb67ded98ef75d544f7 SHA512 792480abee2b641d383fdb63a5478172e63c90f7390d1a1e0ffcb7a1477a15c27c3588c4a810eeca62c3990aebc28da6c0903d451236bc727f806d3635766864
AUX ntpsec-1.1.9-remove-asciidoctor-from-config.patch 680 BLAKE2B 7204a831b3dc0dba7f268febd10fa7599ef6b9bee30199ce10529d2d326719f5b376d301aabfef3beacecd4af813bcef1d6a65d61ab00996d72f1240f83ef8e3 SHA512 3e012ad70507f440ed3a4aca4886a96e40d49a0dd7c14572f664633a56139cb7767e07ee1bb5e8295fc32052914364660c928d11369b6f80193ae7e190e5a48e
AUX ntpsec-1.2.1-build-notests.patch 1512 BLAKE2B 16f1b49802c2883866d5ddc862c49ddca994fc530938b53d6059a0f044aa67692180efd528727b91940357562eb4db4a1abaa0a04404b13b912eb11a6a94b9fc SHA512 5b9cf22809a727c687d4a6796a334fd515d1de3883f2e72b5a44e787dd5e1189cc86e5a50c7f693d45e58ac1c5ee0503571fe4aa15cc31f7fc7d3f409128d21e
+AUX ntpsec-1.2.1-seccomp-nsd.patch 1469 BLAKE2B a3b0db89c8eff4f184263fdaaaf522718cd8bbc26b67b5bfdbbff3ba4e4c6000702f8e683d4069a2a87b157748025d48ecbd68f6f1634ca2070083a9b9326e2e SHA512 f73989906b24357a99dc5d56ab830c7f5605c992b11d25d75ef35b92242cdcb41cad2bf301963c1df2f3564ffe96ac19bd1836060585187ee282719b6cb2b66a
AUX ntpsec-1.2.1-seccomp-rollup.patch 2987 BLAKE2B 82bd355cdd169133f232f6514f363e87b6876472d49d69d034dd33aefe7179dc3db5e661909774471635dd947761f5e8ab47ecc0dcf8d6c2e62ffdad06044a3f SHA512 34c1941dfd7d7968fa954fb36411aad5e711767f1c0b6aca52cd8f8c839163110af2d4774a7a41b1f3d0daa49af5823b74e9c8a2a9ec12b9a344c72ce505d279
AUX ntpsec-1.2.1-seccomp-rseq-glibc-2.35.patch 785 BLAKE2B df61801e9748e20ce7fa8577c472ea2ed4e31a8d2cb1aef39a245bfe145e482b61b6b30398fc5c2da69685ed872b70ac8399481ec71ea35fc4469df1b83bd195 SHA512 a35ba539aa6a0b8f28079e1dd7a729e7ea21ab045233d7b5e1938a11c03a72aa87907068505e0330c644ebb9b509663a21a24ad9a4cc954a0f03ec7198309c0e
AUX ntpsec-no-bsd.patch 1538 BLAKE2B 6abb7acf23149a5a47f8e479bff090966e7e6161fc0d5bca1f9e5b9396d90898a783e7d309d6cdbdf689ea12314c804aa7a39f05b3f11d75a95eb337cea95b55 SHA512 7ddb346c7f0c9b30ea08ac28eaa39cf86e3d6cee7eaeba3bc7fe0883acd5087966e4e7beb298cee02607dfa3198a8c1dfcd9ce43ead820de3bb7014cefe75302
AUX ntpsec-py3-test-clarify.patch 993 BLAKE2B 85df81d6301e3f057601bbb2e01590a11cefe338b8a309d37818524896cb694d9a479ab80613763bd2c779680ccecc06526dfca87370409372788ba9254b9003 SHA512 3ac296a2329b2a9dede51499a75f82eeae1870ad5dbd769b7ea1f3d4634ff2512fda8383f7d3adc6fa1a4fd03e035cf0b52157639ca21f458af161fffbf6a0e4
DIST ntpsec-1.2.1.tar.gz 2681237 BLAKE2B bfb2674131718dcf9f393e93d1148cfb6631591dbcce1ade91746586f261123b80b238393ac2a763fab119cd627f8eae4b006b023ad2b319e752db9eb4b04cc0 SHA512 0b8b0bda52d3025f6e9a06c00b1e0c25c595ada72b87ed0e5d3d6f77a034f557745156bc6d9a263c9876c041efffa38d42fa93ba8bfda31f67efbd842a726277
EBUILD ntpsec-1.2.1-r2.ebuild 4434 BLAKE2B fc33f87243be18fe8ccf1faccc5aa261a162656e8c675fedaa333631ae85c95ca59bf8a06b24c4a3b3e46ab669bc026ae164afdb2a507f3e19b2cef3c7139602 SHA512 d564a533817ad9a54c81db43b8ab1e09dea2f8aa749c930662e2912bb0e058d9fdc835ab22599d403fe34dc85c6a1a25fe0635667ea8a6cf12cd9d5718baa507
-EBUILD ntpsec-1.2.1-r3.ebuild 4686 BLAKE2B 648e6194976a9a9e237f49c5fc05e7fab7bb777ffc318887d137f0222ddeaf14aee9785d03d574bf45cd2503c0e80605eb9badc4ff158c360a83444db41ebaa6 SHA512 270c6e2496e250f9871a16f74438aa709105c2da06f0df0459cdafc8692543ddcb2e2e7b44af85c66d7c33badeeae6647f9592165fd8dd9ee2f066014d22d49b
-EBUILD ntpsec-9999.ebuild 4534 BLAKE2B baffc367ed04fe5042e4acad1c7172e280f49e9f391f409f14bc4511ae02d3a1927c3c4f2198e7bedd64243c81ff8e75b797faf8b04f8c1b92cda922468f9843 SHA512 979c140c15e1c7f6b99c21fad33d825961e22306031d6ada7775d0af35f35391af33007049359a8b66b983cf0dc178683c8f5db62cd42600fb10f15826f31f12
+EBUILD ntpsec-1.2.1-r3.ebuild 4683 BLAKE2B 9106135c2355acd4bfefb24c0b68fb6ab1300773fd7cf8aa9dda380b210b61c8f1cc42555c7571b292b2131bc39bf1c0e9b3f6b7a09a0e152fa025bad9aff1c7 SHA512 253294ff11133d62bc54fe5f5bdd3c6b25cecbf02fe84676f99e190d752343cbf5783111d85fc183097d9fcb956385ae0342beb5f0428ea851218a3e8652f360
+EBUILD ntpsec-1.2.1-r4.ebuild 4686 BLAKE2B 94e74b206caf561809b32b1e369f2fe77d133caddfdbd499b36858a5510a62afc43a9dd0ffde54ee98d18da88a70af049d7679fd0e3bd0e40fca682085e1a6ae SHA512 f3e165bf6fc6c4074d3182c22fdae1ce51fd36dfe3e91947f1bbaabcae032bd80b402fd4341a0e38b83c46adc40551678ba5f2b560ef073cd60ddb0fa53b21a9
+EBUILD ntpsec-1.2.1-r5.ebuild 4731 BLAKE2B db85ef6514e13677bb2c405600c002e8c969771c0ae61495a272792ffde4331fb4d5f8abb219489e2e4d3131608f21a0447a900bfa6f48c1cd55c3e16e5b0251 SHA512 eb81825a8d3fbac628729b9f322cc88c0d68715627149fadf31bae01407536b75253467380edda64ce40b9e97b9346f0a5a1f86a7e840d2b5a9afe36f8ae69ca
+EBUILD ntpsec-1.2.1-r6.ebuild 4406 BLAKE2B b0e1cefb7748ea8c115270543915cc7bdde4dc060ec5f36730df635613b0ec84e0c2a26e6a7aecb438e8379a8552bd1729fffab74d1e5cef156b633b507a9018 SHA512 4ec946fad4fcac345be239cecebbd56c1a17c6259cac2d4747e8266f4937cf3f4c2c59d1e9a3b9634ad9f9475c55bcbacc0f6520b04ca73541b926551489fe6c
+EBUILD ntpsec-9999.ebuild 4168 BLAKE2B d92e57770bd9a46330ff6057de0a2706745c48a4bf0c53921065e70cd059266af78c6d48c551391f0535679a7cdca017e8227e6d54aea7e3ee6f20d469521f0d SHA512 2dcd85192a8359975483500e31c501fec3f40fbb9c93ce60503779b51de4256aad3e8a375ef19df3eaaa1ac683af77fafcce62e2fc6053ed58ea03dcdd7baada
MISC metadata.xml 1902 BLAKE2B d807dc3dae199835bfa1624e76b43e39a1392f07d736ab5936c48bd4cfd69fdc1bae71a02c3cd9f405aa0992e7ebe27f5ffb639eafed027deba96eaa99ace391 SHA512 a29e4dfebcda69c393487ccfccdefd2b9e4e5c63591d2ed7c008b54b7c04afea071938fd2e0ce6c67f26ccecf427053b1a2b8e946dfcc3e092f64d00bc28aadf
diff --git a/net-misc/ntpsec/files/ntpd.rc-r3 b/net-misc/ntpsec/files/ntpd.rc-r3
new file mode 100644
index 000000000000..68d07237455c
--- /dev/null
+++ b/net-misc/ntpsec/files/ntpd.rc-r3
@@ -0,0 +1,23 @@
+#!/sbin/openrc-run
+# Copyright 1999-2021 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+description="ntpd - the network time protocol daemon"
+pidfile="/run/ntpd.pid"
+command="/usr/sbin/ntpd"
+command_args="${NTPD_OPTS}"
+command_args_background="-p ${pidfile}"
+command_args_foreground="-n"
+
+depend() {
+ use net dns logger
+ after ntp-client
+}
+
+start_pre() {
+ if [ ! -f /etc/ntp.conf ] ; then
+ eerror "Please create /etc/ntp.conf"
+ return 1
+ fi
+ return 0
+}
diff --git a/net-misc/ntpsec/files/ntpsec-1.2.1-seccomp-nsd.patch b/net-misc/ntpsec/files/ntpsec-1.2.1-seccomp-nsd.patch
new file mode 100644
index 000000000000..5b7a4e51374c
--- /dev/null
+++ b/net-misc/ntpsec/files/ntpsec-1.2.1-seccomp-nsd.patch
@@ -0,0 +1,34 @@
+https://gitlab.com/NTPsec/ntpsec/-/commit/a49d53b7fe1d
+https://bugs.gentoo.org/851531
+
+From: "Maciej S. Szmigiero" <mail@maciej.szmigiero.name>
+Date: Sat, 11 Jun 2022 15:16:15 +0200
+Subject: [PATCH] ntpd/ntp_sandbox.c: allow readv() for glibc nscd
+ getaddrinfo() provider
+
+Otherwise, ntpd crashes from time to time with the following stack trace:
+#0 0x00007f5763bfac4d in readv () from /lib64/libc.so.6
+#1 0x00007f5763c48b4c in __readvall () from /lib64/libc.so.6
+#2 0x00007f5763c467ed in nscd_gethst_r () from /lib64/libc.so.6
+#3 0x00007f5763c46c0d in __nscd_gethostbyname2_r () from /lib64/libc.so.6
+#4 0x00007f5763c15a2a in gethostbyname2_r () from /lib64/libc.so.6
+#5 0x00007f5763bed3ca in gaih_inet.constprop () from /lib64/libc.so.6
+#6 0x00007f5763bee225 in getaddrinfo () from /lib64/libc.so.6
+#7 0x000055fcf0ad6544 in open_TCP_socket ()
+#8 0x000055fcf0ad79b4 in nts_probe ()
+#9 0x000055fcf0ac37c4 in dns_lookup ()
+#10 0x00007f5763b8205a in start_thread () from /lib64/libc.so.6
+#11 0x00007f5763c05d1c in clone3 () from /lib64/libc.so.6
+
+Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
+--- a/ntpd/ntp_sandbox.c
++++ b/ntpd/ntp_sandbox.c
+@@ -357,6 +357,7 @@ int scmp_sc[] = {
+ SCMP_SYS(poll),
+ SCMP_SYS(pselect6),
+ SCMP_SYS(read),
++ SCMP_SYS(readv), /* nscd getaddrinfo() provider */
+ SCMP_SYS(recvfrom), /* Comment this out for testing.
+ * It will die on the first reply.
+ * (Or maybe sooner if a request arrives.)
+GitLab
diff --git a/net-misc/ntpsec/ntpsec-1.2.1-r3.ebuild b/net-misc/ntpsec/ntpsec-1.2.1-r3.ebuild
index 69d38d6263b9..93bcb0332fab 100644
--- a/net-misc/ntpsec/ntpsec-1.2.1-r3.ebuild
+++ b/net-misc/ntpsec/ntpsec-1.2.1-r3.ebuild
@@ -14,7 +14,7 @@ if [[ ${PV} == *9999* ]]; then
EGIT_REPO_URI="https://gitlab.com/NTPsec/ntpsec.git"
else
SRC_URI="ftp://ftp.ntpsec.org/pub/releases/${P}.tar.gz"
- KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
+ KEYWORDS="amd64 arm arm64 ~riscv ~x86"
fi
DESCRIPTION="The NTP reference implementation, refactored"
diff --git a/net-misc/ntpsec/ntpsec-1.2.1-r4.ebuild b/net-misc/ntpsec/ntpsec-1.2.1-r4.ebuild
new file mode 100644
index 000000000000..c6da1c0300fc
--- /dev/null
+++ b/net-misc/ntpsec/ntpsec-1.2.1-r4.ebuild
@@ -0,0 +1,177 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+PYTHON_REQ_USE='threads(+)'
+DISTUTILS_USE_SETUPTOOLS=no
+
+inherit distutils-r1 flag-o-matic waf-utils systemd
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://gitlab.com/NTPsec/ntpsec.git"
+else
+ SRC_URI="ftp://ftp.ntpsec.org/pub/releases/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
+fi
+
+DESCRIPTION="The NTP reference implementation, refactored"
+HOMEPAGE="https://www.ntpsec.org/"
+
+NTPSEC_REFCLOCK=(
+ oncore trimble truetime gpsd jjy generic spectracom
+ shm pps hpgps zyfer arbiter nmea modem local
+)
+
+IUSE_NTPSEC_REFCLOCK=${NTPSEC_REFCLOCK[@]/#/rclock_}
+
+LICENSE="HPND MIT BSD-2 BSD CC-BY-SA-4.0"
+SLOT="0"
+IUSE="${IUSE_NTPSEC_REFCLOCK} debug doc early gdb heat libbsd nist ntpviz samba seccomp smear" #ionice
+REQUIRED_USE="${PYTHON_REQUIRED_USE} nist? ( rclock_local )"
+
+# net-misc/pps-tools oncore,pps
+DEPEND="${PYTHON_DEPS}
+ dev-libs/openssl:=
+ dev-python/psutil[${PYTHON_USEDEP}]
+ sys-libs/libcap
+ libbsd? ( dev-libs/libbsd:0= )
+ seccomp? ( sys-libs/libseccomp )
+ rclock_oncore? ( net-misc/pps-tools )
+ rclock_pps? ( net-misc/pps-tools )"
+RDEPEND="${DEPEND}
+ !net-misc/ntp
+ !net-misc/openntpd
+ acct-group/ntp
+ acct-user/ntp
+ ntpviz? ( sci-visualization/gnuplot media-fonts/liberation-fonts )"
+BDEPEND=">=app-text/asciidoc-8.6.8
+ dev-libs/libxslt
+ app-text/docbook-xsl-stylesheets
+ sys-devel/bison"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.1.9-remove-asciidoctor-from-config.patch"
+ "${FILESDIR}/${PN}-1.2.1-seccomp-rollup.patch"
+ "${FILESDIR}/${PN}-1.2.1-seccomp-rseq-glibc-2.35.patch"
+ "${FILESDIR}/${PN}-1.2.1-build-notests.patch"
+ "${FILESDIR}/${PN}-py3-test-clarify.patch"
+)
+
+WAF_BINARY="${S}/waf"
+
+src_prepare() {
+ default
+
+ # Remove autostripping of binaries
+ sed -i -e '/Strip binaries/d' wscript || die
+ if ! use libbsd ; then
+ eapply "${FILESDIR}/${PN}-no-bsd.patch"
+ fi
+ # remove extra default pool servers
+ sed -i '/use-pool/s/^/#/' "${S}"/etc/ntp.d/default.conf || die
+
+ python_copy_sources
+}
+
+src_configure() {
+ is-flagq -flto* && filter-flags -flto* -fuse-linker-plugin
+
+ local string_127=""
+ local rclocks="";
+ local CLOCKSTRING=""
+
+ for refclock in ${NTPSEC_REFCLOCK[@]} ; do
+ if use rclock_${refclock} ; then
+ string_127+="$refclock,"
+ fi
+ done
+ CLOCKSTRING="`echo ${string_127}|sed 's|,$||'`"
+
+ local myconf=(
+ --notests
+ --nopyc
+ --nopyo
+ --enable-pylib ext
+ --refclock="${CLOCKSTRING}"
+ #--build-epoch="$(date +%s)"
+ $(use doc || echo "--disable-doc")
+ $(use early && echo "--enable-early-droproot")
+ $(use gdb && echo "--enable-debug-gdb")
+ $(use samba && echo "--enable-mssntp")
+ $(use seccomp && echo "--enable-seccomp")
+ $(use smear && echo "--enable-leap-smear")
+ $(use debug && echo "--enable-debug")
+ )
+
+ python_configure() {
+ waf-utils_src_configure "${myconf[@]}"
+ }
+ python_foreach_impl run_in_build_dir python_configure
+}
+
+src_compile() {
+ unset MAKEOPTS
+ python_compile() {
+ waf-utils_src_compile --notests
+ }
+ python_foreach_impl run_in_build_dir python_compile
+}
+
+src_test() {
+ python_compile() {
+ waf-utils_src_compile check
+ }
+ python_foreach_impl run_in_build_dir python_compile
+}
+
+python_test() {
+ # Silence QA warning as we're running tests via src_test anyway.
+ :;
+}
+
+src_install() {
+ python_install() {
+ waf-utils_src_install --notests
+ python_fix_shebang "${ED}"
+ }
+ python_foreach_impl run_in_build_dir python_install
+ python_foreach_impl python_optimize
+
+ # Install heat generating scripts
+ use heat && dosbin "${S}"/contrib/ntpheat{,usb}
+
+ # Install the openrc files
+ newinitd "${FILESDIR}"/ntpd.rc-r3 ntp
+ newconfd "${FILESDIR}"/ntpd.confd ntp
+
+ # Install the systemd unit file
+ systemd_newunit "${FILESDIR}"/ntpd-r1.service ntpd.service
+
+ # Prepare a directory for the ntp.drift file
+ mkdir -pv "${ED}"/var/lib/ntp
+ chown ntp:ntp "${ED}"/var/lib/ntp
+ chmod 770 "${ED}"/var/lib/ntp
+ keepdir /var/lib/ntp
+
+ # Install a log rotate script
+ mkdir -pv "${ED}"/etc/logrotate.d
+ cp -v "${S}"/etc/logrotate-config.ntpd "${ED}"/etc/logrotate.d/ntpd
+
+ # Install the configuration file and sample configuration
+ cp -v "${FILESDIR}"/ntp.conf "${ED}"/etc/ntp.conf
+ cp -Rv "${S}"/etc/ntp.d/ "${ED}"/etc/
+
+ # move doc files to /usr/share/doc/"${P}"
+ use doc && mv -v "${ED}"/usr/share/doc/"${PN}" "${ED}"/usr/share/doc/"${P}"/html
+}
+
+pkg_postinst() {
+ einfo "If you want to serve time on your local network, then"
+ einfo "you should disable all the ref_clocks unless you have"
+ einfo "one and can get stable time from it. Feel free to try"
+ einfo "it but PPS probably won't work unless you have a UART"
+ einfo "GPS that actually provides PPS messages."
+}
diff --git a/net-misc/ntpsec/ntpsec-1.2.1-r5.ebuild b/net-misc/ntpsec/ntpsec-1.2.1-r5.ebuild
new file mode 100644
index 000000000000..faba59c221e6
--- /dev/null
+++ b/net-misc/ntpsec/ntpsec-1.2.1-r5.ebuild
@@ -0,0 +1,178 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+PYTHON_REQ_USE='threads(+)'
+DISTUTILS_USE_SETUPTOOLS=no
+
+inherit distutils-r1 flag-o-matic waf-utils systemd
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://gitlab.com/NTPsec/ntpsec.git"
+else
+ SRC_URI="ftp://ftp.ntpsec.org/pub/releases/${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
+fi
+
+DESCRIPTION="The NTP reference implementation, refactored"
+HOMEPAGE="https://www.ntpsec.org/"
+
+NTPSEC_REFCLOCK=(
+ oncore trimble truetime gpsd jjy generic spectracom
+ shm pps hpgps zyfer arbiter nmea modem local
+)
+
+IUSE_NTPSEC_REFCLOCK=${NTPSEC_REFCLOCK[@]/#/rclock_}
+
+LICENSE="HPND MIT BSD-2 BSD CC-BY-SA-4.0"
+SLOT="0"
+IUSE="${IUSE_NTPSEC_REFCLOCK} debug doc early gdb heat libbsd nist ntpviz samba seccomp smear" #ionice
+REQUIRED_USE="${PYTHON_REQUIRED_USE} nist? ( rclock_local )"
+
+# net-misc/pps-tools oncore,pps
+DEPEND="${PYTHON_DEPS}
+ dev-libs/openssl:=
+ dev-python/psutil[${PYTHON_USEDEP}]
+ sys-libs/libcap
+ libbsd? ( dev-libs/libbsd:0= )
+ seccomp? ( sys-libs/libseccomp )
+ rclock_oncore? ( net-misc/pps-tools )
+ rclock_pps? ( net-misc/pps-tools )"
+RDEPEND="${DEPEND}
+ !net-misc/ntp
+ !net-misc/openntpd
+ acct-group/ntp
+ acct-user/ntp
+ ntpviz? ( sci-visualization/gnuplot media-fonts/liberation-fonts )"
+BDEPEND=">=app-text/asciidoc-8.6.8
+ dev-libs/libxslt
+ app-text/docbook-xsl-stylesheets
+ sys-devel/bison"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.1.9-remove-asciidoctor-from-config.patch"
+ "${FILESDIR}/${PN}-1.2.1-seccomp-rollup.patch"
+ "${FILESDIR}/${PN}-1.2.1-seccomp-rseq-glibc-2.35.patch"
+ "${FILESDIR}/${PN}-1.2.1-build-notests.patch"
+ "${FILESDIR}/${PN}-py3-test-clarify.patch"
+ "${FILESDIR}/${PN}-1.2.1-seccomp-nsd.patch"
+)
+
+WAF_BINARY="${S}/waf"
+
+src_prepare() {
+ default
+
+ # Remove autostripping of binaries
+ sed -i -e '/Strip binaries/d' wscript || die
+ if ! use libbsd ; then
+ eapply "${FILESDIR}/${PN}-no-bsd.patch"
+ fi
+ # remove extra default pool servers
+ sed -i '/use-pool/s/^/#/' "${S}"/etc/ntp.d/default.conf || die
+
+ python_copy_sources
+}
+
+src_configure() {
+ is-flagq -flto* && filter-flags -flto* -fuse-linker-plugin
+
+ local string_127=""
+ local rclocks="";
+ local CLOCKSTRING=""
+
+ for refclock in ${NTPSEC_REFCLOCK[@]} ; do
+ if use rclock_${refclock} ; then
+ string_127+="$refclock,"
+ fi
+ done
+ CLOCKSTRING="`echo ${string_127}|sed 's|,$||'`"
+
+ local myconf=(
+ --notests
+ --nopyc
+ --nopyo
+ --enable-pylib ext
+ --refclock="${CLOCKSTRING}"
+ #--build-epoch="$(date +%s)"
+ $(use doc || echo "--disable-doc")
+ $(use early && echo "--enable-early-droproot")
+ $(use gdb && echo "--enable-debug-gdb")
+ $(use samba && echo "--enable-mssntp")
+ $(use seccomp && echo "--enable-seccomp")
+ $(use smear && echo "--enable-leap-smear")
+ $(use debug && echo "--enable-debug")
+ )
+
+ python_configure() {
+ waf-utils_src_configure "${myconf[@]}"
+ }
+ python_foreach_impl run_in_build_dir python_configure
+}
+
+src_compile() {
+ unset MAKEOPTS
+ python_compile() {
+ waf-utils_src_compile --notests
+ }
+ python_foreach_impl run_in_build_dir python_compile
+}
+
+src_test() {
+ python_compile() {
+ waf-utils_src_compile check
+ }
+ python_foreach_impl run_in_build_dir python_compile
+}
+
+python_test() {
+ # Silence QA warning as we're running tests via src_test anyway.
+ :;
+}
+
+src_install() {
+ python_install() {
+ waf-utils_src_install --notests
+ python_fix_shebang "${ED}"
+ }
+ python_foreach_impl run_in_build_dir python_install
+ python_foreach_impl python_optimize
+
+ # Install heat generating scripts
+ use heat && dosbin "${S}"/contrib/ntpheat{,usb}
+
+ # Install the openrc files
+ newinitd "${FILESDIR}"/ntpd.rc-r3 ntp
+ newconfd "${FILESDIR}"/ntpd.confd ntp
+
+ # Install the systemd unit file
+ systemd_newunit "${FILESDIR}"/ntpd-r1.service ntpd.service
+
+ # Prepare a directory for the ntp.drift file
+ mkdir -pv "${ED}"/var/lib/ntp
+ chown ntp:ntp "${ED}"/var/lib/ntp
+ chmod 770 "${ED}"/var/lib/ntp
+ keepdir /var/lib/ntp
+
+ # Install a log rotate script
+ mkdir -pv "${ED}"/etc/logrotate.d
+ cp -v "${S}"/etc/logrotate-config.ntpd "${ED}"/etc/logrotate.d/ntpd
+
+ # Install the configuration file and sample configuration
+ cp -v "${FILESDIR}"/ntp.conf "${ED}"/etc/ntp.conf
+ cp -Rv "${S}"/etc/ntp.d/ "${ED}"/etc/
+
+ # move doc files to /usr/share/doc/"${P}"
+ use doc && mv -v "${ED}"/usr/share/doc/"${PN}" "${ED}"/usr/share/doc/"${P}"/html
+}
+
+pkg_postinst() {
+ einfo "If you want to serve time on your local network, then"
+ einfo "you should disable all the ref_clocks unless you have"
+ einfo "one and can get stable time from it. Feel free to try"
+ einfo "it but PPS probably won't work unless you have a UART"
+ einfo "GPS that actually provides PPS messages."
+}
diff --git a/net-misc/ntpsec/ntpsec-1.2.1-r6.ebuild b/net-misc/ntpsec/ntpsec-1.2.1-r6.ebuild
new file mode 100644
index 000000000000..b163db94a45f
--- /dev/null
+++ b/net-misc/ntpsec/ntpsec-1.2.1-r6.ebuild
@@ -0,0 +1,169 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+PYTHON_REQ_USE='threads(+)'
+DISTUTILS_USE_SETUPTOOLS=no
+
+inherit distutils-r1 flag-o-matic waf-utils systemd
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://gitlab.com/NTPsec/ntpsec.git"
+else
+ SRC_URI="ftp://ftp.ntpsec.org/pub/releases/${P}.tar.gz"
+ KEYWORDS="amd64 arm arm64 ~riscv ~x86"
+fi
+
+DESCRIPTION="The NTP reference implementation, refactored"
+HOMEPAGE="https://www.ntpsec.org/"
+
+NTPSEC_REFCLOCK=(
+ oncore trimble truetime gpsd jjy generic spectracom
+ shm pps hpgps zyfer arbiter nmea modem local
+)
+
+IUSE_NTPSEC_REFCLOCK=${NTPSEC_REFCLOCK[@]/#/rclock_}
+
+LICENSE="HPND MIT BSD-2 BSD CC-BY-SA-4.0"
+SLOT="0"
+IUSE="${IUSE_NTPSEC_REFCLOCK} debug doc early gdb heat libbsd nist ntpviz samba seccomp smear" #ionice
+REQUIRED_USE="${PYTHON_REQUIRED_USE} nist? ( rclock_local )"
+
+# net-misc/pps-tools oncore,pps
+DEPEND="${PYTHON_DEPS}
+ dev-libs/openssl:=
+ dev-python/psutil[${PYTHON_USEDEP}]
+ sys-libs/libcap
+ libbsd? ( dev-libs/libbsd:0= )
+ seccomp? ( sys-libs/libseccomp )
+ rclock_oncore? ( net-misc/pps-tools )
+ rclock_pps? ( net-misc/pps-tools )"
+RDEPEND="${DEPEND}
+ !net-misc/ntp
+ !net-misc/openntpd
+ acct-group/ntp
+ acct-user/ntp
+ ntpviz? ( sci-visualization/gnuplot media-fonts/liberation-fonts )"
+BDEPEND=">=app-text/asciidoc-8.6.8
+ dev-libs/libxslt
+ app-text/docbook-xsl-stylesheets
+ sys-devel/bison"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-1.1.9-remove-asciidoctor-from-config.patch"
+ "${FILESDIR}/${PN}-1.2.1-seccomp-rollup.patch"
+ "${FILESDIR}/${PN}-1.2.1-seccomp-rseq-glibc-2.35.patch"
+ "${FILESDIR}/${PN}-1.2.1-build-notests.patch"
+ "${FILESDIR}/${PN}-py3-test-clarify.patch"
+ "${FILESDIR}/${PN}-1.2.1-seccomp-nsd.patch"
+)
+
+WAF_BINARY="${S}/waf"
+
+src_prepare() {
+ default
+
+ # Remove autostripping of binaries
+ sed -i -e '/Strip binaries/d' wscript || die
+ if ! use libbsd ; then
+ eapply "${FILESDIR}/${PN}-no-bsd.patch"
+ fi
+ # remove extra default pool servers
+ sed -i '/use-pool/s/^/#/' "${S}"/etc/ntp.d/default.conf || die
+
+ python_copy_sources
+}
+
+src_configure() {
+ is-flagq -flto* && filter-flags -flto* -fuse-linker-plugin
+
+ local string_127=""
+ local rclocks="";
+ local CLOCKSTRING=""
+
+ for refclock in ${NTPSEC_REFCLOCK[@]} ; do
+ if use rclock_${refclock} ; then
+ string_127+="$refclock,"
+ fi
+ done
+ CLOCKSTRING="`echo ${string_127}|sed 's|,$||'`"
+
+ myconf=(
+ --notests
+ --nopyc
+ --nopyo
+ --enable-pylib ext
+ --refclock="${CLOCKSTRING}"
+ #--build-epoch="$(date +%s)"
+ $(use doc || echo "--disable-doc")
+ $(use early && echo "--enable-early-droproot")
+ $(use gdb && echo "--enable-debug-gdb")
+ $(use samba && echo "--enable-mssntp")
+ $(use seccomp && echo "--enable-seccomp")
+ $(use smear && echo "--enable-leap-smear")
+ $(use debug && echo "--enable-debug")
+ )
+
+ distutils-r1_src_configure
+}
+
+python_configure() {
+ waf-utils_src_configure "${myconf[@]}"
+}
+
+python_compile() {
+ unset MAKEOPTS
+ waf-utils_src_compile --notests
+}
+
+python_test() {
+ waf-utils_src_compile check
+}
+
+src_install() {
+ distutils-r1_src_install
+
+ # Install heat generating scripts
+ use heat && dosbin "${S}"/contrib/ntpheat{,usb}
+
+ # Install the openrc files
+ newinitd "${FILESDIR}"/ntpd.rc-r3 ntp
+ newconfd "${FILESDIR}"/ntpd.confd ntp
+
+ # Install the systemd unit file
+ systemd_newunit "${FILESDIR}"/ntpd-r1.service ntpd.service
+
+ # Prepare a directory for the ntp.drift file
+ mkdir -pv "${ED}"/var/lib/ntp
+ chown ntp:ntp "${ED}"/var/lib/ntp
+ chmod 770 "${ED}"/var/lib/ntp
+ keepdir /var/lib/ntp
+
+ # Install a log rotate script
+ mkdir -pv "${ED}"/etc/logrotate.d
+ cp -v "${S}"/etc/logrotate-config.ntpd "${ED}"/etc/logrotate.d/ntpd
+
+ # Install the configuration file and sample configuration
+ cp -v "${FILESDIR}"/ntp.conf "${ED}"/etc/ntp.conf
+ cp -Rv "${S}"/etc/ntp.d/ "${ED}"/etc/
+
+ # move doc files to /usr/share/doc/"${P}"
+ use doc && mv -v "${ED}"/usr/share/doc/"${PN}" "${ED}"/usr/share/doc/"${P}"/html
+}
+
+python_install() {
+ waf-utils_src_install --notests
+ python_fix_shebang "${ED}"
+ python_optimize
+}
+
+pkg_postinst() {
+ einfo "If you want to serve time on your local network, then"
+ einfo "you should disable all the ref_clocks unless you have"
+ einfo "one and can get stable time from it. Feel free to try"
+ einfo "it but PPS probably won't work unless you have a UART"
+ einfo "GPS that actually provides PPS messages."
+}
diff --git a/net-misc/ntpsec/ntpsec-9999.ebuild b/net-misc/ntpsec/ntpsec-9999.ebuild
index 4d49e9065f2e..c5b75b26451e 100644
--- a/net-misc/ntpsec/ntpsec-9999.ebuild
+++ b/net-misc/ntpsec/ntpsec-9999.ebuild
@@ -54,7 +54,6 @@ BDEPEND=">=app-text/asciidoc-8.6.8
PATCHES=(
"${FILESDIR}/${PN}-1.1.9-remove-asciidoctor-from-config.patch"
- "${FILESDIR}/${PN}-py3-test-clarify.patch"
)
WAF_BINARY="${S}/waf"
@@ -87,7 +86,7 @@ src_configure() {
done
CLOCKSTRING="`echo ${string_127}|sed 's|,$||'`"
- local myconf=(
+ myconf=(
--notests
--nopyc
--nopyo
@@ -103,45 +102,30 @@ src_configure() {
$(use debug && echo "--enable-debug")
)
- python_configure() {
- waf-utils_src_configure "${myconf[@]}"
- }
- python_foreach_impl run_in_build_dir python_configure
+ distutils-r1_src_configure
}
-src_compile() {
- unset MAKEOPTS
- python_compile() {
- waf-utils_src_compile --notests
- }
- python_foreach_impl run_in_build_dir python_compile
+python_configure() {
+ waf-utils_src_configure "${myconf[@]}"
}
-src_test() {
- python_compile() {
- waf-utils_src_compile check
- }
- python_foreach_impl run_in_build_dir python_compile
+python_compile() {
+ unset MAKEOPTS
+ waf-utils_src_compile --notests
}
python_test() {
- # Silence QA warning as we're running tests via src_test anyway.
- :;
+ waf-utils_src_compile check
}
src_install() {
- python_install() {
- waf-utils_src_install --notests
- python_fix_shebang "${ED}"
- }
- python_foreach_impl run_in_build_dir python_install
- python_foreach_impl python_optimize
+ distutils-r1_src_install
# Install heat generating scripts
use heat && dosbin "${S}"/contrib/ntpheat{,usb}
# Install the openrc files
- newinitd "${FILESDIR}"/ntpd.rc-r2 ntp
+ newinitd "${FILESDIR}"/ntpd.rc-r3 ntp
newconfd "${FILESDIR}"/ntpd.confd ntp
# Install the systemd unit file
@@ -165,6 +149,12 @@ src_install() {
use doc && mv -v "${ED}"/usr/share/doc/"${PN}" "${ED}"/usr/share/doc/"${P}"/html
}
+python_install() {
+ waf-utils_src_install --notests
+ python_fix_shebang "${ED}"
+ python_optimize
+}
+
pkg_postinst() {
einfo "If you want to serve time on your local network, then"
einfo "you should disable all the ref_clocks unless you have"