summaryrefslogtreecommitdiff
path: root/recipes-support/ntp/ntp_4.2.6p5.bbappend
blob: b656256b4981f9ad5838bbfea1447604d18f2036 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
PR .= ".mlinux1"

SRC_URI += " file://ntpd-init.patch;patchdir=.. \
             file://ntp.conf.patch;patchdir=.. \
             file://ntpd-default \
		"
FILESEXTRAPATHS_prepend := "${THISDIR}/files"

python do_patch_prepend () {
    import os
}
pkg_postinst_${PN} () {
    sdir=/var/log/ntpstats
    if ! [[ -d ${sdir} ]] ; then
	mkdir -p ${sdir}
    fi
    chown ntp:ntp ${sdir}
    chmod 775 ${sdir}

    drdir=/var/lib/ntp
    if ! [[ -d ${drdir} ]] ; then
	mkdir -p ${drdir}
    fi
    drfile="${drdir}/ntp.drift"
    touch ${drfile}
    chmod 664 ${drfile}
    chown -R ntp:ntp ${drdir}
}


do_install_prepend() {
    echo JAK In do_install_append in directory $(pwd), and D is ${D}
    echo JAK In do_install_append sysconfdir is ${sysconfdir}
    install -d ${D}${sysconfdir}/default
    install -m 0644 ${WORKDIR}/ntpd-default ${D}${sysconfdir}/default/ntpd.default
    echo JAK In do_install_append default is $(ls ${D}cd${sysconfdir}/default/ntpd.default)
}
pkg_postinst_${PN}() {
    update-alternatives --install ${sysconfdir}/default/ntpd ntpd-defaults ${sysconfdir}/default/ntpd.default 10
}

pkg_postrm_${PN}() {
    update-alternatives --remove ntpd-defaults ${sysconfdir}/default/ntpd.default
}
FILES_${PN} += "${sysconfdir}/default/ntpd.default"
CONFFILES_${PN} += "${sysconfdir}/default/ntpd.default"