Patrick Williams | ac13d5f | 2023-11-24 18:59:46 -0600 | [diff] [blame] | 1 | SUMMARY = "linuxptp package for linux" |
| 2 | DESCRIPTION = "Precision Time Protocol (PTP) according to IEEE standard 1588 \ |
| 3 | for Linux" |
| 4 | HOMEPAGE = "http://linuxptp.sourceforge.net/" |
| 5 | LICENSE = "GPL-2.0-only" |
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" |
| 7 | |
| 8 | LINUXPTP_SRC_URI = "http://sourceforge.net/projects/linuxptp" |
| 9 | |
| 10 | SRC_URI = "${LINUXPTP_SRC_URI}/files/v4.1/linuxptp-${PV}.tgz \ |
| 11 | file://0001-include-string.h-for-strncpy.patch \ |
| 12 | file://0002-linuxptp-Use-CC-in-incdefs.sh.patch \ |
| 13 | file://systemd/phc2sys@.service.in \ |
| 14 | file://systemd/ptp4l@.service.in \ |
| 15 | " |
| 16 | |
| 17 | SRC_URI[md5sum] = "1db8699fc155965341759be5e5aad938" |
| 18 | SRC_URI[sha256sum] = "e1743d44f8208897e30895da3579e670ff919b914feb4b5a949f3e421ddde535" |
| 19 | |
| 20 | inherit systemd |
| 21 | |
| 22 | UPSTREAM_CHECK_URI = "${LINUXPTP_SRC_URI}/files/" |
| 23 | UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/" |
| 24 | |
| 25 | EXTRA_OEMAKE = "CC='${CC}' EXTRA_CFLAGS='${CFLAGS}' mandir='${mandir}' \ |
| 26 | sbindir='${sbindir}'" |
| 27 | |
| 28 | export KBUILD_OUTPUT="${RECIPE_SYSROOT}" |
| 29 | |
| 30 | LINUXPTP_SYSTEMD_SERVICES = "phc2sys@.service ptp4l@.service" |
| 31 | |
| 32 | do_install() { |
| 33 | oe_runmake install DESTDIR=${D} |
| 34 | |
| 35 | # Install example configs from source tree |
| 36 | install -d ${D}${docdir}/${PN} |
| 37 | cp -R --no-dereference --preserve=mode,links ${S}/configs \ |
| 38 | ${D}${docdir}/${PN} |
| 39 | |
| 40 | # Install default configuration files |
| 41 | install -d ${D}/${sysconfdir}/linuxptp/ |
| 42 | install -m 644 ${S}/configs/default.cfg \ |
| 43 | ${D}${sysconfdir}/linuxptp/ptp4l.conf |
| 44 | |
| 45 | # Install systemd services |
| 46 | install -d ${D}/${systemd_unitdir}/system/ |
| 47 | for service in ${LINUXPTP_SYSTEMD_SERVICES}; do |
| 48 | sed -i -e 's,@SBINDIR@,${sbindir},g' \ |
| 49 | ${WORKDIR}/systemd/$service.in |
| 50 | sed -i -e 's,@SYSCONFDIR@,${sysconfdir},g' \ |
| 51 | ${WORKDIR}/systemd/$service.in |
| 52 | install -m 644 ${WORKDIR}/systemd/$service.in \ |
| 53 | ${D}/${systemd_unitdir}/system/$service |
| 54 | done |
| 55 | } |
| 56 | |
| 57 | SYSTEMD_SERVICE:${PN} = "${LINUXPTP_SYSTEMD_SERVICES}" |
| 58 | SYSTEMD_AUTO_ENABLE:${PN} = "disable" |
| 59 | |
| 60 | PACKAGES =+ "${PN}-configs" |
| 61 | |
| 62 | FILES:${PN}-configs += "${docdir}" |