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          3be59ceb5538550555459fb77d0efe0e218cdfc7
%global shortcommit     %(c=%{commit}; echo ${c:0:7})

Name:           golang-%{provider}-%{project}-%{repo}
Version:        0
Release:        0.1.git%{shortcommit}%{?dist}
Summary:        Go port of Coda Hales Metrics library
License:        BSD
URL:            https://%{import_path}
Source0:        https://%{import_path}/archive/%{commit}/%{name}-%{commit}.tar.gz
BuildArch:      noarch

%description
Go port of Coda Hales Metrics library

%package devel
BuildRequires:  golang >= 1.2.1-3
Requires:       golang >= 1.2.1-3
Summary:        Go port of Coda Hales Metrics library
Provides:       golang(%{import_path}) = %{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}
# we're not providing the ./influxdb, ./stathat, or ./librato pieces yet,
# since they have additional dependencies and the core of this library isn't dependent of these pieces

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

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

%changelog
* 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