]> git.proxmox.com Git - pmg-api.git/blobdiff - Makefile
dkim: add QID in warnings
[pmg-api.git] / Makefile
index 6846958fb78a35141ef17ad8bf5969e750b2b281..37c0739a06c883a2cf9256efceb8be0530f8b30f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,19 +4,14 @@ PACKAGE=pmg-api
 
 BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION)
 
+DSC=$(PACKAGE)_$(DEB_VERSION).dsc
 DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_all.deb
 
-REPOID = $(shell git rev-parse --short=8 HEAD)
-
-export PACKAGE
-export REPOID
-export PMGVERSION = $(DEB_VERSION_UPSTREAM_REVISION)
-export PMGRELEASE = $(shell echo $(DEB_VERSION_UPSTREAM) | cut -c 1-3)
-
 $(BUILDDIR): src debian
        rm -rf $@ $@.tmp
        cp -a src $@.tmp
        cp -a debian $@.tmp/
+       echo "REPOID_GENERATED=$(shell git rev-parse --short=12 HEAD)" > $@.tmp/debian/rules.env
        mv $@.tmp $@
 
 .PHONY: deb
@@ -25,6 +20,16 @@ $(DEB): $(BUILDDIR)
        cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
        lintian $(DEB)
 
+dsc:
+       rm -rf $(BUILDDIR) $(DSC)
+       $(MAKE) $(DSC)
+       lintian $(DSC)
+$(DSC): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
+
+sbuild: $(DSC)
+       sbuild $<
+
 .PHONY: upload
 upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
 upload: $(DEB)
@@ -37,7 +42,8 @@ check:
 .PHONY: clean distclean
 distclean: clean
 clean:
-       rm -rf *.deb *.changes *.buildinfo $(BUILDDIR) $(PACKAGE)*.tar.gz *.dsc
+       rm -rf $(PACKAGE)-[0-9]*/
+       rm -rf *.deb *.changes *.build *.buildinfo $(PACKAGE)*tar* *.dsc
 
 .PHONY: dinstall
 dinstall: $(DEB)