From 06a7b5647e11a8ddf69b1c3d3ded6a8ba28b923e Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 2 Mar 2018 15:59:12 +0000 Subject: gentoo resync : 02.03.2018 --- net-misc/ntpsec/Manifest | 9 +- net-misc/ntpsec/files/ntp.conf | 21 +++ net-misc/ntpsec/files/ntpd.confd | 5 +- net-misc/ntpsec/files/ntpd.rc-r1 | 23 --- net-misc/ntpsec/files/ntpd.rc-r2 | 23 +++ .../ntpsec/files/ntpsec-1.0.0-fix-seccomp.patch | 16 +++ net-misc/ntpsec/ntpsec-1.0.0-r1.ebuild | 116 --------------- net-misc/ntpsec/ntpsec-1.0.0-r6.ebuild | 157 +++++++++++++++++++++ net-misc/ntpsec/ntpsec-9999.ebuild | 154 ++++++++++++++++++++ 9 files changed, 378 insertions(+), 146 deletions(-) create mode 100644 net-misc/ntpsec/files/ntp.conf delete mode 100644 net-misc/ntpsec/files/ntpd.rc-r1 create mode 100644 net-misc/ntpsec/files/ntpd.rc-r2 create mode 100644 net-misc/ntpsec/files/ntpsec-1.0.0-fix-seccomp.patch delete mode 100644 net-misc/ntpsec/ntpsec-1.0.0-r1.ebuild create mode 100644 net-misc/ntpsec/ntpsec-1.0.0-r6.ebuild create mode 100644 net-misc/ntpsec/ntpsec-9999.ebuild (limited to 'net-misc/ntpsec') diff --git a/net-misc/ntpsec/Manifest b/net-misc/ntpsec/Manifest index cee38e4e9cab..cea9697d4e96 100644 --- a/net-misc/ntpsec/Manifest +++ b/net-misc/ntpsec/Manifest @@ -1,6 +1,9 @@ -AUX ntpd.confd 222 BLAKE2B 4884ac23276fffd1c5043ed70b655b2429fcff08a24e6b9912a378fe0493e29ef3e59b11e1ec5cda2302cfba843f0fa5cf22b4499576b5e360f547122a2a194c SHA512 6513e4dce6700f437b98c0592277c336da07e72a251a8f1183d066f7dd5e0ca36c3ddf83f3102965217f70f1f26769650f5d7d3a034590e4dc9cf9f84d98b6cf -AUX ntpd.rc-r1 495 BLAKE2B b6ea30209128135f69314e7b8009f349bfc7c0811d22cba7d1d14bcdb331799cefe330d230551cef51ccbfddf6a9fb9cae385f81853ad072a263d090b82bcd59 SHA512 0519214247a978c79f1c73262f7963eaf688466b0471d5414886f6a4b40379520491a8d818a1d8eb728724c4aae9822452d71e7bd1223d4c0af5130274d7f87a +AUX ntp.conf 727 BLAKE2B 1b37cee807c41593ffc44994e390c98406c49154477bc2a603ba4037308ac1e3c83fc49700c1c0d6ee2e3f274dcb76bc13bfaeefdc9cd533a56cef9454ee27eb SHA512 5b55618b870e436b2160e46ede5e1b8031dab368d72bf376a6a9664f1cb528ae37e10eedeb7d438fee8155e3c50139ac240af95a14215aebbfef3133f3b68694 +AUX ntpd.confd 90 BLAKE2B 980ea88c97b1deff65f53c13410fe46bc1e19a80140776002ae2fdc0a3ad18c9855b74a70f1a89eb31854bbdad6729753c3a199cddb25b58178a79a0ea0a7050 SHA512 a2fdf88f6f55bcf0a6545db77817e3a740dba50bf56b4fdd80d335e8c909d0880fbd962041754d7f5fb3946ed131d9a739ec72008bacab9f1f47ff82dc74c542 +AUX ntpd.rc-r2 491 BLAKE2B b6f035bbdf9a9cc67d9fbee1752fa98e81bdc0d46f58fc20650513e41e7372319f7c8592ba73cafdaacb72fd3ebefcf1e524cf0e44348174104c9d88751816fd SHA512 215c8b37814de267834d6656146bf871f0e0da66cbd472d43d9b304ce73326bdfc4ba6624545988a8d7ca09e8a52e183c89081bdb690137a7e6d174aff97a42a AUX ntpd.service 299 BLAKE2B 307dbf3a8569cdd1d54095bdb9b409986a9de3c7ec98405b4544f1df565828da2b685ce408061bc03f9a7991fbd61a9b42577c4e6db06bd2a4a012949cafe2dc SHA512 b625e993bbeba5da9c0f14ec8ff9d256575d9590a6c506436e834a9dc17877bfd57920b008bd01409d47de71acfb221a0d92c0203e2aacca33083e196466faf9 +AUX ntpsec-1.0.0-fix-seccomp.patch 587 BLAKE2B c937a12ed548a4d825964c66e37faebb35b3b8ca2bb6dda6a75a84cfcce04777a0e9ff48a6f3bbd82dfc9fd47977aba749dd93200e81280cea5475bc04c933f3 SHA512 12eaa510d6dac6b6e2fe764d6ec8cc8582031be25e5e6785a4813d4c150ecb36574b64f1fa8c2a7d6cf6a49423642fe875774b8d6e894f31f8605e5716313107 DIST ntpsec-1.0.0.tar.gz 2405862 BLAKE2B b1631491500cafa5d41761fe6cb2db523450ed7801d06678048d6b8878d93dbd1e9d7cb2081a8400421213cf78a6724220236149a7f719896d1e8e48f5337d85 SHA512 9fb06310508b30d2ae2d66212d7d87b00e8eea294cebc27eb70435d764bd639fcec234b66e78deafb700476c88e47afe2d1b463563008c32efbb0644dd611f43 -EBUILD ntpsec-1.0.0-r1.ebuild 3097 BLAKE2B 35da6f84d8f85a10dd27f95015bc07163b09d84081b6c41aaf77dde48e8c4d3db6b35de30c61fadc83be7f5189d3194fd64dce0059935952613bcae0af2eebd8 SHA512 8d5278b918298c957b0567afb291dc523893de5bb06568ff7fef6c34ef628cb47e7c93251bd05a97daa957aa38a35f6ec885ce396a7f06498a2b4427da807cb6 +EBUILD ntpsec-1.0.0-r6.ebuild 3984 BLAKE2B d1752c19aedecd7cb4a7522ab4f4adbc6c86daf0a3d33a45aa81f501142b0daab5e66785362f751d3603f21fdab66c17a22304365db99af5dd808ae6beccc95a SHA512 fecd7e354283d83be97445a4d7dd36e103f56e123519bbfacfd2983d8e94953dcafc461d97a628be7b019e06a989ef1778afa1af63a41d2e42b61023debc92a9 +EBUILD ntpsec-9999.ebuild 3899 BLAKE2B 2b7cd2154ca66134947d435ce1315402b9eeca0bad2400a318c1ae52a0a155089eddc2787906127eed5a33a644d25ee972abbea597e206f18364774f3ee458eb SHA512 294b7491be69d17d96d01664e26813913cf7ca0c0d18c58a81c2dd9268de625b5681097bdc4f1612e242260aa8b5c555023b2cb02f5d51267644a885de0b8da4 MISC metadata.xml 2008 BLAKE2B e4f1a7e79fbaf5011ba2b26143c138f39663be73664ec9f1270e9b6cbcb553c245201c9a5bd0771435a24e1f342907861e8a2b6808cc2e3f6d6a7a10ad6ed021 SHA512 5c8fc24233d577ebc254a6d92d93734bfb10ef287217ef61f4f6e8b28f059ee7e92bc5e18326d61a9e80fa7504f79c820d831cdad489321a9f45bae0a4d54a16 diff --git a/net-misc/ntpsec/files/ntp.conf b/net-misc/ntpsec/files/ntp.conf new file mode 100644 index 000000000000..e8d68d2ba9bf --- /dev/null +++ b/net-misc/ntpsec/files/ntp.conf @@ -0,0 +1,21 @@ +# This is a Gentoo specific configuration file so ntpsec +# works out of the box as a client. Upstream configuration +# can be found in /etc/ntp.d/, but these are not used by +# this file. They are provided as a guide to more complex +# configurations. For more information on how to configure +# ntpsec see https://docs.ntpsec.org/latest/ + +# Pools for Gentoo users +pool 0.gentoo.pool.ntp.org +pool 1.gentoo.pool.ntp.org +pool 2.gentoo.pool.ntp.org +pool 3.gentoo.pool.ntp.org + +# These are the restrictions most people want +restrict default kod limited nomodify nopeer noquery +restrict -6 default kod limited nomodify nopeer noquery +restrict 127.0.0.1 +restrict -6 ::1 + +# Don't change this location. +driftfile /var/lib/ntp/ntp.drift diff --git a/net-misc/ntpsec/files/ntpd.confd b/net-misc/ntpsec/files/ntpd.confd index 92c553a62615..50c1aac60665 100644 --- a/net-misc/ntpsec/files/ntpd.confd +++ b/net-misc/ntpsec/files/ntpd.confd @@ -1,7 +1,4 @@ # /etc/conf.d/ntpd -# Options to pass to the ntpd process -# Most people should leave this line alone ... -# however, if you know what you're doing, feel free to tweak -#NTPD_OPTS="-g -n -u ntp:ntp" +# Most people should leave this line alone. NTPD_OPTS="-g -u ntp:ntp" diff --git a/net-misc/ntpsec/files/ntpd.rc-r1 b/net-misc/ntpsec/files/ntpd.rc-r1 deleted file mode 100644 index dbe76c85e536..000000000000 --- a/net-misc/ntpsec/files/ntpd.rc-r1 +++ /dev/null @@ -1,23 +0,0 @@ -#!/sbin/openrc-run -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Id$ - -description="ntpd - the network time protocol daemon" -pidfile="/var/run/ntpd.pid" -command="/usr/sbin/ntpd" -command_args="-p ${pidfile} ${NTPD_OPTS}" -start_stop_daemon_args="--pidfile ${pidfile}" - -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/ntpd.rc-r2 b/net-misc/ntpsec/files/ntpd.rc-r2 new file mode 100644 index 000000000000..13fcbdd092d2 --- /dev/null +++ b/net-misc/ntpsec/files/ntpd.rc-r2 @@ -0,0 +1,23 @@ +#!/sbin/openrc-run +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +description="ntpd - the network time protocol daemon" +pidfile="/run/ntpd.pid" +command="/usr/sbin/ntpd" +command_args="-p ${pidfile} ${NTPD_OPTS}" +start_stop_daemon_args="--pidfile ${pidfile}" + +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.0.0-fix-seccomp.patch b/net-misc/ntpsec/files/ntpsec-1.0.0-fix-seccomp.patch new file mode 100644 index 000000000000..b9716569f631 --- /dev/null +++ b/net-misc/ntpsec/files/ntpsec-1.0.0-fix-seccomp.patch @@ -0,0 +1,16 @@ +This is a backport of https://gitlab.com/NTPsec/ntpsec/commit/eef92d6217da03ad2ae41e298d110bdb05031381 + +diff -Naur ntpsec-1.0.0.orig/ntpd/ntp_sandbox.c ntpsec-1.0.0/ntpd/ntp_sandbox.c +--- ntpsec-1.0.0.orig/ntpd/ntp_sandbox.c 2017-10-09 23:54:39.000000000 -0400 ++++ ntpsec-1.0.0/ntpd/ntp_sandbox.c 2018-02-28 07:31:28.381406881 -0500 +@@ -354,6 +354,10 @@ + SCMP_SYS(write), + SCMP_SYS(unlink), + ++#ifdef ENABLE_EARLY_DROPROOT ++ SCMP_SYS(getdents), ++#endif ++ + #ifdef ENABLE_DNS_LOOKUP + /* Don't comment out this block for testing. + * pthread_create blocks signals so it will crash diff --git a/net-misc/ntpsec/ntpsec-1.0.0-r1.ebuild b/net-misc/ntpsec/ntpsec-1.0.0-r1.ebuild deleted file mode 100644 index 91a7ea1e911c..000000000000 --- a/net-misc/ntpsec/ntpsec-1.0.0-r1.ebuild +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright 1999-2018 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 - -PYTHON_COMPAT=( python3_{4,5,6} ) -PYTHON_REQ_USE='threads(+)' - -inherit flag-o-matic python-any-r1 waf-utils systemd user - -if [[ ${PV} == *9999* ]]; then - inherit git-r3 - EGIT_REPO_URI="https://gitlab.com/NTPsec/ntpsec.git" - BDEPEND="" - KEYWORDS="" -else - SRC_URI="ftp://ftp.ntpsec.org/pub/releases/${PN}-${PV}.tar.gz" - RESTRICT="mirror" - BDEPEND="" - 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 libressl nist ntpviz samba seccomp smear tests" #ionice -REQUIRED_USE="${PYTHON_REQUIRED_USE}" - -# net-misc/pps-tools oncore,pps -CDEPEND="${PYTHON_DEPS} - ${BDEPEND} - sys-libs/libcap - dev-python/psutil - libressl? ( dev-libs/libressl:0= ) - !libressl? ( dev-libs/openssl:0= ) - seccomp? ( sys-libs/libseccomp ) -" -RDEPEND="${CDEPEND} - ntpviz? ( sci-visualization/gnuplot media-fonts/liberation-fonts ) -" -DEPEND="${CDEPEND} - app-text/asciidoc - app-text/docbook-xsl-stylesheets - sys-devel/bison - rclock_oncore? ( net-misc/pps-tools ) - rclock_pps? ( net-misc/pps-tools ) - !net-misc/ntp - !net-misc/openntpd -" - -pkg_setup() { - python-any-r1_pkg_setup - enewgroup ntp 123 - enewuser ntp 123 -1 /dev/null ntp -} - -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|,$||'`" - - # Remove autostripping of binaries - sed -i -e '/Strip binaries/d' wscript - - waf-utils_src_configure --nopyc --nopyo --refclock="${CLOCKSTRING}" \ - $(use doc && echo "--enable-doc") \ - $(use early && echo "--enable-early-droproot") \ - $(use gdb && echo "--enable-debug-gdb") \ - $(use nist && echo "--enable-lockclock") \ - $(use samba && echo "--enable-mssntp") \ - $(use seccomp && echo "--enable-seccomp") \ - $(use smear && echo "--enable-leap-smear") \ - $(use tests && echo "--alltests") \ - $(use_enable debug debug) -} - -src_install() { - waf-utils_src_install - - # Install heat generating scripts - use heat && dosbin "${S}/contrib/ntpheat"{,usb} - - # Install the openrc files - newinitd "${FILESDIR}/ntpd.rc-r1" "ntp" - newconfd "${FILESDIR}/ntpd.confd" "ntp" - - # Install the systemd unit file - systemd_newunit "${FILESDIR}/ntpd.service" ntpd.service - - # 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 files - cp -Rv "${S}/etc/ntp.d/" "${ED}/etc/" - mv -v "${ED}/etc/ntp.d/default.conf" "${ED}/etc/ntp.conf" - sed "s|includefile |includefile ntp.d/|" -i "${ED}/etc/ntp.conf" -} diff --git a/net-misc/ntpsec/ntpsec-1.0.0-r6.ebuild b/net-misc/ntpsec/ntpsec-1.0.0-r6.ebuild new file mode 100644 index 000000000000..890ec4f7ebf4 --- /dev/null +++ b/net-misc/ntpsec/ntpsec-1.0.0-r6.ebuild @@ -0,0 +1,157 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) +PYTHON_REQ_USE='threads(+)' + +inherit flag-o-matic python-r1 waf-utils systemd user + +if [[ ${PV} == *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://gitlab.com/NTPsec/ntpsec.git" + BDEPEND="" + KEYWORDS="" +else + SRC_URI="ftp://ftp.ntpsec.org/pub/releases/${PN}-${PV}.tar.gz" + RESTRICT="mirror" + BDEPEND="" + 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 libressl nist ntpviz samba seccomp smear tests" #ionice +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +# net-misc/pps-tools oncore,pps +CDEPEND="${PYTHON_DEPS} + ${BDEPEND} + sys-libs/libcap + dev-python/psutil[${PYTHON_USEDEP}] + libressl? ( dev-libs/libressl:0= ) + !libressl? ( dev-libs/openssl:0= ) + seccomp? ( sys-libs/libseccomp ) +" +RDEPEND="${CDEPEND} + ntpviz? ( sci-visualization/gnuplot media-fonts/liberation-fonts ) + !net-misc/ntp + !net-misc/openntpd +" +DEPEND="${CDEPEND} + app-text/asciidoc + app-text/docbook-xsl-stylesheets + sys-devel/bison + rclock_oncore? ( net-misc/pps-tools ) + rclock_pps? ( net-misc/pps-tools ) +" + +WAF_BINARY="${S}/waf" + +pkg_setup() { + enewgroup ntp 123 + enewuser ntp 123 -1 /dev/null ntp +} + +src_prepare() { + default + + # See https://gitlab.com/NTPsec/ntpsec/issues/460 + eapply "${FILESDIR}"/${P}-fix-seccomp.patch + + 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|,$||'`" + + # Remove autostripping of binaries + sed -i -e '/Strip binaries/d' wscript + + local myconf=( + --nopyc + --nopyo + --refclock="${CLOCKSTRING}" + $(use doc && echo "--enable-doc") + $(use early && echo "--enable-early-droproot") + $(use gdb && echo "--enable-debug-gdb") + $(use nist && echo "--enable-lockclock") + $(use samba && echo "--enable-mssntp") + $(use seccomp && echo "--enable-seccomp") + $(use smear && echo "--enable-leap-smear") + $(use tests && echo "--alltests") + $(use_enable debug 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 + + # 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.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 + + # 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/ +} + +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 new file mode 100644 index 000000000000..a4689a76e05b --- /dev/null +++ b/net-misc/ntpsec/ntpsec-9999.ebuild @@ -0,0 +1,154 @@ +# Copyright 1999-2018 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +PYTHON_COMPAT=( python2_7 python3_{4,5,6} ) +PYTHON_REQ_USE='threads(+)' + +inherit flag-o-matic python-r1 waf-utils systemd user + +if [[ ${PV} == *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://gitlab.com/NTPsec/ntpsec.git" + BDEPEND="" + KEYWORDS="" +else + SRC_URI="ftp://ftp.ntpsec.org/pub/releases/${PN}-${PV}.tar.gz" + RESTRICT="mirror" + BDEPEND="" + 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 libressl nist ntpviz samba seccomp smear tests" #ionice +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +# net-misc/pps-tools oncore,pps +CDEPEND="${PYTHON_DEPS} + ${BDEPEND} + sys-libs/libcap + dev-python/psutil[${PYTHON_USEDEP}] + libressl? ( dev-libs/libressl:0= ) + !libressl? ( dev-libs/openssl:0= ) + seccomp? ( sys-libs/libseccomp ) +" +RDEPEND="${CDEPEND} + ntpviz? ( sci-visualization/gnuplot media-fonts/liberation-fonts ) + !net-misc/ntp + !net-misc/openntpd +" +DEPEND="${CDEPEND} + app-text/asciidoc + app-text/docbook-xsl-stylesheets + sys-devel/bison + rclock_oncore? ( net-misc/pps-tools ) + rclock_pps? ( net-misc/pps-tools ) +" + +WAF_BINARY="${S}/waf" + +pkg_setup() { + enewgroup ntp 123 + enewuser ntp 123 -1 /dev/null ntp +} + +src_prepare() { + default + 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|,$||'`" + + # Remove autostripping of binaries + sed -i -e '/Strip binaries/d' wscript + + local myconf=( + --nopyc + --nopyo + --refclock="${CLOCKSTRING}" + $(use doc && echo "--enable-doc") + $(use early && echo "--enable-early-droproot") + $(use gdb && echo "--enable-debug-gdb") + $(use nist && echo "--enable-lockclock") + $(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 + + # 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.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 + + # 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/ +} + +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." +} -- cgit v1.2.3