Source: dracut
Version: 1.4.3-2
Severity: normal
Tags: patch
User: helm...@debian.org
Usertags: dep17m2

Dear Maintainer,

your package installs systemd system units, currently into /lib.
These files need to be moved to /usr/lib as part of Debian's usr-merge
effort [1].

Attached you will find a patch to delegate the exact placement of
these files to systemd.pc (using pkg-config). This immediately works
in unstable, placing the files into /usr/lib.
It also works for backports to older releases, where it will continue
install into /lib.
Salsa merge request: https://salsa.debian.org/debian/dracut/-/merge_requests/32

The patch inside the debdiff is probably suitable for upstream, if
you want to forward it.

If during the trixie cycle your package will undergo structural
changes or any other file moves, please see the wiki and upload
to experimental first when these changes are done.

Later during the trixie cycle I expect this bug class to raise in
priority.

Thank you for considering,
Chris

[1] https://wiki.debian.org/UsrMerge


PS: it appears the git repository on salsa.d.o is missing a push
to the upstream branch and a few upstream/... tags.

>From 736b5c3cf3b768bb0f4b6cfbec2a9cd3b7e2a044 Mon Sep 17 00:00:00 2001
From: Chris Hofstaedtler <z...@debian.org>
Date: Sun, 10 Dec 2023 20:08:09 +0100
Subject: [PATCH] Set --systemdsystemunitdir from pkg-config

---
 debian/control             | 2 +-
 debian/dracut-core.install | 1 -
 debian/rules               | 8 +++++++-
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/debian/control b/debian/control
index 5d34b9f4..53e270e3 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: dracut
 Section: utils
 Priority: optional
 Maintainer: Thomas Lange <la...@debian.org>
-Build-Depends: debhelper-compat (= 12), debhelper, asciidoc-base, xsltproc, docbook-xsl, docbook-xml, quilt, libkmod-dev, pkg-config
+Build-Depends: debhelper-compat (= 12), debhelper, asciidoc-base, xsltproc, docbook-xsl, docbook-xml, quilt, libkmod-dev, pkg-config, systemd-dev
 Standards-Version: 4.6.2
 Vcs-Browser: https://salsa.debian.org/debian/dracut
 Vcs-Git: https://salsa.debian.org/debian/dracut.git
diff --git a/debian/dracut-core.install b/debian/dracut-core.install
index aa675bf3..cbb526a5 100644
--- a/debian/dracut-core.install
+++ b/debian/dracut-core.install
@@ -9,7 +9,6 @@ usr/lib/dracut/dracut-install
 usr/lib/dracut/dracut-util
 usr/lib/dracut/skipcpio
 usr/lib/dracut/dracut-logger.sh
-lib/systemd/system
 usr/share/bash-completion/completions
 usr/share/pkgconfig/dracut.pc
 usr/lib/dracut/dracut-version.sh
diff --git a/debian/rules b/debian/rules
index bce1c66c..b6f1f770 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,11 +9,13 @@ DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
 export DRACUT_MAIN_VERSION=$(DEB_VERSION_UPSTREAM_REVISION)
 export DRACUT_FULL_VERSION=$(DEB_VERSION)
 
+deb_systemdsystemunitdir = $(shell pkg-config --variable=systemdsystemunitdir systemd | sed s,^/,,)
+
 %:
 	dh $@
 
 override_dh_auto_configure:
-	dh_auto_configure -- --systemdsystemunitdir=/lib/systemd/system --libdir=/usr/lib
+	dh_auto_configure -- --systemdsystemunitdir=/$(deb_systemdsystemunitdir) --libdir=/usr/lib
 	$(SHELL) debian/fix-revdate
 	mv dracut-version.sh dracut-version.sh.orig
 	echo '#!/bin/sh' > dracut-version.sh
@@ -40,6 +42,10 @@ endif
 
 override_dh_auto_test:
 
+override_dh_install:
+	dh_install
+	dh_install -pdracut-core $(deb_systemdsystemunitdir)
+
 override_dh_clean:
 	if test -e dracut-version.sh.orig ; then \
 	   mv -f dracut-version.sh.orig dracut-version.sh ;\
-- 
2.39.2

Reply via email to