Source: haproxy
Version: 2.8.5-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 to delegate the exact placement of
these files to systemd.pc (using pkg-config). This immediately works
in unstable, placing the files into /usr/lib.
It also works for backports to older releases, where it will continue
install into /lib.
Note that the patch is based upon haproxy from experimental.

The patch inside the debdiff is probably suitable for upstream, if
you want to forward it.

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 haproxy-2.9.0/debian/changelog haproxy-2.9.0/debian/changelog
--- haproxy-2.9.0/debian/changelog	2023-12-09 15:33:05.000000000 +0100
+++ haproxy-2.9.0/debian/changelog	2023-12-10 20:15:00.000000000 +0100
@@ -1,3 +1,10 @@
+haproxy (2.9.0-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Use dh_installsystemd to install .service files
+
+ -- Chris Hofstaedtler <z...@debian.org>  Sun, 10 Dec 2023 20:15:00 +0100
+
 haproxy (2.9.0-1) experimental; urgency=medium
 
   * New upstream release.
diff -Nru haproxy-2.9.0/debian/control haproxy-2.9.0/debian/control
--- haproxy-2.9.0/debian/control	2023-12-09 15:33:05.000000000 +0100
+++ haproxy-2.9.0/debian/control	2023-12-10 20:15:00.000000000 +0100
@@ -14,7 +14,8 @@
                libjemalloc-dev,
                python3-sphinx,
                libopentracing-c-wrapper-dev,
-               pkg-config
+               pkg-config,
+               systemd-dev [linux-any]
 Build-Depends-Indep: python3, python3-mako
 Homepage: http://www.haproxy.org/
 Vcs-Git: https://salsa.debian.org/haproxy-team/haproxy.git
diff -Nru haproxy-2.9.0/debian/haproxy.install haproxy-2.9.0/debian/haproxy.install
--- haproxy-2.9.0/debian/haproxy.install	2023-12-09 15:33:05.000000000 +0100
+++ haproxy-2.9.0/debian/haproxy.install	2023-12-10 20:14:28.000000000 +0100
@@ -1,4 +1,3 @@
 debian/haproxy.cfg etc/haproxy
 examples/errorfiles/*.http etc/haproxy/errors
-admin/systemd/haproxy.service lib/systemd/system
 admin/halog/halog usr/bin
diff -Nru haproxy-2.9.0/debian/rules haproxy-2.9.0/debian/rules
--- haproxy-2.9.0/debian/rules	2023-12-09 15:33:05.000000000 +0100
+++ haproxy-2.9.0/debian/rules	2023-12-10 20:15:00.000000000 +0100
@@ -27,6 +27,7 @@
 
 ifeq ($(DEB_HOST_ARCH_OS),linux)
         MAKEARGS+= TARGET=linux-glibc USE_SYSTEMD=1
+        deb_systemdsystemunitdir=$(shell pkg-config --variable=systemdsystemunitdir systemd)
 else ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
         MAKEARGS+= TARGET=freebsd
 else
@@ -75,6 +76,9 @@
 	make $(MAKEARGS) install
 	install -m 0644 -D debian/rsyslog.conf debian/haproxy/etc/rsyslog.d/49-haproxy.conf
 	install -m 0644 -D debian/logrotate.conf debian/haproxy/etc/logrotate.d/haproxy
+ifneq ($(deb_systemdsystemunitdir),)
+	install -m 0644 -D admin/systemd/haproxy.service debian/haproxy$(deb_systemdsystemunitdir)/haproxy.service
+endif
 
 override_dh_auto_install-indep:
 

Reply via email to