From ab216da9bf92504bcffc0446133a6a6c1c36aa01 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 22 May 2019 17:39:30 +0200 Subject: [PATCH] rework buildsystem, move to own src folder most of this is a move plus a little bit of cleanup of the top level packaging make file Signed-off-by: Thomas Lamprecht --- Makefile | 69 +++++----------------------- copyright => debian/copyright | 0 src/Makefile | 47 +++++++++++++++++++ auth-pve.c => src/auth-pve.c | 0 event_loop.c => src/event_loop.c | 0 event_loop.h => src/event_loop.h | 0 genfont.c => src/genfont.c | 0 genkeysym.pl => src/genkeysym.pl | 0 glyphs.h => src/glyphs.h | 0 input.c => src/input.c | 0 keysyms.h => src/keysyms.h | 0 screen.c => src/screen.c | 0 spiceterm.c => src/spiceterm.c | 0 spiceterm.h => src/spiceterm.h | 0 spiceterm.pod => src/spiceterm.pod | 0 translations.h => src/translations.h | 0 16 files changed, 58 insertions(+), 58 deletions(-) rename copyright => debian/copyright (100%) create mode 100644 src/Makefile rename auth-pve.c => src/auth-pve.c (100%) rename event_loop.c => src/event_loop.c (100%) rename event_loop.h => src/event_loop.h (100%) rename genfont.c => src/genfont.c (100%) rename genkeysym.pl => src/genkeysym.pl (100%) rename glyphs.h => src/glyphs.h (100%) rename input.c => src/input.c (100%) rename keysyms.h => src/keysyms.h (100%) rename screen.c => src/screen.c (100%) rename spiceterm.c => src/spiceterm.c (100%) rename spiceterm.h => src/spiceterm.h (100%) rename spiceterm.pod => src/spiceterm.pod (100%) rename translations.h => src/translations.h (100%) diff --git a/Makefile b/Makefile index 5d82f70..f1284d0 100644 --- a/Makefile +++ b/Makefile @@ -1,80 +1,33 @@ -RELEASE=5.0 +include /usr/share/dpkg/pkg-info.mk +include /usr/share/dpkg/architecture.mk PACKAGE=spiceterm -VERSION=3.0 -PACKAGERELEASE=5 -ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) GITVERSION:=$(shell cat .git/refs/heads/master) +BUILDDIR ?= ${PACKAGE}-${DEB_VERSION_UPSTREAM} -DEB=${PACKAGE}_${VERSION}-${PACKAGERELEASE}_${ARCH}.deb +export VERSION=$(DEB_VERSION_UPSTREAM) -PROGRAMS=spiceterm - -HEADERS=translations.h event_loop.h glyphs.h spiceterm.h keysyms.h -SOURCES=screen.c event_loop.c input.c spiceterm.c auth-pve.c - -PKGS := glib-2.0 spice-protocol spice-server -CFLAGS += `pkg-config --cflags $(PKGS)` -LIBS += `pkg-config --libs $(PKGS)` - -#export G_MESSAGES_DEBUG=all -#export SPICE_DEBUG=1 - -all: ${PROGRAMS} - -spiceterm: ${SOURCES} ${HEADERS} spiceterm.c - gcc -Werror -Wall -Wl,-z,relro -Wtype-limits ${SOURCES} -g -O2 $(CFLAGS) -o $@ -lutil $(LIBS) - -genfont: genfont.c - gcc -g -O2 -o $@ genfont.c -Wall -D_GNU_SOURCE -lz - -keysyms.h: genkeysym.pl - ./genkeysym.pl >$@ - -.PHONY: glyphs -glyphs: genfont - ./genfont > glyphs.h - -spiceterm.1: spiceterm.pod - rm -f $@ - pod2man -n $< -s 1 -r ${VERSION} <$< >$@ - -.PHONY: install -install: spiceterm spiceterm.1 - mkdir -p ${DESTDIR}/usr/share/doc/${PACKAGE} - install -m 0644 copyright ${DESTDIR}/usr/share/doc/${PACKAGE} - mkdir -p ${DESTDIR}/usr/share/man/man1 - install -m 0644 spiceterm.1 ${DESTDIR}/usr/share/man/man1 - mkdir -p ${DESTDIR}/usr/bin - install -s -m 0755 spiceterm ${DESTDIR}/usr/bin +DEB=${PACKAGE}_${DEB_VERSION_UPSTREAM_REVISION}_${DEB_BUILD_ARCH}.deb .PHONY: deb deb: ${DEB} ${DEB}: - make clean - rsync -a . --exclude build build - echo "git clone git://git.proxmox.com/git/spiceterm.git\\ngit checkout ${GITVERSION}" > build/debian/SOURCE - cd build; dpkg-buildpackage -rfakeroot -b -us -uc + 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: test -test: spiceterm - ./spiceterm --noauth --keymap de & remote-viewer spice://localhost?tls-port=5900 - #G_MESSAGES_DEBUG=all SPICE_DEBUG=1 SPICE_TICKET=test ./spiceterm & G_MESSAGES_DEBUG=all SPICE_DEBUG=1 remote-viewer --debug 'spice://localhost?tls-port=5900' --spice-ca-file /etc/pve/pve-root-ca.pem --spice-secure-channels=all - -.PHONY: distclean +.PHONY: distclean clean distclean: clean - -.PHONY: clean clean: - rm -rf *~ ${PROGRAMS} build *.deb *.changes genfont + rm -rf *~ $(BUILDDIR) *.deb *.changes genfont *.buildinfo diff --git a/copyright b/debian/copyright similarity index 100% rename from copyright rename to debian/copyright diff --git a/src/Makefile b/src/Makefile new file mode 100644 index 0000000..229866e --- /dev/null +++ b/src/Makefile @@ -0,0 +1,47 @@ +PROGRAMS=spiceterm + +HEADERS=translations.h event_loop.h glyphs.h spiceterm.h keysyms.h +SOURCES=screen.c event_loop.c input.c spiceterm.c auth-pve.c + +PKGS := glib-2.0 spice-protocol spice-server +CFLAGS += `pkg-config --cflags $(PKGS)` +LIBS += `pkg-config --libs $(PKGS)` + +#export G_MESSAGES_DEBUG=all +#export SPICE_DEBUG=1 + +all: ${PROGRAMS} + +spiceterm: ${SOURCES} ${HEADERS} spiceterm.c + gcc -Werror -Wall -Wl,-z,relro -Wtype-limits ${SOURCES} -g -O2 $(CFLAGS) -o $@ -lutil $(LIBS) + +genfont: genfont.c + gcc -g -O2 -o $@ genfont.c -Wall -D_GNU_SOURCE -lz + +keysyms.h: genkeysym.pl + ./genkeysym.pl >$@ + +.PHONY: glyphs +glyphs: genfont + ./genfont > glyphs.h + +spiceterm.1: spiceterm.pod + rm -f $@ + pod2man -n $< -s 1 -r ${VERSION} <$< >$@ + +.PHONY: install +install: spiceterm spiceterm.1 + mkdir -p ${DESTDIR}/usr/share/man/man1 + install -m 0644 spiceterm.1 ${DESTDIR}/usr/share/man/man1 + mkdir -p ${DESTDIR}/usr/bin + install -s -m 0755 spiceterm ${DESTDIR}/usr/bin + +.PHONY: test +test: spiceterm + ./spiceterm --noauth --keymap de & remote-viewer spice://localhost?tls-port=5900 + #G_MESSAGES_DEBUG=all SPICE_DEBUG=1 SPICE_TICKET=test ./spiceterm & G_MESSAGES_DEBUG=all SPICE_DEBUG=1 remote-viewer --debug 'spice://localhost?tls-port=5900' --spice-ca-file /etc/pve/pve-root-ca.pem --spice-secure-channels=all + +.PHONY: distclean clean +distclean: clean +clean: + rm -rf *~ *.deb genfont $(PROGRAMS) spiceterm.1 diff --git a/auth-pve.c b/src/auth-pve.c similarity index 100% rename from auth-pve.c rename to src/auth-pve.c diff --git a/event_loop.c b/src/event_loop.c similarity index 100% rename from event_loop.c rename to src/event_loop.c diff --git a/event_loop.h b/src/event_loop.h similarity index 100% rename from event_loop.h rename to src/event_loop.h diff --git a/genfont.c b/src/genfont.c similarity index 100% rename from genfont.c rename to src/genfont.c diff --git a/genkeysym.pl b/src/genkeysym.pl similarity index 100% rename from genkeysym.pl rename to src/genkeysym.pl diff --git a/glyphs.h b/src/glyphs.h similarity index 100% rename from glyphs.h rename to src/glyphs.h diff --git a/input.c b/src/input.c similarity index 100% rename from input.c rename to src/input.c diff --git a/keysyms.h b/src/keysyms.h similarity index 100% rename from keysyms.h rename to src/keysyms.h diff --git a/screen.c b/src/screen.c similarity index 100% rename from screen.c rename to src/screen.c diff --git a/spiceterm.c b/src/spiceterm.c similarity index 100% rename from spiceterm.c rename to src/spiceterm.c diff --git a/spiceterm.h b/src/spiceterm.h similarity index 100% rename from spiceterm.h rename to src/spiceterm.h diff --git a/spiceterm.pod b/src/spiceterm.pod similarity index 100% rename from spiceterm.pod rename to src/spiceterm.pod diff --git a/translations.h b/src/translations.h similarity index 100% rename from translations.h rename to src/translations.h -- 2.39.2