X-Git-Url: http://git.onelab.eu/?p=plcapi.git;a=blobdiff_plain;f=Makefile;h=f05c06f9f5782a12314f8c08c155153a3c03ee82;hp=b5760a26980c2b26faa23780bfa5135efb4dbf41;hb=HEAD;hpb=05102eb7d8c0faad30ae3719e2045c1af72b9e9d diff --git a/Makefile b/Makefile index b5760a2..f05c06f 100644 --- a/Makefile +++ b/Makefile @@ -1,122 +1,104 @@ -# Makefile for phpxmlrpc library - -### USER EDITABLE VARS ### - -# path to PHP executable, preferably CLI version -PHP=/usr/local/bin/php - -# path were xmlrpc lib files will be copied to -PHPINCLUDEDIR=/usr/local/lib/php - -# mkdir is a thorny beast under windows: make sure we can not use the cmd version, running eg. "make MKDIR=mkdir.exe" -MKDIR=mkdir - -#find too -FIND=find - - -#### DO NOT TOUCH FROM HERE ONWARDS ### - -# recover version number from code -# thanks to Firman Pribadi for unix command line help -# on unix shells lasts char should be \\2/g ) -export VERSION=$(shell egrep "\$GLOBALS *\[ *'xmlrpcVersion' *\] *= *'" lib/xmlrpc.inc | sed -r s/"(.*= *' *)([0-9a-zA-Z.-]+)(.*)"/\2/g ) - -LIBFILES=lib/xmlrpc.inc lib/xmlrpcs.inc lib/xmlrpc_wrappers.inc - -EXTRAFILES=extras/test.pl \ - extras/test.py \ - extras/rsakey.pem \ - extras/workspace.testPhpServer.fttb - -DEMOFILES=demo/vardemo.php \ - demo/demo1.txt \ - demo/demo2.txt \ - demo/demo3.txt - -DEMOSFILES=demo/server/discuss.php \ - demo/server/server.php \ - demo/server/proxy.php - -DEMOCFILES=demo/client/agesort.php \ - demo/client/client.php \ - demo/client/comment.php \ - demo/client/introspect.php \ - demo/client/mail.php \ - demo/client/simple_call.php \ - demo/client/which.php \ - demo/client/wrap.php \ - demo/client/zopetest.php - -TESTFILES=test/testsuite.php \ - test/benchmark.php \ - test/parse_args.php \ - test/phpunit.php \ - test/verify_compat.php \ - test/PHPUnit/*.php - -INFOFILES=Changelog \ - Makefile \ - NEWS \ - README - -DEBUGGERFILES=debugger/index.php \ - debugger/action.php \ - debugger/common.php \ - debugger/controller.php - - -all: install - -install: - cp ${LIBFILES} ${PHPINCLUDEDIR} - @echo Lib files have been copied to ${PHPINCLUDEDIR} - cd doc && $(MAKE) install - -test: - cd test && ${PHP} -q testsuite.php - - -### the following targets are to be used for library development ### - -# make tag target: tag existing working copy as release in cvs. -# todo: convert dots in underscore in $VERSION -tag: - cvs -q tag -p release_${VERSION} - -dist: xmlrpc-${VERSION}.zip xmlrpc-${VERSION}.tar.gz - -xmlrpc-${VERSION}.zip xmlrpc-${VERSION}.tar.gz: ${LIBFILES} ${DEBUGGERFILES} ${INFOFILES} ${TESTFILES} ${EXTRAFILES} ${DEMOFILES} ${DEMOSFILES} ${DEMOCFILES} - @echo ---${VERSION}--- - rm -rf xmlrpc-${VERSION} - ${MKDIR} xmlrpc-${VERSION} - ${MKDIR} xmlrpc-${VERSION}/demo - ${MKDIR} xmlrpc-${VERSION}/demo/client - ${MKDIR} xmlrpc-${VERSION}/demo/server - ${MKDIR} xmlrpc-${VERSION}/test - ${MKDIR} xmlrpc-${VERSION}/test/PHPUnit - ${MKDIR} xmlrpc-${VERSION}/extras - ${MKDIR} xmlrpc-${VERSION}/lib - ${MKDIR} xmlrpc-${VERSION}/debugger - cp --parents ${DEMOFILES} xmlrpc-${VERSION} - cp --parents ${DEMOCFILES} xmlrpc-${VERSION} - cp --parents ${DEMOSFILES} xmlrpc-${VERSION} - cp --parents ${TESTFILES} xmlrpc-${VERSION} - cp --parents ${EXTRAFILES} xmlrpc-${VERSION} - cp --parents ${LIBFILES} xmlrpc-${VERSION} - cp --parents ${DEBUGGERFILES} xmlrpc-${VERSION} - cp ${INFOFILES} xmlrpc-${VERSION} - cd doc && $(MAKE) dist -# on unix shells last char should be \; - ${FIND} xmlrpc-${VERSION} -type f ! -name "*.fttb" ! -name "*.pdf" ! -name "*.gif" -exec dos2unix {} ; - -rm xmlrpc-${VERSION}.zip xmlrpc-${VERSION}.tar.gz - tar -cvf xmlrpc-${VERSION}.tar xmlrpc-${VERSION} - gzip xmlrpc-${VERSION}.tar - zip -r xmlrpc-${VERSION}.zip xmlrpc-${VERSION} - -doc: - cd doc && $(MAKE) doc - -clean: - rm -rf xmlrpc-${VERSION} xmlrpc-${VERSION}.zip xmlrpc-${VERSION}.tar.gz - cd doc && $(MAKE) clean +# +# (Re)builds Python metafiles (__init__.py) and documentation +# +# Mark Huang +# Copyright (C) 2005 The Trustees of Princeton University +# + +# python-pycurl and python-psycopg2 avail. from fedora 5 +# we used to ship our own version of psycopg2 and pycurl, for fedora4 +# starting with 5.0, support for these two modules is taken out + +# Other stuff - doc not implicit, it's redone by myplc-docs + +# autoconf compatible variables +DESTDIR := / +datadir := /usr/share +bindir := /usr/bin + +PWD := $(shell pwd) + +all: + python setup.py build + +install: install-python install-phpxmlrpc + +install-python: + python 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 + +index: + echo "This step is obsolete" + +########## + +force: + +.PHONY: all install force clean index tags + +#################### devel tools +tags: + find . '(' -name '*.py' -o -name '*.sql' -o -name '*.php' -o -name Makefile -o -name '[0-9][0-9][0-9]*' ')' | fgrep -v '.git/' | xargs etags + +.PHONY: tags + +########## sync +# 2 forms are supported +# (*) if your plc root context has direct ssh access: +# make sync PLC=private.one-lab.org +# (*) otherwise, for test deployments, use on your testmaster +# $ run export +# and cut'n paste the export lines before you run make sync + +ifdef PLC +SSHURL:=root@$(PLC):/ +SSHCOMMAND:=ssh root@$(PLC) +else +ifdef PLCHOSTLXC +SSHURL:=root@$(PLCHOSTLXC):/vservers/$(GUESTNAME) +SSHCOMMAND:=ssh root@$(PLCHOSTLXC) ssh -o StrictHostKeyChecking=no -o LogLevel=quiet $(GUESTHOSTNAME) +endif +endif + +LOCAL_RSYNC_EXCLUDES := --exclude '*.pyc' --exclude Accessors_site.py +RSYNC_EXCLUDES := --exclude .svn --exclude .git --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) + +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=.. GUESTHOSTNAME=.. GUESTNAME=.." + @exit 1 +else + +$(RSYNC) plcsh PLC planetlab5.sql migrations $(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 + +#################### convenience, for debugging only +# make +foo : prints the value of $(foo) +# make ++foo : idem but verbose, i.e. foo=$(foo) +++%: varname=$(subst +,,$@) +++%: + @echo "$(varname)=$($(varname))" ++%: varname=$(subst +,,$@) ++%: + @echo "$($(varname))" +