From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id EE536138CA3 for ; Wed, 4 Mar 2015 20:16:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C8BE8E087E; Wed, 4 Mar 2015 20:16:32 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 516F7E087E for ; Wed, 4 Mar 2015 20:16:32 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E4AA734072D for ; Wed, 4 Mar 2015 20:16:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6F7BB130B2 for ; Wed, 4 Mar 2015 20:16:29 +0000 (UTC) From: "Hans de Graaff" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Hans de Graaff" Message-ID: <1425500152.042b314a0c227e876f3bbe09dd9e6c3f6d880760.graaff@gentoo> Subject: [gentoo-commits] dev/graaff:master commit in: net-misc/ptpd/files/, net-misc/ptpd/ X-VCS-Repository: dev/graaff X-VCS-Files: net-misc/ptpd/ChangeLog net-misc/ptpd/Manifest net-misc/ptpd/files/ptpd.conf net-misc/ptpd/files/ptpd.confd net-misc/ptpd/files/ptpd.rc net-misc/ptpd/metadata.xml net-misc/ptpd/ptpd-2.3.0.ebuild X-VCS-Directories: net-misc/ptpd/ net-misc/ptpd/files/ X-VCS-Committer: graaff X-VCS-Committer-Name: Hans de Graaff X-VCS-Revision: 042b314a0c227e876f3bbe09dd9e6c3f6d880760 X-VCS-Branch: master Date: Wed, 4 Mar 2015 20:16:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 9f10be9b-df97-4bb3-bced-7f9e7faad80b X-Archives-Hash: e08cf3e077356ecc23d62abd64ef7210 commit: 042b314a0c227e876f3bbe09dd9e6c3f6d880760 Author: Hans de Graaff degraaff org> AuthorDate: Wed Mar 4 20:15:52 2015 +0000 Commit: Hans de Graaff gentoo org> CommitDate: Wed Mar 4 20:15:52 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=dev/graaff.git;a=commit;h=042b314a Initial import from bug 492508. Original ebuild and support files by Jan Breuer. Package-Manager: portage-2.2.14 net-misc/ptpd/ChangeLog | 11 ++++++++ net-misc/ptpd/Manifest | 1 + net-misc/ptpd/files/ptpd.conf | 62 +++++++++++++++++++++++++++++++++++++++++ net-misc/ptpd/files/ptpd.confd | 4 +++ net-misc/ptpd/files/ptpd.rc | 58 ++++++++++++++++++++++++++++++++++++++ net-misc/ptpd/metadata.xml | 16 +++++++++++ net-misc/ptpd/ptpd-2.3.0.ebuild | 53 +++++++++++++++++++++++++++++++++++ 7 files changed, 205 insertions(+) diff --git a/net-misc/ptpd/ChangeLog b/net-misc/ptpd/ChangeLog new file mode 100644 index 0000000..f16331a --- /dev/null +++ b/net-misc/ptpd/ChangeLog @@ -0,0 +1,11 @@ +# ChangeLog for net-misc/ptpd +# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 +# $Header: $ + +*ptpd-2.3.0 (04 Mar 2015) + + 04 Mar 2015; Hans de Graaff +ptpd-2.3.0.ebuild, + +files/ptpd.conf, +files/ptpd.confd, +files/ptpd.rc, +metadata.xml: + Initial import from bug 492508. Original ebuild and support files by Jan + Breuer. + diff --git a/net-misc/ptpd/Manifest b/net-misc/ptpd/Manifest new file mode 100644 index 0000000..cc5da5e --- /dev/null +++ b/net-misc/ptpd/Manifest @@ -0,0 +1 @@ +DIST ptpd-2.3.0.tar.gz 785362 SHA256 1a4e90496f004bfd91657ccc49209101dc25b787e540648c07c0973469f1d8f7 SHA512 eb6614ce8bfe313dd2a3bb14adcccc0b2580d7a375ead220f44f63fa9ea91e6e1e3eacd757f517e3051ff852000813cda94f21acc5ada75e604e2b20545ddf3a WHIRLPOOL cb87ed5d7ec78a3ea57d4eac14b4d72b062c339b4063d7d9c99ffba894c3ced3746b04f10ae3b4d1dc52d908dca780427ff1273924910065a1799f3e7a33bd63 diff --git a/net-misc/ptpd/files/ptpd.conf b/net-misc/ptpd/files/ptpd.conf new file mode 100644 index 0000000..5e90823 --- /dev/null +++ b/net-misc/ptpd/files/ptpd.conf @@ -0,0 +1,62 @@ +; ============================================================================== +; This is a recommended configuration for a PTPv2 slave +; For a full list of options run ptpd2 -H or see the documentation and man pages +; ============================================================================== + +; interface has to be specified +ptpengine:interface= + +; PTP domain +ptpengine:domain=0 + +; available presets are slaveonly, masteronly and masterslave (full IEEE 1588 implementation) +ptpengine:preset=slaveonly + +; multicast for both sync and delay requests - use hybrid for unicast delay requests +ptpengine:ip_mode=multicast + +; when enabled, instead of sockets, libpcap is used to receive (sniff) and send (inject) packets. +; on low latency hardware such as 10GE NICs this can provide results close to hardware-assisted PTP +ptpengine:use_libpcap=n + +; go into panic mode for 10 minutes instead of resetting the clock +ptpengine:panic_mode=y +ptpengine:panic_mode_duration=10 + +; uncomment this to enable outlier filters +ptpengine:sync_outlier_filter_enable=y +ptpengine:delay_outlier_filter_enable=y + +; store observed drift in a file +clock:drift_handling=file + +; update online statistics every 5 seconds +global:statistics_update_interval=5 + +; wait 5 statistics intervals for one-way delay to stabilise +ptpengine:calibration_delay=5 + +; log file, event log only. if timing statistics are needed, see statistics_file +global:log_file=/var/log/ptpd2.log +; log file up to 5M +global:log_file_max_size=5000 +; rotate logs up to 5 files +global:log_file_max_files=5 + +; status file providing an overview of ptpd's operation and statistics +global:log_status=y + +; required if ip_mode is set to hybrid +;ptpengine:log_delayreq_interval=0 + +; uncomment this to log a timing log like in previous ptpd versions +;global:statistics_file=/var/log/ptpd2.stats + +; on multi-core systems it is recommended to bind ptpd to a single core +;global:cpuaffinity_cpucore=0 + +; use DSCP 46 for expedited forwarding over ipv4 networks +ptpengine:ip_dscp=46 + +; always keep a new line in the end + diff --git a/net-misc/ptpd/files/ptpd.confd b/net-misc/ptpd/files/ptpd.confd new file mode 100644 index 0000000..d8780f3 --- /dev/null +++ b/net-misc/ptpd/files/ptpd.confd @@ -0,0 +1,4 @@ +# /etc/conf.d/ptpd + +# Options to pass to ptpd +PTPD_OPTS="" diff --git a/net-misc/ptpd/files/ptpd.rc b/net-misc/ptpd/files/ptpd.rc new file mode 100644 index 0000000..edb36a6 --- /dev/null +++ b/net-misc/ptpd/files/ptpd.rc @@ -0,0 +1,58 @@ +#!/sbin/runscript +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +PTPD_CONFIGFILE=${PTPD_CONFIGFILE:-/etc/${RC_SVCNAME}.conf} +PTPD_STATEFILE_DIR=${PTPD_STATEFILE_DIR:-/var/run} +PTPD_STATEFILE=${PTPD_STATEFILE:-${PTPD_STATEFILE_DIR}/${RC_SVCNAME}.status} +PTPD_PIDFILE_DIR=${PTPD_PIDFILE_DIR:-/var/run} +PTPD_PIDFILE=${PTPD_PIDFILE:-${PTPD_PIDFILE_DIR}/${RC_SVCNAME}.pid} + +extra_commands="checkconfig" +extra_started_commands="reload" +command="/usr/sbin/ptpd2" +command_args="--global:lock_file=$PTPD_PIDFILE --global:status_file=$PTPD_STATEFILE -c $PTPD_CONFIGFILE $PTPD_OPTS" +pidfile="${PTPD_PIDFILE}" +description="Precise Time Protocol daemon" + + +depend() { + use net dns logger +} + +checkconfig() { + ebegin "Checking ${SVCNAME} configuration" + msgout="$($command -k $command_args 2>&1)" + RETVAL=$? + + # colorize output + echo "$msgout" | while read ln; do + if [[ "$ln" == *ignored* ]]; then + ewarn "$ln" + elif [[ "$ln" != "Configuration OK" ]]; then + eerror "$ln" + fi + done + + eend $RETVAL +} + +start() { + checkconfig || return 1 + + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start --exec ${command} \ + --pidfile ${pidfile} \ + -- ${command_args} 1>/dev/null 2>&1 + eend $? +} + +reload() { + checkconfig || return 1 + + ebegin "Reloading ${SVCNAME} configuration" + start-stop-daemon --signal HUP --pidfile "${pidfile}" + eend $? +} + diff --git a/net-misc/ptpd/metadata.xml b/net-misc/ptpd/metadata.xml new file mode 100644 index 0000000..9263ff5 --- /dev/null +++ b/net-misc/ptpd/metadata.xml @@ -0,0 +1,16 @@ + + + + graaff@gentoo.org + + + Enable support for realtime statistics and statistics based filtering. + + + Enable control of local NTP daemon and failover to local NTP. + + + Enable daemon mode in ptpd. + + + diff --git a/net-misc/ptpd/ptpd-2.3.0.ebuild b/net-misc/ptpd/ptpd-2.3.0.ebuild new file mode 100644 index 0000000..9a50c69 --- /dev/null +++ b/net-misc/ptpd/ptpd-2.3.0.ebuild @@ -0,0 +1,53 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +EAPI=5 + +inherit autotools eutils + +DESCRIPTION="Precision Time Protocol daemon" +HOMEPAGE="http://ptpd.sf.net" + +SRC_URI="mirror://sourceforge/ptpd/${PV}/${P}.tar.gz" +KEYWORDS="~amd64" + +LICENSE="BSD" +SLOT="0" +IUSE="+snmp statistics debug +daemon" + +# Bundles dev-libs/iniparser +COMMON_DEPEND=" snmp? ( net-analyzer/net-snmp ) + net-libs/libpcap" +RDEPEND="${COMMON_DEPEND}" +DEPEND="${COMMON_DEPEND}" + +DOCS="ChangeLog README doc/*" + +src_prepare() { + eautoreconf +} + +src_configure() { + econf \ + $(use_enable snmp) \ + $(use_enable statistics) \ + $(use_enable ntp ntpdc) \ + $(use_enable debug runtime-debug) \ + $(use_enable daemon) +} + +src_install() { + emake install DESTDIR="${D}" || die "install failed" + + insinto /etc + doins "${FILESDIR}"/ptpd.conf + + newinitd "${FILESDIR}"/ptpd.rc ptpd + newconfd "${FILESDIR}"/ptpd.confd ptpd +} + +pkg_postinst() { + ewarn "Review /etc/ptpd.conf to setup server info." + ewarn "Review /etc/conf.d/ptpd to setup init.d info." +}