blob: 2bd642706df53e7a971838342f8f675d452ae7e0 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001SUMMARY = "The PTP daemon (PTPd)"
2DESCRIPTION = "The PTP daemon (PTPd) implements the Precision Time protocol (PTP) as \
3defined by the relevant IEEE 1588 standard. PTP Version 1 implements IEEE-1588-2002, \
4and PTP Version 2 implements IEEE-1588-2008. PTP was developed to provide very precise \
5time coordination of LAN connected computers."
6HOMEPAGE = "http://sourceforge.net/projects/ptpd"
7SECTION = "net"
Brad Bishop2d39a062019-10-28 08:33:36 -04008LICENSE = "BSD-2-Clause"
Patrick Williamsb48b7b42016-08-17 15:04:38 -05009LIC_FILES_CHKSUM = "file://README;md5=0733e1b3788ab2ebbc63bf33a020da1d"
10
11DEPENDS = "libpcap"
12
Brad Bishop6e60e8b2018-02-01 10:27:11 -050013inherit autotools pkgconfig systemd
Patrick Williamsb48b7b42016-08-17 15:04:38 -050014
15# return something like '1.2.3' or '1.2.3/rc1'
16#
17def get_sub(d):
Brad Bishop6e60e8b2018-02-01 10:27:11 -050018 parts = d.getVar('PV').split('-')
Patrick Williamsb48b7b42016-08-17 15:04:38 -050019 try:
20 return parts[0] + '/' + parts[1]
21 except:
22 return parts[0]
23
24SRC_URI = "http://downloads.sourceforge.net/project/ptpd/ptpd/${@get_sub(d)}/ptpd-${PV}.tar.gz \
25 file://ptpd-use-pkgconfig.patch \
Andrew Geissler1548c072019-02-22 16:03:50 -060026 file://Fixed-100-CPU-using-issue-by-adding-minimum-POSIX-ti.patch \
Patrick Williamsb48b7b42016-08-17 15:04:38 -050027 file://ptpd.service \
28 file://ptpd.conf \
29"
30
31SRC_URI[md5sum] = "253bab7ab51d969616ea811be1f132f3"
32SRC_URI[sha256sum] = "0dbf54dd2c178bd9fe62481d2c37513ee36636d8bf137cfdad96891490cdbf93"
33
34S = "${WORKDIR}/ptpd-${PV}"
35
36EXTRA_OEMAKE = ""
37
38EXTRA_OECONF += "--disable-snmp --with-pcap-config=pkg-config"
39
40do_install() {
41 install -d ${D}${bindir} ${D}${mandir}/man8
42 install -m 0755 ${B}/src/ptpd2 ${D}${bindir}
43 install -m 0644 ${B}/src/ptpd2.8 ${D}${mandir}/man8
44
45 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
46 install -d ${D}${systemd_unitdir}/system
47 install -m 0644 ${WORKDIR}/ptpd.service ${D}${systemd_unitdir}/system
48
49 sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/ptpd.service
50 sed -i -e 's#@BINDIR@#${bindir}#g' ${D}${systemd_unitdir}/system/ptpd.service
51
52 install -d ${D}${sysconfdir}/default/
53 install -m 0644 ${WORKDIR}/ptpd.conf ${D}${sysconfdir}/default/ptpd
54 fi
55}
56
57SYSTEMD_PACKAGES = "${PN}"
58SYSTEMD_SERVICE_${PN} = "ptpd.service"
59SYSTEMD_AUTO_ENABLE = "disable"