File project.diff of Package restic
--- restic.changes.orig
+++ restic.changes
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Thu Jun 21 21:00:07 UTC 2018 - mardnh@gmx.de
+
+- Add subpackages for command line completions for bash and
+ zsh shells
+
+-------------------------------------------------------------------
Thu Mar 1 01:11:07 UTC 2018 - asarai@suse.com
- Update to 0.8.3.
--- restic.spec.orig
+++ restic.spec
@@ -31,12 +31,33 @@ Source1: https://github.com/resti
Source2: %{name}.keyring
# 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: bash-completion
BuildRequires: golang-packaging
+BuildRequires: zsh
BuildRequires: golang(API) >= 1.6
+Recommends: %{name}-bash-completion
%description
restic is a backup program that is fast, efficient and secure.
+%package bash-completion
+Summary: Bash Completion for %{name}
+Group: System/Shells
+Requires: %{name} = %{version}
+BuildArch: noarch
+
+%description bash-completion
+Bash command line completion support for %{name}.
+
+%package zsh-completion
+Summary: Zsh Completion for %{name}
+Group: System/Shells
+Requires: %{name} = %{version}
+BuildArch: noarch
+
+%description zsh-completion
+Zsh command line completion support for %{name}.
+
%prep
%setup -q
%patch1 -p1
@@ -57,6 +78,8 @@ go build -o %{name} -buildmode=pie \
install -D -m0755 %{name} %{buildroot}%{_bindir}/%{name}
install -d %{buildroot}%{_mandir}/man1
./%{name} generate --man %{buildroot}%{_mandir}/man1
+install -Dm0644 doc/bash-completion.sh %{buildroot}%{_datadir}/bash-completion/completions/%{name}
+install -Dm0644 doc/zsh-completion.zsh %{buildroot}%{_sysconfdir}/zsh_completion.d/%{name}
%files
%defattr(-,root,root)
@@ -65,4 +88,10 @@ install -d %{buildroot}%{_mandir}/man1
%{_bindir}/restic
%{_mandir}/man1/restic*.1*
+%files bash-completion
+%{_datadir}/bash-completion/completions/%{name}
+
+%files zsh-completion
+%config %{_sysconfdir}/zsh_completion.d/%{name}
+
%changelog