[oe-commits] Koen Kooi : ntp 4.2.6p3: add native systemd support
git at git.openembedded.org
git at git.openembedded.org
Tue Nov 8 14:41:33 UTC 2011
Module: meta-openembedded.git
Branch: master
Commit: dd7c7f11049ecc4eb6cf898059d2dca2766c8408
URL: http://git.openembedded.org/?p=meta-openembedded.git&a=commit;h=dd7c7f11049ecc4eb6cf898059d2dca2766c8408
Author: Koen Kooi <koen at dominion.thruhere.net>
Date: Tue Nov 8 14:11:21 2011 +0100
ntp 4.2.6p3: add native systemd support
Signed-off-by: Koen Kooi <koen at dominion.thruhere.net>
---
meta-oe/recipes-support/ntp/files/ntpd.service | 12 ++++++++++
meta-oe/recipes-support/ntp/ntp.inc | 4 ++-
meta-oe/recipes-support/ntp/ntp_4.2.6p3.bb | 29 ++++++++++++++++++-----
3 files changed, 37 insertions(+), 8 deletions(-)
diff --git a/meta-oe/recipes-support/ntp/files/ntpd.service b/meta-oe/recipes-support/ntp/files/ntpd.service
new file mode 100644
index 0000000..420a056
--- /dev/null
+++ b/meta-oe/recipes-support/ntp/files/ntpd.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Network Time Service
+After=network.target
+
+[Service]
+Type=forking
+PIDFile=/run/ntpd.pid
+EnvironmentFile=/etc/ntp.conf
+ExecStart=/usr/bin/ntpd $NTPD_ARGS -p /run/ntpd.pid
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-oe/recipes-support/ntp/ntp.inc b/meta-oe/recipes-support/ntp/ntp.inc
index 3dc7bdf..b398b80 100644
--- a/meta-oe/recipes-support/ntp/ntp.inc
+++ b/meta-oe/recipes-support/ntp/ntp.inc
@@ -12,7 +12,9 @@ SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \
file://ipv6only-workaround.patch \
file://ntpd \
file://ntp.conf \
- file://ntpdate"
+ file://ntpdate \
+ file://ntpd.service \
+"
inherit autotools update-rc.d
diff --git a/meta-oe/recipes-support/ntp/ntp_4.2.6p3.bb b/meta-oe/recipes-support/ntp/ntp_4.2.6p3.bb
index 590eed1..e2bb1a8 100644
--- a/meta-oe/recipes-support/ntp/ntp_4.2.6p3.bb
+++ b/meta-oe/recipes-support/ntp/ntp_4.2.6p3.bb
@@ -1,13 +1,20 @@
require ntp.inc
-PR = "r2"
+PR = "r3"
+
+inherit systemd
+
+SYSTEMD_PACKAGES = "${PN}-systemd"
+SYSTEMD_SERVICE_${PN}-systemd = "ntpd.service"
SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${P}.tar.gz \
file://tickadj.c.patch \
file://ntp-4.2.4_p6-nano.patch \
file://ntpd \
file://ntp.conf \
- file://ntpdate"
+ file://ntpdate \
+ file://ntpd.service \
+"
SRC_URI[md5sum] = "59876a9009b098ff59767ee45a88ebd2"
SRC_URI[sha256sum] = "6e84d4ddfa14b911c3ed88463af10867e1fa9b287e7b34d8a02e78be85a7c40e"
@@ -15,13 +22,21 @@ SRC_URI[sha256sum] = "6e84d4ddfa14b911c3ed88463af10867e1fa9b287e7b34d8a02e78be85
EXTRA_OECONF += " --with-net-snmp-config=no --without-ntpsnmpd"
do_install_append() {
- install -d ${D}/${sysconfdir}/init.d
- install -m 644 ${WORKDIR}/ntp.conf ${D}/${sysconfdir}
- install -m 755 ${WORKDIR}/ntpd ${D}/${sysconfdir}/init.d
- install -d ${D}/${sysconfdir}/network/if-up.d
- install -m 755 ${WORKDIR}/ntpdate ${D}/${sysconfdir}/network/if-up.d
+ install -d ${D}/${sysconfdir}/init.d
+ install -m 644 ${WORKDIR}/ntp.conf ${D}/${sysconfdir}
+ install -m 755 ${WORKDIR}/ntpd ${D}/${sysconfdir}/init.d
+ install -d ${D}/${sysconfdir}/network/if-up.d
+ install -m 755 ${WORKDIR}/ntpdate ${D}/${sysconfdir}/network/if-up.d
+
+ install -d ${D}${base_libdir}/systemd/system
+ install -m 0644 ${WORKDIR}/ntpd.service ${D}${base_libdir}/systemd/system/
}
+PACKAGES =+ "${PN}-systemd"
+
+FILES_${PN}-systemd = "${base_libdir}/systemd/system/"
+RDEPENDS_${PN}-systemd = "${PN}"
+
FILES_${PN}-bin = "${bindir}/ntp-wait ${bindir}/ntpdc ${bindir}/ntpq ${bindir}/ntptime ${bindir}/ntptrace"
FILES_${PN} = "${bindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd"
FILES_${PN}-tickadj = "${bindir}/tickadj"
More information about the Openembedded-commits
mailing list