summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2015-06-12 10:55:53 +0000
committerMichał Górny <mgorny@gentoo.org>2015-06-12 10:55:53 +0000
commit9f5d1f6eee56e9ed40f90aff3de815a185024d14 (patch)
tree3893772cc9995ec5546b11f211e60ad607d733ed /net-misc/ptpd
parentHandle packages without /usr/share/doc gracefully. (diff)
downloadgentoo-2-9f5d1f6eee56e9ed40f90aff3de815a185024d14.tar.gz
gentoo-2-9f5d1f6eee56e9ed40f90aff3de815a185024d14.tar.bz2
gentoo-2-9f5d1f6eee56e9ed40f90aff3de815a185024d14.zip
New ebuild from Jan Breuer: PTPd -- implementation of Precise Time Protocol (IEEE 1588). https://github.com/gentoo/gentoo-portage-rsync-mirror/pull/144.
(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)
Diffstat (limited to 'net-misc/ptpd')
-rw-r--r--net-misc/ptpd/ChangeLog14
-rw-r--r--net-misc/ptpd/files/ptpd-2.3.0-ntpdc.patch22
-rw-r--r--net-misc/ptpd/files/ptpd-2.3.0-statistics-clear.patch12
-rw-r--r--net-misc/ptpd/files/ptpd-2.3.1_rc4-debug-display.patch12
-rw-r--r--net-misc/ptpd/files/ptpd2.confd4
-rw-r--r--net-misc/ptpd/files/ptpd2.rc57
-rw-r--r--net-misc/ptpd/files/ptpd2.service11
-rw-r--r--net-misc/ptpd/metadata.xml21
-rw-r--r--net-misc/ptpd/ptpd-2.3.0.ebuild61
-rw-r--r--net-misc/ptpd/ptpd-2.3.1_rc4.ebuild64
10 files changed, 278 insertions, 0 deletions
diff --git a/net-misc/ptpd/ChangeLog b/net-misc/ptpd/ChangeLog
new file mode 100644
index 000000000000..0a6d7da56e61
--- /dev/null
+++ b/net-misc/ptpd/ChangeLog
@@ -0,0 +1,14 @@
+# ChangeLog for net-misc/ptpd
+# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/ptpd/ChangeLog,v 1.1 2015/06/12 10:55:53 mgorny Exp $
+
+*ptpd-2.3.1_rc4 (12 Jun 2015)
+*ptpd-2.3.0 (12 Jun 2015)
+
+ 12 Jun 2015; Michał Górny <mgorny@gentoo.org> +files/ptpd-2.3.0-ntpdc.patch,
+ +files/ptpd-2.3.0-statistics-clear.patch,
+ +files/ptpd-2.3.1_rc4-debug-display.patch, +files/ptpd2.confd,
+ +files/ptpd2.rc, +files/ptpd2.service, +metadata.xml, +ptpd-2.3.0.ebuild,
+ +ptpd-2.3.1_rc4.ebuild:
+ New ebuild from Jan Breuer: PTPd -- implementation of Precise Time Protocol
+ (IEEE 1588). https://github.com/gentoo/gentoo-portage-rsync-mirror/pull/144.
diff --git a/net-misc/ptpd/files/ptpd-2.3.0-ntpdc.patch b/net-misc/ptpd/files/ptpd-2.3.0-ntpdc.patch
new file mode 100644
index 000000000000..08b4cd3b8640
--- /dev/null
+++ b/net-misc/ptpd/files/ptpd-2.3.0-ntpdc.patch
@@ -0,0 +1,22 @@
+diff -urN ptpd-2.3.0.old/src/dep/ntpengine/ntpdcontrol.c ptpd-2.3.0.new/src/dep/ntpengine/ntpdcontrol.c
+--- ptpd-2.3.0.old/src/dep/ntpengine/ntpdcontrol.c 2013-11-22 17:17:57.000000000 +0100
++++ ptpd-2.3.0.new/src/dep/ntpengine/ntpdcontrol.c 2014-10-08 01:37:09.000000000 +0200
+@@ -74,7 +74,7 @@
+ if(!options->enableEngine)
+ return FALSE;
+
+- memset(control, 0, sizeof(control));
++ memset(control, 0, sizeof(*control));
+
+ if(!hostLookup(options->hostAddress, &control->serverAddress)) {
+ control->serverAddress = 0;
+@@ -236,8 +236,7 @@
+ int maclen;
+ static char *key;
+
+- key=malloc(21);
+- memset (key, 0, sizeof(key));
++ key=calloc(21,sizeof(char));
+ strncpy(key,options->key,20);
+
+ memset(&qpkt, 0, sizeof(qpkt));
diff --git a/net-misc/ptpd/files/ptpd-2.3.0-statistics-clear.patch b/net-misc/ptpd/files/ptpd-2.3.0-statistics-clear.patch
new file mode 100644
index 000000000000..dd20e2142eb4
--- /dev/null
+++ b/net-misc/ptpd/files/ptpd-2.3.0-statistics-clear.patch
@@ -0,0 +1,12 @@
+diff -urN ptpd-2.3.0.old/src/dep/statistics.c ptpd-2.3.0/src/dep/statistics.c
+--- ptpd-2.3.0.old/src/dep/statistics.c 2013-11-22 17:17:58.000000000 +0100
++++ ptpd-2.3.0/src/dep/statistics.c 2015-06-07 10:29:45.697110725 +0200
+@@ -528,7 +528,7 @@
+ void
+ clearPtpEngineSlaveStats(PtpEngineSlaveStats* stats)
+ {
+- memset(stats, 0, sizeof(stats));
++ memset(stats, 0, sizeof(*stats));
+ }
+
+ void
diff --git a/net-misc/ptpd/files/ptpd-2.3.1_rc4-debug-display.patch b/net-misc/ptpd/files/ptpd-2.3.1_rc4-debug-display.patch
new file mode 100644
index 000000000000..da76904274df
--- /dev/null
+++ b/net-misc/ptpd/files/ptpd-2.3.1_rc4-debug-display.patch
@@ -0,0 +1,12 @@
+diff -ur ptpd-2.3.1-rc4.old/src/ptpd.h ptpd-2.3.1-rc4.new/src/ptpd.h
+--- ptpd-2.3.1-rc4.old/src/ptpd.h 2015-06-08 23:28:46.000000000 +0200
++++ ptpd-2.3.1-rc4.new/src/ptpd.h 2015-06-12 11:35:37.200223151 +0200
+@@ -438,7 +438,7 @@
+ void mMUtcProperties_display(const MMUtcProperties*, const PtpClock*);
+ void mMTraceabilityProperties_display(const MMTraceabilityProperties*, const PtpClock*);
+ void mMDelayMechanism_display(const MMDelayMechanism*, const PtpClock*);
+-void mMlogMinPdelayReqInterval_display(const MMLogMinPdelayReqInterval*, const PtpClock*);
++void mMLogMinPdelayReqInterval_display(const MMLogMinPdelayReqInterval*, const PtpClock*);
+ void mMErrorStatus_display(const MMErrorStatus*, const PtpClock*);
+
+ void sMRequestUnicastTransmission_display(const SMRequestUnicastTransmission*, const PtpClock*);
diff --git a/net-misc/ptpd/files/ptpd2.confd b/net-misc/ptpd/files/ptpd2.confd
new file mode 100644
index 000000000000..22fe2d49285f
--- /dev/null
+++ b/net-misc/ptpd/files/ptpd2.confd
@@ -0,0 +1,4 @@
+# /etc/conf.d/ptpd2
+
+# Options to pass to ptpd2
+PTPD_OPTS=""
diff --git a/net-misc/ptpd/files/ptpd2.rc b/net-misc/ptpd/files/ptpd2.rc
new file mode 100644
index 000000000000..2faa674835a5
--- /dev/null
+++ b/net-misc/ptpd/files/ptpd2.rc
@@ -0,0 +1,57 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/ptpd/files/ptpd2.rc,v 1.1 2015/06/12 10:55:53 mgorny Exp $
+
+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}
+ eend $?
+}
+
+reload() {
+ checkconfig || return 1
+
+ ebegin "Reloading ${SVCNAME} configuration"
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/net-misc/ptpd/files/ptpd2.service b/net-misc/ptpd/files/ptpd2.service
new file mode 100644
index 000000000000..35fb34fd6897
--- /dev/null
+++ b/net-misc/ptpd/files/ptpd2.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Precise Time Protocol daemon
+Documentation=man:ptpd2(8)
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/ptpd2 -C -c /etc/ptpd2.conf
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/ptpd/metadata.xml b/net-misc/ptpd/metadata.xml
new file mode 100644
index 000000000000..a07e1da46b1a
--- /dev/null
+++ b/net-misc/ptpd/metadata.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>jan.breuer@jaybee.cz</email>
+ <name>Jan Breuer</name>
+ </maintainer>
+ <use>
+ <flag name="debug">Enable debugging informations</flag>
+ <flag name="experimental">Enable experimental features</flag>
+ <flag name="ntp">Enable NTPD cooperation</flag>
+ <flag name="snmp">Require <pkg>net-analyzer/net-snmp</pkg> to enable SNMP configuration</flag>
+ <flag name="statistics">Enable compution of statistics</flag>
+ <flag name="pcap">Require <pkg>net-libs/libpcap</pkg> to allow layer 2 (raw Ethernet) transport</flag>
+ <flag name="slave-only">Enable slave only operation (remove master mode functionality)</flag>
+ </use>
+ <upstream>
+ <remote-id type="sourceforge">ptpd</remote-id>
+ </upstream>
+</pkgmetadata>
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 000000000000..d621c08f846c
--- /dev/null
+++ b/net-misc/ptpd/ptpd-2.3.0.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/ptpd/ptpd-2.3.0.ebuild,v 1.1 2015/06/12 10:55:53 mgorny Exp $
+
+EAPI=5
+
+inherit autotools eutils flag-o-matic systemd
+
+DESCRIPTION="Precision Time Protocol daemon"
+HOMEPAGE="http://ptpd.sf.net"
+
+SRC_URI="mirror://sourceforge/ptpd/${PV}/${P}.tar.gz"
+KEYWORDS="~amd64 ~arm ~x86"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="debug experimental ntp snmp +statistics"
+RDEPEND="
+ ntp? ( net-misc/ntp )
+ snmp? ( net-analyzer/net-snmp:= )
+ net-libs/libpcap:="
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ # QA
+ epatch "${FILESDIR}/${P}-statistics-clear.patch"
+ epatch "${FILESDIR}/${P}-ntpdc.patch"
+
+ eautoreconf
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+ econf \
+ --enable-daemon \
+ $(use_enable snmp) \
+ $(use_enable experimental experimental-options) \
+ $(use_enable statistics) \
+ $(use_enable ntp ntpdc) \
+ $(use_enable debug runtime-debug)
+}
+
+src_install() {
+ emake install DESTDIR="${D}"
+
+ insinto /etc
+ newins "src/ptpd2.conf.minimal" ptpd2.conf
+
+ dodoc "src/ptpd2.conf.default-full"
+ dodoc "src/ptpd2.conf.minimal"
+
+ newinitd "${FILESDIR}/ptpd2.rc" ptpd2
+ newconfd "${FILESDIR}/ptpd2.confd" ptpd2
+
+ systemd_dounit "${FILESDIR}/ptpd2.service"
+}
+
+pkg_postinst() {
+ elog "Do not forget to setup correct network interface."
+ elog "Change the config file /etc/ptpd2.conf to suit your needs."
+}
diff --git a/net-misc/ptpd/ptpd-2.3.1_rc4.ebuild b/net-misc/ptpd/ptpd-2.3.1_rc4.ebuild
new file mode 100644
index 000000000000..4abaa9ac3432
--- /dev/null
+++ b/net-misc/ptpd/ptpd-2.3.1_rc4.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/ptpd/ptpd-2.3.1_rc4.ebuild,v 1.1 2015/06/12 10:55:53 mgorny Exp $
+
+EAPI=5
+
+inherit autotools eutils flag-o-matic systemd
+
+DESCRIPTION="Precision Time Protocol daemon"
+HOMEPAGE="http://ptpd.sf.net"
+
+MY_PV=${PV/_rc*/}
+MY_P=${P/_rc/-rc}
+
+SRC_URI="mirror://sourceforge/ptpd/${MY_PV}/${MY_P}.tar.gz"
+KEYWORDS="~amd64 ~arm ~x86"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="debug experimental ntp +pcap snmp slave-only +statistics"
+RDEPEND="
+ pcap? ( net-libs/libpcap )
+ snmp? ( net-analyzer/net-snmp )"
+DEPEND="${RDEPEND}"
+RDEPEND="${RDEPEND}
+ ntp? ( net-misc/ntp )"
+
+S="${WORKDIR}/${MY_P}"
+
+src_prepare() {
+ # QA
+ epatch "${FILESDIR}/${P}-debug-display.patch"
+
+ eautoreconf
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+ econf \
+ --enable-daemon \
+ $(use_enable snmp) \
+ $(use_enable experimental experimental-options) \
+ $(use_enable statistics) \
+ $(use_enable debug runtime-debug) \
+ $(use_enable pcap) \
+ $(use_enable slave-only)
+}
+
+src_install() {
+ emake install DESTDIR="${D}"
+
+ insinto /etc
+ newins "src/ptpd2.conf.minimal" ptpd2.conf
+
+ newinitd "${FILESDIR}/ptpd2.rc" ptpd2
+ newconfd "${FILESDIR}/ptpd2.confd" ptpd2
+
+ systemd_dounit "${FILESDIR}/ptpd2.service"
+}
+
+pkg_postinst() {
+ elog "Do not forget to setup correct network interface."
+ elog "Change the config file /etc/ptpd2.conf to suit your needs."
+}