small updates to generated login base and site name for geni users
[sfa.git] / Makefile
1 #
2 ## (Re)builds Python metafile (__init__.py) and documentation
3
4 # overwritten by the specfile
5 DESTDIR="/"
6
7 ##########
8 all: python wsdl
9
10 install: python-install wsdl-install xmlbuilder-install 
11
12 clean: python-clean wsdl-clean
13
14 uninstall: python-uninstall
15
16 .PHONY: all install clean 
17
18 ##########
19 python: 
20
21 xmlbuilder-install:
22         cd xmlbuilder-0.9 && python setup.py install --root=$(DESTDIR) && cd -
23  
24 python-install:
25         python setup.py install --root=$(DESTDIR)       
26         chmod 444 $(DESTDIR)/etc/sfa/default_config.xml
27
28 python-clean:
29         python setup.py clean
30         rm $(init)
31
32 .PHONY: python python-install python-clean xmlbuilder-install
33 ##########
34 wsdl: 
35         $(MAKE) -C wsdl 
36
37 # propagate DESTDIR from the specfile
38 wsdl-install:
39         $(MAKE) -C wsdl install 
40
41 wsdl-clean:
42         $(MAKE) -C wsdl clean
43
44 .PHONY: wsdl wsdl-install wsdl-clean
45 ##########
46
47 # are the .java files used ?
48 tags:   
49         find . -type f | egrep -v '/\.svn/|TAGS|\.py[co]$$|\.doc$$|\.html$$|\.pdf$$' | xargs etags
50 .PHONY: tags
51
52
53 ########## sync
54 # 2 forms are supported
55 # (*) if your plc root context has direct ssh access:
56 # make sync PLC=private.one-lab.org
57 # (*) otherwise, entering through the root context
58 # make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr
59
60 ifdef GUEST
61 ifdef PLCHOST
62 SSHURL:=root@$(PLCHOST):/vservers/$(GUEST)
63 SSHCOMMAND:=ssh root@$(PLCHOST) vserver $(GUEST)
64 endif
65 endif
66 ifdef PLC
67 SSHURL:=root@$(PLC):/
68 SSHCOMMAND:=ssh root@$(PLC)
69 endif
70
71 LOCAL_RSYNC_EXCLUDES    := --exclude '*.pyc' 
72 RSYNC_EXCLUDES          := --exclude .svn --exclude CVS --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES)
73 RSYNC_COND_DRY_RUN      := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,)
74 RSYNC                   := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES)
75
76 BINS =  ./config/sfa-config-tty ./config/gen-sfa-cm-config.py \
77         ./sfa/plc/sfa-import-plc.py ./sfa/plc/sfa-nuke-plc.py ./sfa/server/sfa-server.py \
78         ./sfa/client/sfi.py ./sfa/client/getNodes.py ./sfa/client/getRecord.py \
79         ./sfa/client/setRecord.py ./sfa/client/sfadump.py
80
81 sync:
82 ifeq (,$(SSHURL))
83         @echo "sync: You must define, either PLC, or PLCHOST & GUEST, on the command line"
84         @echo "  e.g. make sync PLC=private.one-lab.org"
85         @echo "  or   make sync PLCHOST=testbox1.inria.fr GUEST=vplc03.inria.fr"
86         @exit 1
87 else
88         +$(RSYNC) ./sfa/ $(SSHURL)/usr/lib/python2.5/site-packages/sfa/
89         +$(RSYNC)  $(BINS) $(SSHURL)/usr/bin
90         $(SSHCOMMAND) exec service sfa restart
91 endif
92
93 .PHONY: sync
94 ##########