Bug#1054477: autorandr: install autorandr.service twice once dh_installsystemd installs to /usr

2023-10-27 Thread Don Armstrong
On Fri, 27 Oct 2023, Helmut Grohne wrote:
> On Tue, Oct 24, 2023 at 10:08:00AM +0200, Helmut Grohne wrote:
> > We want to change dh_installsystemd such that it installs units below
> > /usr in order to finalize the /usr-merge transition via DEP17. When
> > doing so, autorandr happes to install the upstream unit (via
> > dh_auto_install) below /lib and debian/autorand.service (via
> > dh_installsystemd) below /usr/lib. Doing so is a policy violation and
> > this bug will become release critical once I upload debhelper. I'm
> > attaching a patch that disables the installation of the upstream unit.
> > Once you go back to the upstream unit, please leave SYSTEMD_UNIT_DIR
> > unset, because it'll then pick up the right value from pkgconfig and
> > dh_installsystemd now supports generating maintainer scripts from both
> > locations.
> 
> Jochen Sprickerhof made me aware that my original patch changes the udev
> rules file and breaking it in that way, because systemd is removed from
> TARGETS in Makefile. I'm attaching an updated patch to avoid this
> unintentional issue. Thanks for the attention to detail.

Thanks for all of the patches!

My current plan is to add the build-dependencies so the pkg-config bits
work correctly and then just remove the manual setting of the systemd
configuration line, so when you do the switch, the build will just
happen correctly. [The upstream systemd service is now in pretty good
shape, so there's no point in keeping the Debian specific version any
more.]

-- 
Don Armstrong  https://www.donarmstrong.com

I cannot find rest
Because I am powerless
To amend a broken world.
 -- Guy Gavriel Kay _Under Heaven_ p295



Bug#1054477: autorandr: install autorandr.service twice once dh_installsystemd installs to /usr

2023-10-27 Thread Helmut Grohne
Hi,

On Tue, Oct 24, 2023 at 10:08:00AM +0200, Helmut Grohne wrote:
> We want to change dh_installsystemd such that it installs units below
> /usr in order to finalize the /usr-merge transition via DEP17. When
> doing so, autorandr happes to install the upstream unit (via
> dh_auto_install) below /lib and debian/autorand.service (via
> dh_installsystemd) below /usr/lib. Doing so is a policy violation and
> this bug will become release critical once I upload debhelper. I'm
> attaching a patch that disables the installation of the upstream unit.
> Once you go back to the upstream unit, please leave SYSTEMD_UNIT_DIR
> unset, because it'll then pick up the right value from pkgconfig and
> dh_installsystemd now supports generating maintainer scripts from both
> locations.

Jochen Sprickerhof made me aware that my original patch changes the udev
rules file and breaking it in that way, because systemd is removed from
TARGETS in Makefile. I'm attaching an updated patch to avoid this
unintentional issue. Thanks for the attention to detail.

Helmut
diff --minimal -Nru autorandr-1.12.1/debian/changelog 
autorandr-1.12.1/debian/changelog
--- autorandr-1.12.1/debian/changelog   2022-10-15 11:53:17.0 +0200
+++ autorandr-1.12.1/debian/changelog   2023-10-27 15:56:09.0 +0200
@@ -1,3 +1,10 @@
+autorandr (1.12.1-1.2) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Install systemd unit only once. (Closes: #-1)
+
+ -- Helmut Grohne   Fri, 27 Oct 2023 15:56:09 +0200
+
 autorandr (1.12.1-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff --minimal -Nru autorandr-1.12.1/debian/rules autorandr-1.12.1/debian/rules
--- autorandr-1.12.1/debian/rules   2020-04-26 01:40:31.0 +0200
+++ autorandr-1.12.1/debian/rules   2023-10-27 15:56:09.0 +0200
@@ -5,15 +5,16 @@
 
 override_dh_auto_build:
dh_auto_build -- UDEV_RULES_DIR=/lib/udev/rules.d \
-   SYSTEMD_UNIT_DIR=/lib/systemd/system \
+   SYSTEMD_UNIT_DIR=/unused \
BASH_COMPLETIONS_DIR=/usr/share/bash-completion/completions \
PM_SLEEPHOOKS_DIR=/etc/pm/sleep.d/
 
 override_dh_auto_install:
dh_auto_install -- UDEV_RULES_DIR=/lib/udev/rules.d \
-   SYSTEMD_UNIT_DIR=/lib/systemd/system \
+   SYSTEMD_UNIT_DIR=/unused \
BASH_COMPLETIONS_DIR=/usr/share/bash-completion/completions \
PM_SLEEPHOOKS_DIR=/etc/pm/sleep.d/
+   $(RM) -R debian/autorandr/unused
install -D -m 755 contrib/pm-utils/40autorandr 
debian/autorandr/etc/pm/sleep.d/40autorandr
 
 # we do not supply an init script


Bug#1054477: autorandr: install autorandr.service twice once dh_installsystemd installs to /usr

2023-10-24 Thread Helmut Grohne
Source: autorandr
Version: 1.12.1-1.1
Severity: normal
Tags: patch
User: helm...@debian.org
Usertags: dep17m2

We want to change dh_installsystemd such that it installs units below
/usr in order to finalize the /usr-merge transition via DEP17. When
doing so, autorandr happes to install the upstream unit (via
dh_auto_install) below /lib and debian/autorand.service (via
dh_installsystemd) below /usr/lib. Doing so is a policy violation and
this bug will become release critical once I upload debhelper. I'm
attaching a patch that disables the installation of the upstream unit.
Once you go back to the upstream unit, please leave SYSTEMD_UNIT_DIR
unset, because it'll then pick up the right value from pkgconfig and
dh_installsystemd now supports generating maintainer scripts from both
locations.

Helmut
diff -Nru autorandr-1.12.1/debian/changelog autorandr-1.12.1/debian/changelog
--- autorandr-1.12.1/debian/changelog   2022-10-15 11:53:17.0 +0200
+++ autorandr-1.12.1/debian/changelog   2023-10-24 09:56:57.0 +0200
@@ -1,3 +1,10 @@
+autorandr (1.12.1-1.2) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Install systemd unit only once. (Closes: #-1)
+
+ -- Helmut Grohne   Tue, 24 Oct 2023 09:56:57 +0200
+
 autorandr (1.12.1-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru autorandr-1.12.1/debian/rules autorandr-1.12.1/debian/rules
--- autorandr-1.12.1/debian/rules   2020-04-26 01:40:31.0 +0200
+++ autorandr-1.12.1/debian/rules   2023-10-24 09:56:57.0 +0200
@@ -5,13 +5,13 @@
 
 override_dh_auto_build:
dh_auto_build -- UDEV_RULES_DIR=/lib/udev/rules.d \
-   SYSTEMD_UNIT_DIR=/lib/systemd/system \
+   SYSTEMD_UNIT_DIR= \
BASH_COMPLETIONS_DIR=/usr/share/bash-completion/completions \
PM_SLEEPHOOKS_DIR=/etc/pm/sleep.d/
 
 override_dh_auto_install:
dh_auto_install -- UDEV_RULES_DIR=/lib/udev/rules.d \
-   SYSTEMD_UNIT_DIR=/lib/systemd/system \
+   SYSTEMD_UNIT_DIR= \
BASH_COMPLETIONS_DIR=/usr/share/bash-completion/completions \
PM_SLEEPHOOKS_DIR=/etc/pm/sleep.d/
install -D -m 755 contrib/pm-utils/40autorandr 
debian/autorandr/etc/pm/sleep.d/40autorandr