[Pkg-mpd-maintainers] Bug#1034236: mpd: dh_installsystemd doesn't handle files in /usr/lib/systemd/system

Andreas Henriksson andreas at fatal.se
Tue Apr 11 16:40:24 BST 2023


Hello Max Kellermann,

On Tue, Apr 11, 2023 at 04:13:28PM +0200, Max Kellermann wrote:
> On 2023/04/11 15:11, Andreas Henriksson <andreas at fatal.se> wrote:
> > The culprit seems to be that mpd falls back on hard-coded path (instead
> > of failing) when systemd.pc is not found!
> 
> What does this have to do with systemd.pc?  It isn't used anywhere.

Right, I overlooked this which is indeed a problem.

Currently there's only a meson_option.txt you can set which means:
1. implement `pkg-config --variable=systemdsystemunitdir systemd`
   in debian/rules and pass it in via the existing option.
2. implement checking systemdsystemunitdir from systemd.pc in meson
   and have the build system do the right thing without any options.

I think 2 is better myself and I'm attaching a proof of concept
debdiff to implement it. (You might want to make a cleaner version.)

Regards,
Andreas Henriksson
-------------- next part --------------
diff -Nru mpd-0.23.12/debian/changelog mpd-0.23.12/debian/changelog
--- mpd-0.23.12/debian/changelog	2023-01-21 21:32:37.000000000 +0100
+++ mpd-0.23.12/debian/changelog	2023-04-11 17:30:42.000000000 +0200
@@ -1,3 +1,11 @@
+mpd (0.23.12-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add debian/patches/systemdsystemunitdir.patch
+  * Add systemd build-dep for systemd.pc
+
+ -- Andreas Henriksson <andreas at fatal.se>  Tue, 11 Apr 2023 17:30:42 +0200
+
 mpd (0.23.12-1) unstable; urgency=medium
 
   * New upstream version 0.23.12
diff -Nru mpd-0.23.12/debian/control mpd-0.23.12/debian/control
--- mpd-0.23.12/debian/control	2023-01-21 21:32:37.000000000 +0100
+++ mpd-0.23.12/debian/control	2023-04-11 17:30:42.000000000 +0200
@@ -55,6 +55,7 @@
                libsoxr-dev,
                libsqlite3-dev,
                libsystemd-dev [linux-any],
+	       systemd [linux-any],
                libupnp-dev (>= 1.8~),
                liburing-dev [linux-any],
                libvorbis-dev [!armel],
diff -Nru mpd-0.23.12/debian/patches/series mpd-0.23.12/debian/patches/series
--- mpd-0.23.12/debian/patches/series	2021-11-11 15:58:40.000000000 +0100
+++ mpd-0.23.12/debian/patches/series	2023-04-11 17:25:58.000000000 +0200
@@ -1,3 +1,4 @@
 # Debian-specific
 systemd_honor_MPDCONF.patch
 mpd.service.documentation.user.patch
+systemdsystemunitdir.patch
diff -Nru mpd-0.23.12/debian/patches/systemdsystemunitdir.patch mpd-0.23.12/debian/patches/systemdsystemunitdir.patch
--- mpd-0.23.12/debian/patches/systemdsystemunitdir.patch	1970-01-01 01:00:00.000000000 +0100
+++ mpd-0.23.12/debian/patches/systemdsystemunitdir.patch	2023-04-11 17:30:33.000000000 +0200
@@ -0,0 +1,16 @@
+Index: mpd-0.23.12/systemd/system/meson.build
+===================================================================
+--- mpd-0.23.12.orig/systemd/system/meson.build
++++ mpd-0.23.12/systemd/system/meson.build
+@@ -1,5 +1,11 @@
+ systemd_system_unit_dir = get_option('systemd_system_unit_dir')
+ if systemd_system_unit_dir == ''
++  systemd = dependency('systemd', required: false)
++  if systemd.found()
++      systemd_system_unit_dir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
++  endif
++endif
++if systemd_system_unit_dir == ''
+   systemd_system_unit_dir = join_paths(get_option('prefix'), 'lib', 'systemd', 'system')
+ endif
+ 


More information about the Pkg-mpd-maintainers mailing list