]> git.proxmox.com Git - spiceterm.git/blobdiff - Makefile
rework buildsystem, move to own src folder
[spiceterm.git] / Makefile
index 84f359c76ff7c02ac137b78dda3ad5158b47a42f..f1284d0a92fcefd66945004d2ae6654ee422c83a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,33 @@
+include /usr/share/dpkg/pkg-info.mk
+include /usr/share/dpkg/architecture.mk
 
-PROGRAMS=test_display_no_ssl
-HEADERS=test_display_base.h basic_event_loop.h ring.h
-SOURCES=test_display_base.c test_display_no_ssl.c basic_event_loop.c
+PACKAGE=spiceterm
 
-all: ${PROGRAMS}
+GITVERSION:=$(shell cat .git/refs/heads/master)
+BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM}
 
-test_display_no_ssl: ${SOURCES} ${HEADERS}
-       gcc ${SOURCES} -o $@ $(shell pkg-config --cflags --libs spice-protocol,spice-server)
+export VERSION=$(DEB_VERSION_UPSTREAM)
 
-.PHONY: test
-test: test_display_no_ssl
-       ./test_display_no_ssl & remote-viewer spice://localhost:5912
+DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb
+
+.PHONY: deb
+deb: ${DEB}
+${DEB}:
+       rm -rf $(BUILDDIR)
+       rsync -a src/ debian $(BUILDDIR)
+       echo "git clone git://git.proxmox.com/git/spiceterm.git\\ngit checkout ${GITVERSION}" > $(BUILDDIR)/debian/SOURCE
+       cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
+       lintian ${DEB}
+
+.PHONY: dinstall
+dinstall: ${DEB}
+       dpkg -i ${DEB}
+
+.PHONY: upload
+upload: ${DEB}
+       tar cf - ${DEB} | ssh repoman@repo.proxmox.com -- upload --product pve --dist stretch --arch ${ARCH}
+
+.PHONY: distclean clean
+distclean: clean
+clean:
+       rm -rf *~ $(BUILDDIR) *.deb *.changes genfont *.buildinfo