Blob Blame History Raw
%global debug_package   %{nil}
%global provider        github
%global provider_tld    com
%global project         spf13
%global repo            cobra
%global import_path     %{provider}.%{provider_tld}/%{project}/%{repo}
%global commit          8f5946caaeeff40a98d67f60c25e89c3525038a3
%global shortcommit     %(c=%{commit}; echo ${c:0:7})

Name:           golang-%{provider}-%{project}-%{repo}
Version:        0
Release:        0.9.git%{shortcommit}%{?dist}
Summary:        A Commander for modern go CLI interactions
License:        ASL 2.0
URL:            http://%{import_path}
Source0:        https://%{import_path}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
Patch0:         Remove-Windows-related-code.patch

%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
BuildArch:      noarch
%else
ExclusiveArch:  %{ix86} x86_64 %{arm}
%endif

%description
Cobra is a commander providing a simple interface to create powerful modern
CLI interfaces similar to git & go tools.
In addition to providing an interface, Cobra simultaneously provides
a controller to organize your application code.

Inspired by go, go-Commander, gh and subcommand, Cobra improves on these
by providing fully posix compliant flags (including short & long versions),
nesting commands, and the ability to define your own help and usage
for any or all commands.

%package devel
BuildRequires:  golang >= 1.2.1-3
BuildRequires:  golang(github.com/spf13/pflag)
Requires:       golang >= 1.2.1-3
Requires:       golang(github.com/spf13/pflag)
Summary:        A Commander for modern go CLI interactions
Provides:       golang(%{import_path}) = %{version}-%{release}

%description devel
Cobra is a commander providing a simple interface to create powerful modern
CLI interfaces similar to git & go tools.
In addition to providing an interface, Cobra simultaneously provides
a controller to organize your application code.

Inspired by go, go-Commander, gh and subcommand, Cobra improves on these
by providing fully posix compliant flags (including short & long versions),
nesting commands, and the ability to define your own help and usage
for any or all commands.

This package contains library source intended for building other packages
which use spf13/cobra.

%prep
%setup -q -n %{repo}-%{commit}
%patch0 -p1

%build

%install
install -d -p %{buildroot}/%{gopath}/src/%{import_path}
cp -pav *.go %{buildroot}/%{gopath}/src/%{import_path}

%check
GOPATH=%{buildroot}/%{gopath}:%{gopath} go test %{import_path}

%files devel
%doc LICENSE.txt README.md
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
%{gopath}/src/%{import_path}

%changelog
* Tue Jun 02 2015 jchaloup <jchaloup@redhat.com> - 0-0.9.git8f5946c
- Bump to upstream 8f5946caaeeff40a98d67f60c25e89c3525038a3
  related: #1214769

* Thu Apr 23 2015 jchaloup <jchaloup@redhat.com> - 0-0.8.git3c187e9
- Bump to upstream 3c187e904540cd62f0a197cddd6da02645a7cc5a
  related: #1214769

* Tue Mar 31 2015 jchaloup <jchaloup@redhat.com> - 0-0.7.git79bd93d
- Bump to upstream 79bd93d369fb73d640179208d4e2b1a748915567
  related: #1085881

* Wed Feb 25 2015 jchaloup <jchaloup@redhat.com> - 0-0.6.gitf8e1ec5
- Bump to upstream f8e1ec56bdd7494d309c69681267859a6bfb7549
  related: #1085881

* Wed Dec 24 2014 jchaloup <jchaloup@redhat.com> - 0-0.5.gitb1e90a7
- Bump to e1e66f7b4e667751cf530ddb6e72b79d6eeb0235
  related: #1085881

* Thu Oct 16 2014 jchaloup <jchaloup@redhat.com> - 0-0.4.gite174a40
- Bump to b1e90a7943957b51bb96a13b44b844475bcf95c0

* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.3.gite174a40
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Fri Apr 04 2014 Lokesh Mandvekar <lsm5@redhat.com> 0-0.2.git
- correct tarball name

* Fri Apr 04 2014 Lokesh Mandvekar <lsm5@redhat.com> 0-0.1.git
- Initial package