summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/neard
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/neard')
-rw-r--r--meta/recipes-connectivity/neard/neard.inc59
-rw-r--r--meta/recipes-connectivity/neard/neard/Makefile.am-fix-parallel-issue.patch33
-rw-r--r--meta/recipes-connectivity/neard/neard/neard.in54
-rw-r--r--meta/recipes-connectivity/neard/neard/neard.service.in13
-rw-r--r--meta/recipes-connectivity/neard/neard/parallel-build.patch40
-rw-r--r--meta/recipes-connectivity/neard/neard_0.14.bb11
6 files changed, 210 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/neard/neard.inc b/meta/recipes-connectivity/neard/neard.inc
new file mode 100644
index 0000000..e714cad
--- /dev/null
+++ b/meta/recipes-connectivity/neard/neard.inc
@@ -0,0 +1,59 @@
1SUMMARY = "Linux NFC daemon"
2DESCRIPTION = "A daemon for the Linux Near Field Communication stack"
3HOMEPAGE = "http://01.org/linux-nfc"
4LICENSE = "GPLv2"
5
6DEPENDS = "dbus glib-2.0 libnl"
7
8LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
9 file://src/near.h;beginline=1;endline=20;md5=358e4deefef251a4761e1ffacc965d13 \
10 "
11
12inherit autotools-brokensep pkgconfig systemd update-rc.d
13
14EXTRA_OECONF += "--enable-tools"
15
16do_install() {
17 oe_runmake DESTDIR=${D} libexecdir=${libexecdir} install
18}
19
20# This would copy neard start-stop shell and test scripts
21do_install_append() {
22 if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
23 install -d ${D}${sysconfdir}/init.d/
24 sed "s:@installpath@:${libexecdir}:" ${WORKDIR}/neard.in \
25 > ${D}${sysconfdir}/init.d/neard
26 chmod 0755 ${D}${sysconfdir}/init.d/neard
27 fi
28
29 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
30 install -d ${D}${systemd_unitdir}/system
31 sed "s:@installpath@:${libexecdir}:" ${WORKDIR}/neard.service.in \
32 > ${D}${systemd_unitdir}/system/neard.service
33 fi
34
35 # Install the tests for neard-tests
36 install -d ${D}${libdir}/neard
37 install -m 0755 ${S}/test/* ${D}${libdir}/${BPN}/
38 install -m 0755 ${S}/tools/nfctool/nfctool ${D}${libdir}/${BPN}/
39}
40
41PACKAGES =+ "${PN}-tests"
42
43FILES_${PN}-tests = "${libdir}/${BPN}/*-test"
44FILES_${PN}-dbg += "${libdir}/${BPN}/*/.debug"
45
46RDEPENDS_${PN} = "dbus python python-dbus python-pygobject"
47
48# Bluez & Wifi are not mandatory except for handover
49RRECOMMENDS_${PN} = "\
50 ${@bb.utils.contains('DISTRO_FEATURES', 'bluetooth', 'bluez4', '', d)} \
51 ${@bb.utils.contains('DISTRO_FEATURES', 'wifi','wpa-supplicant', '', d)} \
52 "
53
54RDEPENDS_${PN}-tests = "python python-dbus python-pygobject"
55
56INITSCRIPT_NAME = "neard"
57INITSCRIPT_PARAMS = "defaults 64"
58
59SYSTEMD_SERVICE_${PN} = "neard.service"
diff --git a/meta/recipes-connectivity/neard/neard/Makefile.am-fix-parallel-issue.patch b/meta/recipes-connectivity/neard/neard/Makefile.am-fix-parallel-issue.patch
new file mode 100644
index 0000000..4660676
--- /dev/null
+++ b/meta/recipes-connectivity/neard/neard/Makefile.am-fix-parallel-issue.patch
@@ -0,0 +1,33 @@
1From 43acc56d5506c7e318f717fb3634bc16e3438913 Mon Sep 17 00:00:00 2001
2From: Robert Yang <liezhi.yang@windriver.com>
3Date: Thu, 15 Jan 2015 18:12:07 -0800
4Subject: [PATCH] Makefile.am: fix parallel issue
5
6There might be no src dir if src/builtin.h runs earlier, create it to
7fix the race issue:
8
9src/genbuiltin nfctype1 nfctype2 nfctype3 nfctype4 p2p > src/builtin.h
10/bin/sh: src/builtin.h: No such file or directory
11
12Upstream-Status: Pending
13
14Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
15---
16 Makefile.am | 1 +
17 1 file changed, 1 insertion(+)
18
19diff --git a/Makefile.am b/Makefile.am
20index 3241311..a43eaa2 100644
21--- a/Makefile.am
22+++ b/Makefile.am
23@@ -164,6 +164,7 @@ MAINTAINERCLEANFILES = Makefile.in \
24 src/plugin.$(OBJEXT): src/builtin.h
25
26 src/builtin.h: src/genbuiltin $(builtin_sources)
27+ $(AM_V_at)$(MKDIR_P) src
28 $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_modules) > $@
29
30 $(src_neard_OBJECTS) \
31--
321.7.9.5
33
diff --git a/meta/recipes-connectivity/neard/neard/neard.in b/meta/recipes-connectivity/neard/neard/neard.in
new file mode 100644
index 0000000..a47d4d9
--- /dev/null
+++ b/meta/recipes-connectivity/neard/neard/neard.in
@@ -0,0 +1,54 @@
1#!/bin/sh
2#
3# start/stop neard daemon.
4
5### BEGIN INIT INFO
6# Provides: neard
7# Required-Start: $network
8# Required-Stop: $network
9# Default-Start: S 2 3 4 5
10# Default-Stop: 0 1 6
11# Short-Description: NFC daemon
12# Description: neard is a daemon used to enable NFC features
13### END INIT INFO
14
15DAEMON=@installpath@/neard
16PIDFILE=/var/run/neard.pid
17DESC="Linux NFC daemon"
18
19if [ -f /etc/default/neard ] ; then
20 . /etc/default/neard
21fi
22
23set -e
24
25do_start() {
26 $DAEMON
27}
28
29do_stop() {
30 start-stop-daemon --stop --name neard --quiet
31}
32
33case "$1" in
34 start)
35 echo "Starting $DESC"
36 do_start
37 ;;
38 stop)
39 echo "Stopping $DESC"
40 do_stop
41 ;;
42 restart|force-reload)
43 echo "Restarting $DESC"
44 do_stop
45 sleep 1
46 do_start
47 ;;
48 *)
49 echo "Usage: $0 {start|stop|restart|force-reload}" >&2
50 exit 1
51 ;;
52esac
53
54exit 0
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 0000000..a6f8a84
--- /dev/null
+++ b/meta/recipes-connectivity/neard/neard/neard.service.in
@@ -0,0 +1,13 @@
1[Unit]
2Description=neard service
3Documentation=man:neard(8)
4After=syslog.target
5
6[Service]
7Type=dbus
8BusName=org.neard
9ExecStart=@installpath@/neard -n
10
11[Install]
12Alias=dbus-org.neard.service
13WantedBy=multi-user.target
diff --git a/meta/recipes-connectivity/neard/neard/parallel-build.patch b/meta/recipes-connectivity/neard/neard/parallel-build.patch
new file mode 100644
index 0000000..5624749
--- /dev/null
+++ b/meta/recipes-connectivity/neard/neard/parallel-build.patch
@@ -0,0 +1,40 @@
1Upstream-Status: Pending
2Signed-off-by: Ross Burton <ross.burton@intel.com>
3
4From 488e898300f7a4ab9ba73307967ae9e02b7a6511 Mon Sep 17 00:00:00 2001
5From: Ross Burton <ross.burton@intel.com>
6Date: Fri, 13 Jun 2014 17:49:45 +0100
7Subject: [PATCH] Makefile: add missing binaries to dependency on
8 local_headers
9
10seeld and snap_send were missing from the rule that generates the header symlink
11farm, resulting in headers not being available in highly parallel builds.
12
13Signed-off-by: Ross Burton <ross.burton@intel.com>
14---
15 Makefile.am | 9 ++++++++-
16 1 file changed, 8 insertions(+), 1 deletion(-)
17
18diff --git a/Makefile.am b/Makefile.am
19index c51351f..8e58ac1 100644
20--- a/Makefile.am
21+++ b/Makefile.am
22@@ -254,7 +254,14 @@ se/plugin.$(OBJEXT): se/builtin.h
23 se/builtin.h: src/genbuiltin $(builtin_se_sources)
24 $(AM_V_GEN)$(srcdir)/src/genbuiltin $(builtin_se_modules) > $@
25
26-$(src_neard_OBJECTS) $(tools_nfctool_nfctool_OBJECTS) $(plugin_objects): $(local_headers)
27+$(src_neard_OBJECTS) \
28+$(tools_nfctool_nfctool_OBJECTS) \
29+$(plugin_objects) \
30+$(se_seeld_OBJECTS) \
31+$(unit_test_ndef_parse_OBJECTS) \
32+$(unit_test_ndef_build_OBJECTS) \
33+$(unit_test_snep_read_OBJECTS) \
34+$(tools_snep_send_OBJECTS): $(local_headers)
35
36 include/near/version.h: include/version.h
37 $(AM_V_at)$(MKDIR_P) include/near
38--
391.7.10.4
40
diff --git a/meta/recipes-connectivity/neard/neard_0.14.bb b/meta/recipes-connectivity/neard/neard_0.14.bb
new file mode 100644
index 0000000..2fb47cc
--- /dev/null
+++ b/meta/recipes-connectivity/neard/neard_0.14.bb
@@ -0,0 +1,11 @@
1require neard.inc
2
3SRC_URI = "${KERNELORG_MIRROR}/linux/network/nfc/${BPN}-${PV}.tar.xz \
4 file://parallel-build.patch \
5 file://neard.in \
6 file://neard.service.in \
7 file://Makefile.am-fix-parallel-issue.patch \
8 "
9SRC_URI[md5sum] = "692ba2653d60155255244c87396c486b"
10SRC_URI[sha256sum] = "6ea724b443d39d679168fc7776a965d1f64727c3735391df2c01469ee7cd8cca"
11