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
+ # we mention --upgrade because otherwise
+ # pip install complains the php/ target already exists
+ # and it refuses to put plc_api.php in there
+ pip install --upgrade --target $(DESTDIR)/$(datadir)/plc_api .
+ # it's important that plcsh sits in /usr/share/plc_api
+ # and not under bin/ so that python can find the PLC/ modules
+ mv $(DESTDIR)/$(datadir)/plc_api/bin/plcsh $(DESTDIR)/$(datadir)/plc_api
+ mv $(DESTDIR)/$(datadir)/plc_api/bin/Server.py $(DESTDIR)/$(datadir)/Server.py
+ # the old recipe used to read
+ # python3 setup.py install \
+ # --install-purelib=$(DESTDIR)/$(datadir)/plc_api \
+ # --install-scripts=$(DESTDIR)/$(datadir)/plc_api \
+ # --install-data=$(DESTDIR)/$(datadir)/plc_api
# phpxmlrpc is a git subtree; we just ship all its contents
# under /usr/share/plc_api/php/phpxmlrpc
@echo " make sync PLCHOSTLXC=.. GUESTHOSTNAME=.. GUESTNAME=.."
@exit 1
else
- +$(RSYNC) plcsh PLC planetlab5.sql migrations $(SSHURL)/usr/share/plc_api/
+ +$(RSYNC) plcsh PLC planetlab5.sql migrations php $(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; /etc/plc.d/httpd start"
+ $(SSHCOMMAND) systemctl restart plc
endif
#################### convenience, for debugging only