]> code.ossystems Code Review - openembedded-core.git/commitdiff
Near Field communication recipe for neard 0.9
authorOlivier Guiter <olivier.guiter@linux.intel.com>
Mon, 4 Mar 2013 18:06:13 +0000 (19:06 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 7 Mar 2013 11:10:35 +0000 (11:10 +0000)
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)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/conf/distro/include/default-distrovars.inc
meta/recipes-connectivity/neard/neard/neard [new file with mode: 0644]
meta/recipes-connectivity/neard/neard_0.9.bb [new file with mode: 0644]
meta/recipes-core/packagegroups/packagegroup-base.bb

index 1169ca5b6fb78b344ece34ba516c7c753115c521..f0fec2a0118642af8fcaaa3b2cbd85c0f9691ee0 100644 (file)
@@ -18,7 +18,7 @@ DISTRO_FEATURES_LIBC_DEFAULT ?= "ipv4 ipv6 libc-backtrace libc-big-macros libc-b
 DISTRO_FEATURES_LIBC ?= "${DISTRO_FEATURES_LIBC_DEFAULT}"
 DISTRO_FEATURES_LIBC_class-nativesdk = "${DISTRO_FEATURES_LIBC_DEFAULT}"
 DISTRO_FEATURES_INITMAN ?= "sysvinit"
-DISTRO_FEATURES ?= "alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g x11 ${DISTRO_FEATURES_LIBC} ${DISTRO_FEATURES_INITMAN}"
+DISTRO_FEATURES ?= "alsa argp bluetooth ext2 irda largefile pcmcia usbgadget usbhost wifi xattr nfs zeroconf pci 3g nfc x11 ${DISTRO_FEATURES_LIBC} ${DISTRO_FEATURES_INITMAN}"
 
 IMAGE_FEATURES ?= ""
 
diff --git a/meta/recipes-connectivity/neard/neard/neard b/meta/recipes-connectivity/neard/neard/neard
new file mode 100644 (file)
index 0000000..5f36174
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+DAEMON=/usr/sbin/neard
+PIDFILE=/var/run/neard.pid
+DESC="Linux NFC daemon"
+
+if [ -f /etc/default/neard ] ; then
+       . /etc/default/neard
+fi
+
+set -e
+
+do_start() {
+       $DAEMON
+}
+
+do_stop() {
+       start-stop-daemon --stop --name neard --quiet
+}
+
+case "$1" in
+  start)
+       echo "Starting $DESC"
+       do_start
+       ;;
+  stop)
+       echo "Stopping $DESC"
+       do_stop
+       ;;
+  restart|force-reload)
+       echo "Restarting $DESC"
+       do_stop
+       sleep 1
+       do_start
+       ;;
+  *)
+       echo "Usage: $0 {start|stop|restart|force-reload}" >&2
+       exit 1
+       ;;
+esac
+
+exit 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 (file)
index 0000000..61ea58c
--- /dev/null
@@ -0,0 +1,57 @@
+SUMMARY  = "Linux NFC daemon"
+DESCRIPTION = "A daemon for the Linux Near Field Communication stack"
+HOMEPAGE = "http://01.org/linux-nfc"
+
+LICENSE  = "GPLv2"
+
+DEPENDS  = "dbus glib-2.0 libnl"
+
+inherit autotools pkgconfig update-rc.d
+
+INITSCRIPT_NAME = "neard"
+INITSCRIPT_PARAMS = "defaults 64"
+
+# This would copy neard start-stop shell and test scripts
+do_install_append() {
+  install -d ${D}${sysconfdir}/init.d/
+  install -m 0755 ${WORKDIR}/neard ${D}${sysconfdir}/init.d/neard
+
+  install -d ${D}${libdir}/neard
+  install -m 0755 ${S}/test/* ${D}${libdir}/neard/
+  install -m 0755 ${S}/tools/nfctool/nfctool ${D}${libdir}/neard/
+}
+
+RDEPENDS_${PN} = "dbus python python-dbus python-pygobject"
+
+# Bluez & Wifi are not mandatory except for handover   "
+RRECOMMENDS_${PN} = "\
+       ${@base_contains('DISTRO_FEATURES', 'bluetooth', 'bluez4', '', d)} \
+       ${@base_contains('DISTRO_FEATURES', 'wifi','wpa-supplicant', '', d)} \
+       "
+
+#Additional
+PACKAGES =+ "${PN}-tests"
+
+FILES_${PN}-tests = "${libdir}/neard/*-test"
+RDEPENDS_${PN}-tests = "python python-dbus python-pygobject"
+
+FILES_${PN}-dbg += "${bindir}/neard/*/.debug"
+
+##=============================
+# This is valid for 0.9+
+LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \
+ file://src/near.h;beginline=1;endline=20;md5=358e4deefef251a4761e1ffacc965d13 \
+ "
+S      = "${WORKDIR}/git"
+SRCREV = "7abdb13d106d496e1115fab49e6448a249dfb3c8"
+PV     = "0.9-git${SRCPV}"
+PR     = "r1"
+
+SRC_URI  = "git://git.kernel.org/pub/scm/network/nfc/neard.git;protocol=git \
+       file://neard \
+       "
+
+EXTRA_OECONF += "--enable-tools \
+       "
+
+
index 100cc88be3b17ea885ed03625c50caf9411d7b08..799e12a7ac6213653186a0a78b766b0d665bb609 100644 (file)
@@ -28,6 +28,7 @@ PACKAGES = ' \
             ${@base_contains("DISTRO_FEATURES", "bluetooth", "packagegroup-base-bluetooth", "", d)} \
             ${@base_contains("DISTRO_FEATURES", "wifi", "packagegroup-base-wifi", "", d)} \
             ${@base_contains("DISTRO_FEATURES", "3g", "packagegroup-base-3g", "", d)} \
+            ${@base_contains("DISTRO_FEATURES", "nfc", "packagegroup-base-nfc", "", d)} \
             ${@base_contains("DISTRO_FEATURES", "cramfs", "packagegroup-base-cramfs", "", d)} \
             ${@base_contains("DISTRO_FEATURES", "ipsec", "packagegroup-base-ipsec", "", d)} \
             ${@base_contains("DISTRO_FEATURES", "ipv6", "packagegroup-base-ipv6", "", d)} \
@@ -71,6 +72,7 @@ RDEPENDS_packagegroup-base = "\
     ${@base_contains('COMBINED_FEATURES', 'bluetooth', 'packagegroup-base-bluetooth', '',d)} \
     ${@base_contains('COMBINED_FEATURES', 'wifi', 'packagegroup-base-wifi', '',d)} \
     ${@base_contains('COMBINED_FEATURES', '3g', 'packagegroup-base-3g', '',d)} \
+    ${@base_contains('COMBINED_FEATURES', 'nfc', 'packagegroup-base-nfc', '',d)} \
     \
     ${@base_contains('DISTRO_FEATURES', 'nfs', 'packagegroup-base-nfs', '',d)} \
     ${@base_contains('DISTRO_FEATURES', 'cramfs', 'packagegroup-base-cramfs', '',d)} \
@@ -96,11 +98,13 @@ RDEPENDS_packagegroup-base-extended = "\
     ${ADD_WIFI} \
     ${ADD_BT} \
     ${ADD_3G} \
+    ${ADD_NFC} \
     "
 
 ADD_WIFI = ""
 ADD_BT = ""
 ADD_3G = ""
+ADD_NFC = ""
 
 python __anonymous () {
     # If Distro want wifi and machine feature wifi/pci/pcmcia/usbhost (one of them)
@@ -118,6 +122,9 @@ python __anonymous () {
     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):
         d.setVar("ADD_3G", "packagegroup-base-3g")
 
+    if "nfc" in distro_features and not "nfc" in machine_features and ("usbhost" in machine_features):
+        d.setVar("ADD_NFC", "packagegroup-base-nfc")
+
     # For backwards compatibility after rename
     packages = d.getVar("PACKAGES", True).split()
     for pkg in packages:
@@ -309,6 +316,13 @@ RRECOMMENDS_packagegroup-base-wifi = "\
     kernel-module-aes-generic \
     kernel-module-aes"
 
+SUMMARY_packagegroup-base-nfc = "Near Field Communication support"
+RDEPENDS_packagegroup-base-nfc = "\
+    neard"
+
+RRECOMMENDS_packagegroup-base-nfc = "\
+    kernel-module-nfc"
+
 SUMMARY_packagegroup-base-3g = "Cellular data support"
 RDEPENDS_packagegroup-base-3g = "\
     ofono"