blob: 9a5c9b52043c84c08878f2acd422c6da3e64f890 [file] [log] [blame]
Patrick Williamsac13d5f2023-11-24 18:59:46 -06001SUMMARY = "linuxptp package for linux"
2DESCRIPTION = "Precision Time Protocol (PTP) according to IEEE standard 1588 \
3for Linux"
4HOMEPAGE = "http://linuxptp.sourceforge.net/"
5LICENSE = "GPL-2.0-only"
6LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
7
8LINUXPTP_SRC_URI = "http://sourceforge.net/projects/linuxptp"
9
10SRC_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
17SRC_URI[md5sum] = "1db8699fc155965341759be5e5aad938"
18SRC_URI[sha256sum] = "e1743d44f8208897e30895da3579e670ff919b914feb4b5a949f3e421ddde535"
19
20inherit systemd
21
22UPSTREAM_CHECK_URI = "${LINUXPTP_SRC_URI}/files/"
23UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)/"
24
25EXTRA_OEMAKE = "CC='${CC}' EXTRA_CFLAGS='${CFLAGS}' mandir='${mandir}' \
26 sbindir='${sbindir}'"
27
28export KBUILD_OUTPUT="${RECIPE_SYSROOT}"
29
30LINUXPTP_SYSTEMD_SERVICES = "phc2sys@.service ptp4l@.service"
31
32do_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
57SYSTEMD_SERVICE:${PN} = "${LINUXPTP_SYSTEMD_SERVICES}"
58SYSTEMD_AUTO_ENABLE:${PN} = "disable"
59
60PACKAGES =+ "${PN}-configs"
61
62FILES:${PN}-configs += "${docdir}"