]> git.proxmox.com Git - pve-http-server.git/blobdiff - Makefile
buildsys: use dpkg-dev makefile helpers for pkg info
[pve-http-server.git] / Makefile
index 457521afe9edca535fae5375a21d46c63868f744..b9e4c21898baff1c81a5fe11e68934ad4c44f4a4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,12 @@
+include /usr/share/dpkg/pkg-info.mk
+include /usr/share/dpkg/architecture.mk
+
 PACKAGE=libpve-http-server-perl
-PKGVER=1.0
-PKGREL=4
 
-DEB=${PACKAGE}_${PKGVER}-${PKGREL}_all.deb
+GITVERSION:=$(shell git rev-parse HEAD)
+BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
+
+DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
 
 DESTDIR=
 
@@ -31,10 +35,12 @@ JQSRC=jquery-${JQVER}.min.js
 all:
 
 .PHONY: deb
-deb ${DEB}:
-       rm -rf build
-       rsync -a * build
-       cd build; dpkg-buildpackage -b -us -uc
+deb: ${DEB}
+${DEB}:
+       rm -rf ${BUILDDIR}
+       rsync -a * ${BUILDDIR}
+       echo "git clone git://git.proxmox.com/git/pve-http-server\\ngit checkout $(GITVERSION)" > $(BUILDDIR)/debian/SOURCE
+       cd ${BUILDDIR}; dpkg-buildpackage -b -us -uc
        lintian ${DEB}
 
 download_bootstrap:
@@ -56,6 +62,7 @@ install: ${BTDATA}
        install -d -m 755 ${PERL5DIR}/PVE/APIServer
        install -m 0644 PVE/APIServer/AnyEvent.pm ${PERL5DIR}/PVE/APIServer
        install -m 0644 PVE/APIServer/Formatter.pm ${PERL5DIR}/PVE/APIServer
+       install -m 0644 PVE/APIServer/Utils.pm ${PERL5DIR}/PVE/APIServer
        install -d -m 755 ${PERL5DIR}/PVE/APIServer/Formatter
        install -m 0644 PVE/APIServer/Formatter/Standard.pm ${PERL5DIR}/PVE/APIServer/Formatter
        install -m 0644 PVE/APIServer/Formatter/Bootstrap.pm ${PERL5DIR}/PVE/APIServer/Formatter
@@ -74,13 +81,13 @@ install: ${BTDATA}
 
 .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,pmg --dist stretch
 
 distclean: clean
        rm -f examples/simple-demo.pem
 
 clean:
-       rm -rf ./build *.deb *.changes ${BTDIR} examples/simple-demo.lck
+       rm -rf ./build *.deb *.changes *.buildinfo ${BTDIR} examples/simple-demo.lck
        find . -name '*~' -exec rm {} ';'
 
 .PHONY: dinstall