diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
commit | c527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch) | |
tree | bb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/recipes-connectivity/neard | |
download | poky-c527fd1f14c27855a37f2e8ac5346ce8d940ced2.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-connectivity/neard')
-rw-r--r-- | meta/recipes-connectivity/neard/neard.inc | 59 | ||||
-rw-r--r-- | meta/recipes-connectivity/neard/neard/neard.in | 54 | ||||
-rw-r--r-- | meta/recipes-connectivity/neard/neard/neard.service.in | 13 | ||||
-rw-r--r-- | meta/recipes-connectivity/neard/neard_0.14.bb | 9 |
4 files changed, 135 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/neard/neard.inc b/meta/recipes-connectivity/neard/neard.inc new file mode 100644 index 0000000000..1dde1da377 --- /dev/null +++ b/meta/recipes-connectivity/neard/neard.inc | |||
@@ -0,0 +1,59 @@ | |||
1 | SUMMARY = "Linux NFC daemon" | ||
2 | DESCRIPTION = "A daemon for the Linux Near Field Communication stack" | ||
3 | HOMEPAGE = "http://01.org/linux-nfc" | ||
4 | LICENSE = "GPLv2" | ||
5 | |||
6 | DEPENDS = "dbus glib-2.0 libnl" | ||
7 | |||
8 | LIC_FILES_CHKSUM = "file://COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ | ||
9 | file://src/near.h;beginline=1;endline=20;md5=358e4deefef251a4761e1ffacc965d13 \ | ||
10 | " | ||
11 | |||
12 | inherit autotools-brokensep pkgconfig systemd update-rc.d | ||
13 | |||
14 | EXTRA_OECONF += "--enable-tools" | ||
15 | |||
16 | do_install() { | ||
17 | oe_runmake DESTDIR=${D} libexecdir=${libexecdir} install | ||
18 | } | ||
19 | |||
20 | # This would copy neard start-stop shell and test scripts | ||
21 | do_install_append() { | ||
22 | if ${@base_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 ${@base_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 | |||
41 | PACKAGES =+ "${PN}-tests" | ||
42 | |||
43 | FILES_${PN}-tests = "${libdir}/${BPN}/*-test" | ||
44 | FILES_${PN}-dbg += "${libdir}/${BPN}/*/.debug" | ||
45 | |||
46 | RDEPENDS_${PN} = "dbus python python-dbus python-pygobject" | ||
47 | |||
48 | # Bluez & Wifi are not mandatory except for handover | ||
49 | RRECOMMENDS_${PN} = "\ | ||
50 | ${@base_contains('DISTRO_FEATURES', 'bluetooth', 'bluez4', '', d)} \ | ||
51 | ${@base_contains('DISTRO_FEATURES', 'wifi','wpa-supplicant', '', d)} \ | ||
52 | " | ||
53 | |||
54 | RDEPENDS_${PN}-tests = "python python-dbus python-pygobject" | ||
55 | |||
56 | INITSCRIPT_NAME = "neard" | ||
57 | INITSCRIPT_PARAMS = "defaults 64" | ||
58 | |||
59 | SYSTEMD_SERVICE_${PN} = "neard.service" | ||
diff --git a/meta/recipes-connectivity/neard/neard/neard.in b/meta/recipes-connectivity/neard/neard/neard.in new file mode 100644 index 0000000000..a47d4d96c9 --- /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 | |||
15 | DAEMON=@installpath@/neard | ||
16 | PIDFILE=/var/run/neard.pid | ||
17 | DESC="Linux NFC daemon" | ||
18 | |||
19 | if [ -f /etc/default/neard ] ; then | ||
20 | . /etc/default/neard | ||
21 | fi | ||
22 | |||
23 | set -e | ||
24 | |||
25 | do_start() { | ||
26 | $DAEMON | ||
27 | } | ||
28 | |||
29 | do_stop() { | ||
30 | start-stop-daemon --stop --name neard --quiet | ||
31 | } | ||
32 | |||
33 | case "$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 | ;; | ||
52 | esac | ||
53 | |||
54 | exit 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 0000000000..90e5302662 --- /dev/null +++ b/meta/recipes-connectivity/neard/neard/neard.service.in | |||
@@ -0,0 +1,13 @@ | |||
1 | [Unit] | ||
2 | Description=NFC service | ||
3 | After=syslog.target | ||
4 | |||
5 | [Service] | ||
6 | Type=dbus | ||
7 | BusName=org.neard | ||
8 | Restart=on-failure | ||
9 | ExecStart=@installpath@/neard -n | ||
10 | StandardOutput=null | ||
11 | |||
12 | [Install] | ||
13 | WantedBy=multi-user.target | ||
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 0000000000..ac9aaf1498 --- /dev/null +++ b/meta/recipes-connectivity/neard/neard_0.14.bb | |||
@@ -0,0 +1,9 @@ | |||
1 | require neard.inc | ||
2 | |||
3 | SRC_URI = "${KERNELORG_MIRROR}/linux/network/nfc/${BPN}-${PV}.tar.xz \ | ||
4 | file://neard.in \ | ||
5 | file://neard.service.in \ | ||
6 | " | ||
7 | SRC_URI[md5sum] = "692ba2653d60155255244c87396c486b" | ||
8 | SRC_URI[sha256sum] = "6ea724b443d39d679168fc7776a965d1f64727c3735391df2c01469ee7cd8cca" | ||
9 | |||