new targets and support for the new www/pgm2 directory added to Makefile
git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@1573 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
2
CHANGED
2
CHANGED
@@ -31,6 +31,8 @@
|
|||||||
- change: updatefhem modifications to support a clean install of fhem and
|
- change: updatefhem modifications to support a clean install of fhem and
|
||||||
pgm2 installation, see commandref.html (M. Fischer)
|
pgm2 installation, see commandref.html (M. Fischer)
|
||||||
- change: FHEMWEB support for the new www/pgm2 directroy added (M. Fischer)
|
- change: FHEMWEB support for the new www/pgm2 directroy added (M. Fischer)
|
||||||
|
- change: Makefile support for for the new www/pgm2 directroy and new targets
|
||||||
|
backup and uninstall added. More verbose output. (M. Fischer)
|
||||||
|
|
||||||
- 2011-12-31 (5.2)
|
- 2011-12-31 (5.2)
|
||||||
- bugfix: applying smallscreen attributes to firefox/opera
|
- bugfix: applying smallscreen attributes to firefox/opera
|
||||||
|
|||||||
207
Makefile
207
Makefile
@@ -13,80 +13,185 @@ RDOCDIR=$(ROOT)$(DOCDIR)
|
|||||||
RMANDIR=$(ROOT)$(MANDIR)
|
RMANDIR=$(ROOT)$(MANDIR)
|
||||||
RETCDIR=$(ROOT)$(ETCDIR)
|
RETCDIR=$(ROOT)$(ETCDIR)
|
||||||
|
|
||||||
|
# Destination Directories
|
||||||
|
DEST=$(RETCDIR) $(RBINDIR) $(RDOCDIR) $(RMODDIR) $(RMANDIR) $(RVARDIR)
|
||||||
|
|
||||||
VERS=5.2
|
VERS=5.2
|
||||||
DATE=2011-12-31
|
DATE=2011-12-31
|
||||||
DESTDIR=fhem-$(VERS)
|
DESTDIR=fhem-$(VERS)
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@echo Nothing to do for all.
|
@echo "fhem $(VERS) - $(DATE)"
|
||||||
@echo To install, check the Makefile, and then \'make install\'
|
@echo
|
||||||
@echo or \'make install-pgm2\' to install a web frontend too.
|
@echo "Use 'make <target>', where <target> is"
|
||||||
|
@echo " install - to install base files for fhem"
|
||||||
|
@echo " install-pgm2 - to install base files and webgui pgm2 for fhem"
|
||||||
|
@echo " dist - to create a compressed archivfile of fhem"
|
||||||
|
@echo " deb - to create a .deb file of fhem"
|
||||||
|
@echo " fb7390 - to create an imagefile for AVM Fritz!Box 7390"
|
||||||
|
@echo " fb7270 - to create an imagefile for AVM Fritz!Box 7270"
|
||||||
|
@echo " backup - to backup current installation of fhem"
|
||||||
|
@echo " uninstall - to uninstall an existing fhem installation (with backup)"
|
||||||
|
@echo
|
||||||
|
@echo "Examples:"
|
||||||
|
@echo " make install-pgm2"
|
||||||
|
@echo " make deb"
|
||||||
|
@echo
|
||||||
|
@echo "Check Makefile for default installation paths!"
|
||||||
|
@echo
|
||||||
|
|
||||||
install:install-pgm2
|
prepare:
|
||||||
|
@echo "Preparing installation for fhem..."
|
||||||
|
@echo "- create directories"
|
||||||
|
@-$(foreach DIR,$(DEST), if [ ! -e $(DIR) ]; then mkdir -p $(DIR); fi; )
|
||||||
|
@echo "- fix permissions"
|
||||||
|
@find ./FHEM -type f -print | xargs chmod 644
|
||||||
|
@find ./docs -type f -print | xargs chmod 644
|
||||||
|
@find ./examples -type f -print | xargs chmod 644
|
||||||
|
@echo "- modify examples"
|
||||||
|
@rm -rf examples_changed
|
||||||
|
@cp -r examples examples_changed
|
||||||
|
@perl -pi -e 's,modpath \.,modpath $(MODDIR),' examples_changed/[a-z]*
|
||||||
|
@perl -pi -e 's,([^h]) /tmp,$$1 $(VARDIR),' examples_changed/[a-z]*
|
||||||
|
@-if [ -e $(RETCDIR)/fhem.cfg ]; then \
|
||||||
|
echo "- move existing configuration to fhem.cfg.`date "+%Y-%m-%d_%H:%M:%S"`"; \
|
||||||
|
mv $(RETCDIR)/fhem.cfg $(RETCDIR)/fhem.cfg.`date "+%Y-%m-%d_%H:%M:%S"`; fi;
|
||||||
|
@echo
|
||||||
|
|
||||||
install-pgm2:install-base
|
install:prepare install-base install-note
|
||||||
cp -r webfrontend/pgm2/* $(RMODDIR)/FHEM
|
|
||||||
cp docs/commandref.html docs/faq.html docs/HOWTO.html $(RMODDIR)/FHEM
|
install-pgm2:prepare install-base pgm2 install-note
|
||||||
cp docs/*.png docs/*.jpg $(RMODDIR)/FHEM
|
|
||||||
cd examples_changed; for i in *; do cp -r $$i $(RMODDIR)/FHEM/example.$$i; done
|
|
||||||
cp examples_changed/sample_pgm2 $(RETCDIR)/fhem.cfg
|
|
||||||
|
|
||||||
install-base:
|
install-base:
|
||||||
@echo After installation start fhem with
|
@echo "Install base files of fhem..."
|
||||||
@echo perl $(BINDIR)/fhem.pl $(ETCDIR)/fhem.cfg
|
cp examples_changed/sample_fhem $(RETCDIR)/fhem.cfg
|
||||||
@echo
|
|
||||||
@echo
|
|
||||||
mkdir -p $(RBINDIR) $(RMODDIR) $(RVARDIR)
|
|
||||||
mkdir -p $(RDOCDIR) $(RETCDIR) $(RMANDIR)
|
|
||||||
cp fhem.pl $(RBINDIR)
|
cp fhem.pl $(RBINDIR)
|
||||||
cp -r FHEM $(RMODDIR)
|
cp -r FHEM $(RMODDIR)
|
||||||
rm -rf examples_changed
|
|
||||||
cp -r examples examples_changed
|
|
||||||
perl -pi -e 's,modpath \.,modpath $(MODDIR),' examples_changed/[a-z]*
|
|
||||||
perl -pi -e 's,([^h]) /tmp,$$1 $(VARDIR),' examples_changed/[a-z]*
|
|
||||||
-mv $(RETCDIR)/fhem.cfg $(RETCDIR)/fhem.cfg.`date "+%Y-%m-%d_%H:%M:%S"`
|
|
||||||
cp examples_changed/sample_fhem $(RETCDIR)/fhem.cfg
|
|
||||||
cp -rp contrib $(RMODDIR)
|
cp -rp contrib $(RMODDIR)
|
||||||
cp -rp docs/* $(RDOCDIR)
|
cp -rp docs/* $(RDOCDIR)
|
||||||
cp docs/fhem.man $(RMANDIR)/fhem.pl.1
|
cp docs/fhem.man $(RMANDIR)/fhem.pl.1
|
||||||
gzip -f -9 $(RMANDIR)/fhem.pl.1
|
gzip -f -9 $(RMANDIR)/fhem.pl.1
|
||||||
|
|
||||||
|
install-note:
|
||||||
|
@echo
|
||||||
|
@echo "Housekeeping..."
|
||||||
|
@rm -rf examples_changed
|
||||||
|
@echo "- remove .svn stuff"
|
||||||
|
find $(RMODDIR) -name .svn -print | xargs rm -rf
|
||||||
|
find $(RDOCDIR) -name .svn -print | xargs rm -rf
|
||||||
|
@echo
|
||||||
|
@echo "Installation of fhem completed!"
|
||||||
|
@echo
|
||||||
|
@echo "To start fhem use"
|
||||||
|
@echo "<perl $(BINDIR)/fhem.pl $(ETCDIR)/fhem.cfg>"
|
||||||
|
@echo
|
||||||
|
|
||||||
|
backup:
|
||||||
|
@echo
|
||||||
|
@echo "Backup current installation of fhem to .backup 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)
|
||||||
|
|
||||||
|
uninstall:backup
|
||||||
|
@echo
|
||||||
|
@echo "Remove fhem installation..."
|
||||||
|
rm -rf $(RETCDIR)/fhem.cfg
|
||||||
|
rm -rf $(RBINDIR)/fhem.pl
|
||||||
|
rm -rf $(RDOCDIR)
|
||||||
|
rm -rf $(RMODDIR)
|
||||||
|
rm -rf $(RMANDIR)/fhem.pl.*
|
||||||
|
rm -rf $(RVARDIR)
|
||||||
|
@echo done
|
||||||
|
@echo
|
||||||
|
|
||||||
|
pgm2:
|
||||||
|
@echo
|
||||||
|
@echo "Install files of fhem webfrontend pgm2..."
|
||||||
|
@-if [ ! -e $(RMODDIR)/www/pgm2 ]; then mkdir -p $(RMODDIR)/www/pgm2; fi;
|
||||||
|
@echo "- fix permissions"
|
||||||
|
@find ./webfrontend/pgm2/* -type f -print | xargs chmod 644
|
||||||
|
cp -r webfrontend/pgm2/*.pm $(RMODDIR)/FHEM
|
||||||
|
cp -r webfrontend/pgm2/*?[!pm] $(RMODDIR)/www/pgm2
|
||||||
|
cp docs/commandref.html docs/faq.html docs/HOWTO.html $(RMODDIR)/www/pgm2
|
||||||
|
cp docs/*.png docs/*.jpg $(RMODDIR)/www/pgm2
|
||||||
|
cp examples_changed/sample_pgm2 $(RETCDIR)/fhem.cfg
|
||||||
|
|
||||||
dist:
|
dist:
|
||||||
@echo Version is $(VERS), Date is $(DATE)
|
@echo "fhem $(VERS) - $(DATE)"
|
||||||
mkdir .f
|
@echo
|
||||||
cp -r CHANGED FHEM HISTORY Makefile README.SVN\
|
@echo "Make distribution..."
|
||||||
|
@echo "- copy files"
|
||||||
|
@mkdir .f
|
||||||
|
@cp -r CHANGED FHEM HISTORY Makefile README.SVN\
|
||||||
TODO contrib docs examples fhem.pl webfrontend .f
|
TODO contrib docs examples fhem.pl webfrontend .f
|
||||||
find .f -name .svn -print | xargs rm -rf
|
@echo
|
||||||
find .f -name \*.orig -print | xargs rm -f
|
@echo "Housekeeping..."
|
||||||
find .f -name .#\* -print | xargs rm -f
|
@echo "- remove misc developing stuff"
|
||||||
find .f -type f -print | grep -v Makefile |\
|
@find .f -name .svn -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 |\
|
||||||
xargs perl -pi -e 's/=VERS=/$(VERS)/g;s/=DATE=/$(DATE)/g'
|
xargs perl -pi -e 's/=VERS=/$(VERS)/g;s/=DATE=/$(DATE)/g'
|
||||||
mv .f $(DESTDIR)
|
@mv .f $(DESTDIR)
|
||||||
tar cf - $(DESTDIR) | gzip > $(DESTDIR).tar.gz
|
@echo
|
||||||
mv $(DESTDIR)/docs/*.html .
|
@echo "Distribution..."
|
||||||
rm -rf $(DESTDIR)
|
@echo "- create archiv"
|
||||||
|
@tar cf - $(DESTDIR) | gzip > $(DESTDIR).tar.gz
|
||||||
|
@echo "- copy main documentation files"
|
||||||
|
@mv $(DESTDIR)/docs/*.html .
|
||||||
|
@echo "- Housekeeping"
|
||||||
|
@rm -rf $(DESTDIR)
|
||||||
|
@echo
|
||||||
|
@echo "Done. Provided files: $(DESTDIR).tar.gz *.html"
|
||||||
|
@echo
|
||||||
|
|
||||||
|
dist-clean:
|
||||||
|
@echo
|
||||||
|
@echo "Housekeeping..."
|
||||||
|
@echo "- remove distribution files"
|
||||||
|
@rm -rf *.html $(DESTDIR).tar.gz
|
||||||
|
@echo done
|
||||||
|
@echo
|
||||||
|
|
||||||
deb:
|
deb:
|
||||||
echo $(PWD)
|
@echo
|
||||||
rm -rf .f
|
@echo "Make debian package..."
|
||||||
|
@echo $(PWD)
|
||||||
|
@rm -rf .f
|
||||||
|
@echo
|
||||||
make ROOT=`pwd`/.f install
|
make ROOT=`pwd`/.f install
|
||||||
cp -r contrib/DEBIAN .f
|
@echo
|
||||||
rm -rf .f/$(MODDIR)/contrib/FB7*/var
|
@echo "- copy files"
|
||||||
rm -rf .f/$(MODDIR)/contrib/FB7*/*.image
|
@cp -r contrib/DEBIAN .f
|
||||||
rm -rf .f/$(MODDIR)/contrib/FB7*/*.zip
|
@echo "- housekeeping"
|
||||||
find .f -name .svn -print | xargs rm -rf
|
@rm -rf .f/$(MODDIR)/contrib/FB7*/var
|
||||||
find .f -name \*.orig -print | xargs rm -f
|
@rm -rf .f/$(MODDIR)/contrib/FB7*/*.image
|
||||||
find .f -name .#\* -print | xargs rm -f
|
@rm -rf .f/$(MODDIR)/contrib/FB7*/*.zip
|
||||||
find .f -type f -print | grep -v Makefile |\
|
@find .f -name .svn -print | xargs rm -rf
|
||||||
|
@find .f -name \*.orig -print | xargs rm -f
|
||||||
|
@find .f -name .#\* -print | xargs rm -f
|
||||||
|
@echo "- modify fhem version and date"
|
||||||
|
@find .f -type f -print | grep -v Makefile |\
|
||||||
xargs perl -pi -e 's/=VERS=/$(VERS)/g;s/=DATE=/$(DATE)/g'
|
xargs perl -pi -e 's/=VERS=/$(VERS)/g;s/=DATE=/$(DATE)/g'
|
||||||
find .f -type f | xargs chmod 644
|
@echo "- fix permissions"
|
||||||
find .f -type d | xargs chmod 755
|
@find .f -type f | xargs chmod 644
|
||||||
chmod 755 `cat contrib/executables`
|
@find .f -type d | xargs chmod 755
|
||||||
gzip -9 .f/$(DOCDIR)/changelog
|
@chmod 755 `cat contrib/executables`
|
||||||
chown -R root:root .f
|
@gzip -9 .f/$(DOCDIR)/changelog
|
||||||
mv .f $(DESTDIR)
|
@echo "- fix ownership"
|
||||||
dpkg-deb --build $(DESTDIR)
|
@chown -R root:root .f
|
||||||
rm -rf $(DESTDIR)
|
@echo "- housekeeping"
|
||||||
|
@mv .f $(DESTDIR)
|
||||||
|
@echo
|
||||||
|
@echo "Build package..."
|
||||||
|
@dpkg-deb --build $(DESTDIR)
|
||||||
|
@echo
|
||||||
|
@echo "Housekeeping..."
|
||||||
|
@rm -rf $(DESTDIR)
|
||||||
|
@echo
|
||||||
|
@echo "Done. Provided file: $(DESTDIR).deb"
|
||||||
|
@echo
|
||||||
|
|
||||||
fb7390:
|
fb7390:
|
||||||
cd contrib/FB7390 && ./makeimage $(DESTDIR)
|
cd contrib/FB7390 && ./makeimage $(DESTDIR)
|
||||||
|
|||||||
Reference in New Issue
Block a user