]> git.proxmox.com Git - pmg-api.git/commitdiff
buildsys: build-dir: split-out and generate atomically
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 26 Jun 2023 09:36:38 +0000 (11:36 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 26 Jun 2023 09:36:42 +0000 (11:36 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Makefile

index 02dd4c1cfc89fa213835fc46afc70366f564e67a..b2d20787bc3f0fe82f34baa40fb6f4200400562c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,7 @@ include /usr/share/dpkg/pkg-info.mk
 
 PACKAGE=pmg-api
 
-BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
+BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION)
 
 DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_all.deb
 
@@ -13,14 +13,18 @@ export REPOID
 export PMGVERSION = $(DEB_VERSION_UPSTREAM_REVISION)
 export PMGRELEASE = $(DEB_VERSION_UPSTREAM)
 
+$(BUILDDIR): src debian
+       rm -rf $@ $@.tmp
+       cp -a src $@.tmp
+       cp -a debian $@.tmp/
+       mv $@.tmp $@
+
 .PHONY: deb
-deb $(DEB):
-       rm -rf $(BUILDDIR)
-       rsync -a src/ debian $(BUILDDIR)
+deb: $(DEB)
+$(DEB): $(BUILDDIR)
        cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
        lintian $(DEB)
 
-
 .PHONY: upload
 upload: $(DEB)
        tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com -- upload --product pmg --dist bullseye