From 8752e5a3ecf44440e2516d1fb3485275a4ba5050 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 24 Sep 2019 18:08:48 +0200 Subject: [PATCH] move qmeventd to own directory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's really not nice if such many files, source code, meta-files, … linger around in the top level directory.. Also, cleanup the build a bit, i.e., use LDFLAGS as dpkg-buildpackage can set some LDFLAGS so it'd be nice if both CFLAFGS and LDFLAGS have the same (related) ones. Signed-off-by: Thomas Lamprecht --- Makefile | 18 ++--------- qmeventd/Makefile | 31 +++++++++++++++++++ qmeventd.c => qmeventd/qmeventd.c | 0 qmeventd.h => qmeventd/qmeventd.h | 0 qmeventd.service => qmeventd/qmeventd.service | 0 5 files changed, 34 insertions(+), 15 deletions(-) create mode 100644 qmeventd/Makefile rename qmeventd.c => qmeventd/qmeventd.c (100%) rename qmeventd.h => qmeventd/qmeventd.h (100%) rename qmeventd.service => qmeventd/qmeventd.service (100%) diff --git a/Makefile b/Makefile index 9bb92c7c..1a7d4049 100644 --- a/Makefile +++ b/Makefile @@ -3,17 +3,11 @@ include /usr/share/dpkg/architecture.mk PACKAGE=qemu-server -CFLAGS+=-O2 -Werror -Wall -Wextra -Wpedantic -Wtype-limits -Wl,-z,relro -std=gnu11 -JSON_CFLAGS=$(shell pkg-config --cflags json-c) -JSON_LIBS=$(shell pkg-config --libs json-c) - DESTDIR= PREFIX=/usr BINDIR=${PREFIX}/bin SBINDIR=${PREFIX}/sbin -BINDIR=${PREFIX}/bin LIBDIR=${PREFIX}/lib/${PACKAGE} -SERVICEDIR=/lib/systemd/system VARLIBDIR=/var/lib/${PACKAGE} MANDIR=${PREFIX}/share/man DOCDIR=${PREFIX}/share/doc @@ -42,9 +36,6 @@ all: dinstall: deb dpkg -i ${DEB} -qmeventd: qmeventd.c - $(CC) $(CFLAGS) ${JSON_CFLAGS} -o $@ $< ${JSON_LIBS} - qm.bash-completion: PVE_GENERATING_DOCS=1 perl -I. -T -e "use PVE::CLI::qm; PVE::CLI::qm->generate_bash_completions();" >$@.tmp mv $@.tmp $@ @@ -62,14 +53,13 @@ qmrestore.zsh-completion: mv $@.tmp $@ PKGSOURCES=qm qm.1 qmrestore qmrestore.1 qmextract qm.conf.5 qm.bash-completion qmrestore.bash-completion \ - qm.zsh-completion qmrestore.zsh-completion qmeventd qmeventd.8 + qm.zsh-completion qmrestore.zsh-completion .PHONY: install install: ${PKGSOURCES} install -d ${DESTDIR}/${SBINDIR} install -d ${DESTDIR}${LIBDIR} install -d ${DESTDIR}${VARLIBDIR} - install -d ${DESTDIR}${SERVICEDIR} install -d ${DESTDIR}/${MAN1DIR} install -d ${DESTDIR}/${MAN5DIR} install -d ${DESTDIR}/${MAN8DIR} @@ -84,17 +74,15 @@ install: ${PKGSOURCES} install -m 0644 -D qmrestore.zsh-completion ${DESTDIR}/${ZSHCOMPLDIR}/_qmrestore install -m 0644 -D bootsplash.jpg ${DESTDIR}/usr/share/${PACKAGE} $(MAKE) -C PVE install + $(MAKE) -C qmeventd install install -m 0755 qm ${DESTDIR}${SBINDIR} install -m 0755 qmrestore ${DESTDIR}${SBINDIR} - install -m 0755 qmeventd ${DESTDIR}${SBINDIR} - install -m 0644 qmeventd.service ${DESTDIR}${SERVICEDIR} install -m 0755 pve-bridge ${DESTDIR}${VARLIBDIR}/pve-bridge install -m 0755 pve-bridge-hotplug ${DESTDIR}${VARLIBDIR}/pve-bridge-hotplug install -m 0755 pve-bridgedown ${DESTDIR}${VARLIBDIR}/pve-bridgedown install -D -m 0644 modules-load.conf ${DESTDIR}/etc/modules-load.d/qemu-server.conf install -m 0755 qmextract ${DESTDIR}${LIBDIR} install -m 0644 qm.1 ${DESTDIR}/${MAN1DIR} - install -m 0644 qmeventd.8 ${DESTDIR}/${MAN8DIR} install -m 0644 qmrestore.1 ${DESTDIR}/${MAN1DIR} install -m 0644 qm.conf.5 ${DESTDIR}/${MAN5DIR} cd ${DESTDIR}/${MAN5DIR}; ln -s -f qm.conf.5.gz vm.conf.5.gz @@ -121,7 +109,7 @@ upload: ${DEB} .PHONY: clean clean: $(MAKE) cleanup-docgen - rm -rf build *.deb *.buildinfo *.changes qmeventd + rm -rf build *.deb *.buildinfo *.changes find . -name '*~' -exec rm {} ';' diff --git a/qmeventd/Makefile b/qmeventd/Makefile new file mode 100644 index 00000000..28b76f1c --- /dev/null +++ b/qmeventd/Makefile @@ -0,0 +1,31 @@ +DESTDIR= +PREFIX=/usr +SBINDIR=${PREFIX}/sbin +SERVICEDIR=/lib/systemd/system +MANDIR=${PREFIX}/share/man + +export NOVIEW=1 +include /usr/share/pve-doc-generator/pve-doc-generator.mk + +CC ?= gcc +CFLAGS += -O2 -Werror -Wall -Wextra -Wpedantic -Wtype-limits -Wl,-z,relro -std=gnu11 +CFLAGS += $(shell pkg-config --cflags json-c) +LDFLAGS += $(shell pkg-config --libs json-c) + +qmeventd: qmeventd.c + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< + +docs: qmeventd.8 + +.PHONY: install +install: qmeventd docs + install -d ${DESTDIR}/${SBINDIR} + install -d ${DESTDIR}${SERVICEDIR} + install -m 0644 qmeventd.service ${DESTDIR}${SERVICEDIR} + install -m 0755 qmeventd ${DESTDIR}${SBINDIR} + install -m 0644 qmeventd.8 ${DESTDIR}/${MANDIR}/man8 + +.PHONY: clean +clean: + $(MAKE) cleanup-docgen + rm -rf qmeventd diff --git a/qmeventd.c b/qmeventd/qmeventd.c similarity index 100% rename from qmeventd.c rename to qmeventd/qmeventd.c diff --git a/qmeventd.h b/qmeventd/qmeventd.h similarity index 100% rename from qmeventd.h rename to qmeventd/qmeventd.h diff --git a/qmeventd.service b/qmeventd/qmeventd.service similarity index 100% rename from qmeventd.service rename to qmeventd/qmeventd.service