]> git.proxmox.com Git - novnc-pve.git/blobdiff - Makefile
bump version to 1.0.0-2
[novnc-pve.git] / Makefile
index 83b6fd3a83c171fe29e51774bbb134132a0a6c6c..f982bb5fdf4f5ddb8c7dd13a796647f0a92ef9e8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,41 +1,37 @@
 PACKAGE=novnc-pve
-PKGREL=8
+VER=1.0.0
+PKGREL=2
 
-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)
 
-DEB=${PACKAGE}_${NOVNCVER}-${PKGREL}_${ARCH}.deb
+GITVERSION:=$(shell git rev-parse HEAD)
 
-all: deb
+DEB=${PACKAGE}_${VER}-${PKGREL}_${ARCH}.deb
 
-.PHONY: dinstall
-dinstall: deb
-       dpkg -i ${DEB}
+all: ${DEB}
+       @echo ${DEB}
 
 .PHONY: deb
 deb: ${DEB}
-${DEB}: ${TARSRC}
-       rm -rf ${NOVNCDIR}
-       tar xf ${NOVNCSRC}
-       cp -a debian ${NOVNCDIR}/debian
-       cp ${NOVNCDIR}/include/ui.js ${NOVNCDIR}/pveui.js
-       cp ${NOVNCDIR}/vnc.html ${NOVNCDIR}/index.html.tpl
-       # 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}: | submodule
+       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
+       cd ${BUILDDIR}; dpkg-buildpackage -rfakeroot -b -uc -us
        lintian ${DEB}
+       @echo ${DEB}
+
+.PHONY: submodule
+submodule:
+       test -f "${SRCDIR}/vnc.html" || 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}
@@ -46,4 +42,8 @@ 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}