]> git.proxmox.com Git - pve-container.git/blobdiff - Makefile
api status: indentation, whitespace and empty newline fixes
[pve-container.git] / Makefile
index 5a0a1e1ef7cce2258bec51a1ac4d470eeb5353bb..7f18b7c8f94cb9abfe606fbaad77c306a59420e6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,14 @@
-VERSION=1.0
 PACKAGE=pve-container
-PKGREL=81
+PKGVER != dpkg-parsechangelog -Sversion | cut -d- -f1
+PKGREL != dpkg-parsechangelog -Sversion | cut -d- -f2
 
-GITVERSION:=$(shell cat .git/refs/heads/master)
+GITVERSION:=$(shell git rev-parse HEAD)
+BUILDDIR ?= build
 
 ARCH:=all
 
-DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
+DEB=${PACKAGE}_${PKGVER}-${PKGREL}_${ARCH}.deb
+DSC=${PACKAGE}_${PKGVER}-${PKGREL}.dsc
 
 all: ${DEB}
 
@@ -14,20 +16,29 @@ all: ${DEB}
 dinstall: ${DEB}
        dpkg -i ${DEB}
 
-.PHONY: deb
-deb ${DEB}:
-       rm -rf build
-       mkdir build
-       rsync -a src/ build
-       rsync -a debian/ build/debian
+${BUILDDIR}:
+       rm -rf ${BUILDDIR}
+       rsync -a src/ ${BUILDDIR}
+       rsync -a debian ${BUILDDIR}/
        echo "git clone git://git.proxmox.com/git/pve-container\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
-       cd build; dpkg-buildpackage -rfakeroot -b -us -uc
+
+.PHONY: deb
+deb: ${DEB}
+${DEB}: ${BUILDDIR}
+       cd build; dpkg-buildpackage -b -us -uc
        lintian ${DEB}
 
+
+.PHONY: dsc
+dsc: ${DSC}
+${DSC}: ${BUILDDIR}
+       cd ${BUILDDIR}; dpkg-buildpackage -S -us -uc -d -nc
+       lintian ${DSC}
+
 .PHONY: clean
 clean:
        make -C src clean
-       rm -rf build *.deb ${PACKAGE}-*.tar.gz *.changes 
+       rm -rf *.deb ${PACKAGE}*.tar.gz *.changes *.buildinfo ${DSC} ${BUILDDIR}
        find . -name '*~' -exec rm {} ';'
 
 .PHONY: distclean
@@ -35,4 +46,4 @@ distclean: clean
 
 .PHONY: upload
 upload: ${DEB}
-       tar cf - ${DEB} | ssh repoman@repo.proxmox.com upload
+       tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pve --dist stretch