summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/ntp/ntp_4.2.8p18.bb
diff options
context:
space:
mode:
authorWang Mingyu <wangmy@fujitsu.com>2024-06-06 17:06:30 +0800
committerKhem Raj <raj.khem@gmail.com>2024-06-07 09:11:59 -0700
commita5f414bc460f3102860999b170d0de046f0ebe9f (patch)
treec59eb75af34a0c0efc414678da4cd4d364feb790 /meta-networking/recipes-support/ntp/ntp_4.2.8p18.bb
parent485dfc19be3495fd110a05752f6251ee059ffd04 (diff)
downloadmeta-openembedded-a5f414bc460f3102860999b170d0de046f0ebe9f.tar.gz
ntp: upgrade 4.2.8p17 -> 4.2.8p18
License-Update: Copyright year updated to 2024. Changelog: =========== - changes crypto (OpenSSL or compatible) detection and default build behavior. Signed-off-by: Wang Mingyu <wangmy@fujitsu.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-networking/recipes-support/ntp/ntp_4.2.8p18.bb')
-rw-r--r--meta-networking/recipes-support/ntp/ntp_4.2.8p18.bb184
1 files changed, 184 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/ntp/ntp_4.2.8p18.bb b/meta-networking/recipes-support/ntp/ntp_4.2.8p18.bb
new file mode 100644
index 0000000000..302cf9915f
--- /dev/null
+++ b/meta-networking/recipes-support/ntp/ntp_4.2.8p18.bb
@@ -0,0 +1,184 @@
1SUMMARY = "Network Time Protocol daemon and utilities"
2DESCRIPTION = "The Network Time Protocol (NTP) is used to \
3synchronize the time of a computer client or server to \
4another server or reference time source, such as a radio \
5or satellite receiver or modem."
6HOMEPAGE = "http://support.ntp.org"
7SECTION = "net"
8LICENSE = "NTP"
9LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=2311915f6d5142b06395231b0ffeaf29"
10
11DEPENDS = "libevent"
12
13SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \
14 file://ntp-4.2.4_p6-nano.patch \
15 file://reproducibility-fixed-path-to-posix-shell.patch \
16 file://0001-libntp-Do-not-use-PTHREAD_STACK_MIN-on-glibc.patch \
17 file://0001-test-Fix-build-with-new-compiler-defaults-to-fno-com.patch \
18 file://0001-sntp-Fix-types-in-check-for-pthread_detach.patch \
19 file://ntpd \
20 file://ntp.conf \
21 file://ntpd.service \
22 file://sntp.service \
23 file://sntp \
24 file://ntpd.list \
25"
26
27SRC_URI[sha256sum] = "cf84c5f3fb1a295284942624d823fffa634144e096cfc4f9969ac98ef5f468e5"
28
29CVE_STATUS[CVE-2016-9312] = "not-applicable-platform: Issue only applies on Windows"
30CVE_STATUS[CVE-2019-11331] = "upstream-wontfix: inherent to RFC 5905 and cannot be fixed without breaking compatibility"
31CVE_STATUS_GROUPS += "CVE_STATUS_NTP"
32CVE_STATUS_NTP[status] = "fixed-version: Yocto CVE check can not handle 'p' in ntp version"
33CVE_STATUS_NTP = " \
34 CVE-2015-5146 \
35 CVE-2015-5300 \
36 CVE-2015-7975 \
37 CVE-2015-7976 \
38 CVE-2015-7977 \
39 CVE-2015-7978 \
40 CVE-2015-7979 \
41 CVE-2015-8138 \
42 CVE-2015-8139 \
43 CVE-2015-8140 \
44 CVE-2015-8158 \
45 CVE-2016-1547 \
46 CVE-2016-2516 \
47 CVE-2016-2517 \
48 CVE-2016-2519 \
49 CVE-2016-7429 \
50 CVE-2016-7433 \
51 CVE-2016-9310 \
52 CVE-2016-9311 \
53"
54
55
56inherit autotools update-rc.d useradd systemd pkgconfig
57
58# The ac_cv_header_readline_history is to stop ntpdc depending on either
59# readline or curses
60EXTRA_OECONF += "--with-net-snmp-config=no \
61 --without-ntpsnmpd \
62 ac_cv_header_readline_history_h=no \
63 --with-yielding_select=yes \
64 --with-locfile=redhat \
65 --without-rpath \
66 "
67CFLAGS:append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
68
69USERADD_PACKAGES = "${PN}"
70NTP_USER_HOME ?= "/var/lib/ntp"
71USERADD_PARAM:${PN} = "--system --home-dir ${NTP_USER_HOME} \
72 --no-create-home \
73 --shell /bin/false --user-group ntp"
74
75# NB: debug is default-enabled by NTP; keep it default-enabled here.
76PACKAGECONFIG ??= "cap debug refclocks openssl \
77 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
78"
79PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \
80 --with-openssl-incdir=${STAGING_INCDIR} \
81 --with-crypto, \
82 --without-openssl --without-crypto, \
83 openssl"
84PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap"
85PACKAGECONFIG[readline] = "--with-lineeditlibs,--without-lineeditlibs,readline"
86PACKAGECONFIG[refclocks] = "--enable-all-clocks,--disable-all-clocks,pps-tools"
87PACKAGECONFIG[debug] = "--enable-debugging,--disable-debugging"
88PACKAGECONFIG[mdns] = "ac_cv_header_dns_sd_h=yes,ac_cv_header_dns_sd_h=no,mdns"
89PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
90
91do_install:append() {
92 install -d ${D}${sysconfdir}/init.d
93 install -m 644 ${UNPACKDIR}/ntp.conf ${D}${sysconfdir}
94 install -m 755 ${UNPACKDIR}/ntpd ${D}${sysconfdir}/init.d
95
96 install -m 755 -d ${D}${NTP_USER_HOME}
97 chown ntp:ntp ${D}${NTP_USER_HOME}
98
99 # Fix hardcoded paths in scripts
100 sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd
101 sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd
102 sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd
103 sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd
104 sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntptrace
105 sed -i '/use/i use warnings;' ${D}${sbindir}/ntptrace
106 sed -i '1s,#!.*perl,#! ${bindir}/env perl,' ${D}${sbindir}/ntp-wait
107 sed -i '/use/i use warnings;' ${D}${sbindir}/ntp-wait
108 sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/calc_tickadj
109 sed -i '/use/i use warnings;' ${D}${sbindir}/calc_tickadj
110
111 install -d ${D}/${sysconfdir}/default
112 install -m 0644 ${UNPACKDIR}/sntp ${D}${sysconfdir}/default/
113
114 install -d ${D}${systemd_unitdir}/system
115 install -m 0644 ${UNPACKDIR}/ntpd.service ${D}${systemd_unitdir}/system/
116 install -m 0644 ${UNPACKDIR}/sntp.service ${D}${systemd_unitdir}/system/
117
118 install -d ${D}${systemd_unitdir}/ntp-units.d
119 install -m 0644 ${UNPACKDIR}/ntpd.list ${D}${systemd_unitdir}/ntp-units.d/60-ntpd.list
120
121 # Remove the empty libexecdir and bindir.
122 rmdir --ignore-fail-on-non-empty ${D}${libexecdir}
123 rmdir --ignore-fail-on-non-empty ${D}${bindir}
124}
125
126PACKAGES += "sntp ntpdc ntpq ${PN}-tickadj ${PN}-utils"
127
128# ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
129# with wonky clocks (e.g. OpenSlug)
130RDEPENDS:${PN} = "${PN}-tickadj"
131# ntpd & sntp require libgcc for execution due to phtread_cancel/pthread_exit calls
132RDEPENDS:${PN} += "libgcc"
133RDEPENDS:sntp += "libgcc"
134# Handle move from bin to utils package
135RPROVIDES:${PN}-utils = "${PN}-bin"
136RREPLACES:${PN}-utils = "${PN}-bin"
137RCONFLICTS:${PN}-utils = "${PN}-bin"
138# ntpdc and ntpq were split out of ntp-utils
139RDEPENDS:${PN}-utils = "ntpdc ntpq \
140 perl-module-lib \
141 perl-module-exporter \
142 perl-module-carp \
143 perl-module-version \
144 perl-module-socket \
145 perl-module-getopt-long \
146 "
147
148SYSTEMD_PACKAGES = "${PN} sntp"
149SYSTEMD_SERVICE:${PN} = "ntpd.service"
150SYSTEMD_SERVICE:sntp = "sntp.service"
151SYSTEMD_AUTO_ENABLE:sntp = "disable"
152
153RPROVIDES:${PN} += "${PN}-systemd"
154RREPLACES:${PN} += "${PN}-systemd"
155RCONFLICTS:${PN} += "${PN}-systemd"
156
157RSUGGESTS:${PN} = "iana-etc"
158
159FILES:${PN} = "${sbindir}/ntpd.ntp ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd \
160 ${NTP_USER_HOME} \
161 ${systemd_unitdir}/ntp-units.d/60-ntpd.list \
162"
163FILES:${PN}-tickadj = "${sbindir}/tickadj"
164FILES:${PN}-utils = "${sbindir} ${datadir}/ntp/lib"
165RDEPENDS:${PN}-utils += "perl"
166FILES:sntp = "${sbindir}/sntp \
167 ${sysconfdir}/default/sntp \
168 ${systemd_unitdir}/system/sntp.service \
169 "
170FILES:ntpdc = "${sbindir}/ntpdc"
171FILES:ntpq = "${sbindir}/ntpq"
172
173CONFFILES:${PN} = "${sysconfdir}/ntp.conf"
174
175INITSCRIPT_NAME = "ntpd"
176# No dependencies, so just go in at the standard level (20)
177INITSCRIPT_PARAMS = "defaults"
178
179inherit update-alternatives
180
181ALTERNATIVE_PRIORITY = "100"
182
183ALTERNATIVE:${PN} = "ntpd"
184ALTERNATIVE_LINK_NAME[ntpd] = "${sbindir}/ntpd"