0b1b975
%global provider        github
0b1b975
%global provider_tld    com
0b1b975
%global project github
0b1b975
%global repo hub
0b1b975
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
0b1b975
%global import_path     %{provider_prefix}
b642ca8
3cac5f9
%global stable_release 1
83a5074
# Run ./hub-latest.sh to automatically update this to the latest git HEAD
3cac5f9
b642ca8
# https://fedoraproject.org/wiki/Packaging:SourceURL#Github
b642ca8
# For a number of reasons (immutability, availability, uniqueness), you must
b642ca8
# use the full commit revision hash when referring to the sources.
9aed46e
%global commit a9a497c53cbbcead28b45114de5ca07c0acec66c
b642ca8
%global shortcommit %(c=%{commit}; echo ${c:0:7})
b642ca8
0b1b975
# Tests cannot run in mock buildroot currently
0b1b975
# It's recommended to run them locally by switching this value
0b1b975
# before pushing to Koji
0b1b975
%global run_tests 0
0b1b975
3cac5f9
b642ca8
Summary:        A command-line wrapper for git with github shortcuts
b642ca8
Name:           hub
9a9b7ea
Version:        2.10.0
62c6673
Release:        2%{?dist}
b642ca8
License:        MIT
b642ca8
URL:            http://hub.github.com/
b642ca8
b642ca8
# https://fedoraproject.org/wiki/Packaging:SourceURL#Github
b642ca8
# Keep in mind that github tarballs are generated on-demand, so their
b642ca8
# modification dates will vary and cause checksum tests to fail. Reviewers will
0b1b975
# need to use diff -r to verify the tarballs.
3cac5f9
%if 0%{?stable_release}
3cac5f9
Source0: https://%{provider_prefix}/archive/v%{version}/%{repo}-%{version}.tar.gz
3cac5f9
%else
3cac5f9
Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{version}-%{shortcommit}.tar.gz
3cac5f9
%endif
0b1b975
0b1b975
ExclusiveArch: %{go_arches}
0b1b975
BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
b642ca8
0b1b975
BuildRequires: git-core
6c988b1
BuildRequires: rubygem-cucumber
6c988b1
BuildRequires: vim-filesystem
eba67bb
BuildRequires: groff-base
b642ca8
0b1b975
BuildRequires: golang(gopkg.in/yaml.v1)
0b1b975
BuildRequires: golang(github.com/bmizerany/assert)
0b1b975
BuildRequires: golang(github.com/BurntSushi/toml)
0b1b975
BuildRequires: golang(github.com/kballard/go-shellquote)
0b1b975
BuildRequires: golang(github.com/mitchellh/go-homedir)
b642ca8
0b1b975
Requires: git-core
6c988b1
Requires: vim-filesystem
0b1b975
0b1b975
Provides: bundled(golang(github.com/inconshreveable/go-update))
0b1b975
Provides: bundled(golang(github.com/mattn/go-colorable))
0b1b975
Provides: bundled(golang(github.com/mattn/go-isatty))
0b1b975
Provides: bundled(golang(github.com/octokit/go-octokit))
0b1b975
Provides: bundled(golang(github.com/ogier/pflag))
b642ca8
eba67bb
# Fedora: use system cucumber
eba67bb
Patch0001: 0001-Use-system-cucumber.patch
3cac5f9
eba67bb
# Fedora: Use distro compiler settings. Many of these have been set manually
eba67bb
# because there isn't an easy way to get the RPM values inserted, so check
eba67bb
# regularly that this is not out of date.
eba67bb
Patch0002: 0002-Use-Fedora-compiler-settings.patch
b642ca8
eba67bb
# Fedora: don't trim out the source paths. They are needed for debuginfo
eba67bb
# generation
eba67bb
Patch0003: 0003-Don-t-trim-source-paths.patch
d2ac60a
b642ca8
%description
b642ca8
hub is a command line tool that wraps `git` in order to extend it with extra
b642ca8
features and commands that make working with GitHub easier.
b642ca8
b642ca8
    $ hub clone rtomayko/tilt
b642ca8
b642ca8
    # expands to:
b642ca8
    $ git clone git://github.com/rtomayko/tilt.git
b642ca8
b642ca8
%prep
3cac5f9
%if 0%{?stable_release}
eba67bb
%autosetup -p1
3cac5f9
%else
eba67bb
%autosetup -p1 -n %{name}-%{commit}
d2ac60a
%endif
d2ac60a
b642ca8
9aed46e
mkdir -p src/github.com/github/
9aed46e
ln -s `pwd` src/github.com/github/hub
9aed46e
0b1b975
rm -rf vendor/gopkg.in/yaml.v1 \
0b1b975
       vendor/github.com/bmizerany/assert \
0b1b975
       vendor/github.com/BurntSushi/toml \
0b1b975
       vendor/github.com/kballard/go-shellquote \
0b1b975
       vendor/github.com/mitchellh/go-homedir
0b1b975
3cac5f9
ln -s /usr/share/gocode/src/gopkg.in/yaml.v1 \
3cac5f9
      vendor/gopkg.in/yaml.v1
3cac5f9
ln -s /usr/share/gocode/src/github.com/bmizerany/assert \
3cac5f9
      vendor/github.com/bmizerany/assert
3cac5f9
ln -s /usr/share/gocode/src/github.com/BurntSushi/toml \
3cac5f9
      vendor/github.com/BurntSushi/toml
3cac5f9
ln -s /usr/share/gocode/src/github.com/kballard/go-shellquote \
3cac5f9
      vendor/github.com/kballard/go-shellquote
3cac5f9
ln -s /usr/share/gocode/src/github.com/mitchellh/go-homedir \
3cac5f9
      vendor/github.com/mitchellh/go-homedir
0b1b975
3cac5f9
%build
eba67bb
LDFLAGS="%{__global_ldflags} %{?__golang_extldflags}" GOPATH=`pwd` %make_build
b642ca8
b642ca8
%install
eba67bb
LDFLAGS="%{__global_ldflags} %{?__golang_extldflags}" LC_ALL=C.UTF-8 GOPATH=`pwd` %make_install PREFIX=%{_prefix}
0b1b975
0b1b975
# Bash-completion
62c6673
install -d -m 755 %{buildroot}%{_datarootdir}/bash-completion/completions/
62c6673
cp -p etc/hub.bash_completion.sh %{buildroot}%{_datarootdir}/bash-completion/completions/hub
cd1f342
0b1b975
# ZSH-completion
224b1ac
install -d -m 755 %{buildroot}%{_datarootdir}/zsh/site-functions/
4d5be90
cp -p etc/hub.zsh_completion %{buildroot}%{_datarootdir}/zsh/site-functions/_hub
0b1b975
0b1b975
%check
0b1b975
0b1b975
%if 0%{run_tests}
0b1b975
# Tests are currently nonfunctional in mock
0b1b975
# All calls to 'git' are failing to find a valid repo, but
0b1b975
# they work when run outside of mock.
ce2f727
0b1b975
export GOPATH=$(pwd):$(pwd)/Godeps/_workspace:%{gopath}
0b1b975
0b1b975
find . -maxdepth 2 -name '*.go' '!' -name '*_test.go' | \
0b1b975
  cut -d/ -f2 | sort -u | grep -v '.go$' | sed 's!^!github.com/github/hub/!' | \
0b1b975
  xargs go test -v
0b1b975
%endif
b642ca8
6c988b1
b642ca8
%files
0b1b975
%license LICENSE
0b1b975
%doc README.md CONTRIBUTING.md
b642ca8
%{_bindir}/hub
e320669
%{_mandir}/man1/*
62c6673
%{_datarootdir}/bash-completion/completions/hub
4d5be90
%{_datarootdir}/zsh/site-functions/_hub
6c988b1
%{_datarootdir}/vim/vimfiles/ftdetect/pullrequest.vim
6c988b1
%{_datarootdir}/vim/vimfiles/syntax/pullrequest.vim
6c988b1
b642ca8
b642ca8
%changelog
62c6673
* Thu Feb 28 2019 Stephen Gallagher <sgallagh@redhat.com> - 2.10.0-2
62c6673
- Install bash-completion into the correct path (BZ #1683866)
62c6673
9a9b7ea
* Mon Feb 25 2019 Stephen Gallagher <sgallagh@redhat.com> - 2.10.0-1
9a9b7ea
- Update to 2.10.0
9a9b7ea
- Features
9a9b7ea
  * New hub pr --format fields %pS and %pC for PR state and color
9a9b7ea
    %pS: "open", "draft", "merged", or "closed"
9a9b7ea
    %pC: green, gray, purple, or red
9a9b7ea
  * Have commands with rich output respect the --color flag
9a9b7ea
    default: --color=auto
9a9b7ea
    --color is equivalent to --color=always
9a9b7ea
    --color=never disables color for TTYs
9a9b7ea
- Fixes
9a9b7ea
  * Make man pages parseable with whatis
9a9b7ea
  * Make hub checkout work independently of remote refspec
9a9b7ea
6c139b0
* Wed Feb 13 2019 Stephen Gallagher <sgallagh@redhat.com> - 2.9.0-1
6c139b0
- Update to 2.9.0
6c139b0
- Features
6c139b0
  * Add support for hub ci-status --format <FORMAT> string
6c139b0
  * Add hub create --remote-name <REMOTE> flag
6c139b0
  * Allow passing in a raw request body via hub api --input <FILE>
6c139b0
  * Cache HTTP 4xx (except 403) server responses in hub api --cache
6c139b0
- Fixes
6c139b0
  * Ensure consistent ordering of hub ci-status -v results
6c139b0
  * Avoid crashing on invalid GitHub hostname
6c139b0
  * Fix parsing empty string within command-line arguments
6c139b0
eba67bb
* Mon Feb 11 2019 Stephen Gallagher <sgallagh@redhat.com> - 2.8.4-1
eba67bb
- Update to 2.8.4
eba67bb
- Drop DWARF decompression patch
eba67bb
- Use Fedora compiler and linker flags
eba67bb
623cbc6
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.7.1-2
623cbc6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
623cbc6
6c988b1
* Wed Jan 23 2019 Stephen Gallagher <sgallagh@redhat.com> - 2.7.1-1
6c988b1
- Update to 2.7.1
6c988b1
- https://github.com/github/hub/releases/tag/v2.7.1
6c988b1
- https://github.com/github/hub/releases/tag/v2.7.0
6c988b1
f499fef
* Thu Nov 01 2018 Stephen Gallagher <sgallagh@redhat.com> - 2.6.0-1
f499fef
- Update to 2.6.0
f499fef
- https://github.com/github/hub/releases/tag/v2.6.0
f499fef
- Features
f499fef
  * Use "scissors" line to delineate comments in editable messages instead of
f499fef
    stripping away lines that start with #
f499fef
  * New command `hub issue show <NUMBER>`
f499fef
  * Add `hub release show --format=<FORMAT>` functionality
f499fef
  * `hub pr list --format=%rs` lists requested reviewers
f499fef
  * Add support for communicating with GitHub Enterprise over Unix socket
f499fef
- Fixes
f499fef
  * Prevent `hub create` setting a public upstream when creating a private repo
f499fef
  * Fix `hub release create/edit/delete` when there are multiple git remotes
f499fef
  * Auto-detect private/pushable repos in `hub remote add`
f499fef
  * Fix `hub ci-status` exit code when there is only Checks
f499fef
  * Allow `hub compare <RANGE>` even if not on any branch
f499fef
  * Ensure consistent sort direction when listing issues, PRs
f499fef
  * Match requested team names by slug instead of name in
f499fef
    `hub pull-request -r <TEAM>`
f499fef
35d56bc
* Fri Sep 28 2018 Stephen Gallagher <sgallagh@redhat.com> - 2.5.1-1
35d56bc
- Update to 2.5.1
35d56bc
- hub issue create: ignore the .github/ISSUE_TEMPLATE directory instead of
35d56bc
  crashing
35d56bc
- hub pull-request: avoid re-requesting reviewers in case of CODEOWNERS
35d56bc
- hub ci-status: handle cases when Checks API is unavailable, like older
35d56bc
  GitHub Enterprise
35d56bc
- Handle HTTP 422 message format from server response
35d56bc
- Ignore crash for malformed ~/.config/hub file
35d56bc
- Clarify hub init -g documentation that it doesn't imply hub create
35d56bc
- hub clone: add more documentation about git protocol used
35d56bc
d2ac60a
* Tue Jul 17 2018 Stephen Gallagher <sgallagh@redhat.com> - 2.5.0-2
d2ac60a
- Fix generation of debuginfo for F29
d2ac60a
bb455da
* Mon Jul 16 2018 Stephen Gallagher <sgallagh@redhat.com> - 2.5.0-1
bb455da
- Update to 2.5.0
bb455da
- Features
bb455da
  * Have ci-status also query Checks API
bb455da
- Fixes
bb455da
  * Do not pass '--cmd' to vi editor to ensure compatibility with older vi
bb455da
  * Simplify cherry-picking commits from pull request URLs
bb455da
  * Allow single-character branches/tag names in hub compare
bb455da
  * Fix hub compare for Enterprise when <USER> is specified
bb455da
  * Support remote add -t BRANCH argument
bb455da
  * Bash shell completion fixes for git 2.18
bb455da
  * Documentation fixes
bb455da
e320669
* Thu Jun 14 2018 Stephen Gallagher <sgallagh@redhat.com> - 2.4.0-2
e320669
- Don't own manpage directory
e320669
3cac5f9
* Wed Jun 13 2018 Stephen Gallagher <sgallagh@redhat.com> - 2.4.0-1
3cac5f9
- Release hub 2.4.0
3cac5f9
- https://github.com/github/hub/releases/tag/v2.4.0
3cac5f9
5e14790
* Fri Jun 01 2018 Stephen Gallagher <sgallagh@redhat.com> - 2.3.0-1
5e14790
- Release hub 2.3.0
5e14790
- https://github.com/github/hub/releases/tag/v2.3.0
5e14790
30d5424
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.9-6
30d5424
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
30d5424
456e724
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.9-5
456e724
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
456e724
22ca064
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.9-4
22ca064
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
22ca064
f684410
* Wed Mar 01 2017 Stephen Gallagher <sgallagh@redhat.com> - 2.2.9-3
f684410
- Rebuild for golang bug that caused segfaults
f684410
cf5312f
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.2.9-2
cf5312f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
cf5312f
df1cfea
* Thu Nov 17 2016 Stephen Gallagher <sgallagh@redhat.com> - 2.2.9-1
df1cfea
- Update to latest stable release 2.2.9
df1cfea
224b1ac
* Wed Sep 28 2016 Stephen Gallagher <sgallagh@redhat.com> - 2.2.5-3
224b1ac
- Really fix location of ZSH completion script
224b1ac
4d5be90
* Tue Sep 13 2016 Stephen Gallagher <sgallagh@redhat.com> - 2.2.5-2
4d5be90
- Fix location of ZSH completion script
4d5be90
0b1b975
* Wed Aug 31 2016 Stephen Gallagher <sgallagh@redhat.com> - 2.2.5-1
0b1b975
- Update to new (and latest) major release of hub
0b1b975
- Include ZSH completion script
0b1b975
6364ff6
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.12.4-6
6364ff6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
6364ff6
a94b924
* Fri Sep 11 2015 Ralph Bean <rbean@redhat.com> - 1.12.4-5
a94b924
- Adjust ownership of bash_completion file/dir.
a94b924
cd1f342
* Fri Sep 11 2015 Ralph Bean <rbean@redhat.com> - 1.12.4-4
cd1f342
- Ship bash completion file.
cd1f342
dcd6e3a
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12.4-3
dcd6e3a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
dcd6e3a
cd1f342
* Wed May 27 2015 Ralph Bean <rbean@redhat.com> - 1.12.4-2
47ffbb6
- Require ruby (for ruby-mri.  jruby and hub don't get along.)
47ffbb6
  https://bugzilla.redhat.com/show_bug.cgi?id=1225254
47ffbb6
ce2f727
* Wed Apr 22 2015 Ralph Bean <rbean@redhat.com> - 1.12.4-1
ce2f727
- New version
ce2f727
- Stop building with rdoc for now because its being so squirrely.
ce2f727
63072c6
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12.1-2
63072c6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
63072c6
703b47c
* Wed May 28 2014 Ralph Bean <rbean@redhat.com> - 1.12.1-1
703b47c
- Latest upstream.
703b47c
b642ca8
* Thu May 22 2014 Ralph Bean <rbean@redhat.com> - 1.12.0-4
b642ca8
- Add -doc subpackage with rdoc product.
b642ca8
- Add check section, but left it commented out due to dep issues.
b642ca8
- Remove spurious man files.
b642ca8
- Remove weirdly nested docs from rdoc.
b642ca8
b642ca8
* Wed Apr 02 2014 Ralph Bean <rbean@redhat.com> - 1.12.0-3
b642ca8
- Update Source0 URL to use the github guidelines.
b642ca8
- Replace weird %%prep %%setup stuff with something more familiar.
b642ca8
b642ca8
* Wed Apr 02 2014 Ralph Bean <rbean@redhat.com> - 1.12.0-2
b642ca8
- Remove version from the doc directory.
b642ca8
- Replace install macro with just "install".
b642ca8
b642ca8
* Mon Mar 31 2014 Ralph Bean <rbean@redhat.com> - 1.12.0-1
b642ca8
- Initial packaging for Fedora