diff options
| author | root <root@elwms02.(none)> | 2010-04-06 16:13:08 +0200 |
|---|---|---|
| committer | root <root@elwms02.(none)> | 2010-04-06 16:13:08 +0200 |
| commit | 0e7005fcc7483c01aa102fbea358c5ac65a48d62 (patch) | |
| tree | 11517ce0d3d2977c6732b3aa583b0008083e0bd3 /plugins/calc | |
| download | x-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.gz x-vdr-0e7005fcc7483c01aa102fbea358c5ac65a48d62.tar.bz2 | |
hello world
Diffstat (limited to 'plugins/calc')
| -rw-r--r-- | plugins/calc/patches/calc-0.0.1-rc5.diff | 78 | ||||
| -rw-r--r-- | plugins/calc/plugin.sh | 52 |
2 files changed, 130 insertions, 0 deletions
diff --git a/plugins/calc/patches/calc-0.0.1-rc5.diff b/plugins/calc/patches/calc-0.0.1-rc5.diff new file mode 100644 index 0000000..373135c --- /dev/null +++ b/plugins/calc/patches/calc-0.0.1-rc5.diff @@ -0,0 +1,78 @@ +diff -Nur calc-0.0.1-rc5/calc.c calc-0.0.1-rc5-n/calc.c +--- calc-0.0.1-rc5/calc.c 2004-07-18 20:53:54.000000000 +0200 ++++ calc-0.0.1-rc5-n/calc.c 2006-11-07 02:37:26.000000000 +0100 +@@ -72,7 +72,7 @@ + void AddDigit(eKeys key); + void CalculateResult(char* inOperand1, char* inOperand2, char *outOperand, char cOperator); + operType operatorSymbol; +- void cCalcMain::CalculateResultTrig(char* inOperand1, char *outOperand, char cOperator, gradType calculateGradType); ++ void CalculateResultTrig(char* inOperand1, char *outOperand, char cOperator, gradType calculateGradType); + public: + cCalcMain(void); + ~cCalcMain(); +@@ -486,12 +486,12 @@ + { + FILE *f; + // printf("inOperand1 %s inOperand2 %s operator %c\n",inOperand1,inOperand2,cOperator); +- f = fopen("./bc_in.dat","w"); ++ f = fopen("/tmp/bc_in.dat","w"); + fprintf(f,"scale = 10\n"); + fprintf(f,"%s%c%s\n",inOperand1,cOperator,inOperand2); + fclose(f); +- system("bc <./bc_in.dat >./bc_out.dat"); +- f = fopen("./bc_out.dat","r"); ++ system("/usr/bin/bc </tmp/bc_in.dat >/tmp/bc_out.dat"); ++ f = fopen("/tmp/bc_out.dat","r"); + if (f != NULL) + { + fscanf(f,"%s",outOperand); +@@ -499,6 +499,8 @@ + } + else + printf("VDR-Calc : bc run failed !!\n"); ++ remove("/tmp/bc_in.dat"); ++ remove("/tmp/bc_out.dat"); + } + + void cCalcMain::CalculateResultTrig(char* inOperand1, char *outOperand, char cOperator, gradType calculateGradType) +@@ -512,7 +514,7 @@ + CalculateResult(inOperand1, "(3.1415926535/200)",inOperand1, '*'); + + // printf("inOperand1 %s inOperand2 %s operator %c\n",inOperand1,inOperand2,cOperator); +- f = fopen("./bc_in.dat","w"); ++ f = fopen("/tmp/bc_in.dat","w"); + fprintf(f,"scale = 10\n"); + + // only valid for cOperator == s, c, t (for sin,cos,tan) +@@ -525,8 +527,8 @@ + fprintf(f,"s(%s)/c(%s)\n",inOperand1,inOperand1); + } + fclose(f); +- system("bc -l <./bc_in.dat >./bc_out.dat"); +- f = fopen("./bc_out.dat","r"); ++ system("/usr/bin/bc -l </tmp/bc_in.dat >/tmp/bc_out.dat"); ++ f = fopen("/tmp/bc_out.dat","r"); + if (f != NULL) + { + fscanf(f,"%s",outOperand); +@@ -534,6 +536,8 @@ + } + else + printf("VDR-Calc : bc run failed !!\n"); ++ remove("/tmp/bc_in.dat"); ++ remove("/tmp/bc_out.dat"); + clearOutputForNextDigit = true; + } + +diff -Nur calc-0.0.1-rc5/Makefile calc-0.0.1-rc5-n/Makefile +--- calc-0.0.1-rc5/Makefile 2006-11-07 02:04:33.000000000 +0100 ++++ calc-0.0.1-rc5-n/Makefile 2006-11-07 02:37:26.000000000 +0100 +@@ -16,7 +16,7 @@ + ### The C++ compiler and options: + + CXX ?= g++ +-CXXFLAGS ?= -O2 -Wall -Woverloaded-virtual ++CXXFLAGS ?= -fPIC -O2 -Wall -Woverloaded-virtual + + ### The directory environment: + diff --git a/plugins/calc/plugin.sh b/plugins/calc/plugin.sh new file mode 100644 index 0000000..bdd7161 --- /dev/null +++ b/plugins/calc/plugin.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +# x-vdr (Installations-Skript fuer einen VDR mit Debian als Basis) +# von Marc Wernecke - www.zulu-entertainment.de +# 05.05.2008 +# +# vdr-calc + +# defaults +source ./../../x-vdr.conf +source ./../../setup.conf +source ./../../functions + +WEB="http://vdr-wiki.de/vdr/vdr-calc/vdr-calc-0.0.1-rc5.tgz" +VERSION="calc-0.0.1-rc5" +LINK="calc" + +VAR=`basename $WEB` +DIR=`pwd` + +# plugin entfernen +function clean_plugin() { + cd $SOURCEDIR/VDR/PLUGINS/src + rm -rf $LINK* + rm -f $VDRLIBDIR/libvdr-$LINK* + log "cleaning $LINK" +} + +# plugin installieren +function install_plugin() { + download_plugin + extract_plugin + cd $SOURCEDIR/VDR/PLUGINS/src + rm -f $LINK + ln -vfs $VERSION $LINK + patch_plugin + + ## plugin specials - start ## + + ## plugin specials - ende ## +} + +# plugin commands +if [ $# \> 0 ]; then + cmd=$1 + cmd_plugin +else + install_plugin + log "install-plugin fuer $VERSION ist fertig" +fi + +exit 0 |
