commit:     d998008bf946024fd3a47f4d9b201e477b447cef
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 15 09:00:18 2022 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Mon Aug 15 09:03:27 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d998008b

net-misc/linuxptp: add 3.1.1

Closes: https://bugs.gentoo.org/864547
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 net-misc/linuxptp/Manifest                |  1 +
 net-misc/linuxptp/files/phc2sysAT.service | 13 +++++++++
 net-misc/linuxptp/files/ptp4lAT.service   | 11 ++++++++
 net-misc/linuxptp/linuxptp-3.1.1.ebuild   | 45 +++++++++++++++++++++++++++++++
 4 files changed, 70 insertions(+)

diff --git a/net-misc/linuxptp/Manifest b/net-misc/linuxptp/Manifest
index 1fca8bc9d88a..0691344ced65 100644
--- a/net-misc/linuxptp/Manifest
+++ b/net-misc/linuxptp/Manifest
@@ -1 +1,2 @@
 DIST linuxptp-2.0.tgz 184942 BLAKE2B 
79ef9d3c379769a71e652a77f05ab661db444a76a339e72106055cf900de9cabfe303c48760f11701fefe5e641d07b73fc5a250078bedf7faa3ae995ace24da3
 SHA512 
c33487a803f8cc461f790d9a137d5cf8b35cb6d292bdd2cf7a16aa666359d8c5e24667473be843182bef1e9f8d5c6af8aab8918978f10bf08257dd408bba66d6
+DIST linuxptp-3.1.1.tgz 218784 BLAKE2B 
5b46580a0e1b6e003f5f03e512c4f9b348c086f356fd47d3480da5e8223ba291fdb213798c696c37759896a99bccf21cd7e7daddce5aa5ed5701afb0e622a755
 SHA512 
c3c40987fe68480a8473097ebc3c506fb4f8f3b6456bbe637b2b3cb0b3e0182f1513b511fdc04b3607d5f7d8bd1bd22502bb86eb13f9fa4fa63a3331846b33ec

diff --git a/net-misc/linuxptp/files/phc2sysAT.service 
b/net-misc/linuxptp/files/phc2sysAT.service
new file mode 100644
index 000000000000..576c7691ba89
--- /dev/null
+++ b/net-misc/linuxptp/files/phc2sysAT.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Synchronise two or more system clocks
+Documentation=man:phc2sys
+Requires=ptp4l.service
+After=ptp4l.service
+Before=time-sync.target
+
+[Service]
+Type=simple
+ExecStart=/usr/sbin/phc2sys -w -s %I
+
+[Install]
+WantedBy=multi-user.target

diff --git a/net-misc/linuxptp/files/ptp4lAT.service 
b/net-misc/linuxptp/files/ptp4lAT.service
new file mode 100644
index 000000000000..c3844605d2e3
--- /dev/null
+++ b/net-misc/linuxptp/files/ptp4lAT.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Precision Time Protocol (PTP) service for %I
+Documentation=man:ptp4l
+After=sys-subsystem-net-devices-%i.device
+
+[Service]
+Type=simple
+ExecStart=/usr/sbin/ptp4l -f /etc/ptp4l.conf -i %I
+
+[Install]
+WantedBy=multi-user.target

diff --git a/net-misc/linuxptp/linuxptp-3.1.1.ebuild 
b/net-misc/linuxptp/linuxptp-3.1.1.ebuild
new file mode 100644
index 000000000000..faae13c19360
--- /dev/null
+++ b/net-misc/linuxptp/linuxptp-3.1.1.ebuild
@@ -0,0 +1,45 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit linux-info systemd toolchain-funcs
+
+DESCRIPTION="The Linux Precision Time Protocol (PTP) implementation"
+HOMEPAGE="http://linuxptp.sourceforge.net/";
+SRC_URI="mirror://sourceforge/project/${PN}/v$(ver_cut 1-2)/${P}.tgz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
+
+DEPEND="elibc_musl? ( sys-libs/queue-standalone )"
+
+CONFIG_CHECK="~NETWORK_PHY_TIMESTAMPING ~PPS ~PTP_1588_CLOCK"
+
+pkg_setup() {
+       linux-info_pkg_setup
+}
+
+src_compile() {
+       # parse needed additional CFLAGS
+       export MY_FLAGS=$(./incdefs.sh)
+       export EXTRA_CFLAGS="${CFLAGS} ${MY_FLAGS}"
+       emake CC="$(tc-getCC)" prefix=/usr mandir=/usr/share/man
+}
+
+src_install() {
+       emake \
+               prefix="${D}"/usr \
+               mandir="${D}"/usr/share/man \
+               infodir="${D}"/usr/share/info \
+               libdir="${D}"/usr/$(get_libdir) \
+               install
+
+       systemd_newunit "${FILESDIR}"/phc2sysAT.service phc2sys@.service
+       systemd_newunit "${FILESDIR}"/ptp4lAT.service ptp4l@.service
+       systemd_dounit "${FILESDIR}"/timemaster.service
+
+       dodoc README.org
+       dodoc -r configs
+}

Reply via email to