]> git.proxmox.com Git - novnc-pve.git/blobdiff - Makefile
add DSC source package and fix its reported lintian errors
[novnc-pve.git] / Makefile
index 701c9d6c0ad9cb343aa0dc28a73ac99ac154bb89..6eea569f3f577789e7afd88685f0d817d4a3b2dc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,49 +1,57 @@
-RELEASE=4.2
+include /usr/share/dpkg/pkg-info.mk
 
 PACKAGE=novnc-pve
-PKGREL=8
 
-NOVNCDIR=novnc
-NOVNCSRC=${NOVNCDIR}.tgz
-NOVNCVER=0.5
+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}_${NOVNCVER}-${PKGREL}_${ARCH}.deb
+DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_all.deb
+DSC=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc
 
-all: deb
+all: ${DEB}
+       @echo ${DEB}
 
-.PHONY: dinstall
-dinstall: deb
-       dpkg -i ${DEB}
+${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}: ${TARSRC}
-       rm -rf ${NOVNCDIR}
-       tar xf ${NOVNCSRC}
-       cp -a debian ${NOVNCDIR}/debian
-       cp ${NOVNCDIR}/include/ui.js ${NOVNCDIR}/pveui.js
-       # fix file permissions
-       chmod 0644 ${NOVNCDIR}/include/jsunzip.js
-       echo "git clone git://git.proxmox.com/git/novnc-pve.git\\ngit checkout ${GITVERSION}" > ${NOVNCDIR}/debian/SOURCE
-       cd ${NOVNCDIR}; dpkg-buildpackage -b -uc -us
+deb: ${DEB}
+${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:
+       git submodule update --init
 
 .PHONY: download
-download:
-       rm -rf ${NOVNCDIR}
-       git clone git://github.com/kanaka/noVNC ${NOVNCDIR}
-       cd ${NOVNCDIR}; git checkout -b local a0e7ab43dca0ce11a713694ee4cf530bd3b17c5a
-       tar czf ${NOVNCSRC} ${NOVNCDIR}
+download ${SRCDIR}:
+       git submodule foreach 'git pull --ff-only origin master'
 
 .PHONY: upload
 upload: ${DEB}
-       tar cf - ${DEB}|ssh repoman@repo.proxmox.com upload
+       tar cf - ${DEB}|ssh -X repoman@repo.proxmox.com -- upload --product pmg,pve --dist stretch
 
 .PHONY: distclean
 distclean: clean
 
 .PHONY: clean
 clean:
-       rm -rf *~ debian/*~ *_${ARCH}.deb *_all.deb *.changes *.dsc novnc 
+       rm -rf *~ debian/*~ *.deb ${BUILDDIR} *.changes *.dsc *.buildinfo
+
+.PHONY: dinstall
+dinstall: deb
+       dpkg -i ${DEB}