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