Source: apcupsd
Version: 3.14.14-3.1
Severity: normal
Tags: patch moreinfo
User: helm...@debian.org
Usertags: dep17m2

Dear Maintainer,

your package installs various files directly into /. For the
ongoing Debian UsrMerge effort [1] these files should move to
/usr in the trixie cycle.

I'm attaching a patch to implement that.
**However:**

1. At the time of writing, moves are paused. Thus I've tagged
   this bug "moreinfo". Please see the wiki [1] if/when moves are
   resumed.

2. Please upload to experimental first. Then "dumat" gets a chance
   to check your new package (my patch), if it might cause
   unforeseen problems.

3. The patch might not work on unmerged systems. However since
   Debian bookworm, the "/usr-merged state" is the only supported
   state, and the usrmerge (| usr-is-merged) package is pseudo-
   essential.

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 apcupsd-3.14.14/debian/apcupsd.init apcupsd-3.14.14/debian/apcupsd.init
--- apcupsd-3.14.14/debian/apcupsd.init	2017-01-17 00:58:25.000000000 +0100
+++ apcupsd-3.14.14/debian/apcupsd.init	2023-12-10 14:44:58.000000000 +0100
@@ -16,11 +16,11 @@
 . /lib/lsb/init-functions
 
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
-DAEMON=/sbin/apcupsd
+DAEMON=/usr/sbin/apcupsd
 CONFIG=/etc/default/apcupsd
 NAME=apcupsd
 DESC="UPS power management"
-APCACCESS=/sbin/apcaccess
+APCACCESS=/usr/sbin/apcaccess
 
 test -x $DAEMON || exit 0
 test -e $CONFIG || exit 0
@@ -40,7 +40,7 @@
 	start)
 		echo -n "Starting $DESC: "
 
-		/lib/apcupsd/prestart
+		/usr/lib/apcupsd/prestart
 
 		if [ "`pidof apcupsd`" = "" ]
 		then
diff -Nru apcupsd-3.14.14/debian/apcupsd.install apcupsd-3.14.14/debian/apcupsd.install
--- apcupsd-3.14.14/debian/apcupsd.install	2018-03-25 20:14:07.000000000 +0200
+++ apcupsd-3.14.14/debian/apcupsd.install	2023-12-10 14:44:58.000000000 +0100
@@ -1,6 +1,5 @@
-debian/local/apcupsd_shutdown lib/systemd/system-shutdown
 debian/local/killpower etc/apcupsd
-debian/local/prestart lib/apcupsd
+debian/local/prestart usr/lib/apcupsd
 debian/local/ups-monitor etc/apcupsd
 etc/apcupsd/apccontrol
 etc/apcupsd/apcupsd.conf
@@ -11,5 +10,5 @@
 etc/apcupsd/multimon.conf
 etc/apcupsd/offbattery
 etc/apcupsd/onbattery
-sbin
+usr/sbin
 #usr/bin
diff -Nru apcupsd-3.14.14/debian/apcupsd.links apcupsd-3.14.14/debian/apcupsd.links
--- apcupsd-3.14.14/debian/apcupsd.links	2017-01-17 00:56:34.000000000 +0100
+++ apcupsd-3.14.14/debian/apcupsd.links	2023-12-10 14:41:43.000000000 +0100
@@ -1,2 +1 @@
-/dev/null /lib/systemd/system/ups-monitor.service
 /etc/apcupsd/ups-monitor /etc/init.d/ups-monitor
diff -Nru apcupsd-3.14.14/debian/apcupsd.service apcupsd-3.14.14/debian/apcupsd.service
--- apcupsd-3.14.14/debian/apcupsd.service	2017-10-04 19:00:03.000000000 +0200
+++ apcupsd-3.14.14/debian/apcupsd.service	2023-12-10 14:44:58.000000000 +0100
@@ -6,8 +6,8 @@
 Documentation=man:apcupsd(8)
 
 [Service]
-ExecStartPre=/lib/apcupsd/prestart
-ExecStart=/sbin/apcupsd
+ExecStartPre=/usr/lib/apcupsd/prestart
+ExecStart=/usr/sbin/apcupsd
 Type=forking
 KillMode=process
 PIDFile=/var/run/apcupsd.pid
diff -Nru apcupsd-3.14.14/debian/changelog apcupsd-3.14.14/debian/changelog
--- apcupsd-3.14.14/debian/changelog	2020-07-12 02:36:12.000000000 +0200
+++ apcupsd-3.14.14/debian/changelog	2023-12-10 14:44:58.000000000 +0100
@@ -1,3 +1,10 @@
+apcupsd (3.14.14-3.2) UNRELEASED; urgency=medium
+
+  * Target experimental.
+  * Move files into /usr. (Closes: #-1)
+
+ -- Chris Hofstaedtler <z...@debian.org>  Sun, 10 Dec 2023 14:44:58 +0100
+
 apcupsd (3.14.14-3.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru apcupsd-3.14.14/debian/control apcupsd-3.14.14/debian/control
--- apcupsd-3.14.14/debian/control	2020-07-12 02:31:45.000000000 +0200
+++ apcupsd-3.14.14/debian/control	2023-12-10 14:39:27.000000000 +0100
@@ -13,6 +13,7 @@
 	, pkg-config
 	, po-debconf
 	, python3-docutils
+	, systemd-dev
 	, tcpd
 	, texinfo
 # gconf shall disappear:	, libgtk2.0-dev
diff -Nru apcupsd-3.14.14/debian/rules apcupsd-3.14.14/debian/rules
--- apcupsd-3.14.14/debian/rules	2018-03-25 20:14:07.000000000 +0200
+++ apcupsd-3.14.14/debian/rules	2023-12-10 14:44:58.000000000 +0100
@@ -1,4 +1,6 @@
 #!/usr/bin/make -f
+export deb_systemdsystemunitdir = $(shell pkg-config --variable=systemdsystemunitdir systemd)
+export deb_systemdutildir = $(shell pkg-config --variable=systemdutildir systemd)
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 DPKG_EXPORT_BUILDFLAGS = 1
@@ -23,6 +25,8 @@
 		--enable-snmp \
 		--enable-test \
 		--sysconfdir=/etc/apcupsd \
+		--bindir=\$${prefix}/bin \
+		--sbindir=\$${prefix}/sbin \
 		--with-cgi-bin=\$${prefix}/lib/cgi-bin/apcupsd \
 		--with-pid-dir=/var/run \
 		--with-log-dir=/var/log \
@@ -41,6 +45,14 @@
 	dh_auto_build
 	make -C doc/manual manual.pdf
 
+override_dh_install:
+	dh_install
+	dh_install -papcupsd debian/local/apcupsd_shutdown $(deb_systemdutildir)/system-shutdown/
+
+override_dh_link:
+	dh_link
+	dh_link -papcupsd /dev/null $(deb_systemdsystemunitdir)/ups-monitor.service
+
 override_dh_installinit:
 	dh_installinit --no-restart-on-upgrade --init-script=apcupsd
 
@@ -54,5 +66,5 @@
 	dh_fixperms
 	chmod 0755 debian/apcupsd/etc/apcupsd/killpower
 	chmod 0755 debian/apcupsd/etc/apcupsd/ups-monitor
-	chmod 0755 debian/apcupsd/lib/apcupsd/prestart
-	chmod 0755 debian/apcupsd/lib/systemd/system-shutdown/apcupsd_shutdown
+	chmod 0755 debian/apcupsd/usr/lib/apcupsd/prestart
+	chmod 0755 debian/apcupsd/$(deb_systemdutildir)/system-shutdown/apcupsd_shutdown

Reply via email to