X-Git-Url: https://git.proxmox.com/?p=pve-container.git;a=blobdiff_plain;f=Makefile;h=7f18b7c8f94cb9abfe606fbaad77c306a59420e6;hp=99a0390295bc8c38dbf8688bc8e3f51a27a0a4b1;hb=HEAD;hpb=85e718a0ebd099777e7e9f048f091d9a561fab8a diff --git a/Makefile b/Makefile index 99a0390..cca127a 100644 --- a/Makefile +++ b/Makefile @@ -1,39 +1,52 @@ -VERSION=2.0 +include /usr/share/dpkg/pkg-info.mk + PACKAGE=pve-container -PKGREL=21 GITVERSION:=$(shell git rev-parse HEAD) +BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM) -ARCH:=all - -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)