changeset 30:2c279c979bcd

Pulled out MATLAB initialisation into a separate script.
author samer
date Mon, 16 Feb 2015 22:03:22 +0000
parents 8576194f1c9c
children 386e9ef272b8
files etc/as_root.d/init_matlab.sh etc/setup_as_root.sh
diffstat 2 files changed, 33 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/as_root.d/init_matlab.sh	Mon Feb 16 22:03:22 2015 +0000
@@ -0,0 +1,32 @@
+
+echo "Checking for MATLAB..." 1>&2
+MATLAB_ROOT=$(matlab -e | grep '^MATLAB=' | sed -e 's/MATLAB=//')
+echo "MATLAB installed in $MATLAB_ROOT" 1>&2
+$DO apt-get install csh libtritonus-java libvorbisspi-java libmp3spi-java
+$DO ln -sf /lib/x86_64-linux-gnu/libc.so.6 /lib64
+$DO ln -sf $MATLAB_ROOT/bin/matlab /usr/local/bin 
+
+# MATLAB (R2012a at least) looks for Java extension jars in this directory
+$DO mkdir -p /usr/java/packages/lib/ext
+# NB - there may be some duplication of service providers here - I'm not sure
+# which of them works best.
+$DO ln -sf /usr/shara/java/{vorbisspi,mp3spi}.jar /usr/java/packages/lib/ext
+$DO ln -sf /usr/shara/java/tritonus_{aos,core,jorbis,mp3,remaining,share}.jar /usr/java/packages/lib/ext
+
+# need to add native library paths to this file
+if grep '/usr/lib/jni' $MATLAB_ROOT/toolbox/local/librarypath.txt; then
+	echo "MATLAB Library path already set." 1>&2
+else
+	if [ $DRY_RUN == yes ]; then
+		echo "echo '/usr/lib/jni' >> $MATLAB_ROOT/toolbox/local/librarypath.txt"
+	else
+		echo '/usr/lib/jni' >> $MATLAB_ROOT/toolbox/local/librarypath.txt
+	fi
+fi
+if [ -h $MATLAB_ROOT/bin/lcdata.xml ]; then
+	echo "MATLAB character set already set up" 1>&2
+else
+	echo "Adjusting MATLAB character set" 1>&2
+	mv $MATLAB_ROOT/bin/lcdata.xml $MATLAB_ROOT/bin/lcdata_orig.xml
+	ln -s lcdata_utf8.xml $MATLAB_ROOT/bin/lcdata.xml
+fi
--- a/etc/setup_as_root.sh	Mon Feb 16 21:23:14 2015 +0000
+++ b/etc/setup_as_root.sh	Mon Feb 16 22:03:22 2015 +0000
@@ -53,30 +53,7 @@
 
 # If you have MATLAB
 if [ $HAVE_MATLAB == yes ]; then
-	echo "Checking for MATLAB..." 1>&2
-	MATLAB_ROOT=$(matlab -e | grep '^MATLAB=' | sed -e 's/MATLAB=//')
-	echo "MATLAB installed in $MATLAB_ROOT" 1>&2
-	$DO apt-get csh libtritonus-java libvorbisspi-java libmp3spi-java
-	$DO ln -sf /lib/x86_64-linux-gnu/libc.so.6 /lib64
-	$DO ln -sf $MATLAB_ROOT/bin/matlab /usr/local/bin 
-
-	# MATLAB (R2012a at least) looks for Java extension jars in this directory
-	$DO mkdir -p /usr/java/packages/lib/ext
-	# NB - there may be some duplication of service providers here - I'm not sure
-	# which of them works best.
-	$DO ln -sf /usr/shara/java/{vorbisspi,mp3spi}.jar /usr/java/packages/lib/ext
-	$DO ln -sf /usr/shara/java/tritonus_{aos,core,jorbis,mp3,remaining,share}.jar /usr/java/packages/lib/ext
-
-	# need to add native library paths to this file
-	if grep '/usr/lib/jni' $MATLAB_ROOT/toolbox/local/librarypath.txt; then
-		echo "MATLAB Library path already set." 1>&2
-	else
-		if [ $DRY_RUN == yes ]; then
-			echo "echo '/usr/lib/jni' >> $MATLAB_ROOT/toolbox/local/librarypath.txt"
-		else
-			echo '/usr/lib/jni' >> $MATLAB_ROOT/toolbox/local/librarypath.txt
-		fi
-	fi
+	DO=$DO DRY_RUN=$DRY_RUN as_root.d/init_matlab.sh
 fi
 
 $DO install -bC rc.local /etc