diff options
| author | Alex Kiernan <alex.kiernan@gmail.com> | 2021-11-03 12:10:16 +0000 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2021-11-04 07:43:14 -0700 |
| commit | 57776d013ab6f74439a6963536421b81635d783c (patch) | |
| tree | 20e15a7f492aad8151a5f98cf772c76ead206fe9 /meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb | |
| parent | 611700b6a0dcdd15dcc586652918bffb7233b761 (diff) | |
| download | meta-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.bb | 113 |
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 @@ | |||
| 1 | SUMMARY = "The Network Time Protocol suite, refactored" | ||
| 2 | HOMEPAGE = "https://www.ntpsec.org/" | ||
| 3 | |||
| 4 | LICENSE = "CC-BY-4.0 & BSD-2-Clause & NTP & BSD-3-Clause & MIT" | ||
| 5 | LIC_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 | |||
| 10 | DEPENDS += "bison-native \ | ||
| 11 | openssl \ | ||
| 12 | python3" | ||
| 13 | |||
| 14 | SRC_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 | |||
| 18 | SRC_URI[sha256sum] = "f2684835116c80b8f21782a5959a805ba3c44e3a681dd6c17c7cb00cc242c27a" | ||
| 19 | |||
| 20 | inherit pkgconfig python3-dir python3targetconfig systemd update-alternatives update-rc.d useradd waf | ||
| 21 | |||
| 22 | PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'seccomp systemd', d)} \ | ||
| 23 | cap \ | ||
| 24 | leap-smear \ | ||
| 25 | mdns \ | ||
| 26 | mssntp \ | ||
| 27 | nts \ | ||
| 28 | refclocks" | ||
| 29 | PACKAGECONFIG[cap] = ",,libcap" | ||
| 30 | PACKAGECONFIG[leap-smear] = "--enable-leap-smear" | ||
| 31 | PACKAGECONFIG[mdns] = ",,mdns" | ||
| 32 | PACKAGECONFIG[mssntp] = "--enable-mssntp" | ||
| 33 | PACKAGECONFIG[nts] = ",--disable-nts" | ||
| 34 | PACKAGECONFIG[refclocks] = "--refclock=all,,pps-tools" | ||
| 35 | PACKAGECONFIG[seccomp] = "--enable-seccomp,,libseccomp" | ||
| 36 | PACKAGECONFIG[systemd] = ",,systemd" | ||
| 37 | |||
| 38 | CC[unexport] = "1" | ||
| 39 | CFLAGS[unexport] = "1" | ||
| 40 | LDFLAGS[unexport] = "1" | ||
| 41 | |||
| 42 | export PYTHON_VERSION = "${PYTHON_BASEVERSION}" | ||
| 43 | export PYTAG = "cpython${@ d.getVar('PYTHON_BASEVERSION').replace('.', '')}" | ||
| 44 | export pyext_PATTERN = "%s.so" | ||
| 45 | export PYTHON_LDFLAGS = "-lpthread -ldl" | ||
| 46 | |||
| 47 | CFLAGS:append = " -I${PYTHON_INCLUDE_DIR}" | ||
| 48 | |||
| 49 | EXTRA_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 | |||
| 59 | EXTRA_OEWAF_BUILD ?= "-v" | ||
| 60 | |||
| 61 | NTP_USER_HOME ?= "/var/lib/ntp" | ||
| 62 | |||
| 63 | do_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 | |||
| 78 | PACKAGE_BEFORE_PN = "${PN}-python ${PN}-utils ${PN}-viz" | ||
| 79 | |||
| 80 | FILES:${PN} += "${nonarch_libdir}/tmpfiles.d/ntpsec.conf" | ||
| 81 | FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR} \ | ||
| 82 | ${libdir}/libntpc.so.*" | ||
| 83 | FILES:${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" | ||
| 92 | FILES:${PN}-viz = "${bindir}/ntplogtemp \ | ||
| 93 | ${bindir}/ntpviz" | ||
| 94 | |||
| 95 | RDEPENDS:${PN} += "libgcc" | ||
| 96 | RDEPENDS:${PN}-utils += "${PN}-python python3-core" | ||
| 97 | RDEPENDS:${PN}-viz += "gnuplot ${PN}-python python3-core python3-compression python3-ctypes python3-logging python3-shell" | ||
| 98 | |||
| 99 | USERADD_PACKAGES = "${PN}" | ||
| 100 | USERADD_PARAM:${PN} = "--system --home-dir ${NTP_USER_HOME} \ | ||
| 101 | --no-create-home \ | ||
| 102 | --shell /bin/false --user-group ntp" | ||
| 103 | |||
| 104 | INITSCRIPT_NAME = "ntpd" | ||
| 105 | |||
| 106 | SYSTEMD_PACKAGES = "${PN} ${PN}-viz" | ||
| 107 | SYSTEMD_SERVICE:${PN} = "ntpd.service ntp-wait.service" | ||
| 108 | SYSTEMD_SERVICE:${PN}-viz = "ntplogtemp.service ntpviz-weekly.timer ntpviz-weekly.service ntpviz-daily.timer ntpviz-daily.service ntplogtemp.timer" | ||
| 109 | |||
| 110 | ALTERNATIVE_PRIORITY = "80" | ||
| 111 | |||
| 112 | ALTERNATIVE:${PN} = "ntpd" | ||
| 113 | ALTERNATIVE_LINK_NAME[ntpd] = "${sbindir}/ntpd" | ||
