2015-05-09 12:55:05 +02:00
|
|
|
#
|
|
|
|
# spec file for package syncthing
|
|
|
|
#
|
2016-01-08 01:12:47 +01:00
|
|
|
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
2015-05-09 12:55:05 +02:00
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
Name: syncthing
|
2016-08-23 13:22:21 +02:00
|
|
|
Version: 0.14.5
|
2015-05-09 12:55:05 +02:00
|
|
|
Release: 0
|
2015-11-06 00:33:15 +01:00
|
|
|
Summary: FOSS Continuous File Synchronisation
|
2015-05-12 15:14:00 +02:00
|
|
|
License: MPL-2.0
|
2015-05-09 12:55:05 +02:00
|
|
|
Group: Productivity/Networking/File-Sharing
|
|
|
|
Url: https://syncthing.net/
|
2015-12-21 01:39:49 +01:00
|
|
|
Source: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-source-v%{version}.tar.gz
|
2016-05-26 19:24:10 +02:00
|
|
|
Source1: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-source-v%{version}.tar.gz.asc
|
|
|
|
Source2: %{name}.keyring
|
|
|
|
Source3: %{name}.firewall
|
2016-01-12 09:23:33 +01:00
|
|
|
BuildRequires: go >= 1.3
|
2015-05-09 12:55:05 +02:00
|
|
|
BuildRequires: systemd
|
|
|
|
BuildRequires: systemd-rpm-macros
|
|
|
|
|
|
|
|
%description
|
|
|
|
Syncthing replaces proprietary sync and cloud services with
|
2015-11-06 00:33:15 +01:00
|
|
|
something open, trustworthy and decentralised. Your data is your
|
2015-05-09 12:55:05 +02:00
|
|
|
data alone and you deserve to choose where it is stored, if it is
|
|
|
|
shared with some third party and how it's transmitted over the
|
|
|
|
Internet.
|
|
|
|
|
|
|
|
%prep
|
2015-12-21 09:14:22 +01:00
|
|
|
%setup -q -n %{name}
|
2016-05-26 19:24:10 +02:00
|
|
|
cp -f %{SOURCE3} %{name}.firewall
|
2016-06-28 18:14:07 +02:00
|
|
|
%if !(0%{?suse_version} > 1320 || 0%{?sle_version} >= 120200)
|
2016-08-23 13:22:21 +02:00
|
|
|
# Remove entries which only exist since systemd 215.
|
2015-08-15 22:57:55 +02:00
|
|
|
sed -i '/^RestartForceExitStatus=/d;s/^\(SuccessExitStatus=\).*$/\12/' \
|
|
|
|
etc/linux-systemd/system/syncthing@.service
|
|
|
|
%endif
|
2015-05-09 12:55:05 +02:00
|
|
|
|
|
|
|
%build
|
2016-05-18 00:15:21 +02:00
|
|
|
mkdir -p build/src/ build/vendor/
|
|
|
|
export GOPATH="$PWD/build:$PWD/build/vendor"
|
|
|
|
|
2016-01-12 09:23:33 +01:00
|
|
|
mkdir -p build/src/github.com/%{name}/%{name}
|
|
|
|
ls | sed '/^build$/d' | xargs cp -at build/src/github.com/%{name}/%{name}
|
2016-05-18 00:15:21 +02:00
|
|
|
cp -a vendor build/vendor/src
|
|
|
|
|
|
|
|
pushd build/src/github.com/%{name}/%{name}/
|
|
|
|
go run build.go install all \
|
|
|
|
-version v%{version} -no-upgrade
|
|
|
|
popd
|
2015-05-09 12:55:05 +02:00
|
|
|
|
|
|
|
%install
|
2016-05-18 00:15:21 +02:00
|
|
|
install -Dm 0755 build/src/github.com/%{name}/%{name}/bin/%{name} \
|
|
|
|
%{buildroot}%{_bindir}/%{name}
|
|
|
|
install -Dm 0644 etc/linux-systemd/system/%{name}@.service \
|
2015-05-09 12:55:05 +02:00
|
|
|
%{buildroot}%{_unitdir}/%{name}@.service
|
2016-05-18 00:15:21 +02:00
|
|
|
install -Dm 0644 etc/linux-systemd/system/%{name}-resume.service \
|
2016-03-06 13:35:31 +01:00
|
|
|
%{buildroot}%{_unitdir}/%{name}-resume.service
|
2016-06-28 18:14:07 +02:00
|
|
|
%if 0%{?suse_version} > 1320 || 0%{?sle_version} >= 120200
|
2016-05-18 00:15:21 +02:00
|
|
|
install -Dm 0644 etc/linux-systemd/user/%{name}.service \
|
2015-05-09 12:55:05 +02:00
|
|
|
%{buildroot}%{_userunitdir}/%{name}.service
|
2016-05-18 00:15:21 +02:00
|
|
|
%endif
|
2016-05-26 19:24:10 +02:00
|
|
|
install -Dm 0644 %{name}.firewall \
|
2016-05-18 00:15:21 +02:00
|
|
|
%{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}
|
2015-05-09 12:55:05 +02:00
|
|
|
|
|
|
|
%pre
|
2016-05-18 11:23:45 +02:00
|
|
|
%service_add_pre %{name}-resume.service
|
2015-05-09 12:55:05 +02:00
|
|
|
|
|
|
|
%post
|
2016-05-18 11:23:45 +02:00
|
|
|
%service_add_post %{name}-resume.service
|
2016-06-28 18:14:07 +02:00
|
|
|
%if 0%{?suse_version} > 1320 || 0%{?sle_version} >= 120200
|
2015-05-09 12:55:05 +02:00
|
|
|
%systemd_user_post %{name}.service
|
2015-05-18 10:03:46 +02:00
|
|
|
%endif
|
2015-05-09 12:55:05 +02:00
|
|
|
|
|
|
|
%preun
|
2016-03-06 13:35:31 +01:00
|
|
|
%service_del_preun %{name}@.service %{name}-resume.service
|
2016-06-28 18:14:07 +02:00
|
|
|
%if 0%{?suse_version} > 1320 || 0%{?sle_version} >= 120200
|
2015-05-09 12:55:05 +02:00
|
|
|
%systemd_user_preun %{name}.service
|
2015-05-18 10:03:46 +02:00
|
|
|
%endif
|
2015-05-09 12:55:05 +02:00
|
|
|
|
|
|
|
%postun
|
2016-05-18 11:23:45 +02:00
|
|
|
%service_del_postun %{name}-resume.service
|
2016-06-28 18:14:07 +02:00
|
|
|
%if 0%{?suse_version} > 1320 || 0%{?sle_version} >= 120200
|
2015-05-09 12:55:05 +02:00
|
|
|
%systemd_user_postun %{name}.service
|
2015-05-18 10:03:46 +02:00
|
|
|
%endif
|
2015-05-09 12:55:05 +02:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2015-08-02 11:46:57 +02:00
|
|
|
%doc AUTHORS CONDUCT.md CONTRIBUTING.md LICENSE README.md
|
2015-08-10 01:04:25 +02:00
|
|
|
%config %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/%{name}
|
2015-05-09 12:55:05 +02:00
|
|
|
%{_bindir}/%{name}
|
|
|
|
%{_unitdir}/%{name}@.service
|
2016-03-06 13:35:31 +01:00
|
|
|
%{_unitdir}/%{name}-resume.service
|
2016-06-28 18:14:07 +02:00
|
|
|
%if 0%{?suse_version} > 1320 || 0%{?sle_version} >= 120200
|
2015-05-09 12:55:05 +02:00
|
|
|
%{_userunitdir}/%{name}.service
|
2015-05-18 10:03:46 +02:00
|
|
|
%endif
|
2015-05-09 12:55:05 +02:00
|
|
|
|
|
|
|
%changelog
|