SHA256
1
0
forked from pool/syncthing

Accepting request 1144269 from home:dimstar:Factory

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
This commit is contained in:
Marius Kittler 2024-02-05 13:49:18 +00:00 committed by Git OBS Bridge
parent 82f229b7c1
commit 048cc5b655

View File

@ -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