From e239b00355bf2535fbb89754824becf5e78abfe3d38873f2e30e382fb2d69bc1 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 16 Jan 2024 13:31:12 +0000 Subject: [PATCH] Accepting request 1139158 from home:darix:branches:Base:System - Make provides versioned - Ensure that not both packages can be installed at the same time by adding a conflicts - Downgrade the recommends to suggests based on suggestion from dimstar - Make restart behavior an admin decision: - drop feature-suse-refuse-manual-start-stop.patch - introduce 2 new subpackages: dbus-broker-allow-restart dbus-broker-block-restart (default to reflect the old patch behavior) one of the 2 packages is required and leaves the admin the choice if they want to be able to restart dbus-broker without reboot or not. OBS-URL: https://build.opensuse.org/request/show/1139158 OBS-URL: https://build.opensuse.org/package/show/Base:System/dbus-broker?expand=0&rev=44 --- allow-restart.conf | 3 ++ block-restart.conf | 4 ++ dbus-broker.changes | 27 +++++++++++ dbus-broker.spec | 51 +++++++++++++++++++-- feature-suse-refuse-manual-start-stop.patch | 26 ----------- 5 files changed, 81 insertions(+), 30 deletions(-) create mode 100644 allow-restart.conf create mode 100644 block-restart.conf delete mode 100644 feature-suse-refuse-manual-start-stop.patch diff --git a/allow-restart.conf b/allow-restart.conf new file mode 100644 index 0000000..24c7ac4 --- /dev/null +++ b/allow-restart.conf @@ -0,0 +1,3 @@ +[Unit] +RefuseManualStart=false +RefuseManualStop=false diff --git a/block-restart.conf b/block-restart.conf new file mode 100644 index 0000000..82324b8 --- /dev/null +++ b/block-restart.conf @@ -0,0 +1,4 @@ +[Unit] +RefuseManualStart=true +RefuseManualStop=true + diff --git a/dbus-broker.changes b/dbus-broker.changes index 25847f3..6aadd11 100644 --- a/dbus-broker.changes +++ b/dbus-broker.changes @@ -1,3 +1,30 @@ +------------------------------------------------------------------- +Tue Jan 16 13:07:37 UTC 2024 - Marcus Rueckert + +- Make provides versioned +- Ensure that not both packages can be installed at the same time + by adding a conflicts + +------------------------------------------------------------------- +Tue Jan 16 13:06:24 UTC 2024 - Marcus Rueckert + +- Downgrade the recommends to suggests based on suggestion from + dimstar + +------------------------------------------------------------------- +Tue Jan 16 13:01:16 UTC 2024 - Marcus Rueckert + +- Make restart behavior an admin decision: + - drop feature-suse-refuse-manual-start-stop.patch + - introduce 2 new subpackages: + dbus-broker-allow-restart + dbus-broker-block-restart (default to reflect the old patch + behavior) + + one of the 2 packages is required and leaves the admin the + choice if they want to be able to restart dbus-broker without + reboot or not. + ------------------------------------------------------------------- Wed Dec 20 14:59:15 UTC 2023 - Jan Engelhardt diff --git a/dbus-broker.spec b/dbus-broker.spec index 6943278..086fe31 100644 --- a/dbus-broker.spec +++ b/dbus-broker.spec @@ -1,7 +1,7 @@ # # spec file for package dbus-broker # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,7 +25,8 @@ Group: System/Daemons URL: https://github.com/bus1/dbus-broker Source: https://github.com/bus1/dbus-broker/releases/download/v%version/dbus-broker-%version.tar.xz -Patch0: feature-suse-refuse-manual-start-stop.patch +Source1: allow-restart.conf +Source2: block-restart.conf BuildRequires: linux-glibc-devel >= 4.17 BuildRequires: meson BuildRequires: pkg-config @@ -48,6 +49,8 @@ Provides: bundled(c-rbtree) = 3+git34 Provides: bundled(c-shquote) = 1+ Provides: bundled(c-stdaux) = 1+ Provides: bundled(c-utf8) = 1+ +Requires: dbus-broker-restart-behavior = %{version} +Suggests: dbus-broker-block-restart = %{version} %{?systemd_ordering} %description @@ -64,6 +67,28 @@ from classic D-Bus: * Support for SASL pipelining * Runtime broker control +%package allow-restart +Summary: Restart behavior configuration for dbus-broker - Allow restarting +Provides: dbus-broker-restart-behavior = %{version}-%{release} +Conflicts: dbus-broker-restart-behavior +BuildArch: noarch + +%description allow-restart +This package configures how the service behave to the systemctl restart command. + +By installing this package dbus-broker will be allowed to restart + +%package block-restart +Summary: Restart behavior configuration for dbus-broker - Block restarting +Provides: dbus-broker-restart-behavior = %{version}-%{release} +Conflicts: dbus-broker-restart-behavior +BuildArch: noarch + +%description block-restart +This package configures how the service behave to the systemctl restart command. + +By installing this package dbus-broker will be blocked to restart + %prep %autosetup -p1 @@ -74,6 +99,10 @@ ln -s /bin/true rst2man %install %meson_install +for mode in allow block ; do +install -D -m 0644 ${RPM_SOURCE_DIR}/${mode}-restart.conf %{buildroot}%_unitdir/dbus-broker.service.d/${mode}-restart.conf +install -D -m 0644 ${RPM_SOURCE_DIR}/${mode}-restart.conf %{buildroot}%_userunitdir/dbus-broker.service.d/${mode}-restart.conf +done %pre %service_add_pre dbus-broker.service @@ -90,8 +119,22 @@ ln -s /bin/true rst2man %files %_bindir/dbus-broker* %_unitdir/*.service -%_prefix/lib/systemd/user/*.service -%_prefix/lib/systemd/catalog/ +%_userunitdir/*.service +%_journalcatalogdir/* %license LICENSE +%files allow-restart +%license LICENSE +%dir %_unitdir/dbus-broker.service.d/ +%dir %_userunitdir/dbus-broker.service.d/ +%_unitdir/dbus-broker.service.d/allow-restart.conf +%_userunitdir/dbus-broker.service.d/allow-restart.conf + +%files block-restart +%license LICENSE +%dir %_unitdir/dbus-broker.service.d/ +%dir %_userunitdir/dbus-broker.service.d/ +%_unitdir/dbus-broker.service.d/block-restart.conf +%_userunitdir/dbus-broker.service.d/block-restart.conf + %changelog diff --git a/feature-suse-refuse-manual-start-stop.patch b/feature-suse-refuse-manual-start-stop.patch deleted file mode 100644 index a6d87bc..0000000 --- a/feature-suse-refuse-manual-start-stop.patch +++ /dev/null @@ -1,26 +0,0 @@ -Index: dbus-broker-33/src/units/system/dbus-broker.service.in -=================================================================== ---- dbus-broker-33.orig/src/units/system/dbus-broker.service.in -+++ dbus-broker-33/src/units/system/dbus-broker.service.in -@@ -6,6 +6,8 @@ After=dbus.socket - Before=basic.target shutdown.target - Requires=dbus.socket - Conflicts=shutdown.target -+RefuseManualStart=true -+RefuseManualStop=true - - [Service] - Type=notify -Index: dbus-broker-33/src/units/user/dbus-broker.service.in -=================================================================== ---- dbus-broker-33.orig/src/units/user/dbus-broker.service.in -+++ dbus-broker-33/src/units/user/dbus-broker.service.in -@@ -6,6 +6,8 @@ After=dbus.socket - Before=basic.target shutdown.target - Requires=dbus.socket - Conflicts=shutdown.target -+RefuseManualStart=true -+RefuseManualStop=true - - [Service] - Type=notify