more python3, esp. in shebangs and doc
[plcapi.git] / Makefile
index 97061a5..e038082 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,18 +18,26 @@ bindir := /usr/bin
 
 PWD := $(shell pwd)
 
-all: 
-       python setup.py build
+all:
+       python3 setup.py build
 
-install: 
-       python setup.py install \
+install: install-python install-phpxmlrpc
+
+install-python:
+       python3 setup.py install \
            --install-purelib=$(DESTDIR)/$(datadir)/plc_api \
            --install-scripts=$(DESTDIR)/$(datadir)/plc_api \
            --install-data=$(DESTDIR)/$(datadir)/plc_api
 
-clean: 
+# phpxmlrpc is a git subtree; we just ship all its contents
+# under /usr/share/plc_api/php/phpxmlrpc
+install-phpxmlrpc:
+       mkdir -p $(DESTDIR)/$(datadir)/plc_api/php/phpxmlrpc/
+       rsync --exclude .git -ai php/phpxmlrpc/ $(DESTDIR)/$(datadir)/plc_api/php/phpxmlrpc/
+
+clean:
        find . -name '*.pyc' | xargs rm -f
-       python setup.py clean && rm -rf build
+       python3 setup.py clean && rm -rf build
 
 index:
        echo "This step is obsolete"
@@ -73,12 +81,13 @@ sync:
 ifeq (,$(SSHURL))
        @echo "sync: I need more info from the command line, e.g."
        @echo "  make sync PLC=boot.planetlab.eu"
-       @echo "  make sync PLCHOSTLXC=.. GUESTNAME=.."
+       @echo "  make sync PLCHOSTLXC=.. GUESTHOSTNAME=.. GUESTNAME=.."
        @exit 1
 else
        +$(RSYNC) plcsh PLC planetlab5.sql migrations aspects $(SSHURL)/usr/share/plc_api/
        +$(RSYNC) db-config.d/ $(SSHURL)/etc/planetlab/db-config.d/
        +$(RSYNC) plc.d/ $(SSHURL)/etc/plc.d/
+       +$(RSYNC) apache/plc.wsgi $(SSHURL)/usr/share/plc_api/apache/
        $(SSHCOMMAND) /etc/plc.d/httpd stop
        $(SSHCOMMAND) /etc/plc.d/httpd start
 endif
@@ -92,4 +101,3 @@ endif
 +%: varname=$(subst +,,$@)
 +%:
        @echo "$($(varname))"
-