From 99abbc5e5a6ecd3fc981b45646fd8cb5d320377b Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 24 Feb 2018 19:58:07 +0000 Subject: gentoo resync : 24.02.2018 --- net-misc/ntpsec/Manifest | 6 ++ net-misc/ntpsec/files/ntpd.confd | 7 ++ net-misc/ntpsec/files/ntpd.rc-r1 | 23 +++++++ net-misc/ntpsec/files/ntpd.service | 15 +++++ net-misc/ntpsec/metadata.xml | 40 ++++++++++++ net-misc/ntpsec/ntpsec-1.0.0-r1.ebuild | 116 +++++++++++++++++++++++++++++++++ 6 files changed, 207 insertions(+) create mode 100644 net-misc/ntpsec/Manifest create mode 100644 net-misc/ntpsec/files/ntpd.confd create mode 100644 net-misc/ntpsec/files/ntpd.rc-r1 create mode 100644 net-misc/ntpsec/files/ntpd.service create mode 100644 net-misc/ntpsec/metadata.xml create mode 100644 net-misc/ntpsec/ntpsec-1.0.0-r1.ebuild (limited to 'net-misc/ntpsec') diff --git a/net-misc/ntpsec/Manifest b/net-misc/ntpsec/Manifest new file mode 100644 index 000000000000..cee38e4e9cab --- /dev/null +++ b/net-misc/ntpsec/Manifest @@ -0,0 +1,6 @@ +AUX ntpd.confd 222 BLAKE2B 4884ac23276fffd1c5043ed70b655b2429fcff08a24e6b9912a378fe0493e29ef3e59b11e1ec5cda2302cfba843f0fa5cf22b4499576b5e360f547122a2a194c SHA512 6513e4dce6700f437b98c0592277c336da07e72a251a8f1183d066f7dd5e0ca36c3ddf83f3102965217f70f1f26769650f5d7d3a034590e4dc9cf9f84d98b6cf +AUX ntpd.rc-r1 495 BLAKE2B b6ea30209128135f69314e7b8009f349bfc7c0811d22cba7d1d14bcdb331799cefe330d230551cef51ccbfddf6a9fb9cae385f81853ad072a263d090b82bcd59 SHA512 0519214247a978c79f1c73262f7963eaf688466b0471d5414886f6a4b40379520491a8d818a1d8eb728724c4aae9822452d71e7bd1223d4c0af5130274d7f87a +AUX ntpd.service 299 BLAKE2B 307dbf3a8569cdd1d54095bdb9b409986a9de3c7ec98405b4544f1df565828da2b685ce408061bc03f9a7991fbd61a9b42577c4e6db06bd2a4a012949cafe2dc SHA512 b625e993bbeba5da9c0f14ec8ff9d256575d9590a6c506436e834a9dc17877bfd57920b008bd01409d47de71acfb221a0d92c0203e2aacca33083e196466faf9 +DIST ntpsec-1.0.0.tar.gz 2405862 BLAKE2B b1631491500cafa5d41761fe6cb2db523450ed7801d06678048d6b8878d93dbd1e9d7cb2081a8400421213cf78a6724220236149a7f719896d1e8e48f5337d85 SHA512 9fb06310508b30d2ae2d66212d7d87b00e8eea294cebc27eb70435d764bd639fcec234b66e78deafb700476c88e47afe2d1b463563008c32efbb0644dd611f43 +EBUILD ntpsec-1.0.0-r1.ebuild 3097 BLAKE2B 35da6f84d8f85a10dd27f95015bc07163b09d84081b6c41aaf77dde48e8c4d3db6b35de30c61fadc83be7f5189d3194fd64dce0059935952613bcae0af2eebd8 SHA512 8d5278b918298c957b0567afb291dc523893de5bb06568ff7fef6c34ef628cb47e7c93251bd05a97daa957aa38a35f6ec885ce396a7f06498a2b4427da807cb6 +MISC metadata.xml 2008 BLAKE2B e4f1a7e79fbaf5011ba2b26143c138f39663be73664ec9f1270e9b6cbcb553c245201c9a5bd0771435a24e1f342907861e8a2b6808cc2e3f6d6a7a10ad6ed021 SHA512 5c8fc24233d577ebc254a6d92d93734bfb10ef287217ef61f4f6e8b28f059ee7e92bc5e18326d61a9e80fa7504f79c820d831cdad489321a9f45bae0a4d54a16 diff --git a/net-misc/ntpsec/files/ntpd.confd b/net-misc/ntpsec/files/ntpd.confd new file mode 100644 index 000000000000..92c553a62615 --- /dev/null +++ b/net-misc/ntpsec/files/ntpd.confd @@ -0,0 +1,7 @@ +# /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" +NTPD_OPTS="-g -u ntp:ntp" diff --git a/net-misc/ntpsec/files/ntpd.rc-r1 b/net-misc/ntpsec/files/ntpd.rc-r1 new file mode 100644 index 000000000000..dbe76c85e536 --- /dev/null +++ b/net-misc/ntpsec/files/ntpd.rc-r1 @@ -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="/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.service b/net-misc/ntpsec/files/ntpd.service new file mode 100644 index 000000000000..a551bb7b1307 --- /dev/null +++ b/net-misc/ntpsec/files/ntpd.service @@ -0,0 +1,15 @@ +[Unit] +Description=Network Time Service +After=network.target nss-lookup.target +Conflicts=systemd-timesyncd.service + +[Service] +Type=forking +PrivateTmp=true +EnvironmentFile=-/etc/conf.d/ntp +ExecStart=/usr/sbin/ntpd ${NTPD_OPTS} +Restart=always +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/net-misc/ntpsec/metadata.xml b/net-misc/ntpsec/metadata.xml new file mode 100644 index 000000000000..018f5f40f71b --- /dev/null +++ b/net-misc/ntpsec/metadata.xml @@ -0,0 +1,40 @@ + + + + + nerdboy@gentoo.org + Stephen L Arnold + + + blueness@gentoo.org + Anthony G. Basile + + +NTPsec project - a secure, hardened, and improved implementation of Network Time Protocol derived from NTP Classic, Dave Mills’s original. + + + Drop root privileges early + Enable debugging with gdb + Install contrib heat generating scripts + Enable lockclock + Make visualizations of offsets, jiffies, etc. + Oncore driver + Trimble driver + Trutime driver (deprecated) + Enable gpsd daemon support + JJY driver + Enable support for generic time radios and GPSDOs + Spectracom driver + Obtain refclock info from shared memory-segment + PPS cesium clock driver + Hewlett Packard GPS driver + Zyfer driver + Arbiter 1088A/B GPS driver + NMEA GPS driver + NeoClock4X DCF77/TDF driver + NIST/USNO/PTB Modem Time Services + Support for undisciplined local clock (not recommended) + Specify the interval over which a leap second is applied (experimental) + Enable tests + + diff --git a/net-misc/ntpsec/ntpsec-1.0.0-r1.ebuild b/net-misc/ntpsec/ntpsec-1.0.0-r1.ebuild new file mode 100644 index 000000000000..91a7ea1e911c --- /dev/null +++ b/net-misc/ntpsec/ntpsec-1.0.0-r1.ebuild @@ -0,0 +1,116 @@ +# 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" +} -- cgit v1.2.3