From 048cc5b655b75db0392121ac93a355f78c0b72838de0f0f124202d97cb40e611 Mon Sep 17 00:00:00 2001 From: Marius Kittler Date: Mon, 5 Feb 2024 13:49:18 +0000 Subject: [PATCH] Accepting request 1144269 from home:dimstar:Factory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes the build when referencing the pre script. the build changed directory to a parent, which is pere the sysusers_generate was then started from later, %pre -f … did not match the expected path. Fixed that by changing back to the expected directorty prior to calling sysusers_generate OBS-URL: https://build.opensuse.org/request/show/1144269 OBS-URL: https://build.opensuse.org/package/show/network/syncthing?expand=0&rev=292 --- syncthing.spec | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/syncthing.spec b/syncthing.spec index 934586c..e9fbe95 100644 --- a/syncthing.spec +++ b/syncthing.spec @@ -55,14 +55,11 @@ contains the necessary files for setting up a relay server, either joined to the syncthing relay pool or private. %prep -%setup -q -n %{name} -%patch0 -p1 -%patch1 -p1 -%patch2 -p1 +%autosetup -n %{name} -p1 %build # move source archive which is extracted as "syncthing" to be "src/github.com/syncthing/syncthing" -cd .. +pushd .. install -d "src/github.com/syncthing/" mv %{name} "src/github.com/syncthing/"%{name} mkdir syncthing @@ -77,8 +74,9 @@ export GOFLAGS="-trimpath -mod=vendor" go run build.go -no-upgrade -version v%{version} install # build and install strelaysrv without automatic updates go run build.go -no-upgrade -version v%{version} install strelaysrv +popd -%sysusers_generate_pre %{name}-strelaysrv-user.conf %{name}-strelaysrv %{name}-strelaysrv-user.conf +%sysusers_generate_pre %{SOURCE3} %{name}-strelaysrv %{name}-strelaysrv-user.conf %install st_dir=$PWD @@ -116,7 +114,7 @@ install -D -m 0644 %{SOURCE3} %{buildroot}%{_sysusersdir}/%{name}-relaysrv.conf %pre %service_add_pre %{name}-resume.service -%pre relaysrv +%pre relaysrv -f %{name}-strelaysrv.pre %service_add_pre strelaysrv.service %post