X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile;h=2df9ee963d4c0493ccd17eb630bbe1ae90c03ec3;hb=57fc659826a046c91d050f8be40a9c80ec7ca9d4;hp=d15af83d5299ffd9b0fe146cdb60e17313fdfa5c;hpb=166443b265a563312a0f8097c7e1b7dd2c6dc12d;p=plcapi.git diff --git a/Makefile b/Makefile index d15af83..2df9ee9 100644 --- a/Makefile +++ b/Makefile @@ -7,8 +7,8 @@ # $Id$ # -# Metafiles -init := PLC/__init__.py PLC/Methods/__init__.py +# Metafiles - manage Legacy/ and Accessors by hand +init := PLC/__init__.py PLC/Methods/__init__.py # python-pycurl and python-psycopg2 avail. from fedora 5 # we used to ship our own version of psycopg2 and pycurl, for fedora4 @@ -33,7 +33,6 @@ install: --install-scripts=$(DESTDIR)/$(datadir)/plc_api \ --install-data=$(DESTDIR)/$(datadir)/plc_api install -D -m 755 php/xmlrpc/xmlrpc.so $(DESTDIR)/$(shell php-config --extension-dir)/xmlrpc.so - install -D -m 755 refresh-peer.py $(DESTDIR)/$(bindir)/refresh-peer.py $(subdirs): $(init) @@ -52,8 +51,8 @@ index-clean: rm $(init) #################### regenerate indexes - not used by the build, as both files are svn added - please update as appropriate -# All .py files in PLC/ +########## PLC/ # the current content of __init__.py PLC_now := $(sort $(shell fgrep -v '"' PLC/__init__.py 2>/dev/null)) # what should be declared @@ -66,7 +65,7 @@ endif PLC/__init__.py: (echo 'all = """' ; cd PLC; ls -1 *.py | grep -v __init__ | sed -e 's,.py$$,,' ; echo '""".split()') > $@ - +########## Methods/ # the current content of __init__.py METHODS_now := $(sort $(shell fgrep -v '"' PLC/Methods/__init__.py 2>/dev/null)) # what should be declared @@ -77,8 +76,9 @@ ifneq ($(METHODS_now),$(METHODS_files)) PLC/Methods/__init__.py: force endif PLC/Methods/__init__.py: - (echo 'methods = """' ; cd PLC/Methods; ls -1 *.py system/*.py | grep -v __init__ | sed -e 's,.py$$,,' -e 's,system/,system.,' ; echo '""".split()') > $@ + (echo 'native_methods = """' ; cd PLC/Methods; ls -1 *.py system/*.py | grep -v __init__ | sed -e 's,.py$$,,' -e 's,system/,system.,' ; echo '""".split()') > $@ +########## force: .PHONY: all install force clean index tags $(subdirs) @@ -87,11 +87,24 @@ force: tags: find . '(' -name '*.py' -o -name '*.sql' -o -name '*.php' -o -name Makefile ')' | xargs etags -########## make sync PLCHOST=hostname +.PHONY: tags + +########## sync +# 2 forms are supported +# (*) if your plc root context has direct ssh access: +# make sync PLC=private.one-lab.org +# (*) otherwise, entering through the root context +# make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr + +ifdef GUEST ifdef PLCHOST -ifdef VSERVER -PLCSSH:=root@$(PLCHOST):/vservers/$(VSERVER) +SSHURL:=root@$(PLCHOST):/vservers/$(GUEST) +SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST) +endif endif +ifdef PLC +SSHURL:=root@$(PLC):/ +SSHCOMMAND:=ssh root@$(PLC) endif LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' @@ -100,12 +113,14 @@ RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,) RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES) sync: -ifeq (,$(PLCSSH)) - echo "sync: You must define PLCHOST and VSERVER on the command line" - echo " e.g. make sync PLCHOST=private.one-lab.org VSERVER=myplc01" ; exit 1 +ifeq (,$(SSHURL)) + @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line" + @echo " e.g. make sync PLC=private.one-lab.org" + @echo " or make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr" + @exit 1 else - +$(RSYNC) PLC planetlab5.sql migrations $(PLCSSH)/usr/share/plc_api/ - ssh root@$(PLCHOST) vserver $(VSERVER) exec apachectl graceful + +$(RSYNC) PLC planetlab5.sql migrations $(SSHURL)/usr/share/plc_api/ + $(SSHCOMMAND) exec apachectl graceful endif #################### convenience, for debugging only