]> git.proxmox.com Git - pve-container.git/blobdiff - Makefile
fix #5414: use proper percentages in `pct df`
[pve-container.git] / Makefile
index 19a040429d6b140f938fab982081c904191929a2..cca127a52dc0355889fe8da9cca7dce748f9dbe2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,39 +1,52 @@
-VERSION=1.0
-PACKAGE=pve-container
-PKGREL=94
+include /usr/share/dpkg/pkg-info.mk
 
-GITVERSION:=$(shell cat .git/refs/heads/master)
+PACKAGE=pve-container
 
-ARCH:=all
+GITVERSION:=$(shell git rev-parse HEAD)
+BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
 
-DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
+DEB=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION)_all.deb
+DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
 
-all: ${DEB}
+all: $(DEB)
 
 .PHONY: dinstall
-dinstall: ${DEB}
-       dpkg -i ${DEB}
+dinstall: $(DEB)
+       dpkg -i $(DEB)
+
+$(BUILDDIR): src debian
+       rm -rf $(BUILDDIR) $(BUILDDIR).tmp; mkdir $(BUILDDIR).tmp
+       cp -t $(BUILDDIR).tmp -a debian src/*
+       echo "git clone git://git.proxmox.com/git/pve-container\\ngit checkout $(GITVERSION)" >$(BUILDDIR).tmp/debian/SOURCE
+       mv $(BUILDDIR).tmp $(BUILDDIR)
 
 .PHONY: deb
-deb: ${DEB}
-${DEB}:
-       rm -rf build
-       mkdir build
-       rsync -a src/ build
-       rsync -a debian/ build/debian
-       echo "git clone git://git.proxmox.com/git/pve-container\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
-       cd build; dpkg-buildpackage -rfakeroot -b -us -uc
-       lintian ${DEB}
+deb: $(DEB)
+$(DEB): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
+       lintian $(DEB)
+
+
+.PHONY: dsc
+dsc: $(DSC)
+$(DSC): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
+       lintian $(DSC)
+
+.PHONY: sbuild
+sbuild: $(DSC)
+       sbuild $(DSC)
 
 .PHONY: clean
 clean:
-       make -C src clean
-       rm -rf build *.deb ${PACKAGE}-*.tar.gz *.changes 
-       find . -name '*~' -exec rm {} ';'
+       $(MAKE) -C src clean
+       rm -rf $(PACKAGE)-[0-9]*/
+       rm -f *.deb *.changes *.build *.buildinfo *.dsc $(PACKAGE)*.tar*
 
 .PHONY: distclean
 distclean: clean
 
 .PHONY: upload
-upload: ${DEB}
-       tar cf - ${DEB} | ssh repoman@repo.proxmox.com upload
+upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
+upload: $(DEB)
+       tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com -- upload --product pve --dist $(UPLOAD_DIST)