Source: openrazer
Version: 3.7.0+dfsg-1
Severity: normal
Tags: patch
User: helm...@debian.org
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 using udev.pc to place the udev files
(using pkg-config). This works today in unstable and also for
bookworm, and is safe to do now.
Once udev.pc in unstable points to /usr/lib, your package will
benefit automatically after a binNMU or any other upload.

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
diff -Nru openrazer-3.7.0+dfsg/debian/changelog openrazer-3.7.0+dfsg/debian/changelog
--- openrazer-3.7.0+dfsg/debian/changelog	2023-11-24 15:47:09.000000000 +0100
+++ openrazer-3.7.0+dfsg/debian/changelog	2023-12-16 23:55:45.000000000 +0100
@@ -1,3 +1,10 @@
+openrazer (3.7.0+dfsg-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Use udev.pc to place udev files. (Closes: #-1)
+
+ -- Chris Hofstaedtler <z...@debian.org>  Sat, 16 Dec 2023 23:55:45 +0100
+
 openrazer (3.7.0+dfsg-1) unstable; urgency=medium
 
   * New upstream version 3.7.0+dfsg
diff -Nru openrazer-3.7.0+dfsg/debian/control openrazer-3.7.0+dfsg/debian/control
--- openrazer-3.7.0+dfsg/debian/control	2023-11-24 15:47:09.000000000 +0100
+++ openrazer-3.7.0+dfsg/debian/control	2023-12-16 23:55:45.000000000 +0100
@@ -5,8 +5,10 @@
 Build-Depends: debhelper-compat (= 13),
                dh-python,
                dh-sequence-dkms,
+               pkgconf,
                python3,
-               python3-setuptools
+               python3-setuptools,
+               systemd-dev,
 Standards-Version: 4.6.2
 Vcs-Browser: https://salsa.debian.org/debian/openrazer
 Vcs-Git: https://salsa.debian.org/debian/openrazer.git
diff -Nru openrazer-3.7.0+dfsg/debian/openrazer-driver-dkms.install openrazer-3.7.0+dfsg/debian/openrazer-driver-dkms.install
--- openrazer-3.7.0+dfsg/debian/openrazer-driver-dkms.install	2023-11-24 15:47:09.000000000 +0100
+++ openrazer-3.7.0+dfsg/debian/openrazer-driver-dkms.install	2023-12-16 23:55:17.000000000 +0100
@@ -1,3 +1,3 @@
-lib/udev/
+${env:deb_udevdir}/
 usr/src/
 usr/share/metainfo/io.github.openrazer.openrazer.metainfo.xml
diff -Nru openrazer-3.7.0+dfsg/debian/patches/series openrazer-3.7.0+dfsg/debian/patches/series
--- openrazer-3.7.0+dfsg/debian/patches/series	2023-11-24 15:47:09.000000000 +0100
+++ openrazer-3.7.0+dfsg/debian/patches/series	2023-12-16 23:52:17.000000000 +0100
@@ -1 +1,2 @@
 skip-without-CONFIG_USB.patch
+udevdir.patch
diff -Nru openrazer-3.7.0+dfsg/debian/patches/udevdir.patch openrazer-3.7.0+dfsg/debian/patches/udevdir.patch
--- openrazer-3.7.0+dfsg/debian/patches/udevdir.patch	1970-01-01 01:00:00.000000000 +0100
+++ openrazer-3.7.0+dfsg/debian/patches/udevdir.patch	2023-12-16 23:55:29.000000000 +0100
@@ -0,0 +1,31 @@
+Align udev variable in Makefile with udev.pc, and how this is typically done
+using pkg-config.
+
+Probably suitable for upstream.
+
+Index: openrazer-3.7.0+dfsg/Makefile
+===================================================================
+--- openrazer-3.7.0+dfsg.orig/Makefile
++++ openrazer-3.7.0+dfsg/Makefile
+@@ -12,8 +12,8 @@
+ 
+ # PREFIX is used to prefix where the files will be installed under DESTDIR
+ PREFIX?=/usr
+-# UDEV_PREFIX is specifically a prefix for udev files
+-UDEV_PREFIX?=$(PREFIX)
++# UDEVDIR is specifically a prefix for udev files
++UDEVDIR?=$(shell pkg-config --variable=udevdir udev)
+ # DESTDIR is used to install into a different root directory
+ DESTDIR?=/
+ # Specify the kernel directory to use
+@@ -108,8 +108,8 @@ remove_dkms:
+ udev_install:
+ 	@echo -e "\n::\033[34m Installing OpenRazer udev rules\033[0m"
+ 	@echo "====================================================="
+-	install -m 644 -v -D install_files/udev/99-razer.rules $(DESTDIR)$(UDEV_PREFIX)/lib/udev/rules.d/99-razer.rules
+-	install -m 755 -v -D install_files/udev/razer_mount $(DESTDIR)$(UDEV_PREFIX)/lib/udev/razer_mount
++	install -m 644 -v -D install_files/udev/99-razer.rules $(DESTDIR)$(UDEVDIR)/rules.d/99-razer.rules
++	install -m 755 -v -D install_files/udev/razer_mount $(DESTDIR)$(UDEVDIR)/razer_mount
+ 
+ appstream_install:
+ 	@echo -e "\n::\033[34m Installing OpenRazer AppStream metadata\033[0m"
diff -Nru openrazer-3.7.0+dfsg/debian/rules openrazer-3.7.0+dfsg/debian/rules
--- openrazer-3.7.0+dfsg/debian/rules	2023-11-24 15:47:09.000000000 +0100
+++ openrazer-3.7.0+dfsg/debian/rules	2023-12-16 23:55:03.000000000 +0100
@@ -1,4 +1,5 @@
 #!/usr/bin/make -f
+export deb_udevdir = $(shell pkg-config --variable=udevdir udev | sed s,^/,,)
 
 %:
 	dh $@ --with python3
@@ -14,7 +15,7 @@
 override_dh_auto_install:
 	$(MAKE) ubuntu_install install-systemd \
 	     DESTDIR=$(CURDIR)/debian/tmp \
-	     UDEV_PREFIX="" \
+	     UDEVDIR=/$(deb_udevdir) \
 	     $(NULL)
 
 override_dh_dkms:

Reply via email to