print_text_table: untaint $width
[pve-common.git] / Makefile
index e281c77..0c45312 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,19 +1,12 @@
-RELEASE=4.2
-
-VERSION=4.0
-PKGREL=61
+VERSION=5.0
+PKGREL=38
 
 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)
+GITVERSION:=$(shell git rev-parse HEAD)
+
+BUILDDIR ?= build
 
 DEB=${PACKAGE}_${VERSION}-${PKGREL}_${ARCH}.deb
 
@@ -25,21 +18,18 @@ dinstall: deb
 
 
 .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}: check
+       rm -rf ${BUILDDIR}
+       rsync -a src/ ${BUILDDIR}
+       rsync -a debian/ ${BUILDDIR}/debian
+       echo "git clone git://git.proxmox.com/git/pve-common.git\\ngit checkout ${GITVERSION}" > ${BUILDDIR}/debian/SOURCE
+       cd ${BUILDDIR}; dpkg-buildpackage -b -us -uc
        lintian ${DEB}
 
-.PHONY: clean
-clean:         
-       rm -rf *~ *.deb *.changes build ${PACKAGE}-*.tar.gz
-
-.PHONY: distclean
+.PHONY: clean distclean
 distclean: clean
+clean:
+       rm -rf *~ *.deb *.changes ${BUILDDIR} *.buildinfo
 
 .PHONY: check
 check:
@@ -47,11 +37,5 @@ check:
 
 .PHONY: upload
 upload: ${DEB}
-       umount /pve/${RELEASE}; mount /pve/${RELEASE} -o rw 
-       mkdir -p /pve/${RELEASE}/extra
-       rm -f /pve/${RELEASE}/extra/${PACKAGE}_*.deb
-       rm -f /pve/${RELEASE}/extra/Packages*
-       cp ${DEB} /pve/${RELEASE}/extra
-       cd /pve/${RELEASE}/extra; dpkg-scanpackages . /dev/null > Packages; gzip -9c Packages > Packages.gz
-       umount /pve/${RELEASE}; mount /pve/${RELEASE} -o ro
+       tar cf - ${DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pve,pmg --dist stretch