]> git.proxmox.com Git - pve-qemu.git/blobdiff - Makefile
buildsys: derive upload dist automatically
[pve-qemu.git] / Makefile
index f25cda17b41acaeccf67305376cbde6e7dd5dd40..3cd6aafc555f0c0cf601daf9391b2e5d7c45ee49 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,4 @@
-include /usr/share/dpkg/pkg-info.mk
-include /usr/share/dpkg/architecture.mk
+include /usr/share/dpkg/default.mk
 
 PACKAGE = pve-qemu-kvm
 
@@ -16,17 +15,18 @@ all: $(DEBS)
 
 .PHONY: submodule
 submodule:
-       test -f "${SRCDIR}/debian/changelog" || git submodule update --init
+       test -f "${SRCDIR}/configure" || git submodule update --init --recursive
 
 $(BUILDDIR): keycodemapdb | submodule
+       # check if qemu/ was used for a build
+       # if so, please run 'make distclean' in the submodule and try again
+       test ! -f $(SRCDIR)/build/config.status
        rm -rf $(BUILDDIR)
        cp -a $(SRCDIR) $(BUILDDIR)
        cp -a debian $(BUILDDIR)/debian
        rm -rf $(BUILDDIR)/ui/keycodemapdb
        cp -a keycodemapdb $(BUILDDIR)/ui/
        echo "git clone git://git.proxmox.com/git/pve-qemu.git\\ngit checkout $(GITVERSION)" > $(BUILDDIR)/debian/SOURCE
-       # set package version
-       sed -i 's/^pkgversion="".*/pkgversion="${PACKAGE}_${KVMVER}-${KVMPKGREL}"/' $(BUILDDIR)/configure
 
 .PHONY: deb kvm
 deb kvm: $(DEBS)
@@ -47,13 +47,14 @@ update:
        git add keycodemapdb
 
 .PHONY: upload
+upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
 upload: $(DEBS)
-       tar cf - ${DEBS} | ssh repoman@repo.proxmox.com upload --product pve --dist stretch
+       tar cf - ${DEBS} | ssh repoman@repo.proxmox.com upload --product pve --dist $(UPLOAD_DIST)
 
 .PHONY: distclean clean
 distclean: clean
 clean:
-       rm -rf $(BUILDDIR) $(PACKAGE)_* $(DEBS) *.buildinfo *.changes
+       rm -rf $(BUILDDIR) $(PACKAGE)*.deb *.buildinfo *.changes
 
 .PHONY: dinstall
 dinstall: $(DEBS)