diff options
| author | Andrei Gherzan <andrei@gherzan.ro> | 2014-06-11 16:58:44 +0000 |
|---|---|---|
| committer | Gherzan Code Review <gerrit2@gherzan.ro> | 2014-06-11 16:58:44 +0000 |
| commit | 9cb147d1ddaa16252e0163589b56ef5d8df16dbb (patch) | |
| tree | 8a6f340347eae2e852fa39c2de7ac8d6b436943c | |
| parent | aa790be2fa303de4d881aac4ac75cabf565a332e (diff) | |
| parent | 25fd817f62a1d1c6fe12d969c1a2a806899548df (diff) | |
| download | meta-raspberrypi-9cb147d1ddaa16252e0163589b56ef5d8df16dbb.tar.gz | |
Merge "pi-blaster: Added recipe"
4 files changed, 179 insertions, 0 deletions
diff --git a/recipes-devtools/pi-blaster/files/enable-autotools-support.patch b/recipes-devtools/pi-blaster/files/enable-autotools-support.patch new file mode 100644 index 0000000..f0d4958 --- /dev/null +++ b/recipes-devtools/pi-blaster/files/enable-autotools-support.patch | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | Add autotools configuration files to simplify cross-compilation | ||
| 2 | |||
| 3 | Upstream-Status: Submitted [https://github.com/sarfata/pi-blaster/pull/25] | ||
| 4 | |||
| 5 | Signed-off-by: Alex Lennon <ajlennon@dynamicdevices.co.uk> | ||
| 6 | |||
| 7 | diff -Nur git.org/Makefile git.new/Makefile | ||
| 8 | --- git.org/Makefile 2014-06-11 15:42:26.490930706 +0100 | ||
| 9 | +++ git.new/Makefile 1970-01-01 01:00:00.000000000 +0100 | ||
| 10 | @@ -1,23 +0,0 @@ | ||
| 11 | -.PHONY: all | ||
| 12 | -all: pi-blaster | ||
| 13 | - | ||
| 14 | -REVISION=$(shell egrep -q '000f$$' /proc/cpuinfo && echo 2 || echo 1) | ||
| 15 | - | ||
| 16 | -pi-blaster: pi-blaster.c | ||
| 17 | - gcc -Wall -g -O2 -o $@ $< -DREVISION=$(REVISION) | ||
| 18 | - | ||
| 19 | -clean: | ||
| 20 | - rm -f pi-blaster | ||
| 21 | - | ||
| 22 | -install: pi-blaster | ||
| 23 | - cp -f pi-blaster.boot.sh /etc/init.d/pi-blaster | ||
| 24 | - chmod +x /etc/init.d/pi-blaster | ||
| 25 | - cp -f pi-blaster /usr/sbin/pi-blaster | ||
| 26 | - update-rc.d pi-blaster defaults | ||
| 27 | - /etc/init.d/pi-blaster start | ||
| 28 | - | ||
| 29 | -uninstall: | ||
| 30 | - -/etc/init.d/pi-blaster stop | ||
| 31 | - rm /usr/sbin/pi-blaster | ||
| 32 | - rm /etc/init.d/pi-blaster | ||
| 33 | - update-rc.d pi-blaster remove | ||
| 34 | diff -Nur git.org/Makefile.am git.new/Makefile.am | ||
| 35 | --- git.org/Makefile.am 1970-01-01 01:00:00.000000000 +0100 | ||
| 36 | +++ git.new/Makefile.am 2014-06-11 15:40:16.562930372 +0100 | ||
| 37 | @@ -0,0 +1,9 @@ | ||
| 38 | +AUTOMAKE_OPTIONS = foreign | ||
| 39 | + | ||
| 40 | +CFLAGS = -Wall -pedantic | ||
| 41 | + | ||
| 42 | +sbin_PROGRAMS = pi-blaster | ||
| 43 | +pi_blaster_SOURCES = pi-blaster.c | ||
| 44 | + | ||
| 45 | +init_ddir = $(sysconfdir)/init.d | ||
| 46 | +init_d_SCRIPTS = pi-blaster.boot.sh | ||
| 47 | diff -Nur git.org/autogen.sh git.new/autogen.sh | ||
| 48 | --- git.org/autogen.sh 1970-01-01 01:00:00.000000000 +0100 | ||
| 49 | +++ git.new/autogen.sh 2014-06-11 15:35:57.798929684 +0100 | ||
| 50 | @@ -0,0 +1,9 @@ | ||
| 51 | +#!/bin/sh | ||
| 52 | + | ||
| 53 | +echo "Generating configure files... may take a while." | ||
| 54 | + | ||
| 55 | +autoreconf --install --force && \ | ||
| 56 | + echo "Preparing was successful if there was no error messages above." && \ | ||
| 57 | + echo "Now type:" && \ | ||
| 58 | + echo " ./configure && make" && \ | ||
| 59 | + echo "Run './configure --help' for more information" | ||
| 60 | diff -Nur git.org/configure.ac git.new/configure.ac | ||
| 61 | --- git.org/configure.ac 1970-01-01 01:00:00.000000000 +0100 | ||
| 62 | +++ git.new/configure.ac 2014-06-11 15:35:53.154929717 +0100 | ||
| 63 | @@ -0,0 +1,14 @@ | ||
| 64 | +# -*- Autoconf -*- | ||
| 65 | +# Process this file with autoconf to produce a configure script. | ||
| 66 | + | ||
| 67 | +AC_PREREQ([2.69]) | ||
| 68 | +AC_INIT(pi-blaster, 0.1.0) | ||
| 69 | +AC_CONFIG_SRCDIR([pi-blaster.c]) | ||
| 70 | +AC_CONFIG_HEADERS([config.h]) | ||
| 71 | +AM_INIT_AUTOMAKE | ||
| 72 | + | ||
| 73 | +# Checks for programs. | ||
| 74 | +AC_PROG_CC | ||
| 75 | + | ||
| 76 | +AC_CONFIG_FILES([Makefile]) | ||
| 77 | +AC_OUTPUT | ||
diff --git a/recipes-devtools/pi-blaster/files/remove-initscript-lsb-dependency.patch b/recipes-devtools/pi-blaster/files/remove-initscript-lsb-dependency.patch new file mode 100644 index 0000000..7ea9a3b --- /dev/null +++ b/recipes-devtools/pi-blaster/files/remove-initscript-lsb-dependency.patch | |||
| @@ -0,0 +1,77 @@ | |||
| 1 | Remove dependencies on LSB functions | ||
| 2 | |||
| 3 | Upstream-Status: Inappropriate [configuration] | ||
| 4 | |||
| 5 | Signed-off-by: Alex Lennon <ajlennon@dynamicdevices.co.uk> | ||
| 6 | |||
| 7 | diff -ur git.org/pi-blaster.boot.sh git/pi-blaster.boot.sh | ||
| 8 | --- git.org/pi-blaster.boot.sh 2014-05-20 14:49:44.378582168 +0100 | ||
| 9 | +++ git/pi-blaster.boot.sh 2014-05-20 14:51:08.330582386 +0100 | ||
| 10 | @@ -28,12 +28,12 @@ | ||
| 11 | [ -r /etc/default/$NAME ] && . /etc/default/$NAME | ||
| 12 | |||
| 13 | # Load the VERBOSE setting and other rcS variables | ||
| 14 | -. /lib/init/vars.sh | ||
| 15 | +#. /lib/init/vars.sh | ||
| 16 | |||
| 17 | # Define LSB log_* functions. | ||
| 18 | # Depend on lsb-base (>= 3.2-14) to ensure that this file is present | ||
| 19 | # and status_of_proc is working. | ||
| 20 | -. /lib/lsb/init-functions | ||
| 21 | +#. /lib/lsb/init-functions | ||
| 22 | |||
| 23 | # | ||
| 24 | # Function that starts the daemon/service | ||
| 25 | @@ -77,48 +77,23 @@ | ||
| 26 | |||
| 27 | case "$1" in | ||
| 28 | start) | ||
| 29 | - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" | ||
| 30 | + [ "$VERBOSE" != no ] && echo "Starting $DESC" "$NAME" | ||
| 31 | do_start | ||
| 32 | - case "$?" in | ||
| 33 | - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; | ||
| 34 | - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; | ||
| 35 | - esac | ||
| 36 | ;; | ||
| 37 | stop) | ||
| 38 | - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" | ||
| 39 | + [ "$VERBOSE" != no ] && echo "Stopping $DESC" "$NAME" | ||
| 40 | do_stop | ||
| 41 | - case "$?" in | ||
| 42 | - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; | ||
| 43 | - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; | ||
| 44 | - esac | ||
| 45 | - ;; | ||
| 46 | - status) | ||
| 47 | - status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $? | ||
| 48 | ;; | ||
| 49 | restart|force-reload) | ||
| 50 | # | ||
| 51 | # If the "reload" option is implemented then remove the | ||
| 52 | # 'force-reload' alias | ||
| 53 | # | ||
| 54 | - log_daemon_msg "Restarting $DESC" "$NAME" | ||
| 55 | do_stop | ||
| 56 | - case "$?" in | ||
| 57 | - 0|1) | ||
| 58 | - do_start | ||
| 59 | - case "$?" in | ||
| 60 | - 0) log_end_msg 0 ;; | ||
| 61 | - 1) log_end_msg 1 ;; # Old process is still running | ||
| 62 | - *) log_end_msg 1 ;; # Failed to start | ||
| 63 | - esac | ||
| 64 | - ;; | ||
| 65 | - *) | ||
| 66 | - # Failed to stop | ||
| 67 | - log_end_msg 1 | ||
| 68 | - ;; | ||
| 69 | - esac | ||
| 70 | + do_start | ||
| 71 | ;; | ||
| 72 | *) | ||
| 73 | - echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2 | ||
| 74 | + echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2 | ||
| 75 | exit 3 | ||
| 76 | ;; | ||
| 77 | esac | ||
diff --git a/recipes-devtools/pi-blaster/pi-blaster.inc b/recipes-devtools/pi-blaster/pi-blaster.inc new file mode 100644 index 0000000..04a7b5e --- /dev/null +++ b/recipes-devtools/pi-blaster/pi-blaster.inc | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | DESCRIPTION = "This project enables PWM on the GPIO pins you request of a Raspberry Pi." | ||
| 2 | HOMEPAGE = "https://github.com/sarfata/pi-blaster/" | ||
| 3 | SECTION = "devel/libs" | ||
| 4 | LICENSE = "MIT" | ||
| 5 | LIC_FILES_CHKSUM = "file://README.md;beginline=138;endline=151;md5=e0f0f92050a87a160939707c60940307" | ||
| 6 | |||
| 7 | SRC_URI = "git://github.com/sarfata/pi-blaster \ | ||
| 8 | file://enable-autotools-support.patch \ | ||
| 9 | file://remove-initscript-lsb-dependency.patch \ | ||
| 10 | " | ||
| 11 | |||
| 12 | S = "${WORKDIR}/git" | ||
| 13 | |||
| 14 | inherit update-rc.d autotools | ||
| 15 | |||
| 16 | INITSCRIPT_PACKAGES = "${PN}" | ||
| 17 | INITSCRIPT_NAME_${PN} = "${PN}.boot.sh" | ||
| 18 | INITSCRIPT_PARAMS_${PN} = "defaults 15 85" | ||
| 19 | |||
| 20 | COMPATIBLE_MACHINE = "raspberrypi" | ||
| 21 | |||
| 22 | PACKAGE_ARCH = "${MACHINE_ARCH}" | ||
diff --git a/recipes-devtools/pi-blaster/pi-blaster_git.bb b/recipes-devtools/pi-blaster/pi-blaster_git.bb new file mode 100644 index 0000000..25eb382 --- /dev/null +++ b/recipes-devtools/pi-blaster/pi-blaster_git.bb | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | require pi-blaster.inc | ||
| 2 | |||
| 3 | SRCREV = "177cef81774d6df5c6284c198ff818515281db14" | ||
