Use patch file instead of sed cmd for Fedora modifications

Resolves: RHEL-35671
This commit is contained in:
Ondrej Holy 2024-04-17 13:25:02 +02:00
parent 2214c30e4d
commit 5621de578a
2 changed files with 50 additions and 4 deletions

View File

@ -0,0 +1,48 @@
From 716ab555a99350e60a11066f912df65a0bb01c35 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Wed, 17 Apr 2024 12:50:08 +0200
Subject: [PATCH] Modify systemd service for Fedora
Those changes are needed to honor Fedora package guidelines and for
backward compatibility.
---
etc/systemd/wsdd.defaults | 2 +-
etc/systemd/wsdd.service | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/etc/systemd/wsdd.defaults b/etc/systemd/wsdd.defaults
index 3c8373e..518fe6f 100644
--- a/etc/systemd/wsdd.defaults
+++ b/etc/systemd/wsdd.defaults
@@ -2,4 +2,4 @@
# Use, e.g., "-i eth0" to restrict operations to a specific interface
# Refer to the wsdd(8) man page for details
-WSDD_PARAMS=""
+OPTIONS=""
diff --git a/etc/systemd/wsdd.service b/etc/systemd/wsdd.service
index eea4670..a6d20c6 100644
--- a/etc/systemd/wsdd.service
+++ b/etc/systemd/wsdd.service
@@ -7,15 +7,15 @@ Wants=network-online.target
; It makes sense to have Samba running when wsdd starts, but is not required.
; Thus, the next to lines are disabled and use BindsTo only.
; One may also add any of these services to After for stronger binding.
-;BindsTo=smb.service
+BindsTo=smb.service
;BindsTo=samba.service
[Service]
Type=simple
-EnvironmentFile=/etc/default/wsdd
+EnvironmentFile=-/etc/sysconfig/wsdd
; The service is put into an empty runtime directory chroot,
; i.e. the runtime directory which usually resides under /run
-ExecStart=/usr/bin/wsdd --shortlog --chroot=/run/wsdd $WSDD_PARAMS
+ExecStart=/usr/bin/wsdd --shortlog --chroot=/run/wsdd $OPTIONS
DynamicUser=yes
User=wsdd
Group=wsdd
--
2.44.0

View File

@ -11,6 +11,8 @@ Source2: wsdd-http.xml
# https://github.com/christgau/wsdd/issues/149
Patch: c4a5f346bbb22777a8f66b0d6c6ef899f6d6cc74.patch
Patch: Modify-systemd-service-for-Fedora.patch
BuildArch: noarch
BuildRequires: systemd
Requires(pre): shadow-utils
@ -24,10 +26,6 @@ like Windows.
%prep
%autosetup -p1
sed -i "s/;BindsTo=smb.service/BindsTo=smb.service/" etc/systemd/wsdd.service
sed -i "s/EnvironmentFile=.*/EnvironmentFile=-\/etc\/sysconfig\/wsdd/" etc/systemd/wsdd.service
sed -i "s/WSDD_PARAMS=/OPTIONS=/" etc/systemd/wsdd.defaults
sed -i "s/\$WSDD_PARAMS/\$OPTIONS/" etc/systemd/wsdd.service
%install