From 915594195c5ce096a49dba13437e79340c3f37f3 Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Fri, 26 Apr 2024 10:10:03 -0700 Subject: [PATCH] LU-17774 build: pass systemdsystemunitdir to "make debs" This patch passes "--with-systemdsystemunitdir" configure option to the configure command performed in "make debs". It also updates debian/lustre-{client,server}-utils.install with the detected/specified directory for systemd service files. Test-Parameters: trivial clientdistro=ubuntu2204 Signed-off-by: Jian Yu Change-Id: I7c36904ea0ed0f393a76b0fb0ad444b330dfa78c Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54902 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Yang Sheng Reviewed-by: Andreas Dilger Reviewed-by: Aurelien Degremont Reviewed-by: Oleg Drokin --- autoMakefile.am | 1 + debian/rules | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/autoMakefile.am b/autoMakefile.am index 66064c3..62b6556 100644 --- a/autoMakefile.am +++ b/autoMakefile.am @@ -371,6 +371,7 @@ debs: undef.h debs_common fi; \ if test "x@systemdsystemunitdir@" != "x"; then \ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} systemd"; \ + export SYSTEMD_OPTIONS="--with-systemdsystemunitdir=@systemdsystemunitdir@"; \ fi; \ if test "x@ENABLE_PINGER@" = "xyes"; then \ export DEB_BUILD_PROFILES="$${DEB_BUILD_PROFILES} pinger"; \ diff --git a/debian/rules b/debian/rules index 4cbc3d3..366bdce 100755 --- a/debian/rules +++ b/debian/rules @@ -75,6 +75,10 @@ KSRC?=$(LINUX_OBJ) KSRC_TREE?=$(LINUX) EXTRA_OPTIONS?=$(IB_OPTIONS) +ifneq ($(SYSTEMD_OPTIONS),) + EXTRA_OPTIONS += $(SYSTEMD_OPTIONS) +endif + # Packages provided for both client and server builds IOKIT_PKG=lustre-iokit TESTS_PKG=lustre-tests @@ -164,8 +168,12 @@ configure-stamp: autogen-stamp debian/control.main debian/control.modules.in if echo "$${DEB_BUILD_PROFILES}" | grep -q "server"; then \ export EXTRAFLAGS="--enable-server"; \ if echo "$${DEB_BUILD_PROFILES}" | grep -q "systemd"; then \ - cp debian/lustre-server-utils.install.in \ - debian/lustre-server-utils.install; \ + systemd_dir=$$(echo $${SYSTEMD_OPTIONS} | \ + sed -e "s/--with-systemdsystemunitdir=\///g" \ + -e "s/\//\\\\\//g"); \ + sed "s/lib\/systemd\/system/$${systemd_dir}/g" \ + debian/lustre-server-utils.install.in \ + > debian/lustre-server-utils.install; \ else \ sed /systemd/d debian/lustre-server-utils.install.in \ > debian/lustre-server-utils.install; \ @@ -173,8 +181,12 @@ configure-stamp: autogen-stamp debian/control.main debian/control.modules.in else \ export EXTRAFLAGS="--disable-server"; \ if echo "$${DEB_BUILD_PROFILES}" | grep -q "systemd"; then \ - cp debian/lustre-client-utils.install.in \ - debian/lustre-client-utils.install; \ + systemd_dir=$$(echo $${SYSTEMD_OPTIONS} | \ + sed -e "s/--with-systemdsystemunitdir=\///g" \ + -e "s/\//\\\\\//g"); \ + sed "s/lib\/systemd\/system/$${systemd_dir}/g" \ + debian/lustre-client-utils.install.in \ + > debian/lustre-client-utils.install; \ else \ sed /systemd/d debian/lustre-client-utils.install.in \ > debian/lustre-client-utils.install; \ -- 1.8.3.1