]> git.proxmox.com Git - spiceterm.git/blobdiff - Makefile
bump version to 3.3.0
[spiceterm.git] / Makefile
index 8d8fb41a8ecde9db386e5bfdb51c5533f097621c..b8b513fd4dadfc68ccf20dec6a048cd0e3dbe103 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,28 +1,48 @@
+include /usr/share/dpkg/pkg-info.mk
+include /usr/share/dpkg/architecture.mk
 
-PROGRAMS=test_display_no_ssl spiceterm
+PACKAGE=spiceterm
 
-HEADERS=test_display_base.h basic_event_loop.h ring.h glyphs.h spiceterm.h
-SOURCES=test_display_base.c basic_event_loop.c
+GITVERSION:=$(shell cat .git/refs/heads/master)
+BUILDDIR ?= $(PACKAGE)-$(DEB_VERSION_UPSTREAM)
 
-all: ${PROGRAMS}
+DEB=$(PACKAGE)_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
+DBG_DEB=$(PACKAGE)-dbgsym_$(DEB_VERSION)_$(DEB_HOST_ARCH).deb
+DSC=$(PACKAGE)_$(DEB_VERSION_UPSTREAM_REVISION).dsc
 
-test_display_no_ssl: ${SOURCES} ${HEADERS} test_display_no_ssl.c 
-       gcc ${SOURCES} test_display_no_ssl.c -o $@ $(shell pkg-config --cflags --libs spice-protocol,spice-server)
+$(BUILDDIR): src/ debian/
+       rm -rf $(BUILDDIR)
+       rsync -a src/ debian $(BUILDDIR)
+       echo "git clone git://git.proxmox.com/git/spiceterm.git\\ngit checkout $(GITVERSION)" > $(BUILDDIR)/debian/SOURCE
 
-spiceterm: ${SOURCES} ${HEADERS} spiceterm.c 
-       gcc ${SOURCES} spiceterm.c -o $@ -lutil $(shell pkg-config --cflags gdk-3.0) $(shell pkg-config --cflags --libs spice-protocol,spice-server)
+.PHONY: dsc
+dsc: clean
+       $(MAKE) $(DSC)
+       lintian $(DSC)
 
-.PHONY: test1
-test1: test_display_no_ssl
-       ./test_display_no_ssl & remote-viewer spice://localhost:5912
+$(DSC): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
 
-.PHONY: test2
-test2: spiceterm
-       ./spiceterm & remote-viewer spice://localhost:5912
+sbuild: $(DSC)
+       sbuild $<
 
-.PHONY: distclean
-distclean: clean
+.PHONY: deb
+deb: $(DEB)
+$(DEB): $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
+       lintian $(DEB)
+
+.PHONY: dinstall
+dinstall: $(DEB)
+       dpkg -i $(DEB)
 
-.PHONY: clean
+.PHONY: upload
+upload: UPLOAD_DIST ?= $(DEB_DISTRIBUTION)
+upload: $(DEB)
+       tar cf - $(DEB) $(DBG_DEB) | ssh repoman@repo.proxmox.com -- upload --product pve --dist $(UPLOAD_DIST) --arch $(DEB_HOST_ARCH)
+
+.PHONY: distclean clean
+distclean: clean
 clean:
-       rm -rf *~ ${PROGRAMS}
\ No newline at end of file
+       $(MAKE) -C src $@
+       rm -rf *~ $(PACKAGE)-*/ $(PACKAGE)*.tar* *.deb *.dsc *.changes *.build *.buildinfo