]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/ntp/ntp_4.1.2.bb
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / ntp / ntp_4.1.2.bb
1 DESCRIPTION = "The Network Time Protocol (NTP) is used to \
2 synchronize the time of a computer client or server to \
3 another server or reference time source, such as a radio \
4 or satellite receiver or modem."
5 HOMEPAGE = "http://ntp.isc.org/bin/view/Main/WebHome"
6 SECTION = "console/network"
7 PRIORITY = "optional"
8 LICENSE = "ntp"
9 PR = "r4"
10
11 SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.1/ntp-${PV}.tar.gz \
12            file://configure.patch;patch=1 \
13            file://readline.patch;patch=1 \
14            file://ntpdate \
15            file://ntp"
16
17 inherit autotools
18
19 EXTRA_OECONF = "--without-openssl"
20 CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED"
21
22 PACKAGES =+ "ntpdate"
23
24 FILES_ntpdate = "${bindir}/ntpdate /etc/init.d/ntpdate"
25
26 do_install_append() {
27         install -d ${D}${sysconfdir}/init.d
28         install -m 755 ${WORKDIR}/ntpdate ${D}${sysconfdir}/init.d
29         install -m 755 ${WORKDIR}/ntp ${D}${sysconfdir}/init.d
30         echo "server pool.ntp.org" >${D}${sysconfdir}/ntp.conf
31 }
32
33 pkg_postinst_ntpdate() {
34 if test "x$D" != "x"; then
35         exit 1
36 else
37         if ! grep -q ntpdate /etc/cron/crontabs/root >/dev/null 2>&1; then
38                 echo "adding crontab"
39                 test -d /etc/cron/crontabs || mkdir -p /etc/cron/crontabs
40                 echo "30 * * * *    ${bindir}/ntpdate -s -u pool.ntp.org" >> /etc/cron/crontabs/root
41         fi
42         
43         # Dunno why this is here, ask the "nylon" guys :)
44         test -x /etc/init.d/busybox-cron && update-rc.d -s busybox-cron defaults
45         
46         update-rc.d -s ntpdate defaults 30
47 fi
48 }
49
50 pkg_postrm_ntpdate() {
51         update-rc.d -f ntpdate remove
52 }
53
54 pkg_postinst_ntp() {
55         update-rc.d -s ntp defaults 31
56 }
57
58 pkg_postrm_ntp(){
59         update-rc.d -f ntp remove
60 }
61