From d18bf1e01b65ee4bf0c804e2843b282d3d4e5d7c Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 15 Jun 2021 14:57:03 +0100 Subject: gentoo resync : 15.06.2021 --- net-misc/ntpsec/Manifest | 9 +- net-misc/ntpsec/files/ntpsec-1.2.0-seccomp.patch | 30 ++++ net-misc/ntpsec/ntpsec-1.1.9.ebuild | 160 --------------------- net-misc/ntpsec/ntpsec-1.2.0-r1.ebuild | 167 ---------------------- net-misc/ntpsec/ntpsec-1.2.0-r3.ebuild | 169 +++++++++++++++++++++++ net-misc/ntpsec/ntpsec-1.2.1.ebuild | 169 +++++++++++++++++++++++ net-misc/ntpsec/ntpsec-9999.ebuild | 2 +- 7 files changed, 374 insertions(+), 332 deletions(-) create mode 100644 net-misc/ntpsec/files/ntpsec-1.2.0-seccomp.patch delete mode 100644 net-misc/ntpsec/ntpsec-1.1.9.ebuild delete mode 100644 net-misc/ntpsec/ntpsec-1.2.0-r1.ebuild create mode 100644 net-misc/ntpsec/ntpsec-1.2.0-r3.ebuild create mode 100644 net-misc/ntpsec/ntpsec-1.2.1.ebuild (limited to 'net-misc/ntpsec') diff --git a/net-misc/ntpsec/Manifest b/net-misc/ntpsec/Manifest index 6e028dba60db..d0751f1b2a62 100644 --- a/net-misc/ntpsec/Manifest +++ b/net-misc/ntpsec/Manifest @@ -5,10 +5,11 @@ AUX ntpd.rc-r2 484 BLAKE2B 826a3ee09486d912525fe6d44b967e25d8b31485d89a80987afcf AUX ntpsec-1.1.8-fix-missing-scmp_sys-on-aarch64.patch 536 BLAKE2B cac17041a05d0ec22b8d95dbb16118d7603c74a7d4c873422de65451f5ddd74b7d9aceb51714d842ef7c4a37ea638212487d6db99ebfa201b01b9654b732538c SHA512 c54b3304ca467e8434e29d312e5839c788becd8ae9068737ec9725a42f22073ea0e86355999dc6d606c12f4c733497cbe48bd49b6e150c39e6540e581df6087e AUX ntpsec-1.1.9-remove-asciidoctor-from-config.patch 680 BLAKE2B 7204a831b3dc0dba7f268febd10fa7599ef6b9bee30199ce10529d2d326719f5b376d301aabfef3beacecd4af813bcef1d6a65d61ab00996d72f1240f83ef8e3 SHA512 3e012ad70507f440ed3a4aca4886a96e40d49a0dd7c14572f664633a56139cb7767e07ee1bb5e8295fc32052914364660c928d11369b6f80193ae7e190e5a48e AUX ntpsec-1.2.0-move-newfstatat.patch 544 BLAKE2B 877bb058fc2d06c315c086b5501181bac1a63d3e08bfd900bd3cd651b8dafaac0531357c4b9f30c51eccf17f0debd219daba2d3f115843ad77bb4b9bcdfb47fb SHA512 fe2fac5c6b6cd5c905209685c57ef3a2f2fb14f633b5cd0e73aaace0f7774f76b1cb1b07b6c94558a6bff3017c8498574d12b703495ef314eaf5f1298a9c078f +AUX ntpsec-1.2.0-seccomp.patch 736 BLAKE2B 9cd75079773786aea7b2c87518d9d8d4c0e49298d4a83fb57354faac5b9169fdec2fd1bd36b7bf58b2938ffa954da06e33d07d77ac518885cb876a78b17ec45e SHA512 4949332917b34ef2895da646b0415bb15aea4db07026bbaba1932312e003688718db7a506f6468cae1e1e9e5a5379acb5d244b3bc570548d30e67f2294863d2d AUX ntpsec-no-bsd.patch 1538 BLAKE2B 6abb7acf23149a5a47f8e479bff090966e7e6161fc0d5bca1f9e5b9396d90898a783e7d309d6cdbdf689ea12314c804aa7a39f05b3f11d75a95eb337cea95b55 SHA512 7ddb346c7f0c9b30ea08ac28eaa39cf86e3d6cee7eaeba3bc7fe0883acd5087966e4e7beb298cee02607dfa3198a8c1dfcd9ce43ead820de3bb7014cefe75302 -DIST ntpsec-1.1.9.tar.gz 2606066 BLAKE2B bbc482333c7f86936fa20751df1b427bc24be159969050caf5751e26724714bbf6491b120986563497f015c96ac9cdbdf0e999c6446a68798aff23076f631ecc SHA512 e04267aa675a5b528f3478d00329a569ecb9bbe2b6ad18697020854d2ee451bc188c4603cd5f420a08a7e3bf047d2db1301416f57f9156df23aceb1f57303b0b DIST ntpsec-1.2.0.tar.gz 2625968 BLAKE2B 23ceae5a1f241fcf5a17801fec2f15f9b9d9d64a108bebe29bdc75196303091eaf0efee7df67ce10acefb7c8dba90ce1144a0c0c5432797d7659714d162f26bb SHA512 9e18b3ca2f786a1ea323ba2384b51cff3d862115cea1ae576fc98172c476ac5e7d0d0fc873e47be0b19b050204ea9ed49669d94e66eb94525068dd1b08a8ae71 -EBUILD ntpsec-1.1.9.ebuild 4204 BLAKE2B 7048ffe57ab11bb95b10a136fca7c84178be03b81ae075d390c4cf90ec7c4efffb250a59d957c7c758efbef8e6ede0b38208775d19e33075f12ce61e17c9df2f SHA512 9bdcfb046201f517b8e1f249146c704e55a73b4649382402ad10bfca1bd7708daaad212fe708ef807ef0bccb8196cc7bcb41e5e2684f14c89fb94605535288ae -EBUILD ntpsec-1.2.0-r1.ebuild 4443 BLAKE2B b22f287060e4d61410c4bdcec9c2800e648a1e67b72bb154c5452494caddd88fef92d258490a0c9c18f670dafe792f0cb1b90fb29dd6b5e7bcdebf268a5d8f0e SHA512 ed762dea1c5b8f1f7f49d809a4ec3f4fa25f268ce368188797b3cbba2fdab4cbf95ba6eabaf5a89ffb22375cb1b63d3d0334f7a1c216631a5b2f98732ee200f0 -EBUILD ntpsec-9999.ebuild 4063 BLAKE2B a4bd61f498368159597b30b658ee186c14817fba8e0e27c64f2b779457a7b9df1f51c9ac1cf8b3dbb77bfac97bda5678ae0d4c60bb4ee4dd6ae91898e4aa83a5 SHA512 797245b867ba2e9fa33386fb631dff6b4c724862adf5d92e85b8ea4ae47bc9a9fc104bd99f85d7f1bb64e51fbf5d11bf16dee382ff435650463d19484103d0b7 +DIST ntpsec-1.2.1.tar.gz 2681237 BLAKE2B bfb2674131718dcf9f393e93d1148cfb6631591dbcce1ade91746586f261123b80b238393ac2a763fab119cd627f8eae4b006b023ad2b319e752db9eb4b04cc0 SHA512 0b8b0bda52d3025f6e9a06c00b1e0c25c595ada72b87ed0e5d3d6f77a034f557745156bc6d9a263c9876c041efffa38d42fa93ba8bfda31f67efbd842a726277 +EBUILD ntpsec-1.2.0-r3.ebuild 4484 BLAKE2B 1f32519192c92760de2eecf1b8b4d72f1514da7ca196840d41ad6dc237a903eecce9a33a232c22ae0203be0a41c58e1d298a2177cac909713aaff073b39f77c6 SHA512 5d29ff40f10a9afe490c5f3c2d317eecb8615aff89bf733776a8f702fdc25cf5cf1b7b7510ce3fa149a903d904f1be97e2acd350f43afcc1da6a6c1de7582b9a +EBUILD ntpsec-1.2.1.ebuild 4488 BLAKE2B 7a231efd59c854f2f1f3216131e25dc9008161b81567b6121e5d1d633594db8fd5c50336f27b28733fb9697e5e0ce73f49bb130836c6b871d512d898ff57483e SHA512 ea87adba6261a83eeb1da3ff9b1bf7be1f7a39b1fdf6cc640ec72ad49f60721efc618846d32f4e25a47cf266b044ef01c6d989324cc1477315cf138245598350 +EBUILD ntpsec-9999.ebuild 4063 BLAKE2B 46d4c35ff1b73d2af63182f38ea3d3c4b3ab28b53b31764f9e8615922239857df7cbe7397d32202402b91507547e0d6d9834184f13c249bd95e32e39ed4c1cd2 SHA512 55278b3d172de7de1eff6a9269049bbb40270ce16cd6063c550ae0c9a642300899ba22d3953b24e4abe7fb7391cd453a035892915d15d44d0cf7e7f89cc1606b MISC metadata.xml 2078 BLAKE2B c15f3c9143653044f1da8fdf1e36298df819a6266ca369c511a9d4247cf32d93377b26f4898070c60d59b4737581b22b27a1097de38c314ec03cc908a18a31d3 SHA512 691f4b463d437616d897d979538e20726eda0a4835f3209639ef0ae7ecbcea6fd01c7bfd1849b91bfdd37e71b8306daa07cf6223a08848c7e45f8128135fa6fc diff --git a/net-misc/ntpsec/files/ntpsec-1.2.0-seccomp.patch b/net-misc/ntpsec/files/ntpsec-1.2.0-seccomp.patch new file mode 100644 index 000000000000..6e61a06e12d1 --- /dev/null +++ b/net-misc/ntpsec/files/ntpsec-1.2.0-seccomp.patch @@ -0,0 +1,30 @@ +https://bugs.gentoo.org/705128 +https://bugs.gentoo.org/786228 +--- a/ntpd/ntp_sandbox.c ++++ b/ntpd/ntp_sandbox.c +@@ -463,6 +463,15 @@ int scmp_sc[] = { + SCMP_SYS(send), + SCMP_SYS(stat64), + #endif ++#if defined(__arm__) ++ SCMP_SYS(statx), ++#endif ++#if defined(__riscv32__) ++ SCMP_SYS(faccessat), ++#endif ++#if defined(__aarch64__) ++ SCMP_SYS(syscall), ++#endif + }; + { + for (unsigned int i = 0; i < COUNTOF(scmp_sc); i++) { +--- a/ntpd/ntp_sandbox.c ++++ b/ntpd/ntp_sandbox.c +@@ -355,6 +355,7 @@ int scmp_sc[] = { + SCMP_SYS(openat), /* SUSE */ + #endif + SCMP_SYS(poll), ++ SCMP_SYS(pread64), + SCMP_SYS(pselect6), + SCMP_SYS(read), + SCMP_SYS(recvfrom), /* Comment this out for testing. diff --git a/net-misc/ntpsec/ntpsec-1.1.9.ebuild b/net-misc/ntpsec/ntpsec-1.1.9.ebuild deleted file mode 100644 index f92de0e4f1d9..000000000000 --- a/net-misc/ntpsec/ntpsec-1.1.9.ebuild +++ /dev/null @@ -1,160 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -PYTHON_COMPAT=( python3_{7,8,9} ) -PYTHON_REQ_USE='threads(+)' - -inherit flag-o-matic python-r1 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/${PN}-${PV}.tar.gz" - RESTRICT="mirror" - KEYWORDS="amd64 arm arm64 ~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 neoclock 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 tests" #ionice -REQUIRED_USE="${PYTHON_REQUIRED_USE} nist? ( rclock_local )" - -# net-misc/pps-tools oncore,pps -CDEPEND="${PYTHON_DEPS} - sys-libs/libcap - dev-python/psutil[${PYTHON_USEDEP}] - libbsd? ( dev-libs/libbsd:0= ) - dev-libs/openssl:0= - seccomp? ( sys-libs/libseccomp ) -" -RDEPEND="${CDEPEND} - ntpviz? ( sci-visualization/gnuplot media-fonts/liberation-fonts ) - !net-misc/ntp - !net-misc/openntpd - acct-group/ntp - acct-user/ntp -" -DEPEND="${CDEPEND} - >=app-text/asciidoc-8.6.8 - dev-libs/libxslt - app-text/docbook-xsl-stylesheets - sys-devel/bison - rclock_oncore? ( net-misc/pps-tools ) - rclock_pps? ( net-misc/pps-tools ) -" - -PATCHES=( - "${FILESDIR}/${PN}-1.1.8-fix-missing-scmp_sys-on-aarch64.patch" - "${FILESDIR}/${P}-remove-asciidoctor-from-config.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 - 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=( - --nopyc - --nopyo - --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 tests && echo "--alltests") - $(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 - } - python_foreach_impl run_in_build_dir python_compile -} - -src_install() { - python_install() { - waf-utils_src_install - } - 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-r2 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.0-r1.ebuild b/net-misc/ntpsec/ntpsec-1.2.0-r1.ebuild deleted file mode 100644 index 1032524529cf..000000000000 --- a/net-misc/ntpsec/ntpsec-1.2.0-r1.ebuild +++ /dev/null @@ -1,167 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -PYTHON_COMPAT=( python3_{6..9} ) -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/${PN}-${PV}.tar.gz" - RESTRICT="mirror" - KEYWORDS="amd64 arm ~arm64 ~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 neoclock 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 tests" #ionice -REQUIRED_USE="${PYTHON_REQUIRED_USE} nist? ( rclock_local )" - -# net-misc/pps-tools oncore,pps -CDEPEND="${PYTHON_DEPS} - sys-libs/libcap - dev-python/psutil[${PYTHON_USEDEP}] - libbsd? ( dev-libs/libbsd:0= ) - dev-libs/openssl:0= - seccomp? ( sys-libs/libseccomp ) -" -RDEPEND="${CDEPEND} - ntpviz? ( sci-visualization/gnuplot media-fonts/liberation-fonts ) - !net-misc/ntp - !net-misc/openntpd - acct-group/ntp - acct-user/ntp -" -DEPEND="${CDEPEND} - >=app-text/asciidoc-8.6.8 - dev-libs/libxslt - app-text/docbook-xsl-stylesheets - sys-devel/bison - rclock_oncore? ( net-misc/pps-tools ) - rclock_pps? ( net-misc/pps-tools ) -" - -PATCHES=( - "${FILESDIR}/${PN}-1.1.8-fix-missing-scmp_sys-on-aarch64.patch" - "${FILESDIR}/${PN}-1.1.9-remove-asciidoctor-from-config.patch" - "${FILESDIR}/${PN}-1.2.0-move-newfstatat.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=( - --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 tests && echo "--alltests") - $(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 - } - python_foreach_impl run_in_build_dir python_compile -} - -src_install() { - python_install() { - waf-utils_src_install - 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-r2 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.0-r3.ebuild b/net-misc/ntpsec/ntpsec-1.2.0-r3.ebuild new file mode 100644 index 000000000000..9d2d01df34ea --- /dev/null +++ b/net-misc/ntpsec/ntpsec-1.2.0-r3.ebuild @@ -0,0 +1,169 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7..9} ) +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/${PN}-${PV}.tar.gz" + RESTRICT="mirror" + KEYWORDS="amd64 arm arm64 ~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 neoclock 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 tests" #ionice +REQUIRED_USE="${PYTHON_REQUIRED_USE} nist? ( rclock_local )" + +# net-misc/pps-tools oncore,pps +CDEPEND="${PYTHON_DEPS} + sys-libs/libcap + dev-python/psutil[${PYTHON_USEDEP}] + libbsd? ( dev-libs/libbsd:0= ) + dev-libs/openssl:0= + seccomp? ( sys-libs/libseccomp ) +" +RDEPEND="${CDEPEND} + ntpviz? ( sci-visualization/gnuplot media-fonts/liberation-fonts ) + !net-misc/ntp + !net-misc/openntpd + acct-group/ntp + acct-user/ntp +" +DEPEND="${CDEPEND} + >=app-text/asciidoc-8.6.8 + dev-libs/libxslt + app-text/docbook-xsl-stylesheets + sys-devel/bison + rclock_oncore? ( net-misc/pps-tools ) + rclock_pps? ( net-misc/pps-tools ) +" + +PATCHES=( + "${FILESDIR}/${PN}-1.1.8-fix-missing-scmp_sys-on-aarch64.patch" + "${FILESDIR}/${PN}-1.1.9-remove-asciidoctor-from-config.patch" + "${FILESDIR}/${PN}-1.2.0-move-newfstatat.patch" + "${FILESDIR}/${PN}-1.2.0-seccomp.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=( + --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 tests && echo "--alltests") + $(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 + } + python_foreach_impl run_in_build_dir python_compile +} + +src_install() { + python_install() { + waf-utils_src_install + 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-r2 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.ebuild b/net-misc/ntpsec/ntpsec-1.2.1.ebuild new file mode 100644 index 000000000000..593fe355639b --- /dev/null +++ b/net-misc/ntpsec/ntpsec-1.2.1.ebuild @@ -0,0 +1,169 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7..9} ) +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/${PN}-${PV}.tar.gz" + RESTRICT="mirror" + KEYWORDS="~amd64 ~arm ~arm64 ~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 neoclock 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 tests" #ionice +REQUIRED_USE="${PYTHON_REQUIRED_USE} nist? ( rclock_local )" + +# net-misc/pps-tools oncore,pps +CDEPEND="${PYTHON_DEPS} + sys-libs/libcap + dev-python/psutil[${PYTHON_USEDEP}] + libbsd? ( dev-libs/libbsd:0= ) + dev-libs/openssl:0= + seccomp? ( sys-libs/libseccomp ) +" +RDEPEND="${CDEPEND} + ntpviz? ( sci-visualization/gnuplot media-fonts/liberation-fonts ) + !net-misc/ntp + !net-misc/openntpd + acct-group/ntp + acct-user/ntp +" +DEPEND="${CDEPEND} + >=app-text/asciidoc-8.6.8 + dev-libs/libxslt + app-text/docbook-xsl-stylesheets + sys-devel/bison + rclock_oncore? ( net-misc/pps-tools ) + rclock_pps? ( net-misc/pps-tools ) +" + +PATCHES=( + "${FILESDIR}/${PN}-1.1.8-fix-missing-scmp_sys-on-aarch64.patch" + "${FILESDIR}/${PN}-1.1.9-remove-asciidoctor-from-config.patch" + "${FILESDIR}/${PN}-1.2.0-move-newfstatat.patch" + "${FILESDIR}/${PN}-1.2.0-seccomp.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=( + --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 tests && echo "--alltests") + $(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 + } + python_foreach_impl run_in_build_dir python_compile +} + +src_install() { + python_install() { + waf-utils_src_install + 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-r2 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-9999.ebuild b/net-misc/ntpsec/ntpsec-9999.ebuild index 7833fafd9711..4d520e72c5a9 100644 --- a/net-misc/ntpsec/ntpsec-9999.ebuild +++ b/net-misc/ntpsec/ntpsec-9999.ebuild @@ -1,7 +1,7 @@ # Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=6 +EAPI=7 PYTHON_COMPAT=( python3_{7,8,9} ) PYTHON_REQ_USE='threads(+)' -- cgit v1.2.3