generate and package bash/fish/zsh completions auto/th/rclone-1.55.0-1
authorJan Palus <atler@pld-linux.org>
Thu, 15 Apr 2021 15:25:17 +0000 (17:25 +0200)
committerJan Palus <atler@pld-linux.org>
Thu, 15 Apr 2021 15:26:29 +0000 (17:26 +0200)
rclone.spec

index 9dccfd27e85c5492511460cb0f392a896a240bf9..f3175aaf11eb3793c6da2eec7fec89e8e463befa 100644 (file)
@@ -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
This page took 0.255383 seconds and 4 git commands to generate.