Blame consul.spec

23a9fbf
%if 0%{?fedora}
23a9fbf
%global with_devel 1
23a9fbf
# no bundled dependencies so far
23a9fbf
%global with_bundled 0
23a9fbf
%global with_debug 1
23a9fbf
%global with_check 1
23a9fbf
%else
23a9fbf
%global with_devel 0
23a9fbf
# no bundled dependencies so far
23a9fbf
%global with_bundled 0
23a9fbf
%global with_debug 0
23a9fbf
%global with_check 0
23a9fbf
%endif
23a9fbf
23a9fbf
%if 0%{?with_debug}
23a9fbf
%global _dwz_low_mem_die_limit 0
23a9fbf
%else
23a9fbf
%global debug_package   %{nil}
23a9fbf
%endif
23a9fbf
%global provider        github
23a9fbf
%global provider_tld    com
23a9fbf
%global project         hashicorp
23a9fbf
%global repo            consul
23a9fbf
# https://github.com/hashicorp/consul
23a9fbf
%global import_path     %{provider}.%{provider_tld}/%{project}/%{repo}
dcb6ac9
%global commit          46499d6e7237ca8547c15ce44e9b93bea48a455b
23a9fbf
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
23a9fbf
23a9fbf
Name:           consul
dcb6ac9
Version:        0.6.0
23a9fbf
Release:        0.1.git%{shortcommit}%{?dist}
23a9fbf
Summary:        Tool for service discovery, monitoring and configuration http://www.consul.io
23a9fbf
License:        MPLv2.0
23a9fbf
URL:            https://%{import_path}
23a9fbf
Source0:        https://%{import_path}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
23a9fbf
23a9fbf
ExclusiveArch: %{ix86} x86_64 %{arm}
23a9fbf
23a9fbf
BuildRequires: golang >= 1.2.1-3
23a9fbf
%if ! 0%{?with_bundled}
23a9fbf
BuildRequires: golang(github.com/armon/circbuf)
23a9fbf
BuildRequires: golang(github.com/armon/go-metrics)
23a9fbf
BuildRequires: golang(github.com/armon/go-radix)
23a9fbf
BuildRequires: golang(github.com/armon/gomdb)
23a9fbf
BuildRequires: golang(github.com/hashicorp/consul-migrate/migrator)
23a9fbf
BuildRequires: golang(github.com/hashicorp/go-checkpoint)
23a9fbf
BuildRequires: golang(github.com/hashicorp/go-msgpack/codec)
23a9fbf
BuildRequires: golang(github.com/hashicorp/go-syslog)
23a9fbf
BuildRequires: golang(github.com/hashicorp/golang-lru)
23a9fbf
BuildRequires: golang(github.com/hashicorp/hcl)
23a9fbf
BuildRequires: golang(github.com/hashicorp/logutils)
23a9fbf
BuildRequires: golang(github.com/hashicorp/memberlist)
23a9fbf
BuildRequires: golang(github.com/hashicorp/raft)
23a9fbf
BuildRequires: golang(github.com/hashicorp/raft-boltdb)
23a9fbf
BuildRequires: golang(github.com/hashicorp/scada-client)
23a9fbf
BuildRequires: golang(github.com/hashicorp/serf/serf)
23a9fbf
BuildRequires: golang(github.com/hashicorp/yamux)
23a9fbf
BuildRequires: golang(github.com/inconshreveable/muxado)
23a9fbf
BuildRequires: golang(github.com/miekg/dns)
23a9fbf
#BuildRequires: golang(github.com/mitchellh/cli)
23a9fbf
BuildRequires: golang-github-mitchellh-cli-devel-temporary
23a9fbf
BuildRequires: golang(github.com/mitchellh/mapstructure)
23a9fbf
BuildRequires: golang(github.com/ryanuber/columnize)
23a9fbf
%endif
23a9fbf
23a9fbf
%description
23a9fbf
%{summary}
23a9fbf
23a9fbf
%if 0%{?with_devel}
23a9fbf
%package -n golang-%{provider}-%{project}-%{repo}-devel
23a9fbf
Summary:       %{summary}
23a9fbf
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7
23a9fbf
BuildArch:      noarch
23a9fbf
%else
23a9fbf
ExclusiveArch:  %{ix86} x86_64 %{arm}
23a9fbf
%endif
23a9fbf
BuildRequires: golang >= 1.2.1-3
23a9fbf
BuildRequires: golang(github.com/armon/circbuf)
23a9fbf
BuildRequires: golang(github.com/armon/go-metrics)
23a9fbf
BuildRequires: golang(github.com/armon/go-radix)
23a9fbf
BuildRequires: golang(github.com/armon/gomdb)
23a9fbf
BuildRequires: golang(github.com/hashicorp/consul-migrate/migrator)
23a9fbf
BuildRequires: golang(github.com/hashicorp/go-checkpoint)
23a9fbf
BuildRequires: golang(github.com/hashicorp/go-msgpack/codec)
23a9fbf
BuildRequires: golang(github.com/hashicorp/go-syslog)
23a9fbf
BuildRequires: golang(github.com/hashicorp/golang-lru)
23a9fbf
BuildRequires: golang(github.com/hashicorp/hcl)
23a9fbf
BuildRequires: golang(github.com/hashicorp/logutils)
23a9fbf
BuildRequires: golang(github.com/hashicorp/memberlist)
23a9fbf
BuildRequires: golang(github.com/hashicorp/raft)
23a9fbf
BuildRequires: golang(github.com/hashicorp/raft-boltdb)
23a9fbf
BuildRequires: golang(github.com/hashicorp/scada-client)
23a9fbf
BuildRequires: golang(github.com/hashicorp/serf/serf)
23a9fbf
BuildRequires: golang(github.com/hashicorp/yamux)
23a9fbf
BuildRequires: golang(github.com/inconshreveable/muxado)
23a9fbf
BuildRequires: golang(github.com/miekg/dns)
23a9fbf
#BuildRequires: golang(github.com/mitchellh/cli)
23a9fbf
BuildRequires: golang-github-mitchellh-cli-devel-temporary
23a9fbf
BuildRequires: golang(github.com/mitchellh/mapstructure)
23a9fbf
BuildRequires: golang(github.com/ryanuber/columnize)
23a9fbf
Requires:      golang(github.com/armon/circbuf)
23a9fbf
Requires:      golang(github.com/armon/go-metrics)
23a9fbf
Requires:      golang(github.com/armon/go-radix)
23a9fbf
Requires:      golang(github.com/armon/gomdb)
23a9fbf
Requires:      golang(github.com/hashicorp/consul-migrate/migrator)
23a9fbf
Requires:      golang(github.com/hashicorp/go-checkpoint)
23a9fbf
Requires:      golang(github.com/hashicorp/go-msgpack/codec)
23a9fbf
Requires:      golang(github.com/hashicorp/go-syslog)
23a9fbf
Requires:      golang(github.com/hashicorp/golang-lru)
23a9fbf
Requires:      golang(github.com/hashicorp/hcl)
23a9fbf
Requires:      golang(github.com/hashicorp/logutils)
23a9fbf
Requires:      golang(github.com/hashicorp/memberlist)
23a9fbf
Requires:      golang(github.com/hashicorp/raft)
23a9fbf
Requires:      golang(github.com/hashicorp/raft-boltdb)
23a9fbf
Requires:      golang(github.com/hashicorp/scada-client)
23a9fbf
Requires:      golang(github.com/hashicorp/serf/serf)
23a9fbf
Requires:      golang(github.com/hashicorp/yamux)
23a9fbf
Requires:      golang(github.com/inconshreveable/muxado)
23a9fbf
Requires:      golang(github.com/miekg/dns)
23a9fbf
#Requires:      golang(github.com/mitchellh/cli)
23a9fbf
Requires:      golang-github-mitchellh-cli-devel-temporary
23a9fbf
Requires:      golang(github.com/mitchellh/mapstructure)
23a9fbf
Requires:      golang(github.com/ryanuber/columnize)
23a9fbf
Provides:      golang(%{import_path}/acl) = %{version}-%{release}
23a9fbf
Provides:      golang(%{import_path}/api) = %{version}-%{release}
23a9fbf
Provides:      golang(%{import_path}/command) = %{version}-%{release}
23a9fbf
Provides:      golang(%{import_path}/command/agent) = %{version}-%{release}
23a9fbf
Provides:      golang(%{import_path}/consul) = %{version}-%{release}
23a9fbf
Provides:      golang(%{import_path}/consul/structs) = %{version}-%{release}
23a9fbf
Provides:      golang(%{import_path}/testutil) = %{version}-%{release}
23a9fbf
Provides:      golang(%{import_path}/tlsutil) = %{version}-%{release}
23a9fbf
Provides:      golang(%{import_path}/watch) = %{version}-%{release}
23a9fbf
23a9fbf
%description -n golang-%{provider}-%{project}-%{repo}-devel
23a9fbf
%{summary}
23a9fbf
23a9fbf
This package contains library source intended for
23a9fbf
building other packages which use %{project}/%{repo}.
23a9fbf
%endif
23a9fbf
23a9fbf
%prep
23a9fbf
%setup -q -n %{repo}-%{commit}
23a9fbf
23a9fbf
%build
23a9fbf
# Make link for etcd itself
23a9fbf
mkdir -p src/github.com/hashicorp
23a9fbf
ln -s $(pwd) src/github.com/hashicorp/consul
23a9fbf
23a9fbf
export GOPATH=$(pwd):%{gopath}
23a9fbf
23a9fbf
%if 0%{?with_debug}
23a9fbf
function gobuild { go build -a -ldflags "${CGO_LDFLAGS} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -v -x "$@"; }
23a9fbf
%else
23a9fbf
function gobuild { go build -a -v -x "$@"; }
23a9fbf
%endif
23a9fbf
gobuild -o bin/%{name} %{import_path}
23a9fbf
23a9fbf
%install
23a9fbf
# consul subpackage
23a9fbf
install -D -p -m 0755 bin/%{name} %{buildroot}%{_bindir}/%{name}
23a9fbf
23a9fbf
%if 0%{?with_devel}
23a9fbf
# devel subpackage
23a9fbf
install -d -p %{buildroot}/%{gopath}/src/%{import_path}/
23a9fbf
cp -pav *.go %{buildroot}/%{gopath}/src/%{import_path}/
23a9fbf
23a9fbf
#rm -rf website ui bench contrib demo deps scripts terraform
23a9fbf
# copy directories
23a9fbf
for file in acl api command consul testutil tlsutil watch; do
23a9fbf
    cp -rpav $file %{buildroot}%{gopath}/src/%{import_path}/
23a9fbf
done
23a9fbf
%endif
23a9fbf
23a9fbf
%check
23a9fbf
%if 0%{?with_check}
23a9fbf
export GOPATH=%{buildroot}/%{gopath}:%{gopath}
23a9fbf
go test %{import_path}
23a9fbf
go test %{import_path}/acl
23a9fbf
go test %{import_path}/api
23a9fbf
#go test %{import_path}/command
23a9fbf
#command/agent test fails from time to time
23a9fbf
#/consul test fails from time to time
23a9fbf
go test %{import_path}/consul/structs
23a9fbf
go test %{import_path}/testutil
23a9fbf
#go test %{import_path}/tlsutil
23a9fbf
go test %{import_path}/watch
23a9fbf
%endif
23a9fbf
23a9fbf
%files
23a9fbf
%if 0%{?fedora}
23a9fbf
%license LICENSE
23a9fbf
%doc CHANGELOG.md README.md
23a9fbf
%else
23a9fbf
%doc CHANGELOG.md README.md LICENSE
23a9fbf
%endif
23a9fbf
%{_bindir}/%{name}
23a9fbf
23a9fbf
%if 0%{?with_devel}
23a9fbf
%files -n golang-%{provider}-%{project}-%{repo}-devel
23a9fbf
%if 0%{?fedora}
23a9fbf
%license LICENSE
23a9fbf
%doc CHANGELOG.md README.md
23a9fbf
%else
23a9fbf
%doc CHANGELOG.md README.md LICENSE
23a9fbf
%endif
23a9fbf
%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}
23a9fbf
%{gopath}/src/%{import_path}
23a9fbf
%endif
23a9fbf
23a9fbf
%changelog
dcb6ac9
* Wed Dec 09 2015 jchaloup <jchaloup@redhat.com> - 0.6.0-0.1.git46499d6
dcb6ac9
- Update to 0.6.0
dcb6ac9
  related: #1208616
dcb6ac9
23a9fbf
* Wed Apr 15 2015 jchaloup <jchaloup@redhat.com> - 0-0.1.git5079177
23a9fbf
- First package for Fedora
23a9fbf
  resolves: #1208616
23a9fbf