From 8df08859c4a8eabf7c0a0757aee5e116c53e05f9 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Mon, 29 May 2023 15:32:58 +0200 Subject: [PATCH] buildsys: make build-dir generation atomic and versioned Signed-off-by: Thomas Lamprecht --- Makefile | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 4d848b38..c1ae57c4 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,10 @@ SUBDIRS = aplinfo PVE bin www services configs network-hooks test GITVERSION:=$(shell git rev-parse --short=16 HEAD) -DEB=$(PACKAGE)_$(VERSION)_$(DEB_HOST_ARCH).deb + +BUILDDIR = $(PACKAGE)-$(DEB_VERSION_UPSTREAM) + +DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb all: $(SUBDIRS) set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i; done @@ -26,15 +29,18 @@ check: bin test www dinstall: $(DEB) dpkg -i $(DEB) +$(BUILDDIR): + rm -rf $@ $@.tmp + mkdir $@.tmp + rsync -a * $@.tmp + echo "git clone git://git.proxmox.com/git/pve-manager.git\\ngit checkout $(GITVERSION)" > $@.tmp/debian/SOURCE + echo "REPOID_GENERATED=$(GITVERSION)" > $@.tmp/debian/rules.env + mv $@.tmp $@ + .PHONY: deb deb: $(DEB) -$(DEB): - rm -rf dest - mkdir dest - rsync -a * dest - echo "git clone git://git.proxmox.com/git/pve-manager.git\\ngit checkout $(GITVERSION)" > dest/debian/SOURCE - echo "REPOID_GENERATED=$(GITVERSION)" > dest/debian/rules.env - cd dest; dpkg-buildpackage -b -us -uc +$(DEB): $(BUILDDIR) + cd $(BUILDDIR); dpkg-buildpackage -b -us -uc lintian $(DEB) .PHONY: upload @@ -61,4 +67,5 @@ distclean: clean .PHONY: clean clean: set -e && for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done - rm -rf dest country.dat *.deb *.buildinfo *.changes ca-tmp + rm -f country.dat *.deb *.buildinfo *.changes + rm -rf dest $(PACKAGE)-[0-9]*/