Blob Blame History Raw
%global debug_package   %{nil}
%global provider        github
%global provider_tld    com
%global repo            go-metrics
%global project         rcrowley
%global import_path     %{provider}.%{provider_tld}/%{project}/%{repo}
%global commit          dee209f2455f101a5e4e593dea94872d2c62d85d
%global shortcommit     %(c=%{commit}; echo ${c:0:7})

Name:           golang-%{provider}-%{project}-%{repo}
Version:        0
Release:        0.3.git%{shortcommit}%{?dist}
Summary:        Go port of Coda Hales Metrics library
License:        BSD
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
Go port of Coda Hales Metrics library

%package devel
BuildRequires:  golang >= 1.2.1-3
BuildRequires:  golang(github.com/influxdb/influxdb/client)
BuildRequires:  golang(github.com/stathat/go)
Requires:       golang >= 1.2.1-3
Requires:       golang(github.com/influxdb/influxdb/client)
Requires:       golang(github.com/stathat/go)
Summary:        Go port of Coda Hales Metrics library
Provides:       golang(%{import_path}) = %{version}-%{release}
Provides:       golang(%{import_path}/stathat) = %{version}-%{release}
Provides:       golang(%{import_path}/librato) = %{version}-%{release}
Provides:       golang(%{import_path}/influxdb) = %{version}-%{release}
Provides:       golang(%{import_path}/cmd/never-read) = %{version}-%{release}
Provides:       golang(%{import_path}/cmd/metrics-bench) = %{version}-%{release}
Provides:       golang(%{import_path}/cmd/metrics-example) = %{version}-%{release}

BuildArch:      noarch

%description devel
%{summary}.

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

%build
# the ./cmd pieces are presently examples

%install
install -d %{buildroot}/%{gopath}/src/%{import_path}
cp -pav *.go %{buildroot}/%{gopath}/src/%{import_path}
cp -rpav stathat %{buildroot}/%{gopath}/src/%{import_path}/
cp -rpav librato %{buildroot}/%{gopath}/src/%{import_path}/
cp -rpav influxdb %{buildroot}/%{gopath}/src/%{import_path}/
cp -rpav cmd %{buildroot}/%{gopath}/src/%{import_path}/

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

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

%changelog
* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.3.gitdee209f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Mon Jan 12 2015 jchaloup <jchaloup@redhat.com> - 0-0.2.gitdee209f
- Bump to dee209f2455f101a5e4e593dea94872d2c62d85d
  adding missing provides
  related: #1120867

* Fri Sep 19 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0-0.1.git3be59ce
- BuildArch: noarch for main package
- defattr and attrs aren't needed in files listing
- replacing repo and project values with macros

* Thu Jul 17 2014 Colin Walters <walters@verbum.org> 0-0.0.git3be59ce
- Initial package