first and very rough attempt at building for debian
[nodemanager.git] / Makefile
index 52a7f7a..5648041 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -90,7 +90,35 @@ clean:
 
 .PHONY: all install clean
 
-##########
+#################### debian-related
+# This is called from the build with the following variables set 
+# (see build/Makefile and target_debian)
+# (.) RPMTARBALL
+# (.) RPMVERSION
+# (.) RPMRELEASE
+# (.) RPMNAME
+DEBVERSION=$(RPMVERSION).$(RPMRELEASE)
+DEBTARBALL=../$(RPMNAME)_$(DEBVERSION).orig.tar.bz2
+DATE=$(shell date -u +"%a, %d %b %Y %T")
+force:
+
+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 --set-envvar PREFIX=/usr -uc -us -b
+
+debian.clean:
+       $(MAKE) -f debian/rules clean
+       rm -rf build/ MANIFEST ../*.tar.gz ../*.dsc ../*.build
+       find . -name '*.pyc' -delete
+
+################################################## devel-oriented
 tags:
        (find . '(' -name '*.py' -o -name '*.c' -o -name '*.spec' ')' ; ls initscripts/*) | xargs etags