Whamcloud - gitweb
LU-17774 build: pass systemdsystemunitdir to "make debs"
[fs/lustre-release.git] / debian / rules
index 4cbc3d3..366bdce 100755 (executable)
@@ -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; \