%global debug_package %{nil}
%global provider github
%global provider_tld com
%global project docopt
%global repo docopt.go
%global gorepo docopt-go
%global github_path %{provider}.%{provider_tld}/%{project}/%{repo}
%global import_path %{provider}.%{provider_tld}/%{project}/%{gorepo}
%global commit 854c423c810880e30b9fecdabb12d54f4a92f9bb
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: golang-github-docopt-docopt-go
Version: 0
Release: 0.1.git.%{shortcommit}%{?dist}
Summary: Command-line interface description language in Go
License: MIT
URL: https://godoc.org/%{github_path}
Source0: https://%{github_path}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
BuildArch: noarch
%else
ExclusiveArch: %{ix86} x86_64 %{arm}
%endif
%description
Docopt helps you create beautiful command-line interfaces easily with Go
%package devel
BuildRequires: golang >= 1.2.1-3
Requires: golang >= 1.2.1-3
Summary: Command-line interface description language in Go
Provides: golang(%{import_path}) = %{version}-%{release}
%description devel
Docopt helps you create beautiful command-line interfaces easily with Go
This package contains library source intended for building other packages
which use docopt/docopt-go.
%prep
%setup -q -n %{repo}-%{commit}
%build
%install
install -d %{buildroot}/%{gopath}/src/%{import_path}
cp -pav docopt.go docopt_test.go testcases.docopt test_golang.docopt \
%{buildroot}/%{gopath}/src/%{import_path}/
%check
GOPATH=%{buildroot}/%{gopath} go test %{import_path}
%files devel
%doc LICENSE README.md example_test.go examples
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
%{gopath}/src/%{import_path}
%changelog
* Tue Mar 17 2015 Jakub Jedelsky <jakub.jedelsky@gmail.com> - 0-0.1.git854c423c
- Initial package