diff options
author | Ed Marshall <esm@logic.net> | 2017-03-06 23:07:04 -0800 |
---|---|---|
committer | Ed Marshall <esm@logic.net> | 2017-03-06 23:07:04 -0800 |
commit | 96601a7230b2a2daf8cee8d6585601fb18d22a68 (patch) | |
tree | 7e71acbe4ad82981e92804a44bc7e8edd8bc5c0f | |
parent | 1a639bbf63746aaa9b6887f368ae9002602aaeeb (diff) | |
download | vault-96601a7230b2a2daf8cee8d6585601fb18d22a68.tar.gz vault-96601a7230b2a2daf8cee8d6585601fb18d22a68.tar.xz vault-96601a7230b2a2daf8cee8d6585601fb18d22a68.zip |
Get vault 0.5.3 building properly.
-rw-r--r-- | vault-0.5.3-defaulttransport.patch | 13 | ||||
-rw-r--r-- | vault-0.5.3-twoqueue.patch | 42 | ||||
-rw-r--r-- | vault.spec | 10 |
3 files changed, 64 insertions, 1 deletions
diff --git a/vault-0.5.3-defaulttransport.patch b/vault-0.5.3-defaulttransport.patch new file mode 100644 index 0000000..1ab8f98 --- /dev/null +++ b/vault-0.5.3-defaulttransport.patch @@ -0,0 +1,13 @@ +diff -urN vault-9617c6eb79c3453aa569d620fc71e90f7e32f72f.orig/physical/consul.go vault-9617c6eb79c3453aa569d620fc71e90f7e32f72f/physical/consul.go +--- vault-9617c6eb79c3453aa569d620fc71e90f7e32f72f.orig/physical/consul.go 2016-05-27 10:34:47.000000000 -0700 ++++ vault-9617c6eb79c3453aa569d620fc71e90f7e32f72f/physical/consul.go 2017-03-06 22:38:23.423616423 -0800 +@@ -62,8 +62,7 @@ + return nil, err + } + +- transport := cleanhttp.DefaultPooledTransport() +- transport.MaxIdleConnsPerHost = 4 ++ transport := cleanhttp.DefaultTransport() + transport.TLSClientConfig = tlsClientConfig + consulConf.HttpClient.Transport = transport + } diff --git a/vault-0.5.3-twoqueue.patch b/vault-0.5.3-twoqueue.patch new file mode 100644 index 0000000..7757c68 --- /dev/null +++ b/vault-0.5.3-twoqueue.patch @@ -0,0 +1,42 @@ +diff -urN vault-9617c6eb79c3453aa569d620fc71e90f7e32f72f.orig/physical/cache.go vault-9617c6eb79c3453aa569d620fc71e90f7e32f72f/physical/cache.go +--- vault-9617c6eb79c3453aa569d620fc71e90f7e32f72f.orig/physical/cache.go 2016-05-27 10:34:47.000000000 -0700 ++++ vault-9617c6eb79c3453aa569d620fc71e90f7e32f72f/physical/cache.go 2017-03-06 22:44:42.268610780 -0800 +@@ -17,7 +17,7 @@ + // by using a simple write-through cache. + type Cache struct { + backend Backend +- lru *lru.TwoQueueCache ++ lru *lru.Cache + } + + // NewCache returns a physical cache of the given size. +@@ -26,7 +26,7 @@ + if size <= 0 { + size = DefaultCacheSize + } +- cache, _ := lru.New2Q(size) ++ cache, _ := lru.New(size) + c := &Cache{ + backend: b, + lru: cache, +diff -urN vault-9617c6eb79c3453aa569d620fc71e90f7e32f72f.orig/vault/policy_store.go vault-9617c6eb79c3453aa569d620fc71e90f7e32f72f/vault/policy_store.go +--- vault-9617c6eb79c3453aa569d620fc71e90f7e32f72f.orig/vault/policy_store.go 2016-05-27 10:34:47.000000000 -0700 ++++ vault-9617c6eb79c3453aa569d620fc71e90f7e32f72f/vault/policy_store.go 2017-03-06 22:45:57.929208795 -0800 +@@ -23,7 +23,7 @@ + // manage ACLs associated with them. + type PolicyStore struct { + view *BarrierView +- lru *lru.TwoQueueCache ++ lru *lru.Cache + } + + // PolicyEntry is used to store a policy by name +@@ -35,7 +35,7 @@ + // NewPolicyStore creates a new PolicyStore that is backed + // using a given view. It used used to durable store and manage named policy. + func NewPolicyStore(view *BarrierView) *PolicyStore { +- cache, _ := lru.New2Q(policyCacheSize) ++ cache, _ := lru.New(policyCacheSize) + p := &PolicyStore{ + view: view, + lru: cache, @@ -57,6 +57,12 @@ Source2: vault.sysconfig Source3: vault-config.hcl Source4: vault-keys.txt +# Needed because the version of hashicorp/golang-lru in Fedora is too old +Patch0: vault-0.5.3-twoqueue.patch + +# Needed because the version of hashicorp/go-cleanhttp in Fedora is too old +Patch1: vault-0.5.3-defaulttransport.patch + # e.g. el6 has ppc64 arch without gcc-go, so EA tag is required ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}} # If go_compiler is not set to 1, there is no virtual provide. Use golang instead. @@ -321,6 +327,8 @@ providing packages with %{import_path} prefix. %prep %setup -q -n %{repo}-%{commit} +%patch0 -p1 +%patch1 -p1 %build mkdir -p src/%{provider}.%{provider_tld}/%{project} @@ -361,7 +369,7 @@ done %if 0%{?with_unit_test} && 0%{?with_devel} install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ # find all *_test.go files and generate unit-test-devel.file-list -for file in $(find . -iname "*_test.go" | grep -v "vendor") ; do +for file in $(find . -iname "*_test.go" -o -wholename "*/test-fixtures/*" | grep -v "vendor") ; do dirprefix=$(dirname $file) install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$dirprefix cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file |