]> git.proxmox.com Git - pve-container.git/blobdiff - Makefile
fix #2027: do not disable IPV6_AUTOCONF on centos
[pve-container.git] / Makefile
index 7137be0388de1696bee5e92df129560574581fd4..7f18b7c8f94cb9abfe606fbaad77c306a59420e6 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,14 @@
-VERSION=1.0
 PACKAGE=pve-container
-PKGREL=94
+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,21 +16,29 @@ all: ${DEB}
 dinstall: ${DEB}
        dpkg -i ${DEB}
 
+${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
+
 .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
+${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
@@ -36,4 +46,4 @@ distclean: clean
 
 .PHONY: upload
 upload: ${DEB}
-       tar cf - ${DEB} | ssh repoman@repo.proxmox.com -- upload --product pve --dist jessie
+       tar cf - ${DEB} | ssh -X repoman@repo.proxmox.com -- upload --product pve --dist stretch