X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=Makefile;h=6279ed1ffb77e1433b92635c6f31c39b41b40a53;hb=9387180f9530a333fae7bfad2828b1f0f7f3ed10;hp=df1d311b718630897780f5f621bd652a5fefb8f0;hpb=1cc8e9613cab8b5b22478de369f259e591c54e6d;p=sfa.git diff --git a/Makefile b/Makefile index df1d311b..6279ed1f 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ PREFIX=/usr ########## all: python wsdl -install: python-install wsdl-install xmlbuilder-install tests-install +install: python-install wsdl-install tests-install clean: python-clean wsdl-clean @@ -24,14 +24,10 @@ SCMURL=should-be-redefined-by-specfile python: version -version: sfa/util/version.py -sfa/util/version.py: sfa/util/version.py.in +version: sfa/util/version.py +sfa/util/version.py: sfa/util/version.py.in force sed -e "s,@VERSIONTAG@,$(VERSIONTAG),g" -e "s,@SCMURL@,$(SCMURL),g" sfa/util/version.py.in > $@ -xmlbuilder-install: - cd xmlbuilder-0.9 && python setup.py install --prefix=$(PREFIX) --root=$(DESTDIR) && cd - - rm -rf $(DESTDIR)/usr/lib*/python*/site-packages/*egg-info - # postinstall steps - various cleanups and tweaks for a nicer rpm python-install: python setup.py install --prefix=$(PREFIX) --root=$(DESTDIR) @@ -47,7 +43,7 @@ python-clean: version-clean version-clean: rm -f sfa/util/version.py -.PHONY: python version python-install python-clean version-clean xmlbuilder-install +.PHONY: python version python-install python-clean version-clean ########## wsdl: $(MAKE) -C wsdl @@ -61,11 +57,35 @@ wsdl-clean: .PHONY: wsdl wsdl-install wsdl-clean -########## -debian: version - $(MAKE) -f Makefile.debian debian -debian.clean: - $(MAKE) -f Makefile.debian clean +######################################## debian packaging +# The 'debian' target is called from the build with the following variables set +# (see build/Makefile and target_debian) +# (.) RPMTARBALL +# (.) RPMVERSION +# (.) RPMRELEASE +# (.) RPMNAME +# +PROJECT=$(RPMNAME) +DEBVERSION=$(RPMVERSION).$(RPMRELEASE) +DEBTARBALL=../$(PROJECT)_$(DEBVERSION).orig.tar.bz2 + +DATE=$(shell date -u +"%a, %d %b %Y %T") + +debian: debian/changelog debian.source debian.package + +debian/changelog: debian/changelog.in + sed -e "s|@VERSION@|$(DEBVERSION)|" -e "s|@DATE@|$(DATE)|" debian/changelog.in > debian/changelog + +debian.source: force + rsync -a $(RPMTARBALL) $(DEBTARBALL) + +debian.package: + debuild -uc -us -b + +debian.clean: + $(MAKE) -f debian/rules clean + rm -rf build/ MANIFEST ../*.tar.gz ../*.dsc ../*.build + find . -name '*.pyc' -delete ########## tests-install: @@ -101,12 +121,16 @@ force: ########## # a lot of stuff in the working dir is just noise -scan: +files: @find . -type f | egrep -v '^\./\.|/\.git/|/\.svn/|TAGS|AA-|~$$|egg-info|\.(py[co]|doc|html|pdf|png|svg|out|bak|dg|pickle)$$' + +git-files: + @git ls-files | grep -v '\.doc$$' + tags: - $(MAKE) scan | xargs etags + $(MAKE) git-files | xargs etags -.PHONY: scan tags +.PHONY: files tags signatures: (cd sfa/methods; grep 'def.*call' *.py > SIGNATURES) @@ -125,7 +149,7 @@ SSHURL:=root@$(PLC):/ SSHCOMMAND:=ssh root@$(PLC) else ifdef PLCHOSTLXC -SSHURL:=root@$(PLCHOSTLXC):/var/lib/lxc/$(GUESTNAME)/rootfs +SSHURL:=root@$(PLCHOSTLXC):/vservers/$(GUESTNAME) SSHCOMMAND:=ssh root@$(PLCHOSTLXC) ssh $(GUESTHOSTNAME) else ifdef PLCHOSTVS @@ -195,3 +219,13 @@ sfa/util/{sfalogging,faults,genicode,enumeration,__init__}.py clientlibsync: @[ -d "$(CLIENTLIBTARGET)" ] || { echo "You need to set the make variable CLIENTLIBTARGET"; exit 1; } rsync -av --relative $(CLIENTLIBFILES) $(CLIENTLIBTARGET) + +#################### 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))"