aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/dspgw-utils
diff options
context:
space:
mode:
authorWiller Moreira <willer.moreira@openbossa.org>2010-02-02 16:10:34 -0400
committerKhem Raj <raj.khem@gmail.com>2010-08-27 15:41:23 -0700
commit8d6832e3fba63e86e047932d1a2de20b60654254 (patch)
tree31bf0a4339fe6cec02d581cc11a5c1f60ba6aca9 /recipes/dspgw-utils
parent510367b6ca14dc89a9669a8938a7d177ff4bb02d (diff)
downloadopenembedded-8d6832e3fba63e86e047932d1a2de20b60654254.tar.gz
dspgw-utils: Adding DSP Gateway Utilities package
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@openbossa.org> Signed-off-by: Francisco Alecrim <francisco.alecrim@openbossa.org> Signed-off-by: Willer Moreira <willer.moreira@openbossa.org>
Diffstat (limited to 'recipes/dspgw-utils')
-rw-r--r--recipes/dspgw-utils/dspgw-utils_3.3.1.bb43
-rw-r--r--recipes/dspgw-utils/files/dsp96
-rw-r--r--recipes/dspgw-utils/files/dsp.rules6
-rw-r--r--recipes/dspgw-utils/files/yytext_ptr.patch11
4 files changed, 156 insertions, 0 deletions
diff --git a/recipes/dspgw-utils/dspgw-utils_3.3.1.bb b/recipes/dspgw-utils/dspgw-utils_3.3.1.bb
new file mode 100644
index 0000000000..08e11b6313
--- /dev/null
+++ b/recipes/dspgw-utils/dspgw-utils_3.3.1.bb
@@ -0,0 +1,43 @@
+DESCRIPTION = "DSP Gateway Utilities"
+HOMEPAGE = "http://dspgateway.sourceforge.net"
+LICENSE = "GPL"
+DEPENDS = "bison flex udev"
+PR = "r0"
+
+SRC_URI = "${SOURCEFORGE_MIRROR}/dspgateway/dspgw-${PV}-arm.tar.bz2 \
+ file://yytext_ptr.patch;patch=1 \
+ file://dsp \
+ file://dsp.rules "
+
+S = "${WORKDIR}/dspgw-${PV}-arm/src/utils"
+
+CFLAGS += "-g -Wall -I${WORKDIR}/dspgw-${PV}-arm/include"
+
+inherit update-rc.d
+
+INITSCRIPT_NAME = "dsp"
+INITSCRIPT_PARAMS = "defaults"
+
+# Skipping...
+do_configure () {
+}
+
+# Skipping...
+do_stage () {
+}
+
+do_compile () {
+ cd ${S}/dsp_dld/arm && oe_runmake
+ cd ${S}/dspctl && oe_runmake
+}
+
+do_install () {
+ install -d ${D}${sbindir}
+ install -d ${D}${sysconfdir}/init.d
+ install -d ${D}${sysconfdir}/udev/rules.d
+ install -m 0655 ${S}/dspctl/dspctl ${D}${sbindir}
+ install -m 0655 ${S}/dsp_dld/arm/dsp_dld ${D}${sbindir}
+ install -m 0655 ${S}/dsp_dld/arm/dld_client ${D}${sbindir}
+ install -m 0755 ${WORKDIR}/dsp ${D}${sysconfdir}/init.d
+ install -m 0755 ${WORKDIR}/dsp.rules ${D}${sysconfdir}/udev/rules.d/
+}
diff --git a/recipes/dspgw-utils/files/dsp b/recipes/dspgw-utils/files/dsp
new file mode 100644
index 0000000000..4387d60472
--- /dev/null
+++ b/recipes/dspgw-utils/files/dsp
@@ -0,0 +1,96 @@
+#!/bin/sh
+# DSP Gateway init script
+# Copyright (C) 2007 INdT.
+# @author Abner Jose de Faria Silva <abner.silva@indt.org.br>
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+set -e
+
+DESC="DSP Gateway"
+
+DAEMON=/usr/sbin/dsp_dld
+DSPCTL=/usr/sbin/dspctl
+DSPCONF=/lib/dsp/dsp_dld_avs.conf
+
+DAEMONPARAM="-p --disable-restart -c $DSPCONF"
+
+KMEMRESERVE=360000
+
+PIDDIR=/var/run/dsp
+PIDFILE=$PIDDIR/pid
+
+test -x "$DAEMON" || exit 0
+test -x "$DSPCTL" || exit 0
+test -e "$DSPCONF" || exit 0
+
+start_dsp()
+{
+ if [ ! -d "$PIDDIR" ]; then
+ mkdir -p "$PIDDIR"
+ fi
+
+ if [ -e "$PIDFILE" ]; then
+ TMP=/proc/$(cat $PIDFILE)
+ if [ -d "$TMP" -a "$(readlink -f $TMP/exe)" = "$DAEMON" ]; then
+ echo "$DESC is already running."
+ return
+ else
+ echo "Removing old PID file $PIDFILE."
+ rm -f "$PIDFILE"
+ fi
+ fi
+
+ echo -n "Starting $DESC: "
+
+ $DSPCTL kmem_reserve $KMEMRESERVE
+ start-stop-daemon --start --quiet -b --make-pidfile --pidfile "$PIDFILE" \
+ --exec "$DAEMON" -- $DAEMONPARAM
+
+ echo "done."
+}
+
+stop_dsp()
+{
+ echo -n "Stopping $DESC: "
+
+ $DSPCTL kmem_release
+ start-stop-daemon --stop --quiet --name $(basename "$DAEMON") \
+ --pidfile "$PIDFILE"
+ rm -f "$PIDFILE"
+
+ echo "done."
+}
+
+case "$1" in
+ start)
+ start_dsp
+ ;;
+ stop)
+ stop_dsp
+ ;;
+ restart|force-reload)
+ stop_dsp
+ start_dsp
+ ;;
+ *)
+ echo "Usage: $(basename $0) {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+echo ""
+
+exit 0
diff --git a/recipes/dspgw-utils/files/dsp.rules b/recipes/dspgw-utils/files/dsp.rules
new file mode 100644
index 0000000000..ae01361899
--- /dev/null
+++ b/recipes/dspgw-utils/files/dsp.rules
@@ -0,0 +1,6 @@
+# dsp dev
+KERNEL=="dspctl", NAME="dspctl/ctl"
+KERNEL=="dspmem", NAME="dspctl/mem", MODE="0640", GROUP="kmem"
+KERNEL=="dsptwch", NAME="dspctl/twch", MODE="0640"
+KERNEL=="dsperr", NAME="dspctl/err", MODE="0440"
+KERNEL=="dsptask[0-9]*", MODE="0666"
diff --git a/recipes/dspgw-utils/files/yytext_ptr.patch b/recipes/dspgw-utils/files/yytext_ptr.patch
new file mode 100644
index 0000000000..cf17c1de7c
--- /dev/null
+++ b/recipes/dspgw-utils/files/yytext_ptr.patch
@@ -0,0 +1,11 @@
+--- utils/dsp_dld/arm/dld_cmd_spec.l 2006-09-08 02:57:22.000000000 -0300
++++ utils/dsp_dld/arm/dld_cmd_spec.l.fixed 2007-10-09 16:46:28.000000000 -0300
+@@ -180,6 +180,8 @@
+ return(1);
+ }
+
++#define yytext_ptr yytext
++
+ void comment(void)
+ {
+ char c, c1;