SHA256
1
0
forked from pool/syncthing

Accepting request 679442 from home:bhwachter

- Package additional binaries
  * Add CLI (stcli) to main package
  * Add relay server (strelaysrv) to relaysrv subpackage

OBS-URL: https://build.opensuse.org/request/show/679442
OBS-URL: https://build.opensuse.org/package/show/network/syncthing?expand=0&rev=158
This commit is contained in:
Alexei Sorokin 2019-02-26 21:40:28 +00:00 committed by Git OBS Bridge
parent 6b91d08081
commit 5c69908f70
2 changed files with 48 additions and 0 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Tue Feb 26 11:11:02 UTC 2019 - Bernd Wachter <bernd-obs@wachter.fi>
- Package additional binaries
* Add CLI (stcli) to main package
* Add relay server (strelaysrv) to relaysrv subpackage
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Feb 19 10:45:23 UTC 2019 - Marius Kittler <marius.kittler@suse.com> Tue Feb 19 10:45:23 UTC 2019 - Marius Kittler <marius.kittler@suse.com>

View File

@ -36,6 +36,16 @@ Syncthing is an application that synchronises files across multiple
devices. This means the creation, modification or deletion of files devices. This means the creation, modification or deletion of files
on one machine will automatically be replicated to other devices. on one machine will automatically be replicated to other devices.
%package relaysrv
Summary: Relay server for syncthing
Group: Productivity/Networking/File-Sharing
Requires(pre): pwdutils
%description relaysrv
Syncthing requires relay servers for NAT traversal. This package
contains the necessary files for setting up a relay server, either
joined to the syncthing relay pool or private.
%prep %prep
%setup -q -n %{name} %setup -q -n %{name}
@ -58,6 +68,17 @@ popd
%install %install
install -Dpm 0755 build/src/github.com/%{name}/%{name}/bin/%{name} \ install -Dpm 0755 build/src/github.com/%{name}/%{name}/bin/%{name} \
%{buildroot}%{_bindir}/%{name} %{buildroot}%{_bindir}/%{name}
install -Dpm 0755 build/src/github.com/%{name}/%{name}/bin/stcli \
%{buildroot}%{_bindir}/stcli
install -Dpm 0755 build/src/github.com/%{name}/%{name}/bin/strelaysrv \
%{buildroot}%{_bindir}/strelaysrv
install -dm 0750 %{buildroot}/%{_localstatedir}/lib/strelaysrv
install -Dpm 0644 cmd/strelaysrv/etc/linux-systemd/strelaysrv.service \
%{buildroot}%{_unitdir}/strelaysrv.service
sed -i '/Service\]/a EnvironmentFile=-\/etc\/default/strelaysrv' \
%{buildroot}%{_unitdir}/strelaysrv.service
sed -i 's,^ExecStart=.*,ExecStart=/usr/bin/strelaysrv $OPTIONS,' \
%{buildroot}%{_unitdir}/strelaysrv.service
install -Dpm 0644 etc/linux-systemd/system/%{name}@.service \ install -Dpm 0644 etc/linux-systemd/system/%{name}@.service \
%{buildroot}%{_unitdir}/%{name}@.service %{buildroot}%{_unitdir}/%{name}@.service
install -Dpm 0644 etc/linux-systemd/system/%{name}-resume.service \ install -Dpm 0644 etc/linux-systemd/system/%{name}-resume.service \
@ -72,33 +93,53 @@ install -Dpm 0644 %{name}.firewall \
%pre %pre
%service_add_pre %{name}-resume.service %service_add_pre %{name}-resume.service
%pre relaysrv
%service_add_pre strelaysrv.service
/usr/sbin/groupadd -r strelaysrv &>/dev/null ||:
/usr/sbin/useradd -g strelaysrv -s /bin/false -r -c "User for syncthing relay server" -d /var/lib/strelaysrv strelaysrv &>/dev/null ||:
%post %post
%service_add_post %{name}-resume.service %service_add_post %{name}-resume.service
%if 0%{?suse_version} >= 1500 || 0%{?sle_version} > 120300 %if 0%{?suse_version} >= 1500 || 0%{?sle_version} > 120300
%systemd_user_post %{name}.service %systemd_user_post %{name}.service
%endif %endif
%post relaysrv
%service_add_post strelaysrv.service
%preun %preun
%service_del_preun %{name}@.service %{name}-resume.service %service_del_preun %{name}@.service %{name}-resume.service
%if 0%{?suse_version} >= 1500 || 0%{?sle_version} > 120300 %if 0%{?suse_version} >= 1500 || 0%{?sle_version} > 120300
%systemd_user_preun %{name}.service %systemd_user_preun %{name}.service
%endif %endif
%preun relaysrv
%service_del_preun strelaysrv.service
%postun %postun
%service_del_postun %{name}-resume.service %service_del_postun %{name}-resume.service
%if 0%{?suse_version} >= 1500 || 0%{?sle_version} > 120300 %if 0%{?suse_version} >= 1500 || 0%{?sle_version} > 120300
%systemd_user_postun %{name}.service %systemd_user_postun %{name}.service
%endif %endif
%postun relaysrv
%service_del_postun strelaysrv.service
%files %files
%license LICENSE %license LICENSE
%doc AUTHORS CONDUCT.md CONTRIBUTING.md README.md %doc AUTHORS CONDUCT.md CONTRIBUTING.md README.md
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name} %config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}
%{_bindir}/%{name} %{_bindir}/%{name}
%{_bindir}/stcli
%{_unitdir}/%{name}@.service %{_unitdir}/%{name}@.service
%{_unitdir}/%{name}-resume.service %{_unitdir}/%{name}-resume.service
%if 0%{?suse_version} >= 1500 || 0%{?sle_version} > 120300 %if 0%{?suse_version} >= 1500 || 0%{?sle_version} > 120300
%{_userunitdir}/%{name}.service %{_userunitdir}/%{name}.service
%endif %endif
%files relaysrv
%{_bindir}/strelaysrv
%{_unitdir}/strelaysrv.service
%dir %attr(750,strelaysrv,strelaysrv) %{_localstatedir}/lib/strelaysrv
%changelog %changelog