]> git.proxmox.com Git - novnc-pve.git/blobdiff - Makefile
bump version to 1.4.0-3
[novnc-pve.git] / Makefile
index a59660bc431a9c46a8e63aa5e6e843b36e4f84ef..431dff95abcac03242e9da0ba83be66997507ccd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,37 +1,64 @@
-RELEASE=3.2
+include /usr/share/dpkg/default.mk
 
 PACKAGE=novnc-pve
-PKGREL=1
 
-NOVNCDIR=novnc
-NOVNCSRC=${NOVNCDIR}.tgz
-NOVNCVER=0.4
+SRCDIR=novnc
+BUILDDIR=$(SRCDIR).tmp
+ORIG_SRC_TAR=$(PACKAGE)_$(DEB_VERSION_UPSTREAM).orig.tar.gz
 
-ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
+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:
 
-.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}
-       mv ${NOVNCDIR}/debian ${NOVNCDIR}/debian.org
-       cp -a debian ${NOVNCDIR}/debian 
-       cd ${NOVNCDIR}; dpkg-buildpackage -b -uc -us
-       lintian ${DEB}
+deb: $(DEB)
+$(DEB): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -b -uc -us
+       lintian $(DEB)
+       @echo $(DEB)
+
+$(ORIG_SRC_TAR): $(BUILDDIR)
+       tar czf $(ORIG_SRC_TAR) --exclude="$(BUILDDIR)/debian" $(BUILDDIR)
+
+.PHONY: dsc
+dsc: $(DSC)
+$(DSC): $(ORIG_SRC_TAR) $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -S -uc -us -d
+       lintian $(DSC)
+
+sbuild: $(DSC)
+       sbuild $(DSC)
+
+.PHONY: submodule
+submodule:
+       test -f "$(SRCDIR)/package.json" || git submodule update --init
 
 .PHONY: download
-download:
-       rm -rf ${NOVNCDIR}
-       git clone git://github.com/kanaka/noVNC ${NOVNCDIR}
-       tar czf ${NOVNCSRC} ${NOVNCDIR}
+download $(SRCDIR):
+       git submodule foreach 'git pull --ff-only origin master'
+
+.PHONY: upload
+upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
+upload: $(DEB)
+       tar cf - $(DEB)|ssh -X repoman@repo.proxmox.com -- upload --product pmg,pve --dist $(UPLOAD_DIST)
+
+.PHONY: distclean
+distclean: clean
 
 .PHONY: clean
 clean:
-       rm -rf *~ debian/*~ *_${ARCH}.deb *_all.deb *.changes *.dsc novnc 
+       rm -rf $(PACKAGE)-[0-9]*/ $() *.deb *.dsc $(PACKAGE)*.tar.[gx]z *.changes *.dsc *.buildinfo *.build
+
+.PHONY: dinstall
+dinstall: deb
+       dpkg -i $(DEB)