2015-05-09 12:55:05 +02:00
|
|
|
#
|
|
|
|
# spec file for package syncthing
|
|
|
|
#
|
2018-01-03 13:43:32 +01:00
|
|
|
# Copyright (c) 2018 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
|
2018-02-23 23:23:20 +01:00
|
|
|
Version: 0.14.44
|
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
|
2018-01-16 12:56:39 +01:00
|
|
|
BuildRequires: go >= 1.8
|
2015-05-09 12:55:05 +02:00
|
|
|
BuildRequires: systemd
|
|
|
|
BuildRequires: systemd-rpm-macros
|
|
|
|
|
|
|
|
%description
|
2018-01-11 23:43:31 +01:00
|
|
|
Syncthing is an application that synchronizes files across multiple
|
|
|
|
devices. This means the creation, modification or deletion of files
|
|
|
|
on one machine will automatically be replicated to other devices.
|
2015-05-09 12:55:05 +02:00
|
|
|
|
|
|
|
%prep
|
2015-12-21 09:14:22 +01:00
|
|
|
%setup -q -n %{name}
|
2016-12-17 19:19:49 +01:00
|
|
|
|
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
|
2018-02-01 15:20:29 +01:00
|
|
|
export BUILD_HOST=openSUSE
|
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-09-11 03:20:53 +02:00
|
|
|
install -Dpm 0755 build/src/github.com/%{name}/%{name}/bin/%{name} \
|
2016-05-18 00:15:21 +02:00
|
|
|
%{buildroot}%{_bindir}/%{name}
|
2016-09-11 03:20:53 +02:00
|
|
|
install -Dpm 0644 etc/linux-systemd/system/%{name}@.service \
|
2015-05-09 12:55:05 +02:00
|
|
|
%{buildroot}%{_unitdir}/%{name}@.service
|
2016-09-11 03:20:53 +02:00
|
|
|
install -Dpm 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-09-11 03:20:53 +02:00
|
|
|
install -Dpm 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-09-11 03:20:53 +02:00
|
|
|
install -Dpm 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
|
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
|