Merge branch 'vuplus-1.6k' of code.vuplus.com:/opt/repository/openembedded into vuplu...
[vuplus_openembedded] / recipes / ntp / ntp_4.2.0.bb
1 require ntp.inc
2
3 PR = "r9"
4
5 SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \
6         file://ntpdc.Makefile.am.maybe-layout.patch;patch=1 \
7         file://ipv6only-workaround.patch;patch=1 \
8         file://gcc4.patch;patch=1 \
9         file://ntpd \
10         file://ntp.conf \
11         file://ntpdate"
12
13 PROVIDES = "ntpdate-${PV} ntpdate-${PV}-${PR} ntpdate"
14
15 #This is too painful - perl is only needed for ntp-wait and ntptrace, which are
16 #perl scripts, and installing perl is an enormous overhead for a user who only
17 #needs ntpq
18 #RDEPENDS_ntp-bin = perl
19 # ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms
20 # with wonky clocks (e.g. OpenSlug)
21 RDEPENDS_${PN} = "${PN}-tickadj"
22 FILES_${PN}-bin = "${bindir}/ntp-wait ${bindir}/ntpdc ${bindir}/ntpq ${bindir}/ntptime ${bindir}/ntptrace"
23 FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd"
24 FILES_${PN}-tickadj = "${bindir}/tickadj"
25
26 do_install_append() {
27         install -d ${D}/${sysconfdir}/init.d
28         install -m 644 ${WORKDIR}/ntp.conf ${D}/${sysconfdir}
29         install -m 755 ${WORKDIR}/ntpdate ${D}/${sysconfdir}/init.d
30         install -m 755 ${WORKDIR}/ntpd ${D}/${sysconfdir}/init.d
31 }
32
33 pkg_postinst_ntpdate_nylon() {
34 if test "x$D" != "x"; then
35         exit 1
36 else
37         if ! grep -q ntpdate /etc/cron/crontabs/root; then
38                 echo "adding crontab"
39                 test -d /etc/cron/crontabs || mkdir -p /etc/cron/crontabs
40                 echo "30 * * * *    /usr/bin/ntpdate -s -u pool.ntp.org" >> /etc/cron/crontabs/root
41         fi
42         update-rc.d -s busybox-cron defaults
43         update-rc.d -s ntpdate defaults 30
44 fi
45 }