-all:
- python setup.py build
-
-install:
- python setup.py install \
- --install-purelib=$(DESTDIR)/$(datadir)/plc_api \
- --install-scripts=$(DESTDIR)/$(datadir)/plc_api \
- --install-data=$(DESTDIR)/$(datadir)/plc_api
-
-clean:
+all:
+ python3 setup.py build
+
+install: install-python install-phpxmlrpc
+
+install-python:
+ pip install --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
+ # 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
+install-phpxmlrpc:
+ mkdir -p $(DESTDIR)/$(datadir)/plc_api/php/phpxmlrpc/
+ rsync --exclude .git -ai php/phpxmlrpc/ $(DESTDIR)/$(datadir)/plc_api/php/phpxmlrpc/
+
+clean: