Source: cubemap
Version: 1.4.3-2
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.

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 cubemap-1.4.3/debian/changelog cubemap-1.4.3/debian/changelog
--- cubemap-1.4.3/debian/changelog	2020-11-01 18:55:26.000000000 +0100
+++ cubemap-1.4.3/debian/changelog	2023-12-10 19:39:51.000000000 +0100
@@ -1,3 +1,11 @@
+cubemap (1.4.3-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Use systemd.pc to determine install location for systemd system unit files.
+    (Closes: #-1)
+
+ -- Chris Hofstaedtler <z...@debian.org>  Sun, 10 Dec 2023 19:39:51 +0100
+
 cubemap (1.4.3-2) unstable; urgency=medium
 
   * Remove myself from uploaders.
diff -Nru cubemap-1.4.3/debian/control cubemap-1.4.3/debian/control
--- cubemap-1.4.3/debian/control	2020-11-01 18:55:26.000000000 +0100
+++ cubemap-1.4.3/debian/control	2023-12-10 19:39:51.000000000 +0100
@@ -2,7 +2,7 @@
 Section: net
 Priority: optional
 Maintainer: Steinar H. Gunderson <se...@debian.org>
-Build-Depends: debhelper (>= 9.20160709), libprotobuf-dev, protobuf-compiler, dh-autoreconf, pkg-config, libsystemd-dev, libtomcrypt-dev
+Build-Depends: debhelper (>= 9.20160709), libprotobuf-dev, protobuf-compiler, dh-autoreconf, pkg-config, libsystemd-dev, libtomcrypt-dev, systemd-dev
 Standards-Version: 4.5.0
 Homepage: http://git.sesse.net/?p=cubemap
 
diff -Nru cubemap-1.4.3/debian/patches/1000-systemdsystemunitdir.patch cubemap-1.4.3/debian/patches/1000-systemdsystemunitdir.patch
--- cubemap-1.4.3/debian/patches/1000-systemdsystemunitdir.patch	1970-01-01 01:00:00.000000000 +0100
+++ cubemap-1.4.3/debian/patches/1000-systemdsystemunitdir.patch	2023-12-10 19:39:51.000000000 +0100
@@ -0,0 +1,43 @@
+Use systemd.pc to determine install location of systemd system unit files.
+
+Index: cubemap-1.4.3/Makefile.in
+===================================================================
+--- cubemap-1.4.3.orig/Makefile.in
++++ cubemap-1.4.3/Makefile.in
+@@ -7,6 +7,7 @@ CPPFLAGS += -Itlse -DWITH_KTLS -DNO_TLS_
+ CXXFLAGS=-Wall @CXXFLAGS@ @protobuf_CFLAGS@ @libsystemd_CFLAGS@ @libtomcrypt_CFLAGS@ -pthread
+ LDFLAGS=@LDFLAGS@ -pthread
+ LIBS=@LIBS@ @protobuf_LIBS@ @libsystemd_LIBS@ @libtomcrypt_LIBS@
++SYSTEMDSYSTEMUNITDIR=@SYSTEMDSYSTEMUNITDIR@
+ 
+ OBJS=main.o client.o server.o stream.o udpstream.o serverpool.o input.o input_stats.o httpinput.o udpinput.o parse.o config.o acceptor.o stats.o accesslog.o thread.o util.o log.o metacube2.o sa_compare.o timespec.o state.pb.o tlse/tlse.o
+ 
+@@ -41,14 +42,14 @@ install:
+ 		$(DESTDIR)$(LOCALSTATEDIR)/lib/cubemap \
+ 		$(DESTDIR)$(LOCALSTATEDIR)/log/cubemap \
+ 		$(DESTDIR)$(PREFIX)/share/munin/plugins \
+-		$(DESTDIR)/lib/systemd/system
++		$(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)
+ 	$(INSTALL) -m 755 -o root -g root cubemap $(DESTDIR)$(PREFIX)/bin/cubemap
+ 	$(INSTALL) -m 755 -o root -g root munin/cubemap munin/cubemap_input $(DESTDIR)$(PREFIX)/share/munin/plugins/
+ 	gzip -c cubemap.1 > $(DESTDIR)$(PREFIX)/share/man/man1/cubemap.1.gz
+ 	sed \
+ 		-e "s,@prefix[@],$(PREFIX),g" \
+ 		-e "s,@sysconfdir[@],$(SYSCONFDIR),g" \
+-		cubemap.service.in > $(DESTDIR)/lib/systemd/system/cubemap.service
++		cubemap.service.in > $(DESTDIR)$(SYSTEMDSYSTEMUNITDIR)/cubemap.service
+ 	# Make sure we don't overwrite an existing configuration.
+ 	test ! -f $(DESTDIR)$(SYSCONFDIR)/cubemap.config
+ 	sed \
+Index: cubemap-1.4.3/configure.ac
+===================================================================
+--- cubemap-1.4.3.orig/configure.ac
++++ cubemap-1.4.3/configure.ac
+@@ -9,6 +9,7 @@ PKG_PROG_PKG_CONFIG
+ PKG_CHECK_MODULES([libsystemd], [libsystemd])
+ PKG_CHECK_MODULES([protobuf], [protobuf])
+ PKG_CHECK_MODULES([libtomcrypt], [libtomcrypt])
++PKG_CHECK_VAR(SYSTEMDSYSTEMUNITDIR, systemd, systemdsystemunitdir)
+ 
+ CXXFLAGS="$CXXFLAGS -std=gnu++11"
+ 
diff -Nru cubemap-1.4.3/debian/patches/series cubemap-1.4.3/debian/patches/series
--- cubemap-1.4.3/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ cubemap-1.4.3/debian/patches/series	2023-12-10 19:35:42.000000000 +0100
@@ -0,0 +1 @@
+1000-systemdsystemunitdir.patch

Reply via email to