Blob Blame History Raw
%global debug_package   %{nil}
%global import_path     github.com/goraft/raft
%global gopath          %{_datadir}/gocode
%global commit          e138889d67044726cff4a73554c403311a830e77
%global shortcommit     %(c=%{commit}; echo ${c:0:7})

Name:           golang-github-goraft-raft
Version:        0
Release:        0.4.git%{shortcommit}%{?dist}
Summary:        A Go implementation of the Raft distributed consensus protocol
License:        MIT
URL:            http://%{import_path}
Source0:        https://%{import_path}/archive/%{commit}/raft-%{shortcommit}.tar.gz
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
BuildArch:      noarch
%else
ExclusiveArch:  %{ix86} x86_64 %{arm}
%endif

%description
This is a Go implementation of the Raft distributed consensus protocol.
Raft is a protocol by which a cluster of nodes can maintain a replicated
state machine. The state machine is kept in sync through the use of a
replicated log.

%package devel
Requires:       golang
Requires:       golang(code.google.com/p/goprotobuf)
Summary:        A Go implementation of the Raft distributed consensus protocol
Provides:       golang(%{import_path}) = %{version}-%{release}

%description devel
%{summary}

This package contains library source intended for building other packages
which use goraft/raft.

%prep
%setup -n raft-%{commit}

%build

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

%files devel
%doc LICENSE README.md
%dir %attr(755,root,root) %{gopath}
%dir %attr(755,root,root) %{gopath}/src
%dir %attr(755,root,root) %{gopath}/src/github.com
%dir %attr(755,root,root) %{gopath}/src/github.com/goraft
%dir %attr(755,root,root) %{gopath}/src/%{import_path}
%dir %attr(755,root,root) %{gopath}/src/%{import_path}/protobuf
%{gopath}/src/%{import_path}/*.go
%{gopath}/src/%{import_path}/protobuf/*.pb.go
%{gopath}/src/%{import_path}/protobuf/*.proto

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

* Sun Oct 20 2013 Lokesh Mandvekar <lsm5@redhat.com>  0-0.3.gite138889
- defattr removed
- description updated
- double quotes removed from provides and requires

* Tue Oct 15 2013 Lokesh Mandvekar <lsm5@redhat.com>  0-0.2.gite138889
- requires goprotobuf

* Sat Oct 12 2013 Lokesh Mandvekar <lsm5@redhat.com>  0-0.1.gite138889
- Initial fedora package