[packages/rclone] generate and package bash/fish/zsh completions
atler
atler at pld-linux.org
Thu Apr 15 17:28:13 CEST 2021
commit 1c00b327b6cce1e0cceced6dc85a346efc3c7e85
Author: Jan Palus <atler at pld-linux.org>
Date: Thu Apr 15 17:25:17 2021 +0200
generate and package bash/fish/zsh completions
rclone.spec | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 48 insertions(+), 1 deletion(-)
---
diff --git a/rclone.spec b/rclone.spec
index 9dccfd2..f3175aa 100644
--- a/rclone.spec
+++ b/rclone.spec
@@ -15,6 +15,7 @@ Source1: %{name}-vendor-%{version}.tar.xz
# Source1-md5: 9de5b2c00f12d4f082c0c24f7e3e01d4
URL: https://rclone.org/
BuildRequires: golang >= 1.14
+BuildRequires: rpm-build >= 4.6
BuildRequires: rpmbuild(macros) >= 2.005
BuildRequires: tar >= 1:1.22
BuildRequires: xz
@@ -27,6 +28,36 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
Rclone is a command line program to sync files and directories to and
from different cloud storage providers.
+%package -n bash-completion-rclone
+Summary: bash-completion for rclone
+Group: Applications/Shells
+Requires: %{name} = %{version}-%{release}
+Requires: bash-completion >= 2.0
+BuildArch: noarch
+
+%description -n bash-completion-rclone
+This package provides bash-completion for rclone.
+
+%package -n fish-completion-rclone
+Summary: Fish completion for rclone command
+Group: Applications/Shells
+Requires: %{name} = %{version}-%{release}
+Requires: fish
+BuildArch: noarch
+
+%description -n fish-completion-rclone
+Fish completion for rclone command.
+
+%package -n zsh-completion-rclone
+Summary: Zsh completion for rclone command
+Group: Applications/Shells
+Requires: %{name} = %{version}-%{release}
+Requires: zsh
+BuildArch: noarch
+
+%description -n zsh-completion-rclone
+Zsh completion for rclone command.
+
%prep
%setup -q -b1 -n %{name}-v%{version}
@@ -38,11 +69,15 @@ GOCACHE="$(pwd)/.go-cache" go build -v -mod=vendor --ldflags "-X github.com/rclo
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1}
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_mandir}/man1,%{bash_compdir},%{fish_compdir},%{zsh_compdir}}
cp -p bin/rclone $RPM_BUILD_ROOT%{_bindir}
cp -p rclone.1 $RPM_BUILD_ROOT%{_mandir}/man1
+$RPM_BUILD_ROOT%{_bindir}/rclone genautocomplete bash $RPM_BUILD_ROOT%{bash_compdir}/rclone
+$RPM_BUILD_ROOT%{_bindir}/rclone genautocomplete fish $RPM_BUILD_ROOT%{fish_compdir}/rclone.fish
+$RPM_BUILD_ROOT%{_bindir}/rclone genautocomplete zsh $RPM_BUILD_ROOT%{zsh_compdir}/_rclone
+
%clean
rm -rf $RPM_BUILD_ROOT
@@ -51,3 +86,15 @@ rm -rf $RPM_BUILD_ROOT
%doc CONTRIBUTING.md MAINTAINERS.md MANUAL.md README.md
%attr(755,root,root) %{_bindir}/rclone
%{_mandir}/man1/rclone.1*
+
+%files -n bash-completion-rclone
+%defattr(644,root,root,755)
+%{bash_compdir}/rclone
+
+%files -n fish-completion-%{name}
+%defattr(644,root,root,755)
+%{fish_compdir}/rclone.fish
+
+%files -n zsh-completion-%{name}
+%defattr(644,root,root,755)
+%{zsh_compdir}/_rclone
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/rclone.git/commitdiff/1c00b327b6cce1e0cceced6dc85a346efc3c7e85
More information about the pld-cvs-commit
mailing list