From: Ben Walton Date: Sat, 20 Mar 2010 18:18:06 GMT Subject: [PATCH] Add a git-completion rpm subpackage to the spec Message-ID: <1269109086-8887-1-git-send-email-bwalton@artsci.utoronto.ca> In-Reply-To: <1269045134-28072-1-git-send-email-icomfort@stanford.edu> Make the rpm spec file create a git-completion subpackage that contains the bash completion support from the contrib/ directory. Signed-off-by: Ben Walton --- This is the alternate method for shipping the bash completion support. I think I personally prefer this method, but I'd be happy to see either solution ship as part of the .spec file so that I don't need to continue handling it separately. git.spec.in | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/git.spec.in b/git.spec.in index ee74a5e..d59747a 100644 --- a/git.spec.in +++ b/git.spec.in @@ -80,6 +80,13 @@ Requires: git = %{version}-%{release}, tk >= 8.4 %description gui Git GUI tool +%package completion +Summary: Bash completion support for Git +Group: Development/Tools +Requires: git = %{version}-${release}, bash +%description completion +Bash completion support for Git + %package -n gitk Summary: Git revision tree visualiser ('gitk') Group: Development/Tools @@ -113,6 +120,8 @@ rm -rf $RPM_BUILD_ROOT make %{_smp_mflags} CFLAGS="$RPM_OPT_FLAGS" DESTDIR=$RPM_BUILD_ROOT \ %{path_settings} \ INSTALLDIRS=vendor install %{!?_without_docs: install-doc} +mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/bash_completion.d +install -m 644 -T contrib/completion/git-completion.bash $RPM_BUILD_ROOT/%{_sysconfdir}/bash_completion.d/git test ! -d $RPM_BUILD_ROOT%{python_sitelib} || rm -fr $RPM_BUILD_ROOT%{python_sitelib} find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';' find $RPM_BUILD_ROOT -type f -name '*.bs' -empty -exec rm -f {} ';' @@ -177,6 +186,10 @@ rm -rf $RPM_BUILD_ROOT %{!?_without_docs: %{_mandir}/man1/git-citool.1*} %{!?_without_docs: %doc Documentation/git-citool.html} +%files completion +%defattr(-,root,root) +%{_sysconfdir}/bash_completion.d/git + %files -n gitk %defattr(-,root,root) %doc Documentation/*gitk*.txt @@ -192,6 +205,10 @@ rm -rf $RPM_BUILD_ROOT # No files for you! %changelog +* Sat Mar 20 2010 Ben Walton +- Add git-completion subpackage to distribute bash completion from + contrib. + * Sun Jan 31 2010 Junio C Hamano - Do not use %define inside %{!?...} construct. -- 1.7.0