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