From e9fc3cfdb5b957364f6806935267e5252bcd61ef Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sun, 22 Sep 2013 14:26:57 +0000 Subject: [PATCH] FRITZ!Box image fixes (7390/7270) git-svn-id: https://svn.fhem.de/fhem/trunk@3941 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/Makefile | 24 ++++++++++++------------ fhem/README_DEMO.txt | 2 ++ fhem/contrib/FB7270/makeimage | 3 ++- fhem/contrib/FB7270/startfhemDemo | 16 ++++++++++++++++ fhem/contrib/FB7390/backup.sh | 3 +++ fhem/contrib/FB7390/makeimage | 13 +++++++------ fhem/contrib/FB7390/startfhemDemo | 13 +++++++++++++ 7 files changed, 55 insertions(+), 19 deletions(-) create mode 100755 fhem/contrib/FB7270/startfhemDemo create mode 100755 fhem/contrib/FB7390/startfhemDemo diff --git a/fhem/Makefile b/fhem/Makefile index 63c406da5..658cb482d 100644 --- a/fhem/Makefile +++ b/fhem/Makefile @@ -1,5 +1,5 @@ -VERS=5.4 -DATE=2013-04-08 +VERS=5.5 +DATE=2013-09-22 RELATIVE_PATH=YES BINDIR=/opt/fhem @@ -7,13 +7,7 @@ MODDIR=$(BINDIR) VARDIR=$(BINDIR)/log MANDIR=$(BINDIR)/docs ETCDIR=$(BINDIR) - -# Old variant -#BINDIR=/usr/bin -#MODDIR=/usr/share/fhem -#VARDIR=/var/log/fhem -#MANDIR=/usr/share/man/man1 -#ETCDIR=/etc +DEMODIR=$(BINDIR) # Used for .deb package creation RBINDIR=$(ROOT)$(BINDIR) @@ -21,9 +15,10 @@ RMODDIR=$(ROOT)$(MODDIR) RVARDIR=$(ROOT)$(VARDIR) RMANDIR=$(ROOT)$(MANDIR) RETCDIR=$(ROOT)$(ETCDIR) +RDEMODIR=$(ROOT)$(DEMODIR) # Destination Directories -DEST=$(RETCDIR) $(RBINDIR) $(RMODDIR) $(RMANDIR) $(RVARDIR) +DEST=$(RETCDIR) $(RBINDIR) $(RMODDIR) $(RMANDIR) $(RVARDIR) $(RDEMODIR) DESTDIR=fhem-$(VERS) @@ -57,10 +52,12 @@ install: @rm fhem.cfg.install @cp fhem.pl $(RBINDIR) @cp -rp FHEM docs www contrib $(RMODDIR) + @cp -rp README_DEMO.txt demolog fhem.cfg.demo $/RDEMODIR) @cp docs/fhem.man $(RMANDIR)/fhem.pl.1 @gzip -f -9 $(RMANDIR)/fhem.pl.1 @echo "- cleanup: removing .svn leftovers" @find $(RMODDIR) -name .svn -print | xargs rm -rf + @find $(RMODDIR) -name svn-commit\* -print | xargs rm -rf @echo @echo "Installation of fhem completed!" @echo @@ -73,7 +70,8 @@ backup: @echo "Saving fhem to the .backup directory in the current directory" @-if [ ! -e .backup ]; then mkdir .backup; fi; @tar czf .backup/fhem-backup_`date +%y%m%d%H%M`.tar.gz \ - $(RETCDIR)/fhem* $(RBINDIR)/fhem* $(RDOCDIR) $(RMODDIR) $(RMANDIR)/fhem* $(RVARDIR) + $(RETCDIR)/fhem* $(RBINDIR)/fhem* $(RDOCDIR)\ + $(RMODDIR) $(RMANDIR)/fhem* $(RVARDIR) uninstall:backup @echo @@ -89,18 +87,20 @@ uninstall:backup dist: mkdir .f cp -r fhem.pl fhem.cfg CHANGED HISTORY Makefile README.SVN\ + demolog fhem.cfg.demo README_DEMO.txt\ FHEM contrib docs www webfrontend .f mkdir .f/log touch .f/log/empty_file.txt (cd .f; perl contrib/commandref_join.pl) find .f -name .svn -print | xargs rm -rf + find .f -name svn-commit\* -print | xargs rm -rf find .f -name \*.orig -print | xargs rm -f find .f -name .#\* -print | xargs rm -f find .f -type f -print | grep -v Makefile | grep -v SWAP |\ xargs perl -pi -e 's/=VERS=/$(VERS)/g;s/=DATE=/$(DATE)/g' + rm -rf .f/www/SVGcache mv .f $(DESTDIR) tar cf - $(DESTDIR) | gzip > $(DESTDIR).tar.gz - mv $(DESTDIR)/docs/*.html . rm -rf $(DESTDIR) dist-clean: diff --git a/fhem/README_DEMO.txt b/fhem/README_DEMO.txt index 0f729879e..978b59663 100644 --- a/fhem/README_DEMO.txt +++ b/fhem/README_DEMO.txt @@ -6,6 +6,8 @@ HOWTO: Start FHEM with a demo configuration with perl fhem.pl fhem.cfg.demo (typed in a terminal) and point your browser to http://YourFhemHost:8083 + Use the startfhemDemo skript on the FritzBox. + Stopping: - type shutdown in the browser command window, followed by RETURN diff --git a/fhem/contrib/FB7270/makeimage b/fhem/contrib/FB7270/makeimage index c87de44c0..37a0270a8 100755 --- a/fhem/contrib/FB7270/makeimage +++ b/fhem/contrib/FB7270/makeimage @@ -18,13 +18,14 @@ tar zxf ../../$fw.tar.gz cd $fw cp -rp fhem.pl fhem.cfg FHEM docs www ../fhem +cp -rp README_DEMO.txt fhem.cfg.demo demolog ../fhem rm -rf ../fhem/www/frontend cd .. rm -rf $fw rm -rf fhem/docs/*.{odg,pdf,man,txt} cp fhemcmd.sh fhem/FHEM -cp backup.sh startfhem fhem +cp backup.sh startfhem* fhem echo Packing again zip -qr $fw-fb7270.zip fhem diff --git a/fhem/contrib/FB7270/startfhemDemo b/fhem/contrib/FB7270/startfhemDemo new file mode 100755 index 000000000..24a52a198 --- /dev/null +++ b/fhem/contrib/FB7270/startfhemDemo @@ -0,0 +1,16 @@ +#!/bin/sh + +# On the Fritzbox 7270 V1/V2 with missing df replace home with the hardcoded +# path. +root=`df | sed -n -e '/ftp\//s/.*ftp\///p'` +home=/var/InternerSpeicher/$root/fhem + +cd $home + +PATH=$home:$PATH +export PATH + +export LD_LIBRARY_PATH=$home/lib +export PERL5LIB=$home/lib/perl5/site_perl/5.12.2/mips-linux:$home/lib/perl5/site_perl/5.12.2:$home/lib/perl5/5.12.2/mips-linux:$home/lib/perl5/5.12.2 + +perl fhem.pl fhem.cfg.demo diff --git a/fhem/contrib/FB7390/backup.sh b/fhem/contrib/FB7390/backup.sh index a2dbd70db..8bdea8889 100755 --- a/fhem/contrib/FB7390/backup.sh +++ b/fhem/contrib/FB7390/backup.sh @@ -1,5 +1,8 @@ #!/bin/sh +# optional backup command to speed up backup on th FB by omitting the backup of +# the perl directory. To use it set attr global backupcmd backup.sh + tar cf - FHEM fhem.cfg fhem.pl log startfhem* www | gzip -3 > backup/backup-`date -I`.tar.gz echo backup done diff --git a/fhem/contrib/FB7390/makeimage b/fhem/contrib/FB7390/makeimage index 2cf6062ff..908f94fe0 100755 --- a/fhem/contrib/FB7390/makeimage +++ b/fhem/contrib/FB7390/makeimage @@ -12,12 +12,12 @@ echo Extracting the fritzbox template tar xf ../../priv/fritzbox7390_template.tar cd var tar zxf fhem.tar.gz -rm -rf fhem/FHEM www docs +rm -rf fhem/FHEM fhem/www fhem/docs mkdir fhem/FHEM fhem/docs cd .. cp install var -cp backup.sh startfhem startfhemAsRoot var/fhem +cp backup.sh startfhem* var/fhem cp fhemcmd.sh var/fhem/FHEM @@ -29,6 +29,7 @@ cp fhem.cfg fhem.pl ../var/fhem cp -rp FHEM/* ../var/fhem/FHEM cp docs/*.html docs/*.jpg ../var/fhem/docs cp -rp www ../var/fhem +cp -rp README_DEMO.txt fhem.cfg.demo demolog ../var/fhem rm -rf ../var/fhem/www/frontend cd .. @@ -37,10 +38,10 @@ rm -rf $fw echo Packing again cd var -cat >> fhem/fhem.cfg << EOF -attr global backupcmd backup.sh -EOF -tar zcf fhem.tar.gz fhem +#cat >> fhem/fhem.cfg << EOF +#attr global backupcmd backup.sh +#EOF +tar cf - fhem | gzip -9 > fhem.tar.gz rm -rf fhem cd .. diff --git a/fhem/contrib/FB7390/startfhemDemo b/fhem/contrib/FB7390/startfhemDemo new file mode 100755 index 000000000..7e3e58cad --- /dev/null +++ b/fhem/contrib/FB7390/startfhemDemo @@ -0,0 +1,13 @@ +#!/bin/sh + +home=/var/InternerSpeicher/fhem + +cd $home + +PATH=$home:$PATH +export PATH + +export LD_LIBRARY_PATH=$home/lib +export PERL5LIB=$home/lib/perl5/site_perl/5.12.2/mips-linux:$home/lib/perl5/site_perl/5.12.2:$home/lib/perl5/5.12.2/mips-linux:$home/lib/perl5/5.12.2 + +perl fhem.pl fhem.cfg.demo