summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorOlivier Guiter <olivier.guiter@linux.intel.com>2013-03-04 19:06:13 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-07 11:14:38 +0000
commitd5cfb00f080b68c09660d222437518813816da82 (patch)
treec73e710a7e96cc444cd720780da1a4323312929a /meta
parent45452bc0c3575e44fe2167a07ee9e4e829fd4b5b (diff)
downloadpoky-d5cfb00f080b68c09660d222437518813816da82.tar.gz
Near Field communication recipe for neard 0.9
The Linux NFC project aims to provide a full NFC support for Linux. It is based on the neard NFC user space stack running on top of the Linux kernel NFC subsystem. The code generated using this recipe was tested on a ARM11 device, with a kernel 3.6, using, for the NFC hardware, a USB dongle with the PN533 chipset (SCL3711) (From OE-Core rev: b2a74ae70725be7efc0226901fd560d3b3b48607) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/conf/distro/include/default-distrovars.inc2
-rw-r--r--meta/recipes-connectivity/neard/neard/neard42
-rw-r--r--meta/recipes-connectivity/neard/neard_0.9.bb57
-rw-r--r--meta/recipes-core/packagegroups/packagegroup-base.bb14
4 files changed, 114 insertions, 1 deletions
diff --git a/meta/conf/distro/include/default-distrovars.inc b/meta/conf/distro/include/default-distrovars.inc
index 1169ca5b6f..f0fec2a011 100644
--- a/meta/conf/distro/include/default-distrovars.inc
+++ b/meta/conf/distro/include/default-distrovars.inc
@@ -18,7 +18,7 @@ DISTRO_FEATURES_LIBC_DEFAULT ?= "ipv4 ipv6 libc-backtrace libc-big-macros libc-b
18DISTRO_FEATURES_LIBC ?= "${DISTRO_FEATURES_LIBC_DEFAULT}" 18DISTRO_FEATURES_LIBC ?= "${DISTRO_FEATURES_LIBC_DEFAULT}"
19DISTRO_FEATURES_LIBC_class-nativesdk = "${DISTRO_FEATURES_LIBC_DEFAULT}" 19DISTRO_FEATURES_LIBC_class-nativesdk = "${DISTRO_FEATURES_LIBC_DEFAULT}"
20DISTRO_FEATURES_INITMAN ?= "sysvinit" 20DISTRO_FEATURES_INITMAN ?= "sysvinit"
21DISTRO_FEATURES ?= "alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g x11 ${DISTRO_FEATURES_LIBC} ${DISTRO_FEATURES_INITMAN}" 21DISTRO_FEATURES ?= "alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11 ${DISTRO_FEATURES_LIBC} ${DISTRO_FEATURES_INITMAN}"
22 22
23IMAGE_FEATURES ?= "" 23IMAGE_FEATURES ?= ""
24 24
diff --git a/meta/recipes-connectivity/neard/neard/neard b/meta/recipes-connectivity/neard/neard/neard
new file mode 100644
index 0000000000..5f36174d62
--- /dev/null
+++ b/meta/recipes-connectivity/neard/neard/neard
@@ -0,0 +1,42 @@
1#!/bin/sh
2
3DAEMON=/usr/sbin/neard
4PIDFILE=/var/run/neard.pid
5DESC="Linux NFC daemon"
6
7if [ -f /etc/default/neard ] ; then
8 . /etc/default/neard
9fi
10
11set -e
12
13do_start() {
14 $DAEMON
15}
16
17do_stop() {
18 start-stop-daemon --stop --name neard --quiet
19}
20
21case "$1" in
22 start)
23 echo "Starting $DESC"
24 do_start
25 ;;
26 stop)
27 echo "Stopping $DESC"
28 do_stop
29 ;;
30 restart|force-reload)
31 echo "Restarting $DESC"
32 do_stop
33 sleep 1
34 do_start
35 ;;
36 *)
37 echo "Usage: $0 {start|stop|restart|force-reload}" >&2
38 exit 1
39 ;;
40esac
41
42exit 0
diff --git a/meta/recipes-connectivity/neard/neard_0.9.bb b/meta/recipes-connectivity/neard/neard_0.9.bb
new file mode 100644
index 0000000000..61ea58cc14
--- /dev/null
+++ b/meta/recipes-connectivity/neard/neard_0.9.bb
@@ -0,0 +1,57 @@
1SUMMARY = "Linux NFC daemon"
2DESCRIPTION = "A daemon for the Linux Near Field Communication stack"
3HOMEPAGE = "http://01.org/linux-nfc"
4
5LICENSE = "GPLv2"
6
7DEPENDS = "dbus glib-2.0 libnl"
8
9inherit autotools pkgconfig update-rc.d
10
11INITSCRIPT_NAME = "neard"
12INITSCRIPT_PARAMS = "defaults 64"
13
14# This would copy neard start-stop shell and test scripts
15do_install_append() {
16 install -d ${D}${sysconfdir}/init.d/
17 install -m 0755 ${WORKDIR}/neard ${D}${sysconfdir}/init.d/neard
18
19 install -d ${D}${libdir}/neard
20 install -m 0755 ${S}/test/* ${D}${libdir}/neard/
21 install -m 0755 ${S}/tools/nfctool/nfctool ${D}${libdir}/neard/
22}
23
24RDEPENDS_${PN} = "dbus python python-dbus python-pygobject"
25
26# Bluez & Wifi are not mandatory except for handover "
27RRECOMMENDS_${PN} = "\
28 ${@base_contains('DISTRO_FEATURES', 'bluetooth', 'bluez4', '', d)} \
29 ${@base_contains('DISTRO_FEATURES', 'wifi','wpa-supplicant', '', d)} \
30 "
31
32#Additional
33PACKAGES =+ "${PN}-tests"
34
35FILES_${PN}-tests = "${libdir}/neard/*-test"
36RDEPENDS_${PN}-tests = "python python-dbus python-pygobject"
37
38FILES_${PN}-dbg += "${bindir}/neard/*/.debug"
39
40##=============================
41# This is valid for 0.9+
42LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
43 file://src/near.h;beginline=1;endline=20;md5=358e4deefef251a4761e1ffacc965d13 \
44 "
45S = "${WORKDIR}/git"
46SRCREV = "7abdb13d106d496e1115fab49e6448a249dfb3c8"
47PV = "0.9-git${SRCPV}"
48PR = "r1"
49
50SRC_URI = "git://git.kernel.org/pub/scm/network/nfc/neard.git;protocol=git \
51 file://neard \
52 "
53
54EXTRA_OECONF += "--enable-tools \
55 "
56
57
diff --git a/meta/recipes-core/packagegroups/packagegroup-base.bb b/meta/recipes-core/packagegroups/packagegroup-base.bb
index 100cc88be3..799e12a7ac 100644
--- a/meta/recipes-core/packagegroups/packagegroup-base.bb
+++ b/meta/recipes-core/packagegroups/packagegroup-base.bb
@@ -28,6 +28,7 @@ PACKAGES = ' \
28 ${@base_contains("DISTRO_FEATURES", "bluetooth", "packagegroup-base-bluetooth", "", d)} \ 28 ${@base_contains("DISTRO_FEATURES", "bluetooth", "packagegroup-base-bluetooth", "", d)} \
29 ${@base_contains("DISTRO_FEATURES", "wifi", "packagegroup-base-wifi", "", d)} \ 29 ${@base_contains("DISTRO_FEATURES", "wifi", "packagegroup-base-wifi", "", d)} \
30 ${@base_contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g", "", d)} \ 30 ${@base_contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g", "", d)} \
31 ${@base_contains("DISTRO_FEATURES", "nfc", "packagegroup-base-nfc", "", d)} \
31 ${@base_contains("DISTRO_FEATURES", "cramfs", "packagegroup-base-cramfs", "", d)} \ 32 ${@base_contains("DISTRO_FEATURES", "cramfs", "packagegroup-base-cramfs", "", d)} \
32 ${@base_contains("DISTRO_FEATURES", "ipsec", "packagegroup-base-ipsec", "", d)} \ 33 ${@base_contains("DISTRO_FEATURES", "ipsec", "packagegroup-base-ipsec", "", d)} \
33 ${@base_contains("DISTRO_FEATURES", "ipv6", "packagegroup-base-ipv6", "", d)} \ 34 ${@base_contains("DISTRO_FEATURES", "ipv6", "packagegroup-base-ipv6", "", d)} \
@@ -71,6 +72,7 @@ RDEPENDS_packagegroup-base = "\
71 ${@base_contains('COMBINED_FEATURES', 'bluetooth', 'packagegroup-base-bluetooth', '',d)} \ 72 ${@base_contains('COMBINED_FEATURES', 'bluetooth', 'packagegroup-base-bluetooth', '',d)} \
72 ${@base_contains('COMBINED_FEATURES', 'wifi', 'packagegroup-base-wifi', '',d)} \ 73 ${@base_contains('COMBINED_FEATURES', 'wifi', 'packagegroup-base-wifi', '',d)} \
73 ${@base_contains('COMBINED_FEATURES', '3g', 'packagegroup-base-3g', '',d)} \ 74 ${@base_contains('COMBINED_FEATURES', '3g', 'packagegroup-base-3g', '',d)} \
75 ${@base_contains('COMBINED_FEATURES', 'nfc', 'packagegroup-base-nfc', '',d)} \
74 \ 76 \
75 ${@base_contains('DISTRO_FEATURES', 'nfs', 'packagegroup-base-nfs', '',d)} \ 77 ${@base_contains('DISTRO_FEATURES', 'nfs', 'packagegroup-base-nfs', '',d)} \
76 ${@base_contains('DISTRO_FEATURES', 'cramfs', 'packagegroup-base-cramfs', '',d)} \ 78 ${@base_contains('DISTRO_FEATURES', 'cramfs', 'packagegroup-base-cramfs', '',d)} \
@@ -96,11 +98,13 @@ RDEPENDS_packagegroup-base-extended = "\
96 ${ADD_WIFI} \ 98 ${ADD_WIFI} \
97 ${ADD_BT} \ 99 ${ADD_BT} \
98 ${ADD_3G} \ 100 ${ADD_3G} \
101 ${ADD_NFC} \
99 " 102 "
100 103
101ADD_WIFI = "" 104ADD_WIFI = ""
102ADD_BT = "" 105ADD_BT = ""
103ADD_3G = "" 106ADD_3G = ""
107ADD_NFC = ""
104 108
105python __anonymous () { 109python __anonymous () {
106 # If Distro want wifi and machine feature wifi/pci/pcmcia/usbhost (one of them) 110 # If Distro want wifi and machine feature wifi/pci/pcmcia/usbhost (one of them)
@@ -118,6 +122,9 @@ python __anonymous () {
118 if "3g" in distro_features and not "3g" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features): 122 if "3g" in distro_features and not "3g" in machine_features and ("pcmcia" in machine_features or "pci" in machine_features or "usbhost" in machine_features):
119 d.setVar("ADD_3G", "packagegroup-base-3g") 123 d.setVar("ADD_3G", "packagegroup-base-3g")
120 124
125 if "nfc" in distro_features and not "nfc" in machine_features and ("usbhost" in machine_features):
126 d.setVar("ADD_NFC", "packagegroup-base-nfc")
127
121 # For backwards compatibility after rename 128 # For backwards compatibility after rename
122 packages = d.getVar("PACKAGES", True).split() 129 packages = d.getVar("PACKAGES", True).split()
123 for pkg in packages: 130 for pkg in packages:
@@ -309,6 +316,13 @@ RRECOMMENDS_packagegroup-base-wifi = "\
309 kernel-module-aes-generic \ 316 kernel-module-aes-generic \
310 kernel-module-aes" 317 kernel-module-aes"
311 318
319SUMMARY_packagegroup-base-nfc = "Near Field Communication support"
320RDEPENDS_packagegroup-base-nfc = "\
321 neard"
322
323RRECOMMENDS_packagegroup-base-nfc = "\
324 kernel-module-nfc"
325
312SUMMARY_packagegroup-base-3g = "Cellular data support" 326SUMMARY_packagegroup-base-3g = "Cellular data support"
313RDEPENDS_packagegroup-base-3g = "\ 327RDEPENDS_packagegroup-base-3g = "\
314 ofono" 328 ofono"