%global debug_package %{nil}
%global provider github
%global provider_tld com
%global project bmizerany
%global repo perks
%global import_path %{provider}.%{provider_tld}/%{project}/%{repo}
%global commit d9a9656a3a4b1c2864fdb44db2ef8619772d92aa
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: golang-%{provider}-%{project}-%{repo}
Version: 0
Release: 0.1.git%{shortcommit}%{?dist}
Summary: Effective Computation of Things
License: MIT
URL: https://%{import_path}
Source0: https://%{import_path}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
BuildArch: noarch
%else
ExclusiveArch: %{ix86} x86_64 %{arm}
%endif
%description
%{summary}
%package devel
BuildRequires: golang >= 1.2.1-3
Requires: golang >= 1.2.1-3
Summary: %{summary}
Provides: golang(%{import_path}/histogram) = %{version}-%{release}
Provides: golang(%{import_path}/quantile) = %{version}-%{release}
Provides: golang(%{import_path}/topk) = %{version}-%{release}
%description devel
%{summary}
This package contains library source intended for
building other packages which use %{project}/%{repo}.
%prep
%setup -q -n %{repo}-%{commit}
%build
%install
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
cp -rpav topk %{buildroot}/%{gopath}/src/%{import_path}/
cp -rpav quantile %{buildroot}/%{gopath}/src/%{import_path}/
cp -rpav histogram %{buildroot}/%{gopath}/src/%{import_path}/
%check
GOPATH=%{buildroot}/%{gopath}:%{gopath} go test %{import_path}/topk
GOPATH=%{buildroot}/%{gopath}:%{gopath} go test %{import_path}/quantile
GOPATH=%{buildroot}/%{gopath}:%{gopath} go test %{import_path}/histogram
%files devel
%doc README.md
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
%{gopath}/src/%{import_path}
%changelog
* Sat Feb 07 2015 jchaloup <jchaloup@redhat.com> - 0-0.1.gitd9a9656
- First package for Fedora
resolves: #1190431