diff options
Diffstat (limited to 'meta-networking/recipes-support/ntp/ntp_4.2.8p7.bb')
| -rw-r--r-- | meta-networking/recipes-support/ntp/ntp_4.2.8p7.bb | 160 |
1 files changed, 160 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/ntp/ntp_4.2.8p7.bb b/meta-networking/recipes-support/ntp/ntp_4.2.8p7.bb new file mode 100644 index 0000000000..ff4ba64157 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp_4.2.8p7.bb | |||
| @@ -0,0 +1,160 @@ | |||
| 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=f41fedb22dffefcbfafecc85b0f79cfa" | ||
| 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://ntpd \ | ||
| 16 | file://ntp.conf \ | ||
| 17 | file://ntpdate \ | ||
| 18 | file://ntpdate.default \ | ||
| 19 | file://ntpdate.service \ | ||
| 20 | file://ntpd.service \ | ||
| 21 | file://sntp.service \ | ||
| 22 | file://sntp \ | ||
| 23 | file://ntpd.list \ | ||
| 24 | " | ||
| 25 | |||
| 26 | SRC_URI[md5sum] = "46dfba933c3e4bc924d8e55068797578" | ||
| 27 | SRC_URI[sha256sum] = "81d20c06a0b01abe3b84fac092185bf014252d38fe5e7b2758f604680a0220dc" | ||
| 28 | |||
| 29 | inherit autotools update-rc.d useradd systemd pkgconfig | ||
| 30 | |||
| 31 | # The ac_cv_header_readline_history is to stop ntpdc depending on either | ||
| 32 | # readline or curses | ||
| 33 | EXTRA_OECONF += "--with-net-snmp-config=no \ | ||
| 34 | --without-ntpsnmpd \ | ||
| 35 | ac_cv_header_readline_history_h=no \ | ||
| 36 | --with-yielding_select=yes \ | ||
| 37 | --with-locfile=redhat \ | ||
| 38 | --without-rpath \ | ||
| 39 | " | ||
| 40 | CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED" | ||
| 41 | |||
| 42 | USERADD_PACKAGES = "${PN}" | ||
| 43 | NTP_USER_HOME ?= "/var/lib/ntp" | ||
| 44 | USERADD_PARAM_${PN} = "--system --home-dir ${NTP_USER_HOME} \ | ||
| 45 | --no-create-home \ | ||
| 46 | --shell /bin/false --user-group ntp" | ||
| 47 | |||
| 48 | # NB: debug is default-enabled by NTP; keep it default-enabled here. | ||
| 49 | PACKAGECONFIG ??= "cap debug refclocks" | ||
| 50 | PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \ | ||
| 51 | --with-openssl-incdir=${STAGING_INCDIR} \ | ||
| 52 | --with-crypto, \ | ||
| 53 | --without-openssl --without-crypto, \ | ||
| 54 | openssl" | ||
| 55 | PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap" | ||
| 56 | PACKAGECONFIG[readline] = "--with-lineeditlibs,--without-lineeditlibs,readline" | ||
| 57 | PACKAGECONFIG[refclocks] = "--enable-all-clocks,--disable-all-clocks,pps-tools" | ||
| 58 | PACKAGECONFIG[debug] = "--enable-debugging,--disable-debugging" | ||
| 59 | |||
| 60 | do_install_append() { | ||
| 61 | install -d ${D}${sysconfdir}/init.d | ||
| 62 | install -m 644 ${WORKDIR}/ntp.conf ${D}${sysconfdir} | ||
| 63 | install -m 755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d | ||
| 64 | install -d ${D}${bindir} | ||
| 65 | install -m 755 ${WORKDIR}/ntpdate ${D}${bindir}/ntpdate-sync | ||
| 66 | |||
| 67 | install -m 755 -d ${D}${NTP_USER_HOME} | ||
| 68 | chown ntp:ntp ${D}${NTP_USER_HOME} | ||
| 69 | |||
| 70 | # Fix hardcoded paths in scripts | ||
| 71 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
| 72 | sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
| 73 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
| 74 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
| 75 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${bindir}/ntpdate-sync | ||
| 76 | sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntptrace | ||
| 77 | sed -i '/use/i use warnings;' ${D}${sbindir}/ntptrace | ||
| 78 | sed -i '1s,#!.*perl,#! ${bindir}/env perl,' ${D}${sbindir}/ntp-wait | ||
| 79 | sed -i '/use/i use warnings;' ${D}${sbindir}/ntp-wait | ||
| 80 | sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/calc_tickadj | ||
| 81 | sed -i '/use/i use warnings;' ${D}${sbindir}/calc_tickadj | ||
| 82 | |||
| 83 | install -d ${D}/${sysconfdir}/default | ||
| 84 | install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate | ||
| 85 | install -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/ | ||
| 86 | |||
| 87 | install -d ${D}/${sysconfdir}/network/if-up.d | ||
| 88 | ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d | ||
| 89 | |||
| 90 | install -d ${D}${systemd_unitdir}/system | ||
| 91 | install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/ | ||
| 92 | install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/ | ||
| 93 | install -m 0644 ${WORKDIR}/sntp.service ${D}${systemd_unitdir}/system/ | ||
| 94 | |||
| 95 | install -d ${D}${systemd_unitdir}/ntp-units.d | ||
| 96 | install -m 0644 ${WORKDIR}/ntpd.list ${D}${systemd_unitdir}/ntp-units.d/60-ntpd.list | ||
| 97 | |||
| 98 | # Remove an empty libexecdir. | ||
| 99 | rmdir --ignore-fail-on-non-empty ${D}${libexecdir} | ||
| 100 | } | ||
| 101 | |||
| 102 | PACKAGES += "ntpdate sntp ${PN}-tickadj ${PN}-utils" | ||
| 103 | # NOTE: you don't need ntpdate, use "ntpd -q -g -x" | ||
| 104 | |||
| 105 | # ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms | ||
| 106 | # with wonky clocks (e.g. OpenSlug) | ||
| 107 | RDEPENDS_${PN} = "${PN}-tickadj" | ||
| 108 | # Handle move from bin to utils package | ||
| 109 | RPROVIDES_${PN}-utils = "${PN}-bin" | ||
| 110 | RREPLACES_${PN}-utils = "${PN}-bin" | ||
| 111 | RCONFLICTS_${PN}-utils = "${PN}-bin" | ||
| 112 | |||
| 113 | SYSTEMD_PACKAGES = "${PN} ntpdate sntp" | ||
| 114 | SYSTEMD_SERVICE_${PN} = "ntpd.service" | ||
| 115 | SYSTEMD_SERVICE_ntpdate = "ntpdate.service" | ||
| 116 | SYSTEMD_SERVICE_sntp = "sntp.service" | ||
| 117 | |||
| 118 | RPROVIDES_${PN} += "${PN}-systemd" | ||
| 119 | RREPLACES_${PN} += "${PN}-systemd" | ||
| 120 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
| 121 | |||
| 122 | RPROVIDES_ntpdate += "ntpdate-systemd" | ||
| 123 | RREPLACES_ntpdate += "ntpdate-systemd" | ||
| 124 | RCONFLICTS_ntpdate += "ntpdate-systemd" | ||
| 125 | |||
| 126 | RSUGGESTS_${PN} = "iana-etc" | ||
| 127 | |||
| 128 | FILES_${PN} = "${sbindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${libdir} \ | ||
| 129 | ${NTP_USER_HOME} \ | ||
| 130 | ${systemd_unitdir}/ntp-units.d/60-ntpd.list ${libexecdir}\ | ||
| 131 | " | ||
| 132 | FILES_${PN}-tickadj = "${sbindir}/tickadj" | ||
| 133 | FILES_${PN}-utils = "${sbindir} ${datadir}/ntp/lib" | ||
| 134 | RDEPENDS_${PN}-utils += "perl" | ||
| 135 | FILES_ntpdate = "${sbindir}/ntpdate \ | ||
| 136 | ${sysconfdir}/network/if-up.d/ntpdate-sync \ | ||
| 137 | ${bindir}/ntpdate-sync \ | ||
| 138 | ${sysconfdir}/default/ntpdate \ | ||
| 139 | ${systemd_unitdir}/system/ntpdate.service \ | ||
| 140 | " | ||
| 141 | FILES_sntp = "${sbindir}/sntp \ | ||
| 142 | ${sysconfdir}/default/sntp \ | ||
| 143 | ${systemd_unitdir}/system/sntp.service \ | ||
| 144 | " | ||
| 145 | |||
| 146 | CONFFILES_${PN} = "${sysconfdir}/ntp.conf" | ||
| 147 | CONFFILES_ntpdate = "${sysconfdir}/default/ntpdate" | ||
| 148 | |||
| 149 | INITSCRIPT_NAME = "ntpd" | ||
| 150 | # No dependencies, so just go in at the standard level (20) | ||
| 151 | INITSCRIPT_PARAMS = "defaults" | ||
| 152 | |||
| 153 | pkg_postinst_ntpdate() { | ||
| 154 | if ! grep -q -s ntpdate $D/var/spool/cron/root; then | ||
| 155 | echo "adding crontab" | ||
| 156 | test -d $D/var/spool/cron || mkdir -p $D/var/spool/cron | ||
| 157 | echo "30 * * * * ${bindir}/ntpdate-sync silent" >> $D/var/spool/cron/root | ||
| 158 | fi | ||
| 159 | } | ||
| 160 | |||
