From 91c828185bf9c7cc53ac4446f24bf49a9adf38c8 Mon Sep 17 00:00:00 2001 From: Chuck Short Date: Thu, 10 Mar 2022 14:10:00 +0000 Subject: [PATCH] debian: Simplifying mtce-compute packaging - Ensure that the service is started when the package is installed. - Ensure that the service dependencies are started when the package is installed. - Simplify debian/rules to use the Makefile in order to install the files that are needed. Test Plan PASS Build package and ISO PASS Boot and check for goenabled-compute.service Story: 2009101 Task: 43023 Signed-off-by: Chuck Short Change-Id: I5f931ff1318f32c6c74782cbda2a9517b9c4efe5 --- mtce-compute/debian/deb_folder/control | 3 +-- .../debian/deb_folder/mtce-compute.install | 1 + mtce-compute/debian/deb_folder/not-installed | 1 + mtce-compute/debian/deb_folder/rules | 18 +++++++++--------- .../deb_folder/systemd/00-mtce-compute.preset | 1 + 5 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 mtce-compute/debian/deb_folder/not-installed create mode 100644 mtce-compute/debian/deb_folder/systemd/00-mtce-compute.preset diff --git a/mtce-compute/debian/deb_folder/control b/mtce-compute/debian/deb_folder/control index 6f4611ed..35335a50 100644 --- a/mtce-compute/debian/deb_folder/control +++ b/mtce-compute/debian/deb_folder/control @@ -2,8 +2,7 @@ Source: mtce-compute Section: admin Priority: optional Maintainer: StarlingX Developers -Build-Depends: debhelper-compat (= 13), - libsystemd-dev +Build-Depends: debhelper-compat (= 13) Standards-Version: 4.5.1 Homepage: https://www.starlingx.io diff --git a/mtce-compute/debian/deb_folder/mtce-compute.install b/mtce-compute/debian/deb_folder/mtce-compute.install index d09c2006..df6481df 100644 --- a/mtce-compute/debian/deb_folder/mtce-compute.install +++ b/mtce-compute/debian/deb_folder/mtce-compute.install @@ -1,3 +1,4 @@ etc/goenabled.d/virt-support-goenabled.sh etc/init.d/goenabledWorker lib/systemd/system/goenabled-worker.service +debian/systemd/00-mtce-compute.preset etc/systemd/system-preset diff --git a/mtce-compute/debian/deb_folder/not-installed b/mtce-compute/debian/deb_folder/not-installed new file mode 100644 index 00000000..52d8d235 --- /dev/null +++ b/mtce-compute/debian/deb_folder/not-installed @@ -0,0 +1 @@ +usr/share/licenses/mtce-compute-1.0/LICENSE diff --git a/mtce-compute/debian/deb_folder/rules b/mtce-compute/debian/deb_folder/rules index b747e2ae..d12e3ce4 100644 --- a/mtce-compute/debian/deb_folder/rules +++ b/mtce-compute/debian/deb_folder/rules @@ -2,17 +2,17 @@ # export DH_VERBOSE = 1 export ROOT = debian/tmp -export GODIR = $(ROOT)/etc/goenabled.d -export INITDIR = $(ROOT)/etc/init.d -export SYSTEMDDIR = $(ROOT)/lib/systemd/system %: dh $@ override_dh_auto_install: - install -m 755 -d $(GODIR) - install -m 755 -p -D scripts/virt-support-goenabled.sh $(GODIR) - install -m 755 -d $(INITDIR) - install -m 755 -p -D scripts/goenabled $(INITDIR)/goenabledWorker - install -m 755 -d $(SYSTEMDDIR) - install -m 644 -p -D scripts/goenabled-worker.service $(SYSTEMDDIR) + $(MAKE) buildroot=$(ROOT) \ + _sysconfdir=/etc \ + _unitdir=/lib/systemd/system \ + _datarootdir=/usr/share \ + install + dh_install + +override_dh_installsystemd: + dh_installsystemd -pmtce-compute goenabled-worker.service diff --git a/mtce-compute/debian/deb_folder/systemd/00-mtce-compute.preset b/mtce-compute/debian/deb_folder/systemd/00-mtce-compute.preset new file mode 100644 index 00000000..97f63630 --- /dev/null +++ b/mtce-compute/debian/deb_folder/systemd/00-mtce-compute.preset @@ -0,0 +1 @@ +enable goenabled-worker.service