bump version to 5.0-52
[pve-common.git] / Makefile
index 124b30e..b7efd31 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,49 +1,54 @@
 VERSION=5.0
-PKGREL=12
+PKGREL=52
 
 PACKAGE=libpve-common-perl
 
-PREFIX=/usr
-BINDIR=${PREFIX}/bin
-MANDIR=${PREFIX}/share/man
-DOCDIR=${PREFIX}/share/doc
-MAN1DIR=${MANDIR}/man1/
-PERLDIR=${PREFIX}/share/perl5
-
 ARCH=all
-GITVERSION:=$(shell cat .git/refs/heads/master)
+
+BUILDDIR ?= ${PACKAGE}-${VERSION}
 
 DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
+DSC=${PACKAGE}_${VERSION}-${PKGREL}.dsc
+TARGZ=${PACKAGE}_${VERSION}-${PKGREL}.tar.gz
 
-all: ${DEB}
+all:
+       ${MAKE} -C src
 
 .PHONY: dinstall
 dinstall: deb
        dpkg -i ${DEB}
 
+${BUILDDIR}: src debian
+       rm -rf ${BUILDDIR}
+       rsync -a * ${BUILDDIR}
+       echo "git clone git://git.proxmox.com/git/pve-common.git\\ngit checkout $(shell git rev-parse HEAD)" > ${BUILDDIR}/debian/SOURCE
 
 .PHONY: deb
-deb ${DEB}:
-       $(MAKE) -C test check
-       rm -rf build
-       rsync -a src/ build
-       rsync -a debian/ build/debian
-       echo "git clone git://git.proxmox.com/git/pve-common.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE
-       cd build; dpkg-buildpackage -rfakeroot -b -us -uc
+deb: ${DEB}
+${DEB}: ${BUILDDIR}
+       cd ${BUILDDIR}; dpkg-buildpackage -b -us -uc
        lintian ${DEB}
 
-.PHONY: clean
-clean:         
-       rm -rf *~ *.deb *.changes build ${PACKAGE}-*.tar.gz *.buildinfo
+.PHONY: dsc
+dsc ${TARGZ}: ${DSC}
+${DSC}: ${BUILDDIR}
+       cd ${BUILDDIR}; dpkg-buildpackage -S -us -uc -d -nc
+       lintian ${DSC}
 
-.PHONY: distclean
+.PHONY: clean distclean
 distclean: clean
+clean:
+       rm -rf *~ *.deb *.changes ${BUILDDIR} *.buildinfo *.dsc *.tar.gz
 
 .PHONY: check
 check:
        $(MAKE) -C test check
 
+.PHONY: install
+install:
+       ${MAKE} -C src install
+
 .PHONY: upload
 upload: ${DEB}
-       tar cf - ${DEB}|ssh repoman@repo.proxmox.com -- upload --product pve,pmg --dist stretch
+       tar cf - ${DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pve,pmg --dist stretch