From 61598be67d1da6e74bd8e98c467a2b6edeb61739 Mon Sep 17 00:00:00 2001 From: Alex Kiernan Date: Tue, 24 Jan 2023 11:16:34 +0000 Subject: ntpsec: Upgrade 1.2.1 -> 1.2.2 Drop backported patches, drop `wscript: Widen the search for tags` as upstream has merged something similar which means devtool builds now work. Add BISONFLAGS support to fix build reproducbility issue. Drop `--debug` which generates internal debug info. License-Update: License files moved to separate directory Signed-off-by: Alex Kiernan Signed-off-by: Khem Raj --- .../0001-Update-to-OpenSSL-3.0.0-alpha15.patch | 111 ------------------ ...ndbox.c-allow-clone3-for-glibc-2.34-in-se.patch | 31 ----- ...ndbox.c-allow-newfstatat-on-all-archs-for.patch | 42 ------- .../0001-wscript-Add-BISONFLAGS-support.patch | 29 +++++ .../0001-wscript-Widen-the-search-for-tags.patch | 29 ----- ...ndbox.c-match-riscv-to-aarch-in-seccomp-f.patch | 34 ------ .../recipes-support/ntpsec/ntpsec_1.2.1.bb | 127 -------------------- .../recipes-support/ntpsec/ntpsec_1.2.2.bb | 129 +++++++++++++++++++++ 8 files changed, 158 insertions(+), 374 deletions(-) delete mode 100644 meta-networking/recipes-support/ntpsec/ntpsec/0001-Update-to-OpenSSL-3.0.0-alpha15.patch delete mode 100644 meta-networking/recipes-support/ntpsec/ntpsec/0001-ntpd-ntp_sandbox.c-allow-clone3-for-glibc-2.34-in-se.patch delete mode 100644 meta-networking/recipes-support/ntpsec/ntpsec/0001-ntpd-ntp_sandbox.c-allow-newfstatat-on-all-archs-for.patch create mode 100644 meta-networking/recipes-support/ntpsec/ntpsec/0001-wscript-Add-BISONFLAGS-support.patch delete mode 100644 meta-networking/recipes-support/ntpsec/ntpsec/0001-wscript-Widen-the-search-for-tags.patch delete mode 100644 meta-networking/recipes-support/ntpsec/ntpsec/0002-ntpd-ntp_sandbox.c-match-riscv-to-aarch-in-seccomp-f.patch delete mode 100644 meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb create mode 100644 meta-networking/recipes-support/ntpsec/ntpsec_1.2.2.bb diff --git a/meta-networking/recipes-support/ntpsec/ntpsec/0001-Update-to-OpenSSL-3.0.0-alpha15.patch b/meta-networking/recipes-support/ntpsec/ntpsec/0001-Update-to-OpenSSL-3.0.0-alpha15.patch deleted file mode 100644 index 825f6c93c3..0000000000 --- a/meta-networking/recipes-support/ntpsec/ntpsec/0001-Update-to-OpenSSL-3.0.0-alpha15.patch +++ /dev/null @@ -1,111 +0,0 @@ -From ba368822d0a197cb84c46c911d40d0c52cf9c391 Mon Sep 17 00:00:00 2001 -From: Hal Murray -Date: Sun, 2 May 2021 22:24:26 -0700 -Subject: [PATCH] Update to OpenSSL 3.0.0-alpha15 - -Upstream-Status: Backport [https://gitlab.com/NTPsec/ntpsec/-/commit/ba368822d0a197cb84c46c911d40d0c52cf9c391] -Signed-off-by: Alex Kiernan -Signed-off-by: Alex Kiernan ---- - attic/cmac-timing.c | 37 ++++++++++++++----------------------- - 1 file changed, 14 insertions(+), 23 deletions(-) - -diff --git a/attic/cmac-timing.c b/attic/cmac-timing.c -index c2088db63a4c..464daa76b9e6 100644 ---- a/attic/cmac-timing.c -+++ b/attic/cmac-timing.c -@@ -225,28 +225,14 @@ static void DoPKEY( - #if OPENSSL_VERSION_NUMBER > 0x20000000L - static size_t One_EVP_MAC( - EVP_MAC_CTX *ctx, /* context */ -- char *cipher, - uint8_t *key, /* key pointer */ - int keylength, /* key length */ - uint8_t *pkt, /* packet pointer */ - int pktlength /* packet length */ - ) { -- OSSL_PARAM params[3]; - size_t len = EVP_MAX_MD_SIZE; - -- params[0] = -- OSSL_PARAM_construct_utf8_string("cipher", cipher, 0); -- params[1] = -- OSSL_PARAM_construct_octet_string("key", key, keylength); -- params[2] = OSSL_PARAM_construct_end(); -- if (0 == EVP_MAC_CTX_set_params(ctx, params)) { -- unsigned long err = ERR_get_error(); -- char * str = ERR_error_string(err, NULL); -- printf("## Oops, EVP_MAC_CTX_set_params() failed: %s.\n", str); -- return 0; -- } -- -- if (0 == EVP_MAC_init(ctx)) { -+ if (0 == EVP_MAC_init(ctx, key, keylength, NULL)) { - unsigned long err = ERR_get_error(); - char * str = ERR_error_string(err, NULL); - printf("## Oops, EVP_MAC_init() failed: %s.\n", str); -@@ -255,13 +241,13 @@ static size_t One_EVP_MAC( - if (0 == EVP_MAC_update(ctx, pkt, pktlength)) { - unsigned long err = ERR_get_error(); - char * str = ERR_error_string(err, NULL); -- printf("## Oops, EVP_MAC_init() failed: %s.\n", str); -+ printf("## Oops, EVP_MAC_update() failed: %s.\n", str); - return 0; - } - if (0 == EVP_MAC_final(ctx, answer, &len, sizeof(answer))) { - unsigned long err = ERR_get_error(); - char * str = ERR_error_string(err, NULL); -- printf("## Oops, EVP_MAC_init() failed: %s.\n", str); -+ printf("## Oops, EVP_MAC_final() failed: %s.\n", str); - return 0; - } - return len; -@@ -290,7 +276,7 @@ static void Do_EVP_MAC( - - clock_gettime(CLOCK_MONOTONIC, &start); - for (int i = 0; i < SAMPLESIZE; i++) { -- digestlength = One_EVP_MAC(evp, cbc, key, keylength, pkt, pktlength); -+ digestlength = One_EVP_MAC(evp, key, keylength, pkt, pktlength); - if (0 == digestlength) break; - } - clock_gettime(CLOCK_MONOTONIC, &stop); -@@ -305,26 +291,31 @@ static size_t One_EVP_MAC2( - uint8_t *pkt, /* packet pointer */ - int pktlength /* packet length */ - ) { -+ EVP_MAC_CTX *dup; - size_t len = EVP_MAX_MD_SIZE; - -- if (0 == EVP_MAC_init(ctx)) { -+ // dup = ctx; -+ dup = EVP_MAC_CTX_dup(ctx); -+ -+ if (0 == EVP_MAC_init(dup, NULL, 0, NULL)) { - unsigned long err = ERR_get_error(); - char * str = ERR_error_string(err, NULL); - printf("## Oops, EVP_MAC_init() failed: %s.\n", str); - return 0; - } -- if (0 == EVP_MAC_update(ctx, pkt, pktlength)) { -+ if (0 == EVP_MAC_update(dup, pkt, pktlength)) { - unsigned long err = ERR_get_error(); - char * str = ERR_error_string(err, NULL); -- printf("## Oops, EVP_MAC_init() failed: %s.\n", str); -+ printf("## Oops, EVP_MAC_update() failed: %s.\n", str); - return 0; - } -- if (0 == EVP_MAC_final(ctx, answer, &len, sizeof(answer))) { -+ if (0 == EVP_MAC_final(dup, answer, &len, sizeof(answer))) { - unsigned long err = ERR_get_error(); - char * str = ERR_error_string(err, NULL); -- printf("## Oops, EVP_MAC_init() failed: %s.\n", str); -+ printf("## Oops, EVP_MAC_final() failed: %s.\n", str); - return 0; - } -+ EVP_MAC_CTX_free(dup); - return len; - } - --- -2.33.0 - diff --git a/meta-networking/recipes-support/ntpsec/ntpsec/0001-ntpd-ntp_sandbox.c-allow-clone3-for-glibc-2.34-in-se.patch b/meta-networking/recipes-support/ntpsec/ntpsec/0001-ntpd-ntp_sandbox.c-allow-clone3-for-glibc-2.34-in-se.patch deleted file mode 100644 index 112aaa2a07..0000000000 --- a/meta-networking/recipes-support/ntpsec/ntpsec/0001-ntpd-ntp_sandbox.c-allow-clone3-for-glibc-2.34-in-se.patch +++ /dev/null @@ -1,31 +0,0 @@ -From d474682bb30b93d04b7b01c2dd09832e483265ed Mon Sep 17 00:00:00 2001 -From: Sam James -Date: Sun, 14 Nov 2021 08:54:58 +0000 -Subject: [PATCH] ntpd/ntp_sandbox.c: allow clone3 for glibc-2.34 in seccomp - filter - -Bug: https://bugs.gentoo.org/823692 -Fixes: https://gitlab.com/NTPsec/ntpsec/-/issues/713 -Signed-off-by: Sam James -Upstream-Status: Backport [https://gitlab.com/NTPsec/ntpsec/-/commit/d474682bb30b93d04b7b01c2dd09832e483265ed] -Signed-off-by: Alex Kiernan -Signed-off-by: Alex Kiernan ---- - ntpd/ntp_sandbox.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/ntpd/ntp_sandbox.c b/ntpd/ntp_sandbox.c -index e66faaa8cbb0..3d6bccdfcf77 100644 ---- a/ntpd/ntp_sandbox.c -+++ b/ntpd/ntp_sandbox.c -@@ -401,6 +401,7 @@ int scmp_sc[] = { - * rather than generate a trap. - */ - SCMP_SYS(clone), /* threads */ -+ SCMP_SYS(clone3), - SCMP_SYS(kill), /* generate signal */ - SCMP_SYS(madvise), - SCMP_SYS(mprotect), --- -2.34.1 - diff --git a/meta-networking/recipes-support/ntpsec/ntpsec/0001-ntpd-ntp_sandbox.c-allow-newfstatat-on-all-archs-for.patch b/meta-networking/recipes-support/ntpsec/ntpsec/0001-ntpd-ntp_sandbox.c-allow-newfstatat-on-all-archs-for.patch deleted file mode 100644 index 3bec2cea77..0000000000 --- a/meta-networking/recipes-support/ntpsec/ntpsec/0001-ntpd-ntp_sandbox.c-allow-newfstatat-on-all-archs-for.patch +++ /dev/null @@ -1,42 +0,0 @@ -From a6c0847582305aaab122d54b635954829812922f Mon Sep 17 00:00:00 2001 -From: Alex Kiernan -Date: Thu, 30 Dec 2021 09:32:26 +0000 -Subject: [PATCH 1/2] ntpd/ntp_sandbox.c: allow newfstatat on all archs for - glibc-2.34 in seccomp filter - -On Yocto Poky, newfstatat is used on (at least) arm64, x86_64 and -riscv64: - - 2021-12-30T09:32:04 ntpd[341]: ERR: SIGSYS: got a trap. - 2021-12-30T09:32:04 ntpd[341]: ERR: SIGSYS/seccomp bad syscall 262/0xc000003e - -Upstream-Status: Backport [https://gitlab.com/NTPsec/ntpsec/-/commit/a6c0847582305aaab122d54b635954829812922f] -Signed-off-by: Alex Kiernan -Signed-off-by: Alex Kiernan ---- - ntpd/ntp_sandbox.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ntpd/ntp_sandbox.c b/ntpd/ntp_sandbox.c -index 3d6bccdfcf77..1ae82a671344 100644 ---- a/ntpd/ntp_sandbox.c -+++ b/ntpd/ntp_sandbox.c -@@ -349,6 +349,7 @@ int scmp_sc[] = { - SCMP_SYS(lseek), - SCMP_SYS(membarrier), /* Needed on Alpine 3.11.3 */ - SCMP_SYS(munmap), -+ SCMP_SYS(newfstatat), - SCMP_SYS(open), - #ifdef __NR_openat - SCMP_SYS(openat), /* SUSE */ -@@ -452,7 +453,6 @@ int scmp_sc[] = { - #endif - #if defined(__aarch64__) - SCMP_SYS(faccessat), -- SCMP_SYS(newfstatat), - SCMP_SYS(renameat), - SCMP_SYS(linkat), - SCMP_SYS(unlinkat), --- -2.34.1 - diff --git a/meta-networking/recipes-support/ntpsec/ntpsec/0001-wscript-Add-BISONFLAGS-support.patch b/meta-networking/recipes-support/ntpsec/ntpsec/0001-wscript-Add-BISONFLAGS-support.patch new file mode 100644 index 0000000000..2e3730df47 --- /dev/null +++ b/meta-networking/recipes-support/ntpsec/ntpsec/0001-wscript-Add-BISONFLAGS-support.patch @@ -0,0 +1,29 @@ +From 792cb4f9d13450251c6344eed2b35f382c98df0d Mon Sep 17 00:00:00 2001 +From: Alex Kiernan +Date: Thu, 19 Jan 2023 13:00:45 +0000 +Subject: [PATCH] wscript: Add BISONFLAGS support + +--- + wscript | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/wscript b/wscript +index 7329d6e46889..de51f1e9cdd9 100644 +--- a/wscript ++++ b/wscript +@@ -140,6 +140,7 @@ def configure(ctx): + # Ensure m4 is present, or bison will fail with SIGPIPE + ctx.find_program('m4') + ctx.load('bison') ++ ctx.add_os_flags('BISONFLAGS') + + for opt in opt_map: + ctx.env[opt] = opt_map[opt] +@@ -911,6 +912,7 @@ int main(int argc, char **argv) { + msg_setting("CFLAGS", " ".join(ctx.env.CFLAGS)) + msg_setting("LDFLAGS", " ".join(ctx.env.LDFLAGS)) + msg_setting("LINKFLAGS_NTPD", " ".join(ctx.env.LINKFLAGS_NTPD)) ++ msg_setting("BISONFLAGS", ctx.env.BISONFLAGS) + msg_setting("PREFIX", ctx.env.PREFIX) + msg_setting("LIBDIR", ctx.env.LIBDIR) + msg_setting("Droproot Support", droproot_type) diff --git a/meta-networking/recipes-support/ntpsec/ntpsec/0001-wscript-Widen-the-search-for-tags.patch b/meta-networking/recipes-support/ntpsec/ntpsec/0001-wscript-Widen-the-search-for-tags.patch deleted file mode 100644 index 98c62eed49..0000000000 --- a/meta-networking/recipes-support/ntpsec/ntpsec/0001-wscript-Widen-the-search-for-tags.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 9a7dead72f41e79979625c9bdef2fb638427d3d6 Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Mon, 22 Aug 2022 20:54:17 -0700 -Subject: [PATCH] wscript: Widen the search for tags - -Default is to look for annotated tags, howveer when using devtool we -create our own git tree from release tarballs which will have tags but -they are not annotated, therefore broaden the search to include all tags - -Upstream-Status: Inappropriate [OE-specific] - -Signed-off-by: Khem Raj ---- - wscript | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/wscript b/wscript -index 879ded1..dff835d 100644 ---- a/wscript -+++ b/wscript -@@ -177,7 +177,7 @@ def configure(ctx): - if build_desc: - build_desc = ' ' + build_desc - if ctx.env.BIN_GIT: -- cmd = ctx.env.BIN_GIT + shlex.split("describe --dirty") -+ cmd = ctx.env.BIN_GIT + shlex.split("describe --tags --dirty") - git_short_hash = ctx.cmd_and_log(cmd).strip() - git_short_hash = '-'.join(git_short_hash.split('-')[1:]) - diff --git a/meta-networking/recipes-support/ntpsec/ntpsec/0002-ntpd-ntp_sandbox.c-match-riscv-to-aarch-in-seccomp-f.patch b/meta-networking/recipes-support/ntpsec/ntpsec/0002-ntpd-ntp_sandbox.c-match-riscv-to-aarch-in-seccomp-f.patch deleted file mode 100644 index 705a87bdfa..0000000000 --- a/meta-networking/recipes-support/ntpsec/ntpsec/0002-ntpd-ntp_sandbox.c-match-riscv-to-aarch-in-seccomp-f.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 0f94870b84e68448f16b1304058bde4628dafde5 Mon Sep 17 00:00:00 2001 -From: Alex Kiernan -Date: Thu, 30 Dec 2021 10:41:20 +0000 -Subject: [PATCH 2/2] ntpd/ntp_sandbox.c: match riscv to aarch in seccomp - filter - -On Yocto Poky, faccessat (et al) are also used on riscv64: - - 2018-03-09T12:35:32 ntpd[341]: ERR: SIGSYS: got a trap. - 2018-03-09T12:35:32 ntpd[341]: ERR: SIGSYS/seccomp bad syscall 48/0xc00000f3 - -Upstream-Status: Backport [https://gitlab.com/NTPsec/ntpsec/-/commit/0f94870b84e68448f16b1304058bde4628dafde5] -Signed-off-by: Alex Kiernan -Signed-off-by: Alex Kiernan ---- - ntpd/ntp_sandbox.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/ntpd/ntp_sandbox.c b/ntpd/ntp_sandbox.c -index 1ae82a671344..4a14ae224dc6 100644 ---- a/ntpd/ntp_sandbox.c -+++ b/ntpd/ntp_sandbox.c -@@ -451,7 +451,7 @@ int scmp_sc[] = { - /* gentoo 64-bit and 32-bit, Intel and Arm use mmap */ - SCMP_SYS(mmap), - #endif --#if defined(__aarch64__) -+#if defined(__aarch64__) || defined(__riscv) - SCMP_SYS(faccessat), - SCMP_SYS(renameat), - SCMP_SYS(linkat), --- -2.34.1 - diff --git a/meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb b/meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb deleted file mode 100644 index e975f903f9..0000000000 --- a/meta-networking/recipes-support/ntpsec/ntpsec_1.2.1.bb +++ /dev/null @@ -1,127 +0,0 @@ -SUMMARY = "The Network Time Protocol suite, refactored" -HOMEPAGE = "https://www.ntpsec.org/" - -LICENSE = "CC-BY-4.0 & BSD-2-Clause & NTP & BSD-3-Clause & MIT" -LIC_FILES_CHKSUM = "file://LICENSE.adoc;md5=0520591566b6ed3a9ced8b15b4d4abf9 \ - file://libjsmn/LICENSE;md5=38118982429881235de8adf478a8e75d \ - file://docs/copyright.adoc;md5=9a1e3fce4b630078cb67ba2b619d2b13 \ - file://libaes_siv/COPYING;md5=3b83ef96387f14655fc854ddc3c6bd57" - -DEPENDS += "bison-native \ - openssl \ - python3" - -SRC_URI = "https://ftp.ntpsec.org/pub/releases/ntpsec-${PV}.tar.gz \ - file://0001-Update-to-OpenSSL-3.0.0-alpha15.patch \ - file://0001-ntpd-ntp_sandbox.c-allow-clone3-for-glibc-2.34-in-se.patch \ - file://0001-ntpd-ntp_sandbox.c-allow-newfstatat-on-all-archs-for.patch \ - file://0002-ntpd-ntp_sandbox.c-match-riscv-to-aarch-in-seccomp-f.patch \ - file://volatiles.ntpsec \ - file://0001-wscript-Widen-the-search-for-tags.patch \ - " - -SRC_URI[sha256sum] = "f2684835116c80b8f21782a5959a805ba3c44e3a681dd6c17c7cb00cc242c27a" - -UPSTREAM_CHECK_URI = "ftp://ftp.ntpsec.org/pub/releases/" - -inherit pkgconfig python3-dir python3targetconfig systemd update-alternatives update-rc.d useradd waf features_check - -# RDEPENDS on gnuplot with this restriction -REQUIRED_DISTRO_FEATURES = "x11" - -PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'seccomp systemd', d)} \ - cap \ - leap-smear \ - mdns \ - mssntp \ - nts \ - refclocks" - -PACKAGECONFIG:remove:riscv32 = "seccomp" - -PACKAGECONFIG[cap] = ",,libcap" -PACKAGECONFIG[docs] = "--enable-doc --enable-manpage,--disable-doc --disable-manpage," -PACKAGECONFIG[leap-smear] = "--enable-leap-smear" -PACKAGECONFIG[mdns] = ",,mdns" -PACKAGECONFIG[mssntp] = "--enable-mssntp" -PACKAGECONFIG[nts] = ",--disable-nts" -PACKAGECONFIG[refclocks] = "--refclock=all,,pps-tools" -PACKAGECONFIG[seccomp] = "--enable-seccomp,,libseccomp" -PACKAGECONFIG[systemd] = ",,systemd" - -CC[unexport] = "1" -CFLAGS[unexport] = "1" -LDFLAGS[unexport] = "1" - -export PYTHON_VERSION = "${PYTHON_BASEVERSION}" -export PYTAG = "cpython${@ d.getVar('PYTHON_BASEVERSION').replace('.', '')}" -export pyext_PATTERN = "%s.so" -export PYTHON_LDFLAGS = "-lpthread -ldl" - -CFLAGS:append = " -I${PYTHON_INCLUDE_DIR} -D_GNU_SOURCE" - -EXTRA_OECONF = "--cross-compiler='${CC}' \ - --cross-cflags='${CFLAGS}' \ - --cross-ldflags='${LDFLAGS}' \ - --pyshebang=${bindir}/python3 \ - --pythondir=${PYTHON_SITEPACKAGES_DIR} \ - --pythonarchdir=${PYTHON_SITEPACKAGES_DIR} \ - --enable-debug \ - --enable-debug-gdb \ - --enable-early-droproot" - -EXTRA_OEWAF_BUILD ?= "-v" - -NTP_USER_HOME ?= "/var/lib/ntp" - -do_install:append() { - install -d ${D}${sysconfdir}/init.d - install -m 755 ${S}/etc/rc/ntpd ${D}${sysconfdir}/init.d - cp -r ${S}/etc/ntp.d ${D}${sysconfdir} - - sed -e 's:@NTP_USER_HOME@:${NTP_USER_HOME}:g' ${WORKDIR}/volatiles.ntpsec >${T}/volatiles.ntpsec - if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then - cp ${B}/main/etc/* ${D}${systemd_system_unitdir} - awk '{print $1, $5, $4, $2, $3, "-"}' ${T}/volatiles.ntpsec >${T}/tmpfiles.ntpsec - install -D -m 0644 ${T}/tmpfiles.ntpsec ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf - else - install -D -m 0644 ${T}/volatiles.ntpsec ${D}${sysconfdir}/default/volatiles/99_${BPN} - fi -} - -PACKAGE_BEFORE_PN = "${PN}-python ${PN}-utils ${PN}-viz" - -FILES:${PN} += "${nonarch_libdir}/tmpfiles.d/ntpsec.conf" -FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR} \ - ${libdir}/libntpc.so.*" -FILES:${PN}-utils = "${bindir}/ntpdig \ - ${bindir}/ntpkeygen \ - ${bindir}/ntpleapfetch \ - ${bindir}/ntpmon \ - ${bindir}/ntpq \ - ${bindir}/ntpsnmpd \ - ${bindir}/ntpsweep \ - ${bindir}/ntptrace \ - ${bindir}/ntpwait" -FILES:${PN}-viz = "${bindir}/ntplogtemp \ - ${bindir}/ntpviz" - -RDEPENDS:${PN} += "libgcc" -RDEPENDS:${PN}-utils += "${PN}-python python3-core" -RDEPENDS:${PN}-viz += "gnuplot ${PN}-python python3-core python3-compression python3-ctypes python3-logging python3-shell" - -USERADD_PACKAGES = "${PN}" -USERADD_PARAM:${PN} = "--system --home-dir ${NTP_USER_HOME} \ - --no-create-home \ - --shell /bin/false --user-group ntp" - -INITSCRIPT_NAME = "ntpd" - -SYSTEMD_PACKAGES = "${PN} ${PN}-viz" -SYSTEMD_SERVICE:${PN} = "ntpd.service ntp-wait.service" -SYSTEMD_SERVICE:${PN}-viz = "ntplogtemp.service ntpviz-weekly.timer ntpviz-weekly.service ntpviz-daily.timer ntpviz-daily.service ntplogtemp.timer" - -ALTERNATIVE_PRIORITY = "80" - -ALTERNATIVE:${PN} = "ntpd" -ALTERNATIVE_LINK_NAME[ntpd] = "${sbindir}/ntpd" diff --git a/meta-networking/recipes-support/ntpsec/ntpsec_1.2.2.bb b/meta-networking/recipes-support/ntpsec/ntpsec_1.2.2.bb new file mode 100644 index 0000000000..d11ada67ee --- /dev/null +++ b/meta-networking/recipes-support/ntpsec/ntpsec_1.2.2.bb @@ -0,0 +1,129 @@ +SUMMARY = "The Network Time Protocol suite, refactored" +HOMEPAGE = "https://www.ntpsec.org/" + +LICENSE = "CC-BY-4.0 & BSD-2-Clause & NTP & BSD-3-Clause & MIT" +LIC_FILES_CHKSUM = "file://LICENSES/BSD-2;md5=653830da7b770a32f6f50f6107e0b186 \ + file://LICENSES/BSD-3;md5=55e9dcf6a625a2dcfcda4ef6a647fbfd \ + file://LICENSES/CC-BY-4.0;md5=2ab724713fdaf49e4523c4503bfd068d \ + file://LICENSES/MIT;md5=5a9dfc801af3eb49df2055c9b07918b2 \ + file://LICENSES/NTP;md5=cb56b7747f86157c78ca81f224806694" + +DEPENDS += "bison-native \ + openssl \ + python3" + +SRC_URI = "https://ftp.ntpsec.org/pub/releases/ntpsec-${PV}.tar.gz \ + file://volatiles.ntpsec \ + file://0001-wscript-Add-BISONFLAGS-support.patch \ + " + +SRC_URI[sha256sum] = "2f2848760b915dfe185b9217f777738b36ceeb78a7fc208b7e74e039dec22df5" + +UPSTREAM_CHECK_URI = "ftp://ftp.ntpsec.org/pub/releases/" + +inherit pkgconfig python3-dir python3targetconfig systemd update-alternatives update-rc.d useradd waf features_check + +# RDEPENDS on gnuplot with this restriction +REQUIRED_DISTRO_FEATURES = "x11" + +PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'seccomp systemd', d)} \ + cap \ + leap-smear \ + mdns \ + mssntp \ + nts \ + refclocks" + +PACKAGECONFIG:remove:riscv32 = "seccomp" + +PACKAGECONFIG[cap] = ",,libcap" +PACKAGECONFIG[docs] = "--enable-doc --enable-manpage,--disable-doc --disable-manpage," +PACKAGECONFIG[leap-smear] = "--enable-leap-smear" +PACKAGECONFIG[mdns] = ",,mdns" +PACKAGECONFIG[mssntp] = "--enable-mssntp" +PACKAGECONFIG[nts] = ",--disable-nts" +PACKAGECONFIG[refclocks] = "--refclock=all,,pps-tools" +PACKAGECONFIG[seccomp] = "--enable-seccomp,,libseccomp" +PACKAGECONFIG[systemd] = ",,systemd" + +CC[unexport] = "1" +CFLAGS[unexport] = "1" +LDFLAGS[unexport] = "1" + +export PYTHON_VERSION = "${PYTHON_BASEVERSION}" +export PYTAG = "cpython${@ d.getVar('PYTHON_BASEVERSION').replace('.', '')}" +export pyext_PATTERN = "%s.so" +export PYTHON_LDFLAGS = "-lpthread -ldl" + +CFLAGS:append = " -I${PYTHON_INCLUDE_DIR} -D_GNU_SOURCE" + +EXTRA_OECONF = "--cross-compiler='${CC}' \ + --cross-cflags='${CFLAGS}' \ + --cross-ldflags='${LDFLAGS}' \ + --pyshebang=${bindir}/python3 \ + --pythondir=${PYTHON_SITEPACKAGES_DIR} \ + --pythonarchdir=${PYTHON_SITEPACKAGES_DIR} \ + --enable-debug-gdb \ + --enable-early-droproot" + +EXTRA_OEWAF_BUILD ?= "-v" + +NTP_USER_HOME ?= "/var/lib/ntp" + +BISONFLAGS = "--file-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}" + +do_configure:prepend() { + export BISONFLAGS="${BISONFLAGS}" +} + +do_install:append() { + install -d ${D}${sysconfdir}/init.d + install -m 755 ${S}/etc/rc/ntpd ${D}${sysconfdir}/init.d + cp -r ${S}/etc/ntp.d ${D}${sysconfdir} + + sed -e 's:@NTP_USER_HOME@:${NTP_USER_HOME}:g' ${WORKDIR}/volatiles.ntpsec >${T}/volatiles.ntpsec + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + cp ${B}/main/etc/* ${D}${systemd_system_unitdir} + awk '{print $1, $5, $4, $2, $3, "-"}' ${T}/volatiles.ntpsec >${T}/tmpfiles.ntpsec + install -D -m 0644 ${T}/tmpfiles.ntpsec ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf + else + install -D -m 0644 ${T}/volatiles.ntpsec ${D}${sysconfdir}/default/volatiles/99_${BPN} + fi +} + +PACKAGE_BEFORE_PN = "${PN}-python ${PN}-utils ${PN}-viz" + +FILES:${PN} += "${nonarch_libdir}/tmpfiles.d/ntpsec.conf" +FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR} \ + ${libdir}/libntpc.so.*" +FILES:${PN}-utils = "${bindir}/ntpdig \ + ${bindir}/ntpkeygen \ + ${bindir}/ntpleapfetch \ + ${bindir}/ntpmon \ + ${bindir}/ntpq \ + ${bindir}/ntpsnmpd \ + ${bindir}/ntpsweep \ + ${bindir}/ntptrace \ + ${bindir}/ntpwait" +FILES:${PN}-viz = "${bindir}/ntplogtemp \ + ${bindir}/ntpviz" + +RDEPENDS:${PN} += "libgcc" +RDEPENDS:${PN}-utils += "${PN}-python python3-core" +RDEPENDS:${PN}-viz += "gnuplot ${PN}-python python3-core python3-compression python3-ctypes python3-logging python3-shell" + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM:${PN} = "--system --home-dir ${NTP_USER_HOME} \ + --no-create-home \ + --shell /bin/false --user-group ntp" + +INITSCRIPT_NAME = "ntpd" + +SYSTEMD_PACKAGES = "${PN} ${PN}-viz" +SYSTEMD_SERVICE:${PN} = "ntpd.service ntp-wait.service" +SYSTEMD_SERVICE:${PN}-viz = "ntplogtemp.service ntpviz-weekly.timer ntpviz-weekly.service ntpviz-daily.timer ntpviz-daily.service ntplogtemp.timer" + +ALTERNATIVE_PRIORITY = "80" + +ALTERNATIVE:${PN} = "ntpd" +ALTERNATIVE_LINK_NAME[ntpd] = "${sbindir}/ntpd" -- cgit v1.2.3-54-g00ecf