From 13937162e1dbfb34fd8d0d950702ef76021390b1 Mon Sep 17 00:00:00 2001 From: Helmut Buchsbaum Date: Mon, 31 Oct 2022 17:48:00 +0100 Subject: [PATCH] debian: Fix release package build Since acrn-tools are not built when creating a release build, there are no tool binaries to be installed. Generate the required debian/acrn-tools.install file on the fly whenever a debug build is requested. This keeps this file empty on a release build avoiding the resulting build errors about missing files. Additionally a package specific README.Debian file is added to explain this behavior. It will be installed according to Debian packaging guidelines at /usr/share/doc/acrn-tools/README.Debian. Tracked-On: #8257 Signed-off-by: Helmut Buchsbaum --- debian/acrn-tools.README.Debian | 7 +++++++ ...rn-tools.install => acrn-tools.install.debug} | 0 debian/rules | 16 ++++++++++++++++ 3 files changed, 23 insertions(+) create mode 100644 debian/acrn-tools.README.Debian rename debian/{acrn-tools.install => acrn-tools.install.debug} (100%) diff --git a/debian/acrn-tools.README.Debian b/debian/acrn-tools.README.Debian new file mode 100644 index 000000000..a012b6d46 --- /dev/null +++ b/debian/acrn-tools.README.Debian @@ -0,0 +1,7 @@ +acrn-tools for Debian +--------------------- + +Since acrn-tools cannot be provided for release builds, a virtually empty +acrn-tools package indicates a release build package. As a consequence, +the tools belonging to this package are only populated for debug builds. + diff --git a/debian/acrn-tools.install b/debian/acrn-tools.install.debug similarity index 100% rename from debian/acrn-tools.install rename to debian/acrn-tools.install.debug diff --git a/debian/rules b/debian/rules index fa1a384cf..c5062dfb4 100755 --- a/debian/rules +++ b/debian/rules @@ -146,6 +146,21 @@ else devnull = >/dev/null endif +### dh_installdeb ############################################################ + +# create acrntools.install for debug build +ifeq ($(RELEASE),n) + +debian/acrn-tools.install: debian/acrn-tools.install.debug + @$(call echo-verbose) + @$(call echo-silent,CREATE $@) + $(Q)cp $< $@ + +override_dh_install: debian/acrn-tools.install + $(Q)dh_install + +endif + ### dh_installdeb ############################################################ debian/acrn-hypervisor.postinst: debian/acrn-hypervisor.postinst.in @$(call echo-verbose) @@ -390,6 +405,7 @@ override_dh_auto_clean: $(Q)rm -f debian/acrn-hypervisor.postinst $(Q)rm -f debian/acrn-hypervisor.postrm $(Q)rm -f debian/acrn-hypervisor.prerm + $(Q)rm -f debian/acrn-tools.install $(Q)rm -f debian/acrn-hypervisor.templates $(Q)rm -rf debian/acrn-board-inspector/build $(Q)dh_auto_clean $(devnull)