Blame golang-github-hashicorp-serf.spec

223915d
%if 0%{?fedora} || 0%{?rhel} == 6
223915d
%global with_devel 1
223915d
%global with_bundled 0
223915d
%global with_debug 0
223915d
%global with_check 1
223915d
%global with_unit_test 1
223915d
%else
223915d
%global with_devel 0
223915d
%global with_bundled 0
223915d
%global with_debug 0
223915d
%global with_check 0
223915d
%global with_unit_test 0
223915d
%endif
223915d
223915d
%if 0%{?with_debug}
223915d
%global _dwz_low_mem_die_limit 0
223915d
%else
def4895
%global debug_package   %{nil}
223915d
%endif
223915d
223915d
%define copying() \
223915d
%if 0%{?fedora} >= 21 || 0%{?rhel} >= 7 \
223915d
%license %{*} \
223915d
%else \
223915d
%doc %{*} \
223915d
%endif
223915d
223915d
%global isgccgoarch 0
223915d
%if 0%{?gccgo_arches:1}
223915d
%ifarch %{gccgo_arches}
223915d
%global isgccgoarch 1
223915d
%endif
223915d
%endif
223915d
def4895
%global provider        github
def4895
%global provider_tld    com
def4895
%global project         hashicorp
def4895
%global repo            serf
def4895
# https://github.com/hashicorp/serf
223915d
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
223915d
%global import_path     %{provider_prefix}
def4895
%global commit          4bd6183181bad5ae211029873279fb74ceace07c
def4895
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
def4895
def4895
Name:           golang-%{provider}-%{project}-%{repo}
def4895
Version:        0
223915d
Release:        0.3.git%{shortcommit}%{?dist}
def4895
Summary:        Service orchestration and management tool http://www.serfdom.io
def4895
License:        MPLv2.0
223915d
URL:            https://%{provider_prefix}
223915d
Source0:        https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
def4895
223915d
# If go_arches not defined fall through to implicit golang archs
223915d
%if 0%{?go_arches:1}
223915d
ExclusiveArch:  %{go_arches}
def4895
%else
223915d
ExclusiveArch:   %{ix86} x86_64 %{arm}
223915d
%endif
223915d
# If gccgo_arches does not fit or is not defined fall through to golang
223915d
%if %{isgccgoarch}
223915d
BuildRequires:   gcc-go >= %{gccgo_min_vers}
223915d
%else
223915d
BuildRequires:   golang
def4895
%endif
def4895
def4895
%description
def4895
%{summary}
def4895
223915d
%if 0%{?with_devel}
def4895
%package devel
def4895
Summary:       %{summary}
223915d
BuildArch:     noarch
223915d
223915d
%if 0%{?with_check}
def4895
BuildRequires: golang(github.com/armon/circbuf)
def4895
BuildRequires: golang(github.com/armon/go-metrics)
def4895
BuildRequires: golang(github.com/hashicorp/go-msgpack/codec)
def4895
BuildRequires: golang(github.com/hashicorp/go-syslog)
def4895
BuildRequires: golang(github.com/hashicorp/logutils)
def4895
BuildRequires: golang(github.com/hashicorp/mdns)
def4895
BuildRequires: golang(github.com/hashicorp/memberlist)
def4895
#BuildRequires: golang(github.com/mitchellh/cli)
def4895
BuildRequires: golang-github-mitchellh-cli-devel-temporary
def4895
BuildRequires: golang(github.com/mitchellh/mapstructure)
def4895
BuildRequires: golang(github.com/ryanuber/columnize)
223915d
%endif
def4895
def4895
Requires:      golang(github.com/armon/circbuf)
def4895
Requires:      golang(github.com/armon/go-metrics)
def4895
Requires:      golang(github.com/hashicorp/go-msgpack/codec)
def4895
Requires:      golang(github.com/hashicorp/go-syslog)
def4895
Requires:      golang(github.com/hashicorp/logutils)
def4895
Requires:      golang(github.com/hashicorp/mdns)
def4895
Requires:      golang(github.com/hashicorp/memberlist)
def4895
#Requires:      golang(github.com/mitchellh/cli)
def4895
Requires:      golang-github-mitchellh-cli-devel-temporary
def4895
Requires:      golang(github.com/mitchellh/mapstructure)
def4895
Requires:      golang(github.com/ryanuber/columnize)
def4895
def4895
Provides:      golang(%{import_path}/client) = %{version}-%{release}
def4895
Provides:      golang(%{import_path}/command) = %{version}-%{release}
def4895
Provides:      golang(%{import_path}/command/agent) = %{version}-%{release}
def4895
Provides:      golang(%{import_path}/serf) = %{version}-%{release}
def4895
Provides:      golang(%{import_path}/testutil) = %{version}-%{release}
def4895
def4895
%description devel
def4895
%{summary}
def4895
def4895
This package contains library source intended for
223915d
building other packages which use import path with
223915d
%{import_path} prefix.
223915d
%endif
223915d
223915d
%if 0%{?with_unit_test}
223915d
%package unit-test
223915d
Summary:         Unit tests for %{name} package
223915d
# If go_arches not defined fall through to implicit golang archs
223915d
%if 0%{?go_arches:1}
223915d
ExclusiveArch:  %{go_arches}
223915d
%else
223915d
ExclusiveArch:   %{ix86} x86_64 %{arm}
223915d
%endif
223915d
# If gccgo_arches does not fit or is not defined fall through to golang
223915d
%if %{isgccgoarch}
223915d
BuildRequires:   gcc-go >= %{gccgo_min_vers}
223915d
%else
223915d
BuildRequires:   golang
223915d
%endif
223915d
223915d
%if 0%{?with_check}
223915d
#Here comes all BuildRequires: PACKAGE the unit tests
223915d
#in %%check section need for running
223915d
%endif
223915d
223915d
# test subpackage tests code from devel subpackage
223915d
Requires:        %{name}-devel = %{version}-%{release}
223915d
223915d
%description unit-test
223915d
%{summary}
223915d
223915d
This package contains unit tests for project
223915d
providing packages with %{import_path} prefix.
223915d
%endif
def4895
def4895
%prep
def4895
%setup -q -n %{repo}-%{commit}
def4895
def4895
%build
def4895
def4895
%install
223915d
# source codes for building projects
223915d
%if 0%{?with_devel}
def4895
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
223915d
# find all *.go but no *_test.go files and generate devel.file-list
223915d
for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do
223915d
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
223915d
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
223915d
    echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list
223915d
done
223915d
%endif
def4895
223915d
# testing files for this project
223915d
%if 0%{?with_unit_test}
223915d
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
223915d
# find all *_test.go files and generate unit-test.file-list
223915d
for file in $(find . -iname "*_test.go"); do
223915d
    install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)
223915d
    cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file
223915d
    echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list
def4895
done
223915d
%endif
def4895
def4895
%check
223915d
%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}
223915d
%if %{isgccgoarch}
223915d
function gotest { %{gcc_go_test} "$@"; }
def4895
%else
223915d
%if 0%{?golang_test:1}
223915d
function gotest { %{golang_test} "$@"; }
223915d
%else
223915d
function gotest { go test "$@"; }
223915d
%endif
def4895
%endif
223915d
223915d
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
223915d
gotest %{import_path}
223915d
# --- FAIL: TestForceLeaveCommandRun (0.16s)
223915d
#gotest %%{import_path}/command
223915d
# --- FAIL: TestSyslogFilter (0.00s)
223915d
#	syslog_test.go:17: err: Unix syslog delivery error
223915d
#gotest %%{import_path}/command/agent
223915d
# --- FAIL: TestSerf_Join_IgnoreOld (0.08s)
223915d
# --- FAIL: TestSerf_SnapshotRecovery (0.72s)
223915d
#gotest %%{import_path}/serf
223915d
gotest %{import_path}/testutil
223915d
%endif
223915d
223915d
%if 0%{?with_devel}
223915d
%files devel -f devel.file-list
223915d
%copying LICENSE
def4895
%doc CHANGELOG.md README.md
def4895
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
223915d
%dir %{gopath}/src/%{import_path}
223915d
%endif
223915d
223915d
%if 0%{?with_unit_test}
223915d
%files unit-test -f unit-test.file-list
223915d
%copying LICENSE
223915d
%doc CHANGELOG.md README.md
223915d
%endif
def4895
def4895
%changelog
223915d
* Mon Aug 24 2015 jchaloup <jchaloup@redhat.com> - 0-0.3.git4bd6183
223915d
- Update spec file to spec-2.0
223915d
  resolves: #1250477
223915d
63cb844
* Thu Jul 16 2015 jchaloup <jchaloup@redhat.com> - 0-0.2.git4bd6183
63cb844
- Disable command test
63cb844
  related: #1212318
63cb844
def4895
* Wed Apr 15 2015 jchaloup <jchaloup@redhat.com> - 0-0.1.git4bd6183
def4895
- First package for Fedora
def4895
  resolves: #1212318