X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=Makefile;h=7f18b7c8f94cb9abfe606fbaad77c306a59420e6;hb=HEAD;hp=550713d1c8d537ed1fa8be66f50856a1e0436b03;hpb=3ac31835293b7c849e6a3f8b91d21d4e18f7ec6b;p=pve-container.git diff --git a/Makefile b/Makefile index 550713d..cca127a 100644 --- a/Makefile +++ b/Makefile @@ -1,39 +1,52 @@ -VERSION=2.0 -PACKAGE=pve-container -PKGREL=18 +include /usr/share/dpkg/pkg-info.mk -GITVERSION:=$(git rev-parse HEAD) +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 -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 *.buildinfo - 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 -X repoman@repo.proxmox.com -- upload --product pve --dist stretch +upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION) +upload: $(DEB) + tar cf - $(DEB) | ssh -X repoman@repo.proxmox.com -- upload --product pve --dist $(UPLOAD_DIST)