From c8cd010f49c8b3a14e0a7cfed7042ed9fdea838f Mon Sep 17 00:00:00 2001
From: Leon Ziegler <lziegler@techfak.uni-bielefeld.de>
Date: Mon, 9 Jun 2014 12:58:51 +0200
Subject: [PATCH] fixed install scripts

---
 ps-config/install_pocketsphinx_conf.sh | 17 ++++++++++++-----
 ps-grammar/install_pocketsphinx.sh     | 16 +++++++++++-----
 2 files changed, 23 insertions(+), 10 deletions(-)

diff --git a/ps-config/install_pocketsphinx_conf.sh b/ps-config/install_pocketsphinx_conf.sh
index 749fc980..3bf24d11 100755
--- a/ps-config/install_pocketsphinx_conf.sh
+++ b/ps-config/install_pocketsphinx_conf.sh
@@ -1,14 +1,21 @@
 #!/bin/sh
-if [ $1 ]
- then installdir=$1
- else installdir="/vol/robocup/2013/share/SpeechRec/"
+
+set -e
+
+BASEDIR=$(dirname $(readlink -f $0))
+cd ${BASEDIR}
+
+if [ ! -n "$prefix" ]; then
+        echo "Environment variable \"\$prefix\" must be set!"
+        exit 1
 fi
-mkdir -p $installdir/psConfig
+
+mkdir -p ${prefix}/share/SpeechRec/psConfig
 
 for i in `ls` 
 do
   if [ -d $i ]
-    then cp -r $i $installdir/psConfig
+    then cp -r $i ${prefix}/share/SpeechRec/psConfig
   fi
 done
 
diff --git a/ps-grammar/install_pocketsphinx.sh b/ps-grammar/install_pocketsphinx.sh
index 0482d391..767f361b 100755
--- a/ps-grammar/install_pocketsphinx.sh
+++ b/ps-grammar/install_pocketsphinx.sh
@@ -1,14 +1,20 @@
 #!/bin/sh
-if [ $1 ]
- then installdir=$1
- else installdir="/vol/robocup/2013/share/SpeechRec/"
+set -e
+
+BASEDIR=$(dirname $(readlink -f $0))
+cd ${BASEDIR}
+
+if [ ! -n "$prefix" ]; then
+        echo "Environment variable \"\$prefix\" must be set!"
+        exit 1
 fi
-mkdir -p $installdir/psGrammar
+
+mkdir -p ${prefix}/share/SpeechRec/psConfig
 
 for i in `ls` 
 do
   if [ -d $i ]
-    then cp -r $i $installdir/psGrammar
+    then cp -r $i ${prefix}/share/SpeechRec/psConfig
   fi
 done
 
-- 
GitLab