On Tue, Apr 11, 2023 at 09:37:27AM +0200, bi...@debian.org wrote:
> Package: cloudflare-ddns
> Version: 2.0.0-3       
> Severity: serious
> Tags: sid bookworm
> User: debhel...@packages.debian.org
> Usertags: systemd-files-in-usr-bookworm
> 
> Dear Maintainer,
> 
> It seems that your package cloudflare-ddns is shipping files (.service, 
> .socket or
> .timer) in /usr/lib/systemd/system.
[...]

The culprit seems to be hard-coded paths in the upstream build system
at:
https://sources.debian.org/src/cloudflare-ddns/2.0.0-3/exe/meson.build/#L70

Since I wasn't sure about how configure_file directive in meson works
and the documentation at
https://mesonbuild.com/Reference-manual_functions.html#configure_file
says install_dir takes a subdirectory I had to try it out.

The attached debdiff should solve the problem.

While at it I also adressed the hardcoded sysuser directory at:
https://sources.debian.org/src/cloudflare-ddns/2.0.0-3/exe/meson.build/#L90

See attached file which you might want to improve (for example you could
make systemd a build-option even on linux if you care).

Regards,
Andreas Henriksson

diff -Nru cloudflare-ddns-2.0.0/debian/changelog 
cloudflare-ddns-2.0.0/debian/changelog
--- cloudflare-ddns-2.0.0/debian/changelog      2023-01-16 22:16:37.000000000 
+0100
+++ cloudflare-ddns-2.0.0/debian/changelog      2023-04-11 16:17:38.000000000 
+0200
@@ -1,3 +1,12 @@
+cloudflare-ddns (2.0.0-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * add debian/patches/systemdsystemunitdir.patch
+  * debian/cloudflare-ddns.install: install lib/systemd/system
+  * Add systemd build-dep, for systemd.pc
+
+ -- Andreas Henriksson <andr...@fatal.se>  Tue, 11 Apr 2023 16:17:38 +0200
+
 cloudflare-ddns (2.0.0-3) unstable; urgency=medium
 
   * d/.install: fix build on non-Linux with dh-exec
diff -Nru cloudflare-ddns-2.0.0/debian/cloudflare-ddns.install 
cloudflare-ddns-2.0.0/debian/cloudflare-ddns.install
--- cloudflare-ddns-2.0.0/debian/cloudflare-ddns.install        2023-01-16 
22:10:06.000000000 +0100
+++ cloudflare-ddns-2.0.0/debian/cloudflare-ddns.install        2023-04-11 
16:17:38.000000000 +0200
@@ -1,5 +1,5 @@
 #!/usr/bin/dh-exec
-[linux-any] usr/lib/systemd/
+[linux-any] lib/systemd/system
 [linux-any] usr/lib/sysusers.d/
 etc/
 usr/bin/
diff -Nru cloudflare-ddns-2.0.0/debian/control 
cloudflare-ddns-2.0.0/debian/control
--- cloudflare-ddns-2.0.0/debian/control        2023-01-16 22:10:06.000000000 
+0100
+++ cloudflare-ddns-2.0.0/debian/control        2023-04-11 16:17:38.000000000 
+0200
@@ -11,6 +11,7 @@
                     libsimdjson-dev (>= 0.9.0),
                     meson (>= 0.53.0),
                     pkg-config,
+                   systemd,
                     ronn
 Standards-Version: 4.6.2
 Homepage: https://github.com/Tachi107/cloudflare-ddns
diff -Nru cloudflare-ddns-2.0.0/debian/patches/series 
cloudflare-ddns-2.0.0/debian/patches/series
--- cloudflare-ddns-2.0.0/debian/patches/series 1970-01-01 01:00:00.000000000 
+0100
+++ cloudflare-ddns-2.0.0/debian/patches/series 2023-04-11 16:13:19.000000000 
+0200
@@ -0,0 +1 @@
+systemdsystemunitdir.patch
diff -Nru cloudflare-ddns-2.0.0/debian/patches/systemdsystemunitdir.patch 
cloudflare-ddns-2.0.0/debian/patches/systemdsystemunitdir.patch
--- cloudflare-ddns-2.0.0/debian/patches/systemdsystemunitdir.patch     
1970-01-01 01:00:00.000000000 +0100
+++ cloudflare-ddns-2.0.0/debian/patches/systemdsystemunitdir.patch     
2023-04-11 16:17:38.000000000 +0200
@@ -0,0 +1,37 @@
+Index: cloudflare-ddns-2.0.0/exe/meson.build
+===================================================================
+--- cloudflare-ddns-2.0.0.orig/exe/meson.build
++++ cloudflare-ddns-2.0.0/exe/meson.build
+@@ -66,8 +66,10 @@ if ronn.found()
+       )
+ endif
+ 
+-if host_machine.system() == 'linux'
+-      systemddir = 'lib'/'systemd'/'system'
++systemd = dependency('systemd', required: host_machine.system() == 'linux')
++if systemd.found()
++      systemdsystemunitdir = 
systemd.get_pkgconfig_variable('systemdsystemunitdir')
++        systemdsysusersdir = systemd.get_pkgconfig_variable('sysusersdir')
+ 
+       configure_file(
+               input: 'systemd'/'cloudflare-ddns.service.in',
+@@ -77,16 +79,16 @@ if host_machine.system() == 'linux'
+                       'libdir': get_option('prefix')/get_option('libdir')
+               },
+               install: true,
+-              install_dir: systemddir
++              install_dir: systemdsystemunitdir
+       )
+ 
+       install_data(
+               'systemd'/'cloudflare-ddns.timer',
+-              install_dir: systemddir
++              install_dir: systemdsystemunitdir
+       )
+ 
+       install_data(
+               'sysusers.d'/'cloudflare-ddns.conf',
+-              install_dir: 'lib'/'sysusers.d'
++              install_dir: systemdsysusersdir
+       )
+ endif

Reply via email to