git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Add a git-completion rpm subpackage to the spec

From
Ben Walton <bwalton@artsci.utoronto.ca>
Date
Mar 20, 2010, 18:18 UTC
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 <bwalton@artsci.utoronto.ca>
---

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 <bwalton@artsci.utoronto.ca>
+- Add git-completion subpackage to distribute bash completion from
+  contrib.
+
 * Sun Jan 31 2010 Junio C Hamano <gitster@pobox.com>
 - Do not use %define inside %{!?...} construct.
 
-- 
1.7.0
Previous: Ian Ward ComfortNext: Junio C Hamano
Message 2 of 8 in “RPM spec: optionally include bash completion support”
  1. RPM spec: optionally include bash completion supportIan Ward Comfort, Mar 20, 2010
  2. Add a git-completion rpm subpackage to the specBen Walton, Mar 20, 2010
  3. Junio C HamanoMar 20, 2010
  4. Ian Ward ComfortMar 20, 2010
  5. Ben WaltonMar 20, 2010
  6. Junio C HamanoMar 21, 2010
  7. Todd ZullingerMar 21, 2010
  8. Ben WaltonMar 21, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.