Gentoo Archives: gentoo-commits

From: Hans de Graaff <graaff@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/graaff:master commit in: net-misc/ptpd/files/, net-misc/ptpd/
Date: Wed, 04 Mar 2015 20:16:34
Message-Id: 1425500152.042b314a0c227e876f3bbe09dd9e6c3f6d880760.graaff@gentoo
1 commit: 042b314a0c227e876f3bbe09dd9e6c3f6d880760
2 Author: Hans de Graaff <hans <AT> degraaff <DOT> org>
3 AuthorDate: Wed Mar 4 20:15:52 2015 +0000
4 Commit: Hans de Graaff <graaff <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 4 20:15:52 2015 +0000
6 URL: http://sources.gentoo.org/gitweb/?p=dev/graaff.git;a=commit;h=042b314a
7
8 Initial import from bug 492508. Original ebuild and support files by Jan Breuer.
9
10 Package-Manager: portage-2.2.14
11
12 net-misc/ptpd/ChangeLog | 11 ++++++++
13 net-misc/ptpd/Manifest | 1 +
14 net-misc/ptpd/files/ptpd.conf | 62 +++++++++++++++++++++++++++++++++++++++++
15 net-misc/ptpd/files/ptpd.confd | 4 +++
16 net-misc/ptpd/files/ptpd.rc | 58 ++++++++++++++++++++++++++++++++++++++
17 net-misc/ptpd/metadata.xml | 16 +++++++++++
18 net-misc/ptpd/ptpd-2.3.0.ebuild | 53 +++++++++++++++++++++++++++++++++++
19 7 files changed, 205 insertions(+)
20
21 diff --git a/net-misc/ptpd/ChangeLog b/net-misc/ptpd/ChangeLog
22 new file mode 100644
23 index 0000000..f16331a
24 --- /dev/null
25 +++ b/net-misc/ptpd/ChangeLog
26 @@ -0,0 +1,11 @@
27 +# ChangeLog for net-misc/ptpd
28 +# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
29 +# $Header: $
30 +
31 +*ptpd-2.3.0 (04 Mar 2015)
32 +
33 + 04 Mar 2015; Hans de Graaff <graaff@g.o> +ptpd-2.3.0.ebuild,
34 + +files/ptpd.conf, +files/ptpd.confd, +files/ptpd.rc, +metadata.xml:
35 + Initial import from bug 492508. Original ebuild and support files by Jan
36 + Breuer.
37 +
38
39 diff --git a/net-misc/ptpd/Manifest b/net-misc/ptpd/Manifest
40 new file mode 100644
41 index 0000000..cc5da5e
42 --- /dev/null
43 +++ b/net-misc/ptpd/Manifest
44 @@ -0,0 +1 @@
45 +DIST ptpd-2.3.0.tar.gz 785362 SHA256 1a4e90496f004bfd91657ccc49209101dc25b787e540648c07c0973469f1d8f7 SHA512 eb6614ce8bfe313dd2a3bb14adcccc0b2580d7a375ead220f44f63fa9ea91e6e1e3eacd757f517e3051ff852000813cda94f21acc5ada75e604e2b20545ddf3a WHIRLPOOL cb87ed5d7ec78a3ea57d4eac14b4d72b062c339b4063d7d9c99ffba894c3ced3746b04f10ae3b4d1dc52d908dca780427ff1273924910065a1799f3e7a33bd63
46
47 diff --git a/net-misc/ptpd/files/ptpd.conf b/net-misc/ptpd/files/ptpd.conf
48 new file mode 100644
49 index 0000000..5e90823
50 --- /dev/null
51 +++ b/net-misc/ptpd/files/ptpd.conf
52 @@ -0,0 +1,62 @@
53 +; ==============================================================================
54 +; This is a recommended configuration for a PTPv2 slave
55 +; For a full list of options run ptpd2 -H or see the documentation and man pages
56 +; ==============================================================================
57 +
58 +; interface has to be specified
59 +ptpengine:interface=
60 +
61 +; PTP domain
62 +ptpengine:domain=0
63 +
64 +; available presets are slaveonly, masteronly and masterslave (full IEEE 1588 implementation)
65 +ptpengine:preset=slaveonly
66 +
67 +; multicast for both sync and delay requests - use hybrid for unicast delay requests
68 +ptpengine:ip_mode=multicast
69 +
70 +; when enabled, instead of sockets, libpcap is used to receive (sniff) and send (inject) packets.
71 +; on low latency hardware such as 10GE NICs this can provide results close to hardware-assisted PTP
72 +ptpengine:use_libpcap=n
73 +
74 +; go into panic mode for 10 minutes instead of resetting the clock
75 +ptpengine:panic_mode=y
76 +ptpengine:panic_mode_duration=10
77 +
78 +; uncomment this to enable outlier filters
79 +ptpengine:sync_outlier_filter_enable=y
80 +ptpengine:delay_outlier_filter_enable=y
81 +
82 +; store observed drift in a file
83 +clock:drift_handling=file
84 +
85 +; update online statistics every 5 seconds
86 +global:statistics_update_interval=5
87 +
88 +; wait 5 statistics intervals for one-way delay to stabilise
89 +ptpengine:calibration_delay=5
90 +
91 +; log file, event log only. if timing statistics are needed, see statistics_file
92 +global:log_file=/var/log/ptpd2.log
93 +; log file up to 5M
94 +global:log_file_max_size=5000
95 +; rotate logs up to 5 files
96 +global:log_file_max_files=5
97 +
98 +; status file providing an overview of ptpd's operation and statistics
99 +global:log_status=y
100 +
101 +; required if ip_mode is set to hybrid
102 +;ptpengine:log_delayreq_interval=0
103 +
104 +; uncomment this to log a timing log like in previous ptpd versions
105 +;global:statistics_file=/var/log/ptpd2.stats
106 +
107 +; on multi-core systems it is recommended to bind ptpd to a single core
108 +;global:cpuaffinity_cpucore=0
109 +
110 +; use DSCP 46 for expedited forwarding over ipv4 networks
111 +ptpengine:ip_dscp=46
112 +
113 +; always keep a new line in the end
114 +
115
116 diff --git a/net-misc/ptpd/files/ptpd.confd b/net-misc/ptpd/files/ptpd.confd
117 new file mode 100644
118 index 0000000..d8780f3
119 --- /dev/null
120 +++ b/net-misc/ptpd/files/ptpd.confd
121 @@ -0,0 +1,4 @@
122 +# /etc/conf.d/ptpd
123 +
124 +# Options to pass to ptpd
125 +PTPD_OPTS=""
126
127 diff --git a/net-misc/ptpd/files/ptpd.rc b/net-misc/ptpd/files/ptpd.rc
128 new file mode 100644
129 index 0000000..edb36a6
130 --- /dev/null
131 +++ b/net-misc/ptpd/files/ptpd.rc
132 @@ -0,0 +1,58 @@
133 +#!/sbin/runscript
134 +# Copyright 1999-2015 Gentoo Foundation
135 +# Distributed under the terms of the GNU General Public License v2
136 +# $Header: $
137 +
138 +PTPD_CONFIGFILE=${PTPD_CONFIGFILE:-/etc/${RC_SVCNAME}.conf}
139 +PTPD_STATEFILE_DIR=${PTPD_STATEFILE_DIR:-/var/run}
140 +PTPD_STATEFILE=${PTPD_STATEFILE:-${PTPD_STATEFILE_DIR}/${RC_SVCNAME}.status}
141 +PTPD_PIDFILE_DIR=${PTPD_PIDFILE_DIR:-/var/run}
142 +PTPD_PIDFILE=${PTPD_PIDFILE:-${PTPD_PIDFILE_DIR}/${RC_SVCNAME}.pid}
143 +
144 +extra_commands="checkconfig"
145 +extra_started_commands="reload"
146 +command="/usr/sbin/ptpd2"
147 +command_args="--global:lock_file=$PTPD_PIDFILE --global:status_file=$PTPD_STATEFILE -c $PTPD_CONFIGFILE $PTPD_OPTS"
148 +pidfile="${PTPD_PIDFILE}"
149 +description="Precise Time Protocol daemon"
150 +
151 +
152 +depend() {
153 + use net dns logger
154 +}
155 +
156 +checkconfig() {
157 + ebegin "Checking ${SVCNAME} configuration"
158 + msgout="$($command -k $command_args 2>&1)"
159 + RETVAL=$?
160 +
161 + # colorize output
162 + echo "$msgout" | while read ln; do
163 + if [[ "$ln" == *ignored* ]]; then
164 + ewarn "$ln"
165 + elif [[ "$ln" != "Configuration OK" ]]; then
166 + eerror "$ln"
167 + fi
168 + done
169 +
170 + eend $RETVAL
171 +}
172 +
173 +start() {
174 + checkconfig || return 1
175 +
176 + ebegin "Starting ${SVCNAME}"
177 + start-stop-daemon --start --exec ${command} \
178 + --pidfile ${pidfile} \
179 + -- ${command_args} 1>/dev/null 2>&1
180 + eend $?
181 +}
182 +
183 +reload() {
184 + checkconfig || return 1
185 +
186 + ebegin "Reloading ${SVCNAME} configuration"
187 + start-stop-daemon --signal HUP --pidfile "${pidfile}"
188 + eend $?
189 +}
190 +
191
192 diff --git a/net-misc/ptpd/metadata.xml b/net-misc/ptpd/metadata.xml
193 new file mode 100644
194 index 0000000..9263ff5
195 --- /dev/null
196 +++ b/net-misc/ptpd/metadata.xml
197 @@ -0,0 +1,16 @@
198 +<?xml version = '1.0' encoding = 'UTF-8'?>
199 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
200 +<pkgmetadata>
201 + <maintainer><email>graaff@g.o</email></maintainer>
202 + <use>
203 + <flag name="statistics">
204 + Enable support for realtime statistics and statistics based filtering.
205 + </flag>
206 + <flag name="ntp">
207 + Enable control of local NTP daemon and failover to local NTP.
208 + </flag>
209 + <flag name="daemon">
210 + Enable daemon mode in ptpd.
211 + </flag>
212 + </use>
213 +</pkgmetadata>
214
215 diff --git a/net-misc/ptpd/ptpd-2.3.0.ebuild b/net-misc/ptpd/ptpd-2.3.0.ebuild
216 new file mode 100644
217 index 0000000..9a50c69
218 --- /dev/null
219 +++ b/net-misc/ptpd/ptpd-2.3.0.ebuild
220 @@ -0,0 +1,53 @@
221 +# Copyright 1999-2015 Gentoo Foundation
222 +# Distributed under the terms of the GNU General Public License v2
223 +# $Header: $
224 +
225 +EAPI=5
226 +
227 +inherit autotools eutils
228 +
229 +DESCRIPTION="Precision Time Protocol daemon"
230 +HOMEPAGE="http://ptpd.sf.net"
231 +
232 +SRC_URI="mirror://sourceforge/ptpd/${PV}/${P}.tar.gz"
233 +KEYWORDS="~amd64"
234 +
235 +LICENSE="BSD"
236 +SLOT="0"
237 +IUSE="+snmp statistics debug +daemon"
238 +
239 +# Bundles dev-libs/iniparser
240 +COMMON_DEPEND=" snmp? ( net-analyzer/net-snmp )
241 + net-libs/libpcap"
242 +RDEPEND="${COMMON_DEPEND}"
243 +DEPEND="${COMMON_DEPEND}"
244 +
245 +DOCS="ChangeLog README doc/*"
246 +
247 +src_prepare() {
248 + eautoreconf
249 +}
250 +
251 +src_configure() {
252 + econf \
253 + $(use_enable snmp) \
254 + $(use_enable statistics) \
255 + $(use_enable ntp ntpdc) \
256 + $(use_enable debug runtime-debug) \
257 + $(use_enable daemon)
258 +}
259 +
260 +src_install() {
261 + emake install DESTDIR="${D}" || die "install failed"
262 +
263 + insinto /etc
264 + doins "${FILESDIR}"/ptpd.conf
265 +
266 + newinitd "${FILESDIR}"/ptpd.rc ptpd
267 + newconfd "${FILESDIR}"/ptpd.confd ptpd
268 +}
269 +
270 +pkg_postinst() {
271 + ewarn "Review /etc/ptpd.conf to setup server info."
272 + ewarn "Review /etc/conf.d/ptpd to setup init.d info."
273 +}