diff --git a/Modify-systemd-service-for-Fedora.patch b/Modify-systemd-service-for-Fedora.patch new file mode 100644 index 0000000..763a583 --- /dev/null +++ b/Modify-systemd-service-for-Fedora.patch @@ -0,0 +1,48 @@ +From 716ab555a99350e60a11066f912df65a0bb01c35 Mon Sep 17 00:00:00 2001 +From: Ondrej Holy +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 + diff --git a/wsdd.spec b/wsdd.spec index a1943ba..c6e8e28 100644 --- a/wsdd.spec +++ b/wsdd.spec @@ -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