[etcd] Remove the rest of the bundled libs

Peter Lemenkov peter at fedoraproject.org
Sun Oct 20 09:17:01 UTC 2013


commit eeea1af2baafb6feb094597010571bda49bb5bea
Author: Peter Lemenkov <lemenkov at gmail.com>
Date:   Sun Oct 20 13:16:52 2013 +0400

    Remove the rest of the bundled libs
    
    Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>

 ...001-feat-activation-add-socket-activation.patch |    2 +-
 etcd-0002-Switch-to-goraft-raft.patch              |  124 ++++++++++++++++++++
 etcd.spec                                          |   30 +++--
 3 files changed, 144 insertions(+), 12 deletions(-)
---
diff --git a/etcd-0001-feat-activation-add-socket-activation.patch b/etcd-0001-feat-activation-add-socket-activation.patch
index 1b097ad..00d7f9b 100644
--- a/etcd-0001-feat-activation-add-socket-activation.patch
+++ b/etcd-0001-feat-activation-add-socket-activation.patch
@@ -1,7 +1,7 @@
 From 42f2abe76fcd9fad7dad3777b3aa9a368cf85d6e Mon Sep 17 00:00:00 2001
 From: David Fisher <ddf1991 at gmail.com>
 Date: Wed, 25 Sep 2013 17:07:30 -0700
-Subject: [PATCH 1/1] feat(activation): add socket activation
+Subject: [PATCH 1/2] feat(activation): add socket activation
 
 Checks for sockets on startup and uses them if available. Uses the
 proper (socket activated) port it's listening on in its advertised URL.
diff --git a/etcd-0002-Switch-to-goraft-raft.patch b/etcd-0002-Switch-to-goraft-raft.patch
new file mode 100644
index 0000000..345c25e
--- /dev/null
+++ b/etcd-0002-Switch-to-goraft-raft.patch
@@ -0,0 +1,124 @@
+From 182125db8f3eb0d9b8cce969b9d72dafb2b74af2 Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Sun, 20 Oct 2013 12:29:45 +0400
+Subject: [PATCH 2/2] Switch to goraft/raft
+
+Signed-off-by: Peter Lemenkov <lemenkov at gmail.com>
+---
+ command.go       | 2 +-
+ etcd.go          | 2 +-
+ etcd_handlers.go | 2 +-
+ raft_handlers.go | 2 +-
+ raft_server.go   | 2 +-
+ raft_stats.go    | 2 +-
+ transporter.go   | 2 +-
+ web/web.go       | 2 +-
+ 8 files changed, 8 insertions(+), 8 deletions(-)
+
+diff --git a/command.go b/command.go
+index 587afad..594e5e3 100644
+--- a/command.go
++++ b/command.go
+@@ -26,7 +26,7 @@ import (
+ 
+ 	etcdErr "github.com/coreos/etcd/error"
+ 	"github.com/coreos/etcd/store"
+-	"github.com/coreos/go-raft"
++	"github.com/goraft/raft"
+ )
+ 
+ const commandPrefix = "etcd:"
+diff --git a/etcd.go b/etcd.go
+index 49426b6..2023de5 100644
+--- a/etcd.go
++++ b/etcd.go
+@@ -27,7 +27,7 @@ import (
+ 	"time"
+ 
+ 	"github.com/coreos/etcd/store"
+-	"github.com/coreos/go-raft"
++	"github.com/goraft/raft"
+ )
+ 
+ //------------------------------------------------------------------------------
+diff --git a/etcd_handlers.go b/etcd_handlers.go
+index cc0c79a..e1d2cca 100644
+--- a/etcd_handlers.go
++++ b/etcd_handlers.go
+@@ -25,7 +25,7 @@ import (
+ 	etcdErr "github.com/coreos/etcd/error"
+ 	"github.com/coreos/etcd/store"
+ 	"github.com/coreos/etcd/mod"
+-	"github.com/coreos/go-raft"
++	"github.com/goraft/raft"
+ )
+ 
+ //-------------------------------------------------------------------
+diff --git a/raft_handlers.go b/raft_handlers.go
+index efd45ec..0bc9d5f 100644
+--- a/raft_handlers.go
++++ b/raft_handlers.go
+@@ -20,7 +20,7 @@ import (
+ 	"encoding/json"
+ 	"net/http"
+ 
+-	"github.com/coreos/go-raft"
++	"github.com/goraft/raft"
+ )
+ 
+ //-------------------------------------------------------------
+diff --git a/raft_server.go b/raft_server.go
+index 7da281b..01e553d 100644
+--- a/raft_server.go
++++ b/raft_server.go
+@@ -28,7 +28,7 @@ import (
+ 	"time"
+ 
+ 	etcdErr "github.com/coreos/etcd/error"
+-	"github.com/coreos/go-raft"
++	"github.com/goraft/raft"
+ )
+ 
+ type raftServer struct {
+diff --git a/raft_stats.go b/raft_stats.go
+index fbe439f..254e829 100644
+--- a/raft_stats.go
++++ b/raft_stats.go
+@@ -21,7 +21,7 @@ import (
+ 	"sync"
+ 	"time"
+ 
+-	"github.com/coreos/go-raft"
++	"github.com/goraft/raft"
+ )
+ 
+ const (
+diff --git a/transporter.go b/transporter.go
+index ac533c2..a0154c4 100644
+--- a/transporter.go
++++ b/transporter.go
+@@ -26,7 +26,7 @@ import (
+ 	"net/http"
+ 	"time"
+ 
+-	"github.com/coreos/go-raft"
++	"github.com/goraft/raft"
+ )
+ 
+ // Timeout for setup internal raft http connection
+diff --git a/web/web.go b/web/web.go
+index 0d139fa..bfd2ca2 100644
+--- a/web/web.go
++++ b/web/web.go
+@@ -19,7 +19,7 @@ package web
+ import (
+ 	"code.google.com/p/go.net/websocket"
+ 	"fmt"
+-	"github.com/coreos/go-raft"
++	"github.com/goraft/raft"
+ 	"html/template"
+ 	"net/http"
+ 	"net/url"
+-- 
+1.8.3.1
+
diff --git a/etcd.spec b/etcd.spec
index d416741..a2c2392 100644
--- a/etcd.spec
+++ b/etcd.spec
@@ -2,7 +2,7 @@
 
 Name:		etcd
 Version:	0.1.2
-Release:	4%{?dist}
+Release:	5%{?dist}
 Summary:	A highly-available key value store for shared configuration
 
 License:	ASL 2.0
@@ -11,9 +11,15 @@ Source0:	https://github.com/coreos/%{name}/archive/v%{version}/%{name}-v%{versio
 Source1:	etcd.service
 Source2:	etcd.socket
 Patch1:		etcd-0001-feat-activation-add-socket-activation.patch
+Patch2:		etcd-0002-Switch-to-goraft-raft.patch
 
 BuildRequires:	golang
-BuildRequires:	golang("code.google.com/p/go.net")
+BuildRequires:	golang(code.google.com/p/go.net)
+BuildRequires:	golang(code.google.com/p/goprotobuf)
+BuildRequires:	golang(bitbucket.org/kardianos/osext)
+BuildRequires:	golang(github.com/coreos/go-log/log)
+BuildRequires:	golang(github.com/coreos/go-systemd)
+BuildRequires:	golang(github.com/goraft/raft)
 BuildRequires:	systemd
 
 Requires(post): systemd
@@ -28,17 +34,12 @@ A highly-available key value store for shared configuration.
 echo "package main
 const releaseVersion = \"%{version}\"" > release_version.go
 %patch1 -p1 -b .systemd-activation
-# These all packages should be unbundled
-mkdir -p src/code.google.com/p
-cp -r third_party/code.google.com/p/goprotobuf/ src/code.google.com/p/
+%patch2 -p1 -b .switch_to_goraft_raft
+# Remove all 3rd party libs (we're using system-wide ones)
+rm -rf third_party
+# Make link for etcd itself
 mkdir -p src/github.com/coreos
-cp -r third_party/github.com/coreos/go-log/ src/github.com/coreos/
-cp -r third_party/github.com/coreos/go-raft/ src/github.com/coreos/
-cp -r third_party/github.com/coreos/go-systemd/ src/github.com/coreos/
-# for etcd itself
 ln -s ../../../ src/github.com/coreos/etcd
-mkdir -p src/bitbucket.org/kardianos
-cp -r third_party/bitbucket.org/kardianos/osext/ src/bitbucket.org/kardianos/
 
 %build
 GOPATH="${PWD}:%{_datadir}/gocode" go build -v -x -o etcd
@@ -67,6 +68,13 @@ install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.socket
 %doc LICENSE README.md Documentation/internal-protocol-versioning.md
 
 %changelog
+* Sun Oct 20 2013 Peter Lemenkov <lemenkov at gmail.com> - 0.1.2-5
+- goprotobuf library unbundled (see rhbz #1018477)
+- go-log library unbundled (see rhbz #1018478)
+- go-raft library unbundled (see rhbz #1018479)
+- go-systemd library unbundled (see rhbz #1018480)
+- kardianos library unbundled (see rhbz #1018481)
+
 * Sun Oct 13 2013 Peter Lemenkov <lemenkov at gmail.com> - 0.1.2-4
 - go.net library unbundled (see rhbz #1018476)
 


More information about the scm-commits mailing list