summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2013-04-29 14:44:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-04-29 15:31:41 +0100
commitc42cc8fb38aee46f4778b9c68412a47ae5919923 (patch)
tree8eeb7036232571b498e4a10ae00c88d7ab4b5816 /meta
parent9dae6e7be41294601f53adf76d1a0955b58c9cf1 (diff)
downloadpoky-c42cc8fb38aee46f4778b9c68412a47ae5919923.tar.gz
neard: add systemd unit file
Add a systemd unit file, and respect the sysvinit feature when installing the init script. (thanks to Jukka Rissanen for the unit file) (From OE-Core rev: e86538db13605953465aacc3f2fb7d719dad919e) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-connectivity/neard/neard/neard.service.in13
-rw-r--r--meta/recipes-connectivity/neard/neard_0.9.bb28
2 files changed, 31 insertions, 10 deletions
diff --git a/meta/recipes-connectivity/neard/neard/neard.service.in b/meta/recipes-connectivity/neard/neard/neard.service.in
new file mode 100644
index 0000000000..90e5302662
--- /dev/null
+++ b/meta/recipes-connectivity/neard/neard/neard.service.in
@@ -0,0 +1,13 @@
1[Unit]
2Description=NFC service
3After=syslog.target
4
5[Service]
6Type=dbus
7BusName=org.neard
8Restart=on-failure
9ExecStart=@installpath@/neard -n
10StandardOutput=null
11
12[Install]
13WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/neard/neard_0.9.bb b/meta/recipes-connectivity/neard/neard_0.9.bb
index 2c4acb3ebf..dc43f7e315 100644
--- a/meta/recipes-connectivity/neard/neard_0.9.bb
+++ b/meta/recipes-connectivity/neard/neard_0.9.bb
@@ -7,6 +7,7 @@ DEPENDS = "dbus glib-2.0 libnl"
7 7
8SRC_URI = "git://git.kernel.org/pub/scm/network/nfc/neard.git;protocol=git \ 8SRC_URI = "git://git.kernel.org/pub/scm/network/nfc/neard.git;protocol=git \
9 file://neard.in \ 9 file://neard.in \
10 file://neard.service.in \
10 " 11 "
11 12
12LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ 13LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
@@ -18,7 +19,7 @@ SRCREV = "eb486bf35e24d7d1db61350f5ab393a0c880523d"
18PV = "0.10+git${SRCPV}" 19PV = "0.10+git${SRCPV}"
19PR = "r0" 20PR = "r0"
20 21
21inherit autotools pkgconfig update-rc.d 22inherit autotools pkgconfig systemd update-rc.d
22 23
23EXTRA_OECONF += "--enable-tools" 24EXTRA_OECONF += "--enable-tools"
24 25
@@ -28,15 +29,20 @@ do_install() {
28 29
29# This would copy neard start-stop shell and test scripts 30# This would copy neard start-stop shell and test scripts
30do_install_append() { 31do_install_append() {
31 # start/stop 32 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
32 install -d ${D}${sysconfdir}/init.d/ 33 install -d ${D}${sysconfdir}/init.d/
33 34 sed "s:@installpath@:${libexecdir}:" ${WORKDIR}/neard.in \
34 sed "s:@installpath@:${libexecdir}:" ${WORKDIR}/neard.in \ 35 > ${D}${sysconfdir}/init.d/neard
35 > ${D}${sysconfdir}/init.d/neard 36 chmod 0755 ${D}${sysconfdir}/init.d/neard
36 37 fi
37 chmod 0755 ${D}${sysconfdir}/init.d/neard 38
38 39 if ${@base_contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
39 #test files 40 install -d ${D}${systemd_unitdir}/system
41 sed "s:@installpath@:${libexecdir}:" ${WORKDIR}/neard.service.in \
42 > ${D}${systemd_unitdir}/system/neard.service
43 fi
44
45 # Install the tests for neard-tests
40 install -d ${D}${libdir}/neard 46 install -d ${D}${libdir}/neard
41 install -m 0755 ${S}/test/* ${D}${libdir}/${BPN}/ 47 install -m 0755 ${S}/test/* ${D}${libdir}/${BPN}/
42 install -m 0755 ${S}/tools/nfctool/nfctool ${D}${libdir}/${BPN}/ 48 install -m 0755 ${S}/tools/nfctool/nfctool ${D}${libdir}/${BPN}/
@@ -59,3 +65,5 @@ RDEPENDS_${PN}-tests = "python python-dbus python-pygobject"
59 65
60INITSCRIPT_NAME = "neard" 66INITSCRIPT_NAME = "neard"
61INITSCRIPT_PARAMS = "defaults 64" 67INITSCRIPT_PARAMS = "defaults 64"
68
69SYSTEMD_SERVICE_${PN} = "neard.service"