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