Merge branch 'vuplus-1.6k' of code.vuplus.com:/opt/repository/openembedded into vuplu...
[vuplus_openembedded] / recipes / openntpd / openntpd_3.7p1.bb
1 DESCRIPTION = "OpenNTPD is a FREE, easy to use implementation of the \
2 Network Time Protocol."
3 HOMEPAGE = "http://www.openntpd.org/"
4 SECTION = "console/network"
5 LICENSE = "BSD"
6 DEPENDS += "openssl tzdata"
7 PR = "r14"
8
9 SRC_URI = "http://www.zip.com.au/~dtucker/openntpd/release/openntpd-${PV}.tar.gz \
10            file://autofoo.patch;patch=1 \
11            file://adjtimex-${PV}.patch;patch=1 \
12            file://makefile-install.patch;patch=1 \
13            file://init"
14
15 S = "${WORKDIR}/openntpd-${PV}"
16
17 inherit autotools update-rc.d
18
19 EXTRA_OECONF += "CFLAGS=-DUSE_ADJTIMEX --disable-strip --prefix=/usr \
20                 --sysconfdir=/etc  --with-privsep-path=/${localstatedir}/shared/empty \
21                 --with-privsep-user=ntpd \
22                 --with-builtin-arc4random \
23                 --without-ssl-dir"
24
25 do_install_prepend() {
26         install -d ${D}${sysconfdir}/init.d
27 }
28 do_install_append() {
29         install -c -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/openntpd
30 }
31
32 pkg_postinst () {
33         [ ! -d ${localstatedir}/shared ] && mkdir -p ${localstatedir}/shared
34         grep ntpd ${sysconfdir}/passwd || adduser --disabled-password --home=${localstatedir}/shared/empty --ingroup nogroup ntpd
35         chown root:root ${localstatedir}/shared/empty
36 }
37
38 pkg_postrm () {
39         grep ntpd ${sysconfdir}/passwd && deluser ntpd
40 }
41
42 INITSCRIPT_NAME = "openntpd"
43
44 INITSCRIPT_PARAMS = "defaults"