2 ## (Re)builds Python metafile (__init__.py)
4 # overwritten by the specfile
10 install: python-install wsdl-install xmlbuilder-install
12 clean: python-clean wsdl-clean
14 uninstall: python-uninstall
16 .PHONY: all install clean
22 cd xmlbuilder-0.9 && python setup.py install --root=$(DESTDIR) && cd -
25 python setup.py install --root=$(DESTDIR)
26 chmod 444 $(DESTDIR)/etc/sfa/default_config.xml
32 .PHONY: python python-install python-clean xmlbuilder-install
37 # propagate DESTDIR from the specfile
39 $(MAKE) -C wsdl install
44 .PHONY: wsdl wsdl-install wsdl-clean
46 ########## refreshing methods package metafile
47 # Metafiles - manage Legacy/ and Accessors by hand
48 init := sfa/methods/__init__.py
55 methods_now := $(sort $(shell fgrep -v '"' sfa/methods/__init__.py 2>/dev/null))
56 # what should be declared
57 methods_paths := $(filter-out %/__init__.py, $(wildcard sfa/methods/*.py))
58 methods_files := $(sort $(notdir $(methods_paths:.py=)))
60 ifneq ($(methods_now),$(methods_files))
61 sfa/methods/__init__.py: force
63 sfa/methods/__init__.py:
64 (echo '## Please use make index to update this file' ; echo 'all = """' ; cd sfa/methods; ls -1 *.py | grep -v __init__ | sed -e 's,.py$$,,' ; echo '""".split()') > $@
70 find . -type f | egrep -v '/\.git/|/\.svn/|TAGS|\.py[co]$$|\.doc$$|\.html$$|\.pdf$$' | xargs etags
74 grep 'def.*call' sfa/methods/*.py > sfa/methods/SIGNATURES
77 # 2 forms are supported
78 # (*) if your plc root context has direct ssh access:
79 # make sync PLC=private.one-lab.org
80 # (*) otherwise, entering through the root context
81 # make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr
83 PLCHOST ?= testplc.onelab.eu
87 SSHURL:=root@$(PLCHOST):/vservers/$(GUEST)
88 SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST)
93 SSHCOMMAND:=ssh root@$(PLC)
96 LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc'
97 RSYNC_EXCLUDES := --exclude .svn --exclude .git --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
98 RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
99 RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) --no-owner $(RSYNC_EXCLUDES)
101 BINS = ./config/sfa-config-tty ./config/gen-sfa-cm-config.py \
102 ./sfa/plc/sfa-import-plc.py ./sfa/plc/sfa-nuke-plc.py ./sfa/server/sfa-server.py \
103 ./sfa/client/sfi.py ./sfa/client/getNodes.py ./sfa/client/getRecord.py \
104 ./sfa/client/setRecord.py ./sfa/client/sfadump.py
108 @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line"
109 @echo " e.g. make sync PLC=private.one-lab.org"
110 @echo " or make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr"
113 +$(RSYNC) ./sfa/ $(SSHURL)/usr/lib\*/python2.\*/site-packages/sfa/
114 +$(RSYNC) ./tests/ $(SSHURL)/root/tests-sfa
115 +$(RSYNC) $(BINS) $(SSHURL)/usr/bin
116 $(SSHCOMMAND) exec service sfa restart