Source: libmtp
Version: 1.1.21-1
Severity: normal
Tags: patch
User: [email protected]
Usertags: dep17m2

Dear Maintainer,

your package installs files related to udev, 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
the udev files to udev.pc (using pkg-config). This should work today
in unstable and, if necessary, for bookworm. Once udev.pc in
unstable points to /usr/lib your package will benefit automatically
after a binNMU or any other upload.

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

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.

Thank you for considering,
Chris

[1] https://wiki.debian.org/UsrMerge
>From 586690248e1f3a9434ece63e9808082cb13cec9e Mon Sep 17 00:00:00 2001
From: Chris Hofstaedtler <[email protected]>
Date: Fri, 8 Dec 2023 23:32:07 +0100
Subject: [PATCH] Use udev.pc to determine correct udev install path

---
 debian/control                | 1 +
 debian/libmtp-common.install  | 4 ++--
 debian/libmtp-runtime.install | 2 +-
 debian/rules                  | 5 +++--
 4 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/debian/control b/debian/control
index c8a8663..65bf4ce 100644
--- a/debian/control
+++ b/debian/control
@@ -12,6 +12,7 @@ Build-Depends: autoconf,
                libgcrypt20-dev,
                libusb-1.0-0-dev,
                pkg-config,
+               systemd-dev,
                xsltproc
 Standards-Version: 4.6.2
 Vcs-Browser: https://salsa.debian.org/debian/libmtp
diff --git a/debian/libmtp-common.install b/debian/libmtp-common.install
index b86ff82..87e4e7f 100644
--- a/debian/libmtp-common.install
+++ b/debian/libmtp-common.install
@@ -1,3 +1,3 @@
-lib/udev/rules.d/*
+${env:deb_udevdir}/rules.d/*
 ../../debian/apport/* usr/share/apport/package-hooks
-lib/udev/hwdb.d/*
+${env:deb_udevdir}/hwdb.d/*
diff --git a/debian/libmtp-runtime.install b/debian/libmtp-runtime.install
index 3304986..8c4c7d6 100644
--- a/debian/libmtp-runtime.install
+++ b/debian/libmtp-runtime.install
@@ -1 +1 @@
-lib/udev/mtp-probe
+${env:deb_udevdir}/mtp-probe
diff --git a/debian/rules b/debian/rules
index 31be367..033b85f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,8 +13,9 @@ ifeq (,$(findstring libmtp-common, $(shell dh_listpackages)))
 DEB_CONFIGURE_EXTRA_FLAGS += --disable-configfiles
 endif
 
-# The default changed in libmtp 1.1.9 to /usr/lib/udev
-DEB_CONFIGURE_EXTRA_FLAGS += --with-udev=/lib/udev
+export deb_udevdir = $(shell pkg-config --variable=udevdir udev | sed s,^/,,)
+# The default changed in libmtp 1.1.9 to /usr/lib/udev. We defer to udev.pc.
+DEB_CONFIGURE_EXTRA_FLAGS += --with-udev=/$(deb_udevdir)
 
 DB2MAN = /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/manpages/docbook.xsl
 XP = xsltproc --nonet
-- 
2.39.2

Reply via email to