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
%undefine _missing_build_ids_terminate_build
3cac5f9
b642ca8
Summary:        A command-line wrapper for git with github shortcuts
b642ca8
Name:           hub
bb455da
Version:        2.5.0
bb455da
Release:        1%{?dist}
b642ca8
Group:          Development/Languages
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
3cac5f9
BuildRequires: rubygem-ronn
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
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
3cac5f9
# Fedora: use system ronn
3cac5f9
Patch0002: 0002-Use-system-ronn.patch
3cac5f9
b642ca8
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}
3cac5f9
%autosetup -p1
3cac5f9
%else
3cac5f9
%autosetup -n %{name}-%{commit} -p1
3cac5f9
%endif
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
9aed46e
GOPATH=`pwd` %make_build
b642ca8
b642ca8
%install
9aed46e
GOPATH=`pwd` %make_install PREFIX=%{_prefix}
0b1b975
0b1b975
# Bash-completion
cd1f342
install -d -m 755 %{buildroot}%{_sysconfdir}/bash_completion.d/
cd1f342
cp -p etc/hub.bash_completion.sh %{buildroot}%{_sysconfdir}/bash_completion.d/.
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
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
b642ca8
%files
0b1b975
%license LICENSE
0b1b975
%doc README.md CONTRIBUTING.md
b642ca8
%{_bindir}/hub
e320669
%{_mandir}/man1/*
a94b924
%{_sysconfdir}/bash_completion.d/
4d5be90
%{_datarootdir}/zsh/site-functions/_hub
b642ca8
b642ca8
%changelog
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