]> git.proxmox.com Git - spiceterm.git/blobdiff - Makefile
build: fix -dbgsym generation
[spiceterm.git] / Makefile
index 84f359c76ff7c02ac137b78dda3ad5158b47a42f..db644b5b0169c8ee402cacbfbca71de16440048d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,43 @@
+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
+DBG_DEB=${PACKAGE}-dbgsym_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb
+DSC=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}.dsc
+
+${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
+
+.PHONY: dsc
+dsc: ${DSC}
+${DSC}: $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -S -us -uc -d
+       lintian ${DSC}
+
+.PHONY: deb
+deb: ${DEB}
+${DEB}: $(BUILDDIR)
+       cd $(BUILDDIR); dpkg-buildpackage -b -us -uc
+       lintian ${DEB}
+
+.PHONY: dinstall
+dinstall: ${DEB}
+       dpkg -i ${DEB}
+
+.PHONY: upload
+upload: ${DEB}
+       tar cf - ${DEB} ${DBG_DEB} | ssh repoman@repo.proxmox.com -- upload --product pve --dist bullseye --arch ${ARCH}
+
+.PHONY: distclean clean
+distclean: clean
+clean:
+       rm -rf *~ $(PACKAGE)-*/ *.deb *.changes genfont *.buildinfo *.dsc *.tar.gz