{"thread":{"id":"23095","subject":"[PATCH/RFC v2] RPM spec: optionally include bash completion support","startedAt":"2010-03-20T00:32:14Z","lastAt":"2010-03-21T20:06:04Z","messageCount":8,"participants":["Ian Ward Comfort","Ben Walton","Junio C Hamano","Todd Zullinger"],"isPatch":true,"patchVersion":2,"patchTotal":null},"messages":[{"id":"137289","messageId":"1269045134-28072-1-git-send-email-icomfort@stanford.edu","threadId":"23095","inReplyTo":null,"subject":"[PATCH/RFC v2] RPM spec: optionally include bash completion support","fromName":"Ian Ward Comfort","fromEmail":"icomfort@stanford.edu","sentAt":"2010-03-20T00:32:14Z","receivedAt":"2010-03-20T00:32:14Z","isPatch":true,"sender":{"key":"icomfort@stanford.edu","avatar":"https://avatars.githubusercontent.com/u/202841?v=4"},"body":"Include the bash completion routines from contrib/ in our core RPM, in the\nstandard system-wide location, when our spec is built \"--with completion\". The\ncompletion routines are not packaged by default.\n---\n\n git.spec.in |    7 +++++++\n 1 files changed, 7 insertions(+), 0 deletions(-)\n\ndiff --git a/git.spec.in b/git.spec.in\nindex ee74a5e..65a0db8 100644\n--- a/git.spec.in\n+++ b/git.spec.in\n@@ -1,4 +1,5 @@\n # Pass --without docs to rpmbuild if you don't want the documentation\n+# Pass --with completion to rpmbuild if you want shell completion support\n \n Name: \t\tgit\n Version: \t@@VERSION@@\n@@ -127,6 +128,11 @@ find $RPM_BUILD_ROOT -type f -name perllocal.pod -exec rm -f {} ';'\n rm -rf $RPM_BUILD_ROOT%{_mandir}\n %endif\n \n+%if %{?_with_completion:1}0\n+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d\n+install -m 644 -T contrib/completion/git-completion.bash $RPM_BUILD_ROOT%{_sysconfdir}/bash_completion.d/git\n+%endif\n+\n %clean\n rm -rf $RPM_BUILD_ROOT\n \n@@ -136,6 +142,7 @@ rm -rf $RPM_BUILD_ROOT\n %doc README COPYING Documentation/*.txt\n %{!?_without_docs: %doc Documentation/*.html Documentation/howto}\n %{!?_without_docs: %doc Documentation/technical}\n+%{?_with_completion: %{_sysconfdir}/bash_completion.d}\n \n %files svn\n %defattr(-,root,root)\n-- \n1.7.0.2\n"},{"id":"137354","messageId":"1269109086-8887-1-git-send-email-bwalton@artsci.utoronto.ca","threadId":"23095","inReplyTo":"1269045134-28072-1-git-send-email-icomfort@stanford.edu","subject":"[PATCH] Add a git-completion rpm subpackage to the spec","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2010-03-20T18:18:06Z","receivedAt":"2010-03-20T18:18:06Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"Make the rpm spec file create a git-completion subpackage that\ncontains the bash completion support from the contrib/ directory.\n\nSigned-off-by: Ben Walton <bwalton@artsci.utoronto.ca>\n---\n\nThis is the alternate method for shipping the bash completion support.\nI think I personally prefer this method, but I'd be happy to see\neither solution ship as part of the .spec file so that I don't need to\ncontinue handling it separately.\n\n git.spec.in |   17 +++++++++++++++++\n 1 files changed, 17 insertions(+), 0 deletions(-)\n\ndiff --git a/git.spec.in b/git.spec.in\nindex ee74a5e..d59747a 100644\n--- a/git.spec.in\n+++ b/git.spec.in\n@@ -80,6 +80,13 @@ Requires:       git = %{version}-%{release}, tk >= 8.4\n %description gui\n Git GUI tool\n \n+%package completion\n+Summary:\tBash completion support for Git\n+Group:\t\tDevelopment/Tools\n+Requires:\tgit = %{version}-${release}, bash\n+%description completion\n+Bash completion support for Git\n+\n %package -n gitk\n Summary:        Git revision tree visualiser ('gitk')\n Group:          Development/Tools\n@@ -113,6 +120,8 @@ rm -rf $RPM_BUILD_ROOT\n make %{_smp_mflags} CFLAGS=\"$RPM_OPT_FLAGS\" DESTDIR=$RPM_BUILD_ROOT \\\n      %{path_settings} \\\n      INSTALLDIRS=vendor install %{!?_without_docs: install-doc}\n+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/bash_completion.d\n+install -m 644 -T contrib/completion/git-completion.bash $RPM_BUILD_ROOT/%{_sysconfdir}/bash_completion.d/git\n test ! -d $RPM_BUILD_ROOT%{python_sitelib} || rm -fr $RPM_BUILD_ROOT%{python_sitelib}\n find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} ';'\n find $RPM_BUILD_ROOT -type f -name '*.bs' -empty -exec rm -f {} ';'\n@@ -177,6 +186,10 @@ rm -rf $RPM_BUILD_ROOT\n %{!?_without_docs: %{_mandir}/man1/git-citool.1*}\n %{!?_without_docs: %doc Documentation/git-citool.html}\n \n+%files completion\n+%defattr(-,root,root)\n+%{_sysconfdir}/bash_completion.d/git\n+\n %files -n gitk\n %defattr(-,root,root)\n %doc Documentation/*gitk*.txt\n@@ -192,6 +205,10 @@ rm -rf $RPM_BUILD_ROOT\n # No files for you!\n \n %changelog\n+* Sat Mar 20 2010 Ben Walton <bwalton@artsci.utoronto.ca>\n+- Add git-completion subpackage to distribute bash completion from\n+  contrib.\n+\n * Sun Jan 31 2010 Junio C Hamano <gitster@pobox.com>\n - Do not use %define inside %{!?...} construct.\n \n-- \n1.7.0\n"},{"id":"137365","messageId":"7v8w9mda6l.fsf@alter.siamese.dyndns.org","threadId":"23095","inReplyTo":"1269109086-8887-1-git-send-email-bwalton@artsci.utoronto.ca","subject":"Re: [PATCH] Add a git-completion rpm subpackage to the spec","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-20T20:12:34Z","receivedAt":"2010-03-20T20:12:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ben Walton <bwalton@artsci.utoronto.ca> writes:\n\n> Make the rpm spec file create a git-completion subpackage that\n> contains the bash completion support from the contrib/ directory.\n>\n> Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>\n> ---\n>\n> This is the alternate method for shipping the bash completion support.\n> I think I personally prefer this method, but I'd be happy to see\n> either solution ship as part of the .spec file so that I don't need to\n> continue handling it separately.\n\nAs long as %{_sysconfdir}/bash_completion.d/ is the appropriate place for\n*all* RPM based distros, which I don't knonw, the patch looks sensible.\nMay I ask for what distribution you are \"handling it\"?  The last thing I\nwant to do is to get in the way of distro packagers.\n\nI looked for \"gitcompletion\" or \"git-completion\" in rpmfind.net, but\ndidn't find anything, which may actually be a good sign that whatever we\ndo here won't stomp on whatever distro package maintainers would do.\n"},{"id":"137374","messageId":"C774706E-5228-42F2-9DC9-094DF98D5ED2@stanford.edu","threadId":"23095","inReplyTo":"7v8w9mda6l.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Add a git-completion rpm subpackage to the spec","fromName":"Ian Ward Comfort","fromEmail":"icomfort@stanford.edu","sentAt":"2010-03-20T21:01:06Z","receivedAt":"2010-03-20T21:01:06Z","isPatch":true,"sender":{"key":"icomfort@stanford.edu","avatar":"https://avatars.githubusercontent.com/u/202841?v=4"},"body":"On 20 Mar 2010, at 1:12 PM, Junio C Hamano wrote:\n> Ben Walton <bwalton@artsci.utoronto.ca> writes:\n>\n>> Make the rpm spec file create a git-completion subpackage that\n>> contains the bash completion support from the contrib/ directory.\n>>\n>> Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>\n>> ---\n>>\n>> This is the alternate method for shipping the bash completion  \n>> support.\n>> I think I personally prefer this method, but I'd be happy to see\n>> either solution ship as part of the .spec file so that I don't need  \n>> to\n>> continue handling it separately.\n>\n> As long as %{_sysconfdir}/bash_completion.d/ is the appropriate  \n> place for\n> *all* RPM based distros, which I don't knonw, the patch looks  \n> sensible.\n\nThe spec file provided by the author of bash-completion, Ian  \nMacdonald, uses this path:\n\n\thttp://www.caliban.org/files/redhat/SPECS/bash-completion.spec\n\nAs does the Fedora Project (including EPEL):\n\n\thttp://cvs.fedoraproject.org/viewvc/rpms/bash-completion/F-13/bash-completion.spec?view=markup\n\n\thttp://cvs.fedoraproject.org/viewvc/rpms/bash-completion/EL-5/bash-completion.spec?view=markup\n\nOpenSUSE 11 does not appear to ship bash-completion:\n\n\thttp://en.opensuse.org/Package_List/11.2/DVD9\n\nBut OpenSUSE 10.3 used the same path:\n\n\thttp://www.novell.com/products/linuxpackages/opensuse/bash-completion.html\n\nMandriva uses the same path:\n\n\thttp://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/bash-completion/current/SPECS/bash-completion.spec?view=markup\n\nThat's all the definitive information I can find at the moment.\n\n-- \nIan Ward Comfort <icomfort@stanford.edu>\nSystems Team Lead, Academic Computing Services, Stanford University\n"},{"id":"137376","messageId":"1269119663-sup-5823@pinkfloyd.chass.utoronto.ca","threadId":"23095","inReplyTo":"7v8w9mda6l.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH] Add a git-completion rpm subpackage to the spec","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2010-03-20T21:14:41Z","receivedAt":"2010-03-20T21:14:41Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"Excerpts from Junio C Hamano's message of Sat Mar 20 16:12:34 -0400 2010:\n\n> looks sensible.  May I ask for what distribution you are \"handling\n> it\"?  The last thing I want to do is to get in the way of distro\n> packagers.\n\nI can't say it's _the_ global definition for RPM based distros, but I\nsuspect the redhat derived ones would use this location.  I'm working\nagainst RHEL5.\n\nThe info that Ian provides seems to corroborate this hypothesis.\n\nHTH.\n-Ben\n-- \nBen Walton\nSystems Programmer - CHASS\nUniversity of Toronto\nC:416.407.5610 | W:416.978.4302\n"},{"id":"137402","messageId":"7v1vfe8o8n.fsf@alter.siamese.dyndns.org","threadId":"23095","inReplyTo":"1269119663-sup-5823@pinkfloyd.chass.utoronto.ca","subject":"Re: [PATCH] Add a git-completion rpm subpackage to the spec","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-03-21T01:20:08Z","receivedAt":"2010-03-21T01:20:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ben Walton <bwalton@artsci.utoronto.ca> writes:\n\n> Excerpts from Junio C Hamano's message of Sat Mar 20 16:12:34 -0400 2010:\n>\n>> looks sensible.  May I ask for what distribution you are \"handling\n>> it\"?  The last thing I want to do is to get in the way of distro\n>> packagers.\n>\n> I can't say it's _the_ global definition for RPM based distros, but I\n> suspect the redhat derived ones would use this location.  I'm working\n> against RHEL5.\n>\n> The info that Ian provides seems to corroborate this hypothesis.\n>\n> HTH.\n\nYes, it helps a lot---thank you, both!\n\nWill queue.\n"},{"id":"137451","messageId":"20100321155156.GH27676@inocybe.localdomain","threadId":"23095","inReplyTo":"1269119663-sup-5823@pinkfloyd.chass.utoronto.ca","subject":"Re: [PATCH] Add a git-completion rpm subpackage to the spec","fromName":"Todd Zullinger","fromEmail":"tmz@pobox.com","sentAt":"2010-03-21T15:51:56Z","receivedAt":"2010-03-21T15:51:56Z","isPatch":true,"sender":{"key":"tmz@pobox.com","avatar":"https://avatars.githubusercontent.com/u/806319?v=4"},"body":"Ben Walton wrote:\n> Excerpts from Junio C Hamano's message of Sat Mar 20 16:12:34 -0400\n> 2010:\n>\n>> looks sensible.  May I ask for what distribution you are \"handling\n>> it\"?  The last thing I want to do is to get in the way of distro\n>> packagers.\n>\n> I can't say it's _the_ global definition for RPM based distros, but\n> I suspect the redhat derived ones would use this location.  I'm\n> working against RHEL5.\n>\n> The info that Ian provides seems to corroborate this hypothesis.\n\nFWIW, upstream bash-completion is no longer handled by Ian.  The\ncurrent upstream is at http://bash-completion.alioth.debian.org/\n\nThe paths haven't changed currently, though I thought I read that\neventually they'd like to move the default location for completion\nscripts to /usr/share/bash-completion/ (many are already installed\nthere, but are symlinked to /etc/bash_completion.d by bash-completion\npackages (in the Fedora/EPEL packages via %triggers when the\napplications they complete are installed).\n\nAlso worth noting for RHEL/CentOS 5 folks is that the current Fedora\npackages should rebuild cleanly on those systems.  Typically, I do\nthis via mock, which sets some of the needed rpm macros, but they are\nalso available in the buildsys-macros package¹.  I'm hoping to move\ngit in EPEL to a newer version at some point but I haven't made time\nto do so yet.\n\nI also haven't made time to see what, if any, of the changes we've\nmade in the Fedora packages might be worthwhile to integrate into the\ngit.git rpm spec file. :/\n\nThe Fedora packages install the completion scripts by default.  The\ncompletion is only sourced when someone has installed bash-completion,\nso the thought is that if you installed that you would want git to\nprovide completion by default.  For those that only want git\ncompletion without the more general bash-completion package, it's\nsimple to source /etc/bash_completion.d/git.  In that light, is there\na compelling reason not to install the completion by default?\n\n¹ http://buildsys.fedoraproject.org/buildgroups/rhel5/i386/\n  The may eventually be added to the epel-release package to make it\n  simpler to rebuild EPEL packages (and Fedora packages on EPEL).\n\n-- \nTodd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nPeople are crazy and times are strange\nI'm locked in tight, I'm out of range\nI used to care, but things have changed\n\n"},{"id":"137474","messageId":"1269199866-sup-8342@pinkfloyd.chass.utoronto.ca","threadId":"23095","inReplyTo":"20100321155156.GH27676@inocybe.localdomain","subject":"Re: [PATCH] Add a git-completion rpm subpackage to the spec","fromName":"Ben Walton","fromEmail":"bwalton@artsci.utoronto.ca","sentAt":"2010-03-21T20:06:04Z","receivedAt":"2010-03-21T20:06:04Z","isPatch":true,"sender":{"key":"bdwalton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/396061?v=4"},"body":"Excerpts from Todd Zullinger's message of Sun Mar 21 11:51:56 -0400 2010:\n\nHi Todd,\n\n> The paths haven't changed currently, though I thought I read that\n> eventually they'd like to move the default location for completion\n> scripts to /usr/share/bash-completion/ (many are already installed\n> there, but are symlinked to /etc/bash_completion.d by\n> bash-completion packages (in the Fedora/EPEL packages via %triggers\n> when the applications they complete are installed).\n\nShould this be taken as:\n\n* Eventually, /etc/bash_completion will source files directly from\n  /usr/share/...\nOR\n* To play nice with the distros, triggers and symlinks are the way to\n  go after installing to /usr/share/...?\n\n> I also haven't made time to see what, if any, of the changes we've\n> made in the Fedora packages might be worthwhile to integrate into\n> the git.git rpm spec file. :/\n\nI just took a look at the spec from 1.7.0.1-1 in rawhide.  Some of the\nstuff it includes is Fedora/RHEL specific, but a few items that I\nwouldn't mind seeing merged into the stock .spec file are the\nsplitting of the daemon package with the addition of an xinetd.d/git\nfile and the emacs support subpackage.\n\nI also like the gitweb sub-package, but it doesn't meet the (site\nspecific) needs I have for deployment...In general, I think support in\nthe standard .spec for it is a good thing though.\n\n> simple to source /etc/bash_completion.d/git.  In that light, is\n> there a compelling reason not to install the completion by default?\n\nWell, that's a good point.  I think my personal inclination for a\nseparate package comes from having it separated in OpenCSW.  Most of\nthe reasons for a separate package there likely don't apply here\nthough, so maybe it should be part of git-core?  As I said when I sent\nthe alternate (separate rpm) version, I'm happy with either solution\nas long as the completion support is more easily available when I\nbuild rpms in the future.\n\nThanks\n-Ben\n-- \nBen Walton\nSystems Programmer - CHASS\nUniversity of Toronto\nC:416.407.5610 | W:416.978.4302\n"}]}