]> git.pld-linux.org Git - packages/rclone.git/blobdiff - rclone.spec
generate and package bash/fish/zsh completions
[packages/rclone.git] / rclone.spec
index d648e253fba5cea9a8342a03ab09af12ab936252..f3175aaf11eb3793c6da2eec7fec89e8e463befa 100644 (file)
@@ -15,31 +15,69 @@ 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
 ExclusiveArch: %{ix86} %{x8664} %{arm} aarch64 mips64 mips64le ppc64 ppc64le s390x
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define                _debugsource_packages   0
+
 %description
 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}
 
 %{__mkdir_p} .go-cache
 
 %build
-GOCACHE="$(pwd)/.go-cache" go build -v -mod=vendor --ldflags "-s -X github.com/rclone/rclone/fs.Version=%{version}" -o bin/rclone
+GOCACHE="$(pwd)/.go-cache" go build -v -mod=vendor --ldflags "-X github.com/rclone/rclone/fs.Version=%{version}" -o bin/rclone
 
 %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
 
@@ -48,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.072165 seconds and 4 git commands to generate.