diff options
| author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2012-11-22 16:49:34 +0000 |
|---|---|---|
| committer | Joe MacDonald <joe.macdonald@windriver.com> | 2012-11-27 14:43:58 -0500 |
| commit | 93f71dafeb7a8db2842acb7509e2bc2d01e7bf48 (patch) | |
| tree | 700e9245ba9710a6ae0b4a3c796cd7017e281555 /meta-networking/recipes-support/ntp/ntp.inc | |
| parent | 11a6ce97f710fe6578a92edc5409b0aa315da79f (diff) | |
| download | meta-openembedded-93f71dafeb7a8db2842acb7509e2bc2d01e7bf48.tar.gz | |
ntp: cleanup recipes and fix SSL support
* Move common definitions to the inc file
* Drop override of do_configure which doesn't seem to be needed anymore
* Fold ntp-ssl into the ntp recipe as a PACKAGECONFIG option for those
who want it (default to off) and fix configure-time checks to detect
OpenSSL properly so that it gets enabled when selected
* Remove ntp-bin package and put its contents in currently empty
ntp-utils package (with migration path)
* Fix hardcoded paths in ntpd initscript
* Specify ntpd.conf as a configuration file for packaging purposes
* Rearrange so that packaging definitions are towards the end in the
expected order
* Delete unused "ntp" initscript file
* Add SUMMARY
* Update HOMEPAGE
This reapplies some of the changes from the original patch by
Morgan Little <morgan.little@windriver.com>.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'meta-networking/recipes-support/ntp/ntp.inc')
| -rw-r--r-- | meta-networking/recipes-support/ntp/ntp.inc | 87 |
1 files changed, 69 insertions, 18 deletions
diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc index 1d740f00fb..a614e3f06a 100644 --- a/meta-networking/recipes-support/ntp/ntp.inc +++ b/meta-networking/recipes-support/ntp/ntp.inc | |||
| @@ -1,35 +1,86 @@ | |||
| 1 | SUMMARY = "Network Time Protocol daemon and utilities" | ||
| 1 | DESCRIPTION = "The Network Time Protocol (NTP) is used to \ | 2 | DESCRIPTION = "The Network Time Protocol (NTP) is used to \ |
| 2 | synchronize the time of a computer client or server to \ | 3 | synchronize the time of a computer client or server to \ |
| 3 | another server or reference time source, such as a radio \ | 4 | another server or reference time source, such as a radio \ |
| 4 | or satellite receiver or modem." | 5 | or satellite receiver or modem." |
| 5 | HOMEPAGE = "http://ntp.isc.org/bin/view/Main/WebHome" | 6 | HOMEPAGE = "http://support.ntp.org" |
| 6 | SECTION = "console/network" | 7 | SECTION = "console/network" |
| 7 | LICENSE = "ntp" | 8 | LICENSE = "ntp" |
| 8 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=fea4b50c33b18c2194b4b1c9ca512670" | 9 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=fea4b50c33b18c2194b4b1c9ca512670" |
| 9 | RSUGGESTS_${PN} = "iana-etc" | ||
| 10 | 10 | ||
| 11 | SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \ | 11 | INC_PR = "r2" |
| 12 | file://ipv6only-workaround.patch \ | ||
| 13 | file://ntpd \ | ||
| 14 | file://ntp.conf \ | ||
| 15 | file://ntpdate \ | ||
| 16 | file://ntpd.service \ | ||
| 17 | " | ||
| 18 | 12 | ||
| 19 | inherit autotools update-rc.d | 13 | SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \ |
| 14 | file://tickadj.c.patch \ | ||
| 15 | file://ntp-4.2.4_p6-nano.patch \ | ||
| 16 | file://openssl-check.patch \ | ||
| 17 | file://ntpd \ | ||
| 18 | file://ntp.conf \ | ||
| 19 | file://ntpdate \ | ||
| 20 | " | ||
| 20 | 21 | ||
| 21 | INITSCRIPT_NAME = "ntpd" | 22 | inherit autotools update-rc.d |
| 22 | # No dependencies, so just go in at the standard level (20) | ||
| 23 | INITSCRIPT_PARAMS = "defaults" | ||
| 24 | 23 | ||
| 25 | # The ac_cv_header_readline_history is to stop ntpdc depending on either | 24 | # The ac_cv_header_readline_history is to stop ntpdc depending on either |
| 26 | # readline or curses | 25 | # readline or curses |
| 27 | EXTRA_OECONF = "--without-openssl --without-crypto ac_cv_header_readline_history_h=no" | 26 | EXTRA_OECONF += "--with-net-snmp-config=no --without-ntpsnmpd ac_cv_header_readline_history_h=no" |
| 28 | CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED" | 27 | CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED" |
| 29 | 28 | ||
| 30 | PACKAGES += "ntpdate ${PN}-bin ${PN}-tickadj ${PN}-utils" | 29 | PACKAGECONFIG ??= "" |
| 30 | PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \ | ||
| 31 | --with-openssl-incdir=${STAGING_INCDIR} \ | ||
| 32 | --with-crypto, \ | ||
| 33 | --without-openssl --without-crypto, \ | ||
| 34 | openssl" | ||
| 35 | |||
| 36 | do_install_append() { | ||
| 37 | install -d ${D}${sysconfdir}/init.d | ||
| 38 | install -m 644 ${WORKDIR}/ntp.conf ${D}${sysconfdir} | ||
| 39 | install -m 755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d | ||
| 40 | |||
| 41 | # Fix hardcoded paths in scripts | ||
| 42 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd | ||
| 43 | sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd | ||
| 44 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd | ||
| 45 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd | ||
| 46 | |||
| 47 | install -d ${D}${sysconfdir}/network/if-up.d | ||
| 48 | install -m 755 ${WORKDIR}/ntpdate ${D}${sysconfdir}/network/if-up.d | ||
| 49 | } | ||
| 50 | |||
| 51 | PACKAGES += "ntpdate ${PN}-tickadj ${PN}-utils" | ||
| 31 | # NOTE: you don't need ntpdate, use "ntpd -q -g -x" | 52 | # NOTE: you don't need ntpdate, use "ntpd -q -g -x" |
| 32 | # or the ntpdate systemd service | ||
| 33 | 53 | ||
| 34 | # This should use rc.update | 54 | # ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms |
| 35 | FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/init.d/ntpdate" | 55 | # with wonky clocks (e.g. OpenSlug) |
| 56 | RDEPENDS_${PN} = "${PN}-tickadj" | ||
| 57 | # Handle move from bin to utils package | ||
| 58 | RPROVIDES_${PN}-utils = "${PN}-bin" | ||
| 59 | RREPLACES_${PN}-utils = "${PN}-bin" | ||
| 60 | RCONFLICTS_${PN}-utils = "${PN}-bin" | ||
| 61 | |||
| 62 | RSUGGESTS_${PN} = "iana-etc" | ||
| 63 | |||
| 64 | FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${sbindir} ${libdir}" | ||
| 65 | FILES_${PN}-tickadj = "${bindir}/tickadj" | ||
| 66 | FILES_${PN}-utils = "${bindir}" | ||
| 67 | FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/network/if-up.d/ntpdate" | ||
| 68 | |||
| 69 | CONFFILES_${PN} = "${sysconfdir}/ntp.conf" | ||
| 70 | |||
| 71 | INITSCRIPT_NAME = "ntpd" | ||
| 72 | # No dependencies, so just go in at the standard level (20) | ||
| 73 | INITSCRIPT_PARAMS = "defaults" | ||
| 74 | |||
| 75 | pkg_postinst_ntpdate() { | ||
| 76 | if test "x$D" != "x"; then | ||
| 77 | exit 1 | ||
| 78 | else | ||
| 79 | if ! grep -q -s ntpdate /var/spool/cron/root; then | ||
| 80 | echo "adding crontab" | ||
| 81 | test -d /var/spool/cron || mkdir -p /var/spool/cron | ||
| 82 | echo "30 * * * * /usr/bin/ntpdate -b -s -u pool.ntp.org" >> /var/spool/cron/root | ||
| 83 | fi | ||
| 84 | fi | ||
| 85 | } | ||
| 86 | |||
