Source: asterisk
Version: 1:20.5.1~dfsg+~cs6.13.40431414-1
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 using systemd.pc to place these files
(using pkg-config).  This works for unstable today, and is safe to
do now.
It should also work for bookworm-backports, but I have not verified
that.

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
diff -Nru asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/asterisk.install asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/asterisk.install
--- asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/asterisk.install	2022-07-30 09:58:40.000000000 +0200
+++ asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/asterisk.install	2023-12-21 00:11:17.000000000 +0100
@@ -1,4 +1,4 @@
-lib/systemd/system/asterisk.service
+${env:deb_systemdsystemunitdir}/asterisk.service
 usr/bin/asterisk-config-custom
 usr/lib/${DEB_HOST_MULTIARCH}/libasterisk*
 usr/sbin
diff -Nru asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/changelog asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/changelog
--- asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/changelog	2023-12-19 17:38:11.000000000 +0100
+++ asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/changelog	2023-12-21 00:11:25.000000000 +0100
@@ -1,3 +1,10 @@
+asterisk (1:20.5.1~dfsg+~cs6.13.40431414-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Use systemd.pc to place systemd service unit. (Closes: #-1)
+
+ -- Chris Hofstaedtler <z...@debian.org>  Thu, 21 Dec 2023 00:11:25 +0100
+
 asterisk (1:20.5.1~dfsg+~cs6.13.40431414-1) unstable; urgency=high
 
   [ upstream ]
diff -Nru asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/control asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/control
--- asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/control	2023-12-19 17:38:11.000000000 +0100
+++ asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/control	2023-12-21 00:09:08.000000000 +0100
@@ -72,6 +72,7 @@
  libxslt1-dev,
  perl <!nodoc>,
  portaudio19-dev,
+ systemd-dev,
  unixodbc-dev,
  uuid-dev,
  zlib1g-dev,
diff -Nru asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/rules asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/rules
--- asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/rules	2023-12-19 17:38:11.000000000 +0100
+++ asterisk-20.5.1~dfsg+~cs6.13.40431414/debian/rules	2023-12-21 00:11:25.000000000 +0100
@@ -78,6 +78,8 @@
 # resolve if release is experimental
 EXP_RELEASE = $(filter experimental% UNRELEASED,$(DEB_DISTRIBUTION))
 
+export deb_systemdsystemunitdir = $(shell pkg-config --variable=systemdsystemunitdir systemd | sed s,^/,,)
+
 %:
 	dh $@
 
@@ -183,6 +185,9 @@
 	cp -a debian/asterisk-config-custom debian/tmp/usr/bin/
 	cp -a debian/asterisk-config-custom.1 debian/tmp/usr/share/man/man1/
 	cp -a debian/50-asterisk debian/tmp/usr/share/dahdi/span_config.d/
+	mkdir -p debian/tmp/$(deb_systemdsystemunitdir)
+	test "$(deb_systemdsystemunitdir)" != "lib/systemd/system" && mv debian/tmp/lib/systemd/system/* debian/tmp/$(deb_systemdsystemunitdir)/ || true
+	rmdir --ignore-fail-on-non-empty --parents debian/tmp/lib/systemd/system
 	$(RM) -f debian/tmp/usr/sbin/conf2ael
 	$(RM) -f debian/tmp/usr/sbin/muted
 	$(RM) -f debian/tmp/usr/sbin/streamplayer

Reply via email to