X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile;h=b138e0539a7a5e8ed711d8ee645167737cf1f0d9;hb=13cdde8c6f6ea0dac1ea30d703d70938ba8dfcb1;hp=97061a57ef5ce487ea8efca156f603bae102b374;hpb=e48b0945a0f03a51019f72399ac9f0eeabb90211;p=plcapi.git diff --git a/Makefile b/Makefile index 97061a5..b138e05 100644 --- a/Makefile +++ b/Makefile @@ -18,18 +18,30 @@ bindir := /usr/bin PWD := $(shell pwd) -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: 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" @@ -65,22 +77,22 @@ endif endif LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' --exclude Accessors_site.py -RSYNC_EXCLUDES := --exclude .svn --exclude .git --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES) +RSYNC_EXCLUDES := --exclude '*~' --exclude TAGS $(LOCAL_RSYNC_EXCLUDES) RSYNC_COND_DRY_RUN := $(if $(findstring n,$(MAKEFLAGS)),--dry-run,) -RSYNC := rsync -a -v $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES) +RSYNC := rsync -ai $(RSYNC_COND_DRY_RUN) $(RSYNC_EXCLUDES) 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) 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/ - $(SSHCOMMAND) /etc/plc.d/httpd stop - $(SSHCOMMAND) /etc/plc.d/httpd start + +$(RSYNC) apache/plc.wsgi $(SSHURL)/usr/share/plc_api/apache/ + $(SSHCOMMAND) systemctl restart plc endif #################### convenience, for debugging only @@ -92,4 +104,3 @@ endif +%: varname=$(subst +,,$@) +%: @echo "$($(varname))" -