Blob Blame History Raw
%global debug_package   %{nil}
%global provider        github
%global provider_tld    com
%global project         hashicorp
%global repo            serf
# https://github.com/hashicorp/serf
%global import_path     %{provider}.%{provider_tld}/%{project}/%{repo}
%global commit          4bd6183181bad5ae211029873279fb74ceace07c
%global shortcommit     %(c=%{commit}; echo ${c:0:7})

Name:           golang-%{provider}-%{project}-%{repo}
Version:        0
Release:        0.1.git%{shortcommit}%{?dist}
Summary:        Service orchestration and management tool http://www.serfdom.io
License:        MPLv2.0
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
Summary:       %{summary}
BuildRequires: golang >= 1.2.1-3
BuildRequires: golang(github.com/armon/circbuf)
BuildRequires: golang(github.com/armon/go-metrics)
BuildRequires: golang(github.com/hashicorp/go-msgpack/codec)
BuildRequires: golang(github.com/hashicorp/go-syslog)
BuildRequires: golang(github.com/hashicorp/logutils)
BuildRequires: golang(github.com/hashicorp/mdns)
BuildRequires: golang(github.com/hashicorp/memberlist)
#BuildRequires: golang(github.com/mitchellh/cli)
BuildRequires: golang-github-mitchellh-cli-devel-temporary
BuildRequires: golang(github.com/mitchellh/mapstructure)
BuildRequires: golang(github.com/ryanuber/columnize)

Requires:      golang(github.com/armon/circbuf)
Requires:      golang(github.com/armon/go-metrics)
Requires:      golang(github.com/hashicorp/go-msgpack/codec)
Requires:      golang(github.com/hashicorp/go-syslog)
Requires:      golang(github.com/hashicorp/logutils)
Requires:      golang(github.com/hashicorp/mdns)
Requires:      golang(github.com/hashicorp/memberlist)
#Requires:      golang(github.com/mitchellh/cli)
Requires:      golang-github-mitchellh-cli-devel-temporary
Requires:      golang(github.com/mitchellh/mapstructure)
Requires:      golang(github.com/ryanuber/columnize)

Provides:      golang(%{import_path}/client) = %{version}-%{release}
Provides:      golang(%{import_path}/command) = %{version}-%{release}
Provides:      golang(%{import_path}/command/agent) = %{version}-%{release}
Provides:      golang(%{import_path}/serf) = %{version}-%{release}
Provides:      golang(%{import_path}/testutil) = %{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 -pav *.go %{buildroot}/%{gopath}/src/%{import_path}/

rm -rf website ops-misc

# copy directories
for file in ./* ; do
    if [ -d $file ]; then
        cp -rpav $file %{buildroot}%{gopath}/src/%{import_path}/
    fi
done

%check
GOPATH=%{buildroot}/%{gopath}:%{gopath} go test %{import_path}
GOPATH=%{buildroot}/%{gopath}:%{gopath} go test %{import_path}/command
#GOPATH=%{buildroot}/%{gopath}:%{gopath} go test %{import_path}/command/agent
#GOPATH=%{buildroot}/%{gopath}:%{gopath} go test %{import_path}/serf
GOPATH=%{buildroot}/%{gopath}:%{gopath} go test %{import_path}/testutil

%files devel
%if 0%{?fedora}
%license LICENSE
%else
%doc LICENSE
%endif
%doc CHANGELOG.md README.md
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
%{gopath}/src/%{import_path}

%changelog
* Wed Apr 15 2015 jchaloup <jchaloup@redhat.com> - 0-0.1.git4bd6183
- First package for Fedora
  resolves: #1212318