Skip to content

Commit

Permalink
Improve syncthing spec
Browse files Browse the repository at this point in the history
  • Loading branch information
andyone committed Dec 4, 2024
1 parent df2e001 commit 6bc3d77
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions specs/syncthing.spec
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,17 @@ Syncthing Discovery Server and Syncthing Relay Server.
%setup -qn %{name}

%build
go run build.go -no-upgrade -version=%{version} build syncthing
go run build.go -no-upgrade -version=%{version} build strelaysrv
go run build.go -no-upgrade -version=%{version} build stdiscosrv
go run build.go -no-upgrade -version=%{version} build strelaypoolsrv
go run build.go -no-upgrade -version=%{version} build stcrashreceiver
go run build.go -no-upgrade -version=v%{version} build syncthing
go run build.go -no-upgrade -version=v%{version} build strelaysrv
go run build.go -no-upgrade -version=v%{version} build stdiscosrv
go run build.go -no-upgrade -version=v%{version} build strelaypoolsrv
go run build.go -no-upgrade -version=v%{version} build stcrashreceiver

%install
rm -rf %{buildroot}

install -dm 755 %{buildroot}%{_bindir}
install -dm 755 %{buildroot}%{_sysctldir}
install -dm 755 %{buildroot}%{_unitdir}
install -dm 755 %{buildroot}%{_userunitdir}
install -dm 755 %{buildroot}%{_mandir}/man1
Expand All @@ -88,14 +89,30 @@ install -pm 644 man/*.1 %{buildroot}%{_mandir}/man1/
install -pm 644 man/*.5 %{buildroot}%{_mandir}/man5/
install -pm 644 man/*.7 %{buildroot}%{_mandir}/man7/

install -pm 644 etc/linux-sysctl/30-syncthing.conf %{buildroot}%{_sysctldir}/

%clean
rm -rf %{buildroot}

%post
%systemd_post '[email protected]'
%systemd_user_post syncthing.service
%sysctl_apply 30-syncthing.conf

%preun
%systemd_preun 'syncthing@*.service'
%systemd_user_preun syncthing.service

%postun
%systemd_postun_with_restart 'syncthing@*.service'
%systemd_user_postun_with_restart syncthing.service

################################################################################

%files
%defattr(-,root,root,-)
%doc AUTHORS LICENSE README.md
%config(noreplace) %{_sysctldir}/30-syncthing.conf
%{_bindir}/syncthing
%{_unitdir}/[email protected]
%{_userunitdir}/syncthing.service
Expand Down

0 comments on commit 6bc3d77

Please sign in to comment.