1*4882a593SmuzhiyunSUMMARY = "The PTP daemon (PTPd)" 2*4882a593SmuzhiyunDESCRIPTION = "The PTP daemon (PTPd) implements the Precision Time protocol (PTP) as \ 3*4882a593Smuzhiyundefined by the relevant IEEE 1588 standard. PTP Version 1 implements IEEE-1588-2002, \ 4*4882a593Smuzhiyunand PTP Version 2 implements IEEE-1588-2008. PTP was developed to provide very precise \ 5*4882a593Smuzhiyuntime coordination of LAN connected computers." 6*4882a593SmuzhiyunHOMEPAGE = "http://sourceforge.net/projects/ptpd" 7*4882a593SmuzhiyunSECTION = "net" 8*4882a593SmuzhiyunLICENSE = "BSD-2-Clause" 9*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://README;md5=0733e1b3788ab2ebbc63bf33a020da1d" 10*4882a593Smuzhiyun 11*4882a593SmuzhiyunDEPENDS = "libpcap" 12*4882a593Smuzhiyun 13*4882a593Smuzhiyuninherit autotools pkgconfig systemd 14*4882a593Smuzhiyun 15*4882a593Smuzhiyun# return something like '1.2.3' or '1.2.3/rc1' 16*4882a593Smuzhiyun# 17*4882a593Smuzhiyundef get_sub(d): 18*4882a593Smuzhiyun parts = d.getVar('PV').split('-') 19*4882a593Smuzhiyun try: 20*4882a593Smuzhiyun return parts[0] + '/' + parts[1] 21*4882a593Smuzhiyun except: 22*4882a593Smuzhiyun return parts[0] 23*4882a593Smuzhiyun 24*4882a593SmuzhiyunSRC_URI = "http://downloads.sourceforge.net/project/ptpd/ptpd/${@get_sub(d)}/ptpd-${PV}.tar.gz \ 25*4882a593Smuzhiyun file://ptpd-use-pkgconfig.patch \ 26*4882a593Smuzhiyun file://Fixed-100-CPU-using-issue-by-adding-minimum-POSIX-ti.patch \ 27*4882a593Smuzhiyun file://0001-ptpd-Solve-memory-leak-for-function-NTPDCrequest.patch \ 28*4882a593Smuzhiyun file://ptpd.service \ 29*4882a593Smuzhiyun file://ptpd.conf \ 30*4882a593Smuzhiyun" 31*4882a593Smuzhiyun 32*4882a593SmuzhiyunSRC_URI[md5sum] = "253bab7ab51d969616ea811be1f132f3" 33*4882a593SmuzhiyunSRC_URI[sha256sum] = "0dbf54dd2c178bd9fe62481d2c37513ee36636d8bf137cfdad96891490cdbf93" 34*4882a593Smuzhiyun 35*4882a593SmuzhiyunUPSTREAM_CHECK_URI = "http://sourceforge.net/projects/ptpd/files/releases" 36*4882a593Smuzhiyun 37*4882a593SmuzhiyunS = "${WORKDIR}/ptpd-${PV}" 38*4882a593Smuzhiyun 39*4882a593SmuzhiyunEXTRA_OEMAKE = "" 40*4882a593Smuzhiyun 41*4882a593SmuzhiyunEXTRA_OECONF += "--disable-snmp --with-pcap-config=pkg-config" 42*4882a593Smuzhiyun 43*4882a593Smuzhiyundo_install() { 44*4882a593Smuzhiyun install -d ${D}${bindir} ${D}${mandir}/man8 45*4882a593Smuzhiyun install -m 0755 ${B}/src/ptpd2 ${D}${bindir} 46*4882a593Smuzhiyun install -m 0644 ${B}/src/ptpd2.8 ${D}${mandir}/man8 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then 49*4882a593Smuzhiyun install -d ${D}${systemd_unitdir}/system 50*4882a593Smuzhiyun install -m 0644 ${WORKDIR}/ptpd.service ${D}${systemd_unitdir}/system 51*4882a593Smuzhiyun 52*4882a593Smuzhiyun sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/ptpd.service 53*4882a593Smuzhiyun sed -i -e 's#@BINDIR@#${bindir}#g' ${D}${systemd_unitdir}/system/ptpd.service 54*4882a593Smuzhiyun 55*4882a593Smuzhiyun install -d ${D}${sysconfdir}/default/ 56*4882a593Smuzhiyun install -m 0644 ${WORKDIR}/ptpd.conf ${D}${sysconfdir}/default/ptpd 57*4882a593Smuzhiyun fi 58*4882a593Smuzhiyun} 59*4882a593Smuzhiyun 60*4882a593SmuzhiyunSYSTEMD_PACKAGES = "${PN}" 61*4882a593SmuzhiyunSYSTEMD_SERVICE:${PN} = "ptpd.service" 62*4882a593SmuzhiyunSYSTEMD_AUTO_ENABLE = "disable" 63