summaryrefslogtreecommitdiffstats
path: root/meta-networking/recipes-support/ntp/ntp.inc
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-11-22 16:49:34 +0000
committerJoe MacDonald <joe.macdonald@windriver.com>2012-11-27 14:43:58 -0500
commit93f71dafeb7a8db2842acb7509e2bc2d01e7bf48 (patch)
tree700e9245ba9710a6ae0b4a3c796cd7017e281555 /meta-networking/recipes-support/ntp/ntp.inc
parent11a6ce97f710fe6578a92edc5409b0aa315da79f (diff)
downloadmeta-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.inc87
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 @@
1SUMMARY = "Network Time Protocol daemon and utilities"
1DESCRIPTION = "The Network Time Protocol (NTP) is used to \ 2DESCRIPTION = "The Network Time Protocol (NTP) is used to \
2synchronize the time of a computer client or server to \ 3synchronize the time of a computer client or server to \
3another server or reference time source, such as a radio \ 4another server or reference time source, such as a radio \
4or satellite receiver or modem." 5or satellite receiver or modem."
5HOMEPAGE = "http://ntp.isc.org/bin/view/Main/WebHome" 6HOMEPAGE = "http://support.ntp.org"
6SECTION = "console/network" 7SECTION = "console/network"
7LICENSE = "ntp" 8LICENSE = "ntp"
8LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=fea4b50c33b18c2194b4b1c9ca512670" 9LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=fea4b50c33b18c2194b4b1c9ca512670"
9RSUGGESTS_${PN} = "iana-etc"
10 10
11SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \ 11INC_PR = "r2"
12 file://ipv6only-workaround.patch \
13 file://ntpd \
14 file://ntp.conf \
15 file://ntpdate \
16 file://ntpd.service \
17"
18 12
19inherit autotools update-rc.d 13SRC_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
21INITSCRIPT_NAME = "ntpd" 22inherit autotools update-rc.d
22# No dependencies, so just go in at the standard level (20)
23INITSCRIPT_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
27EXTRA_OECONF = "--without-openssl --without-crypto ac_cv_header_readline_history_h=no" 26EXTRA_OECONF += "--with-net-snmp-config=no --without-ntpsnmpd ac_cv_header_readline_history_h=no"
28CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED" 27CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
29 28
30PACKAGES += "ntpdate ${PN}-bin ${PN}-tickadj ${PN}-utils" 29PACKAGECONFIG ??= ""
30PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \
31 --with-openssl-incdir=${STAGING_INCDIR} \
32 --with-crypto, \
33 --without-openssl --without-crypto, \
34 openssl"
35
36do_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
51PACKAGES += "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
35FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/init.d/ntpdate" 55# with wonky clocks (e.g. OpenSlug)
56RDEPENDS_${PN} = "${PN}-tickadj"
57# Handle move from bin to utils package
58RPROVIDES_${PN}-utils = "${PN}-bin"
59RREPLACES_${PN}-utils = "${PN}-bin"
60RCONFLICTS_${PN}-utils = "${PN}-bin"
61
62RSUGGESTS_${PN} = "iana-etc"
63
64FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${sbindir} ${libdir}"
65FILES_${PN}-tickadj = "${bindir}/tickadj"
66FILES_${PN}-utils = "${bindir}"
67FILES_ntpdate = "${bindir}/ntpdate ${sysconfdir}/network/if-up.d/ntpdate"
68
69CONFFILES_${PN} = "${sysconfdir}/ntp.conf"
70
71INITSCRIPT_NAME = "ntpd"
72# No dependencies, so just go in at the standard level (20)
73INITSCRIPT_PARAMS = "defaults"
74
75pkg_postinst_ntpdate() {
76if test "x$D" != "x"; then
77 exit 1
78else
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
84fi
85}
86