2018-01-10 14:45:34 +01:00
|
|
|
#
|
|
|
|
# spec file for package restic
|
|
|
|
#
|
|
|
|
# Copyright (c) 2018 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
2018-01-13 17:47:05 +01:00
|
|
|
# nodebuginfo
|
|
|
|
|
|
|
|
%define import_path github.com/restic/restic
|
2018-01-10 14:45:34 +01:00
|
|
|
|
|
|
|
Name: restic
|
|
|
|
Version: 0.8.1
|
|
|
|
Release: 0
|
|
|
|
License: BSD-2-Clause
|
|
|
|
Summary: Fast, secure, efficient backup program
|
2018-01-13 17:47:05 +01:00
|
|
|
Url: https://restic.net/
|
|
|
|
Group: Productivity/Archiving/Backup
|
2018-01-10 14:45:34 +01:00
|
|
|
Source0: https://github.com/restic/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz
|
|
|
|
Source1: https://github.com/restic/%{name}/releases/download/v%{version}/%{name}-%{version}.tar.gz.asc
|
|
|
|
Source2: %{name}.keyring
|
2018-01-13 17:47:05 +01:00
|
|
|
# PATCH-FIX-OPENSUSE: Revert to using pre-1.8 Go APIs so we can build on Leap 42.x.
|
|
|
|
Patch1: restic-switch-to-pre-1.8-sort.Stable-API.patch
|
|
|
|
BuildRequires: golang(API) >= 1.6
|
2018-01-10 14:45:34 +01:00
|
|
|
BuildRequires: golang-packaging
|
|
|
|
|
|
|
|
%description
|
|
|
|
restic is a backup program that is fast, efficient and secure.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
2018-01-13 17:47:05 +01:00
|
|
|
%patch1 -p1
|
2018-01-10 14:45:34 +01:00
|
|
|
|
|
|
|
%build
|
2018-01-13 17:47:05 +01:00
|
|
|
# Set up GOPATH.
|
|
|
|
export GOPATH="$GOPATH:$HOME/go"
|
|
|
|
mkdir -p $HOME/go/src/%{import_path}
|
|
|
|
cp -rT $PWD $HOME/go/src/%{import_path}
|
|
|
|
|
|
|
|
# Build restic. We don't use build.go because it builds statically and also has
|
|
|
|
# weird golang version requirements for no good reason.
|
|
|
|
go build -o %{name} -buildmode=pie \
|
|
|
|
-ldflags "-s -w -X main.version=%{version}" \
|
|
|
|
%{import_path}/cmd/restic
|
2018-01-10 14:45:34 +01:00
|
|
|
|
|
|
|
%install
|
2018-01-13 17:47:05 +01:00
|
|
|
install -D -m0755 %{name} %{buildroot}%{_bindir}/%{name}
|
|
|
|
install -d %{buildroot}%{_mandir}/man1
|
|
|
|
./%{name} generate --man %{buildroot}%{_mandir}/man1
|
2018-01-10 14:45:34 +01:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc *.md *.rst LICENSE
|
|
|
|
%doc doc/
|
|
|
|
%{_bindir}/restic
|
2018-01-13 17:47:05 +01:00
|
|
|
%{_mandir}/man1/restic*.1*
|