]> git.proxmox.com Git - novnc-pve.git/blobdiff - Makefile
replaced check for VERSION file with check for package.json
[novnc-pve.git] / Makefile
index 711e06f82921fab4d3c040438ddac184119a06d4..9591e35af2c43c8abd550ad224e559650ba6e718 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,35 +1,40 @@
+include /usr/share/dpkg/pkg-info.mk
+
 PACKAGE=novnc-pve
-VER=0.5
-PKGREL=9
 
 SRCDIR=novnc
+BUILDDIR=${SRCDIR}.tmp
 
-ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
-GITVERSION:=$(shell cat .git/refs/heads/master)
+GITVERSION:=$(shell git rev-parse HEAD)
 
-DEB=${PACKAGE}_${VER}-${PKGREL}_${ARCH}.deb
+DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
+DSC=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc
 
-all: ${DEB}
-       @echo ${DEB}
+all:
+
+${SRCDIR}/vnc.html: submodule
+${BUILDDIR}: $(SRCDIR)/vnc.html
+       rm -rf ${BUILDDIR}
+       cp -rpa ${SRCDIR} ${BUILDDIR}
+       cp -a debian ${BUILDDIR}
+       echo "git clone git://git.proxmox.com/git/novnc-pve.git\\ngit checkout ${GITVERSION}" > ${BUILDDIR}/debian/SOURCE
 
 .PHONY: deb
 deb: ${DEB}
-${DEB}: | submodule
-       rm -rf ${SRCDIR}.tmp
-       cp -rpa ${SRCDIR} ${SRCDIR}.tmp
-       cp -a debian ${SRCDIR}.tmp/debian
-       cp ${SRCDIR}.tmp/include/ui.js ${SRCDIR}.tmp/pveui.js
-       cp ${SRCDIR}.tmp/vnc.html ${SRCDIR}.tmp/index.html.tpl
-       # fix file permissions
-       chmod 0644 ${SRCDIR}.tmp/include/jsunzip.js
-       echo "git clone git://git.proxmox.com/git/novnc-pve.git\\ngit checkout ${GITVERSION}" > ${SRCDIR}.tmp/debian/SOURCE
-       cd ${SRCDIR}.tmp; dpkg-buildpackage -rfakeroot -b -uc -us
+${DEB}: ${BUILDDIR}
+       cd ${BUILDDIR}; dpkg-buildpackage -b -uc -us
        lintian ${DEB}
        @echo ${DEB}
 
+.PHONY: dsc
+dsc: ${DSC}
+${DSC}: ${BUILDDIR}
+       cd ${BUILDDIR}; dpkg-buildpackage -S -uc -us -d
+       lintian ${DSC}
+
 .PHONY: submodule
 submodule:
-       test -f "${SRCDIR}/vnc.html" || git submodule update --init
+       test -f "${SRCDIR}/package.json" || git submodule update --init
 
 .PHONY: download
 download ${SRCDIR}:
@@ -37,14 +42,14 @@ download ${SRCDIR}:
 
 .PHONY: upload
 upload: ${DEB}
-       tar cf - ${DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pmg,pve --dist stretch
+       tar cf - ${DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pmg,pve --dist bullseye
 
 .PHONY: distclean
 distclean: clean
 
 .PHONY: clean
 clean:
-       rm -rf *~ debian/*~ *_${ARCH}.deb ${SRCDIR}.tmp *_all.deb *.changes *.dsc *.buildinfo
+       rm -rf *~ debian/*~ *.deb ${BUILDDIR} *.changes *.dsc *.buildinfo ${PACKAGE}*.tar.gz
 
 .PHONY: dinstall
 dinstall: deb