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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
---

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@xxxxxxxxxxxxxxxxxx>
+- Add git-completion subpackage to distribute bash completion from
+  contrib.
+
 * Sun Jan 31 2010 Junio C Hamano <gitster@xxxxxxxxx>
 - Do not use %define inside %{!?...} construct.
 
-- 
1.7.0

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]