summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb
diff options
context:
space:
mode:
authorAlex Kiernan <alex.kiernan@gmail.com>2021-11-03 12:10:16 +0000
committerKhem Raj <raj.khem@gmail.com>2021-11-04 07:43:14 -0700
commit57776d013ab6f74439a6963536421b81635d783c (patch)
tree20e15a7f492aad8151a5f98cf772c76ead206fe9 /meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb
parent611700b6a0dcdd15dcc586652918bffb7233b761 (diff)
downloadmeta-openembedded-57776d013ab6f74439a6963536421b81635d783c.tar.gz
ntpsec: Add recipe
NTPsec, "a secure, hardened, and improved implementation of Network Time Protocol derived from NTP Classic, Dave Mills’s original." Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com> Signed-off-by: Alex Kiernan <alexk@zuma.ai> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb')
-rw-r--r--meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb113
1 files changed, 113 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb b/meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb
new file mode 100644
index 0000000000..1e075b0971
--- /dev/null
+++ b/meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb
@@ -0,0 +1,113 @@
1SUMMARY = "The Network Time Protocol suite, refactored"
2HOMEPAGE = "https://www.ntpsec.org/"
3
4LICENSE = "CC-BY-4.0 & BSD-2-Clause & NTP & BSD-3-Clause & MIT"
5LIC_FILES_CHKSUM = "file://LICENSE.adoc;md5=0520591566b6ed3a9ced8b15b4d4abf9 \
6 file://libjsmn/LICENSE;md5=38118982429881235de8adf478a8e75d \
7 file://docs/copyright.adoc;md5=9a1e3fce4b630078cb67ba2b619d2b13 \
8 file://libaes_siv/COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57"
9
10DEPENDS += "bison-native \
11 openssl \
12 python3"
13
14SRC_URI = "https://ftp.ntpsec.org/pub/releases/ntpsec-${PV}.tar.gz \
15 file://0001-Update-to-OpenSSL-3.0.0-alpha15.patch \
16 file://volatiles.ntpsec"
17
18SRC_URI[sha256sum] = "f2684835116c80b8f21782a5959a805ba3c44e3a681dd6c17c7cb00cc242c27a"
19
20inherit pkgconfig python3-dir python3targetconfig systemd update-alternatives update-rc.d useradd waf
21
22PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'seccomp systemd', d)} \
23 cap \
24 leap-smear \
25 mdns \
26 mssntp \
27 nts \
28 refclocks"
29PACKAGECONFIG[cap] = ",,libcap"
30PACKAGECONFIG[leap-smear] = "--enable-leap-smear"
31PACKAGECONFIG[mdns] = ",,mdns"
32PACKAGECONFIG[mssntp] = "--enable-mssntp"
33PACKAGECONFIG[nts] = ",--disable-nts"
34PACKAGECONFIG[refclocks] = "--refclock=all,,pps-tools"
35PACKAGECONFIG[seccomp] = "--enable-seccomp,,libseccomp"
36PACKAGECONFIG[systemd] = ",,systemd"
37
38CC[unexport] = "1"
39CFLAGS[unexport] = "1"
40LDFLAGS[unexport] = "1"
41
42export PYTHON_VERSION = "${PYTHON_BASEVERSION}"
43export PYTAG = "cpython${@ d.getVar('PYTHON_BASEVERSION').replace('.', '')}"
44export pyext_PATTERN = "%s.so"
45export PYTHON_LDFLAGS = "-lpthread -ldl"
46
47CFLAGS:append = " -I${PYTHON_INCLUDE_DIR}"
48
49EXTRA_OECONF = "--cross-compiler='${CC}' \
50 --cross-cflags='${CFLAGS}' \
51 --cross-ldflags='${LDFLAGS}' \
52 --pyshebang=${bindir}/python3 \
53 --pythondir=${PYTHON_SITEPACKAGES_DIR} \
54 --pythonarchdir=${PYTHON_SITEPACKAGES_DIR} \
55 --enable-debug \
56 --enable-debug-gdb \
57 --enable-early-droproot"
58
59EXTRA_OEWAF_BUILD ?= "-v"
60
61NTP_USER_HOME ?= "/var/lib/ntp"
62
63do_install:append() {
64 install -d ${D}${sysconfdir}/init.d
65 install -m 755 ${S}/etc/rc/ntpd ${D}${sysconfdir}/init.d
66 cp -r ${S}/etc/ntp.d ${D}${sysconfdir}
67
68 sed -e 's:@NTP_USER_HOME@:${NTP_USER_HOME}:g' ${WORKDIR}/volatiles.ntpsec >${T}/volatiles.ntpsec
69 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
70 cp ${B}/main/etc/* ${D}${systemd_system_unitdir}
71 awk '{print $1, $5, $4, $2, $3, "-"}' ${T}/volatiles.ntpsec >${T}/tmpfiles.ntpsec
72 install -D -m 0644 ${T}/tmpfiles.ntpsec ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf
73 else
74 install -D -m 0644 ${T}/volatiles.ntpsec ${D}${sysconfdir}/default/volatiles/99_${BPN}
75 fi
76}
77
78PACKAGE_BEFORE_PN = "${PN}-python ${PN}-utils ${PN}-viz"
79
80FILES:${PN} += "${nonarch_libdir}/tmpfiles.d/ntpsec.conf"
81FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR} \
82 ${libdir}/libntpc.so.*"
83FILES:${PN}-utils = "${bindir}/ntpdig \
84 ${bindir}/ntpkeygen \
85 ${bindir}/ntpleapfetch \
86 ${bindir}/ntpmon \
87 ${bindir}/ntpq \
88 ${bindir}/ntpsnmpd \
89 ${bindir}/ntpsweep \
90 ${bindir}/ntptrace \
91 ${bindir}/ntpwait"
92FILES:${PN}-viz = "${bindir}/ntplogtemp \
93 ${bindir}/ntpviz"
94
95RDEPENDS:${PN} += "libgcc"
96RDEPENDS:${PN}-utils += "${PN}-python python3-core"
97RDEPENDS:${PN}-viz += "gnuplot ${PN}-python python3-core python3-compression python3-ctypes python3-logging python3-shell"
98
99USERADD_PACKAGES = "${PN}"
100USERADD_PARAM:${PN} = "--system --home-dir ${NTP_USER_HOME} \
101 --no-create-home \
102 --shell /bin/false --user-group ntp"
103
104INITSCRIPT_NAME = "ntpd"
105
106SYSTEMD_PACKAGES = "${PN} ${PN}-viz"
107SYSTEMD_SERVICE:${PN} = "ntpd.service ntp-wait.service"
108SYSTEMD_SERVICE:${PN}-viz = "ntplogtemp.service ntpviz-weekly.timer ntpviz-weekly.service ntpviz-daily.timer ntpviz-daily.service ntplogtemp.timer"
109
110ALTERNATIVE_PRIORITY = "80"
111
112ALTERNATIVE:${PN} = "ntpd"
113ALTERNATIVE_LINK_NAME[ntpd] = "${sbindir}/ntpd"