diff options
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.bb | 191 |
1 files changed, 191 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..33d19a696a --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp_4.2.8p18.bb | |||
@@ -0,0 +1,191 @@ | |||
1 | SUMMARY = "Network Time Protocol daemon and utilities" | ||
2 | DESCRIPTION = "The Network Time Protocol (NTP) is used to \ | ||
3 | synchronize the time of a computer client or server to \ | ||
4 | another server or reference time source, such as a radio \ | ||
5 | or satellite receiver or modem." | ||
6 | HOMEPAGE = "http://support.ntp.org" | ||
7 | SECTION = "net" | ||
8 | LICENSE = "NTP" | ||
9 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=2311915f6d5142b06395231b0ffeaf29" | ||
10 | |||
11 | DEPENDS = "libevent" | ||
12 | |||
13 | SRC_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 | |||
27 | SRC_URI[sha256sum] = "cf84c5f3fb1a295284942624d823fffa634144e096cfc4f9969ac98ef5f468e5" | ||
28 | |||
29 | UPSTREAM_CHECK_REGEX = "ntp-(?P<pver>(\d+(\.\d+)+)(p\d+)?)\.tar" | ||
30 | |||
31 | CVE_STATUS[CVE-2016-9312] = "not-applicable-platform: Issue only applies on Windows" | ||
32 | CVE_STATUS[CVE-2019-11331] = "upstream-wontfix: inherent to RFC 5905 and cannot be fixed without breaking compatibility" | ||
33 | CVE_STATUS_GROUPS += "CVE_STATUS_NTP" | ||
34 | CVE_STATUS_NTP[status] = "fixed-version: Yocto CVE check can not handle 'p' in ntp version" | ||
35 | CVE_STATUS_NTP = " \ | ||
36 | CVE-2015-5146 \ | ||
37 | CVE-2015-5300 \ | ||
38 | CVE-2015-7975 \ | ||
39 | CVE-2015-7976 \ | ||
40 | CVE-2015-7977 \ | ||
41 | CVE-2015-7978 \ | ||
42 | CVE-2015-7979 \ | ||
43 | CVE-2015-8138 \ | ||
44 | CVE-2015-8139 \ | ||
45 | CVE-2015-8140 \ | ||
46 | CVE-2015-8158 \ | ||
47 | CVE-2016-1547 \ | ||
48 | CVE-2016-2516 \ | ||
49 | CVE-2016-2517 \ | ||
50 | CVE-2016-2519 \ | ||
51 | CVE-2016-7429 \ | ||
52 | CVE-2016-7433 \ | ||
53 | CVE-2016-9310 \ | ||
54 | CVE-2016-9311 \ | ||
55 | " | ||
56 | |||
57 | |||
58 | inherit autotools update-rc.d useradd systemd pkgconfig | ||
59 | |||
60 | # For some reason this recipe reconfigures the nested configure.ac files in | ||
61 | # do_compile because libtool.m4 is newer than aclocal.m4, and that then | ||
62 | # doesn't know about the site configuration. | ||
63 | do_compile[prefuncs] += "autotools_sitefiles" | ||
64 | |||
65 | # The ac_cv_header_readline_history is to stop ntpdc depending on either | ||
66 | # readline or curses | ||
67 | EXTRA_OECONF += "--with-net-snmp-config=no \ | ||
68 | --without-ntpsnmpd \ | ||
69 | ac_cv_header_readline_history_h=no \ | ||
70 | --with-yielding_select=yes \ | ||
71 | --with-locfile=redhat \ | ||
72 | --without-rpath \ | ||
73 | " | ||
74 | CFLAGS:append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED" | ||
75 | |||
76 | USERADD_PACKAGES = "${PN}" | ||
77 | NTP_USER_HOME ?= "/var/lib/ntp" | ||
78 | USERADD_PARAM:${PN} = "--system --home-dir ${NTP_USER_HOME} \ | ||
79 | --no-create-home \ | ||
80 | --shell /bin/false --user-group ntp" | ||
81 | |||
82 | # NB: debug is default-enabled by NTP; keep it default-enabled here. | ||
83 | PACKAGECONFIG ??= "cap debug refclocks openssl \ | ||
84 | ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ | ||
85 | " | ||
86 | PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \ | ||
87 | --with-openssl-incdir=${STAGING_INCDIR} \ | ||
88 | --with-crypto, \ | ||
89 | --without-openssl --without-crypto, \ | ||
90 | openssl" | ||
91 | PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap" | ||
92 | PACKAGECONFIG[readline] = "--with-lineeditlibs,--without-lineeditlibs,readline" | ||
93 | PACKAGECONFIG[refclocks] = "--enable-all-clocks,--disable-all-clocks,pps-tools" | ||
94 | PACKAGECONFIG[debug] = "--enable-debugging,--disable-debugging" | ||
95 | PACKAGECONFIG[mdns] = "ac_cv_header_dns_sd_h=yes,ac_cv_header_dns_sd_h=no,mdns" | ||
96 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," | ||
97 | |||
98 | do_install:append() { | ||
99 | install -d ${D}${sysconfdir}/init.d | ||
100 | install -m 644 ${UNPACKDIR}/ntp.conf ${D}${sysconfdir} | ||
101 | install -m 755 ${UNPACKDIR}/ntpd ${D}${sysconfdir}/init.d | ||
102 | |||
103 | install -m 755 -d ${D}${NTP_USER_HOME} | ||
104 | chown ntp:ntp ${D}${NTP_USER_HOME} | ||
105 | |||
106 | # Fix hardcoded paths in scripts | ||
107 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd | ||
108 | sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd | ||
109 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd | ||
110 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd | ||
111 | sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntptrace | ||
112 | sed -i '/use/i use warnings;' ${D}${sbindir}/ntptrace | ||
113 | sed -i '1s,#!.*perl,#! ${bindir}/env perl,' ${D}${sbindir}/ntp-wait | ||
114 | sed -i '/use/i use warnings;' ${D}${sbindir}/ntp-wait | ||
115 | sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/calc_tickadj | ||
116 | sed -i '/use/i use warnings;' ${D}${sbindir}/calc_tickadj | ||
117 | |||
118 | install -d ${D}/${sysconfdir}/default | ||
119 | install -m 0644 ${UNPACKDIR}/sntp ${D}${sysconfdir}/default/ | ||
120 | |||
121 | install -d ${D}${systemd_unitdir}/system | ||
122 | install -m 0644 ${UNPACKDIR}/ntpd.service ${D}${systemd_unitdir}/system/ | ||
123 | install -m 0644 ${UNPACKDIR}/sntp.service ${D}${systemd_unitdir}/system/ | ||
124 | |||
125 | install -d ${D}${systemd_unitdir}/ntp-units.d | ||
126 | install -m 0644 ${UNPACKDIR}/ntpd.list ${D}${systemd_unitdir}/ntp-units.d/60-ntpd.list | ||
127 | |||
128 | # Remove the empty libexecdir and bindir. | ||
129 | rmdir --ignore-fail-on-non-empty ${D}${libexecdir} | ||
130 | rmdir --ignore-fail-on-non-empty ${D}${bindir} | ||
131 | } | ||
132 | |||
133 | PACKAGES += "sntp ntpdc ntpq ${PN}-tickadj ${PN}-utils" | ||
134 | |||
135 | # ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms | ||
136 | # with wonky clocks (e.g. OpenSlug) | ||
137 | RDEPENDS:${PN} = "${PN}-tickadj" | ||
138 | # ntpd & sntp require libgcc for execution due to phtread_cancel/pthread_exit calls | ||
139 | RDEPENDS:${PN} += "libgcc" | ||
140 | RDEPENDS:sntp += "libgcc" | ||
141 | # Handle move from bin to utils package | ||
142 | RPROVIDES:${PN}-utils = "${PN}-bin" | ||
143 | RREPLACES:${PN}-utils = "${PN}-bin" | ||
144 | RCONFLICTS:${PN}-utils = "${PN}-bin" | ||
145 | # ntpdc and ntpq were split out of ntp-utils | ||
146 | RDEPENDS:${PN}-utils = "ntpdc ntpq \ | ||
147 | perl-module-lib \ | ||
148 | perl-module-exporter \ | ||
149 | perl-module-carp \ | ||
150 | perl-module-version \ | ||
151 | perl-module-socket \ | ||
152 | perl-module-getopt-long \ | ||
153 | " | ||
154 | |||
155 | SYSTEMD_PACKAGES = "${PN} sntp" | ||
156 | SYSTEMD_SERVICE:${PN} = "ntpd.service" | ||
157 | SYSTEMD_SERVICE:sntp = "sntp.service" | ||
158 | SYSTEMD_AUTO_ENABLE:sntp = "disable" | ||
159 | |||
160 | RPROVIDES:${PN} += "${PN}-systemd" | ||
161 | RREPLACES:${PN} += "${PN}-systemd" | ||
162 | RCONFLICTS:${PN} += "${PN}-systemd" | ||
163 | |||
164 | RSUGGESTS:${PN} = "iana-etc" | ||
165 | |||
166 | FILES:${PN} = "${sbindir}/ntpd.ntp ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd \ | ||
167 | ${NTP_USER_HOME} \ | ||
168 | ${systemd_unitdir}/ntp-units.d/60-ntpd.list \ | ||
169 | " | ||
170 | FILES:${PN}-tickadj = "${sbindir}/tickadj" | ||
171 | FILES:${PN}-utils = "${sbindir} ${datadir}/ntp/lib" | ||
172 | RDEPENDS:${PN}-utils += "perl" | ||
173 | FILES:sntp = "${sbindir}/sntp \ | ||
174 | ${sysconfdir}/default/sntp \ | ||
175 | ${systemd_unitdir}/system/sntp.service \ | ||
176 | " | ||
177 | FILES:ntpdc = "${sbindir}/ntpdc" | ||
178 | FILES:ntpq = "${sbindir}/ntpq" | ||
179 | |||
180 | CONFFILES:${PN} = "${sysconfdir}/ntp.conf" | ||
181 | |||
182 | INITSCRIPT_NAME = "ntpd" | ||
183 | # No dependencies, so just go in at the standard level (20) | ||
184 | INITSCRIPT_PARAMS = "defaults" | ||
185 | |||
186 | inherit update-alternatives | ||
187 | |||
188 | ALTERNATIVE_PRIORITY = "100" | ||
189 | |||
190 | ALTERNATIVE:${PN} = "ntpd" | ||
191 | ALTERNATIVE_LINK_NAME[ntpd] = "${sbindir}/ntpd" | ||