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

[PATCH/RFC v2] RPM spec: optionally include bash completion support

From
Ian Ward Comfort <icomfort@stanford.edu>
Date
Mar 20, 2010, 00:32 UTC
Message-ID
<1269045134-28072-1-git-send-email-icomfort@stanford.edu>

Include the bash completion routines from contrib/ in our core RPM, in the standard system-wide location, when our spec is built "--with completion". The completion routines are not packaged by default. ---

 git.spec.in |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/git.spec.in b/git.spec.in
index ee74a5e..65a0db8 100644
--- a/git.spec.in
+++ b/git.spec.in
@@ -1,4 +1,5 @@
 # Pass --without docs to rpmbuild if you don't want the documentation
+# Pass --with completion to rpmbuild if you want shell completion support
 
 Name: 		git
 Version: 	@@VERSION@@
@@ -127,6 +128,11 @@ find $RPM_BUILD_ROOT -type f -name perllocal.pod -exec rm -f {} ';'
 rm -rf $RPM_BUILD_ROOT%{_mandir}
 %endif
 
+%if %{?_with_completion:1}0
+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
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -136,6 +142,7 @@ rm -rf $RPM_BUILD_ROOT
 %doc README COPYING Documentation/*.txt
 %{!?_without_docs: %doc Documentation/*.html Documentation/howto}
 %{!?_without_docs: %doc Documentation/technical}
+%{?_with_completion: %{_sysconfdir}/bash_completion.d}
 
 %files svn
 %defattr(-,root,root)
-- 
1.7.0.2
Next: Ben Walton
Message 1 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.