From 0b1b975b850c7840d27bf5262cc7137652336264 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgallagh(a)redhat.com>
Date: Wed, 31 Aug 2016 10:02:01 -0400
Subject: Update to 2.2.5
Convert build to git and get all the new goodies from the most
recent releases of hub.
Signed-off-by: Stephen Gallagher <sgallagh(a)redhat.com>
---
.gitignore | 1 +
hub.spec | 130 ++++++++++++++++++++++++++++++++++++-------------------------
sources | 2 +-
3 files changed, 78 insertions(+), 55 deletions(-)
diff --git a/.gitignore b/.gitignore
index 204009d..94bcb7d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
/hub-635646f7f39c7747f9cb06cf15c3c0c37520706b.tar.gz
/hub-e807a3891b13a45d52447b63ca4e54c25a78dc13.tar.gz
/hub-748c1359b33e3f6af843d7b9eaaf990e563a8449.tar.gz
+/hub-2.2.5-7988c4b.tar.gz
diff --git a/hub.spec b/hub.spec
index 9a8a9ed..db949a7 100644
--- a/hub.spec
+++ b/hub.spec
@@ -1,16 +1,25 @@
-%global app_root %{_datadir}/%{name}
-%global gem_name hub
+%global provider github
+%global provider_tld com
+%global project github
+%global repo hub
+%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
+%global import_path %{provider_prefix}
#
https://fedoraproject.org/wiki/Packaging:SourceURL#Github
# For a number of reasons (immutability, availability, uniqueness), you must
# use the full commit revision hash when referring to the sources.
-%global commit 748c1359b33e3f6af843d7b9eaaf990e563a8449
+%global commit 7988c4b6b18b0fba0a1483e972cc45bad56e43ad
%global shortcommit %(c=%{commit}; echo ${c:0:7})
+# Tests cannot run in mock buildroot currently
+# It's recommended to run them locally by switching this value
+# before pushing to Koji
+%global run_tests 0
+
Summary: A command-line wrapper for git with github shortcuts
Name: hub
-Version: 1.12.4
-Release: 6%{?dist}
+Version: 2.2.5
+Release: 1%{?dist}
Group: Development/Languages
License: MIT
URL:
http://hub.github.com/
@@ -18,27 +27,29 @@ URL:
http://hub.github.com/
#
https://fedoraproject.org/wiki/Packaging:SourceURL#Github
# Keep in mind that github tarballs are generated on-demand, so their
# modification dates will vary and cause checksum tests to fail. Reviewers will
-# need to use diff -r to verify the tarballs.
-Source0:
https://github.com/github/hub/archive/%{commit}/hub-%{commit}.tar.gz
+# need to use diff -r to verify the tarballs.
+Source0:
https://%{provider_prefix}/archive/%{commit}/%{repo}-%{version}-%{shortcommit}.tar.gz
+
+ExclusiveArch: %{go_arches}
+BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
-BuildArch: noarch
+BuildRequires: git-core
-BuildRequires: ruby-devel
-BuildRequires: rubygems-devel
-BuildRequires: rubygem(rspec)
+BuildRequires: golang(gopkg.in/yaml.v1)
+BuildRequires:
golang(github.com/bmizerany/assert)
+BuildRequires:
golang(github.com/BurntSushi/toml)
+BuildRequires:
golang(github.com/howeyc/gopass)
+BuildRequires:
golang(github.com/kballard/go-shellquote)
+BuildRequires:
golang(github.com/mitchellh/go-homedir)
-## For the test suite.
-#BuildRequires: rubygem-minitest
-#BuildRequires: rubygem-webmock
-#BuildRequires: rubygem-bundler
-#BuildRequires: rubygem-rake>=10.1.1
-#BuildRequires: rubygem-cucumber
-#BuildRequires: tmux
-#BuildRequires: zsh
+Requires: git-core
+
+Provides:
bundled(golang(github.com/inconshreveable/go-update))
+Provides:
bundled(golang(github.com/mattn/go-colorable))
+Provides:
bundled(golang(github.com/mattn/go-isatty))
+Provides:
bundled(golang(github.com/octokit/go-octokit))
+Provides:
bundled(golang(github.com/ogier/pflag))
-Requires: ruby(rubygems)
-Requires: ruby(release)
-Requires: ruby
%description
hub is a command line tool that wraps `git` in order to extend it with extra
@@ -49,60 +60,71 @@ features and commands that make working with GitHub easier.
# expands to:
$ git clone
git://github.com/rtomayko/tilt.git
-%package doc
-Summary: API documentation for %{name}
-Group: Documentation
-Requires: %{name} = %{version}-%{release}
-
-%description doc
-Documentation for %{name} generated by rdoc.
-
%prep
%setup -qn %{name}-%{commit}
+rm -rf vendor/gopkg.in/yaml.v1 \
+
vendor/github.com/bmizerany/assert \
+
vendor/github.com/BurntSushi/toml \
+
vendor/github.com/howeyc/gopass \
+
vendor/github.com/kballard/go-shellquote \
+
vendor/github.com/mitchellh/go-homedir
+
%build
-gem build %{gem_name}.gemspec
-%gem_install
+mkdir -p src/%{provider}.%{provider_tld}/%{project}/
+ln -s ../../../ src/%{provider}.%{provider_tld}/%{project}/%{repo}
+
+export GOPATH=$(pwd):$(pwd)/Godeps/_workspace:%{gopath}
+%gobuild -o bin/%{name} %{import_path}
%install
-mkdir -p %{buildroot}%{gem_dir}
-cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/
-rm -rf %{buildroot}%{gem_dir}/doc/
-mkdir -p %{buildroot}%{_bindir}
-cp -a ./%{_bindir}/hub %{buildroot}%{_bindir}/hub
+# /bin/hub
+install -d -p %{buildroot}%{_bindir}
+install -p -m 755 bin/%{name} %{buildroot}%{_bindir}
+# Documentation
install -d -m 755 %{buildroot}%{_mandir}/man1/
cp -p man/hub.1 %{buildroot}%{_mandir}/man1/.
+
+# Bash-completion
install -d -m 755 %{buildroot}%{_sysconfdir}/bash_completion.d/
cp -p etc/hub.bash_completion.sh %{buildroot}%{_sysconfdir}/bash_completion.d/.
-## rdoc is so squirrely..
-#rdoc --op %{buildroot}%{_defaultdocdir}/%{name}/
-## But then, it gets installed twice in that directory; remove the nested one.
-#rm -rf %{buildroot}%{_defaultdocdir}/%{name}/usr/
-## Remove spurious executable permission
-#chmod -x %{buildroot}%{_defaultdocdir}/%{name}/images/*.png
+# ZSH-completion
+install -d -m 755 %{buildroot}%{_datarootdir}/zsh/site-functions/_hub/
+cp -p etc/hub.zsh_completion %{buildroot}%{_datarootdir}/zsh/site-functions/_hub/.
+
+
+%check
+
+%if 0%{run_tests}
+# Tests are currently nonfunctional in mock
+# All calls to 'git' are failing to find a valid repo, but
+# they work when run outside of mock.
-# Tests are commented out for now since they require rubygem-rake>=10.1.1 which
-# isn't available in rawhide yet.
-#%%check
-#./script/test
+export GOPATH=$(pwd):$(pwd)/Godeps/_workspace:%{gopath}
+
+find . -maxdepth 2 -name '*.go' '!' -name '*_test.go' | \
+ cut -d/ -f2 | sort -u | grep -v '.go$' | sed
's!^!github.com/github/hub/!' | \
+ xargs go test -v
+%endif
%files
-%doc LICENSE README.md CONTRIBUTING.md
+%license LICENSE
+%doc README.md CONTRIBUTING.md
+%doc man/hub.1.html man/hub.1.ronn
%{_bindir}/hub
%{_mandir}/man1/hub.1.gz
%{_sysconfdir}/bash_completion.d/
-%{gem_spec}
-%{gem_instdir}
-%exclude %{gem_cache}
-
-%files doc
-%{_defaultdocdir}/%{name}/
+%{_datarootdir}/zsh/site-functions/_hub/
%changelog
+* Wed Aug 31 2016 Stephen Gallagher <sgallagh(a)redhat.com> - 2.2.5-1
+- Update to new (and latest) major release of hub
+- Include ZSH completion script
+
* Wed Feb 03 2016 Fedora Release Engineering <releng(a)fedoraproject.org> - 1.12.4-6
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
diff --git a/sources b/sources
index 85beead..fb5c595 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-57be9993bfe8f40f94c9f973f57b9baa hub-748c1359b33e3f6af843d7b9eaaf990e563a8449.tar.gz
+5ba681b934bc4587b7a728ff1dbcd407 hub-2.2.5-7988c4b.tar.gz
--
cgit v0.12
http://pkgs.fedoraproject.org/cgit/hub.git/commit/?h=master&id=0b1b97...