diff --git a/.etcd.metadata b/.etcd.metadata new file mode 100644 index 0000000..ed9fa18 --- /dev/null +++ b/.etcd.metadata @@ -0,0 +1,2 @@ +df18de8f54bfa0ba1dbb73d3b0fdf051c149d17d SOURCES/etcd-f1d7dd8.tar.gz +e5b5bd4b54ba94f001965321e9e64331b9e17985 SOURCES/man-3.2.9-1.tar.gz diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3905985 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/etcd-f1d7dd8.tar.gz +SOURCES/man-3.2.9-1.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/0001-change-import-paths.patch b/SOURCES/0001-change-import-paths.patch new file mode 100644 index 0000000..0bf1d02 --- /dev/null +++ b/SOURCES/0001-change-import-paths.patch @@ -0,0 +1,81 @@ +From bed55580f972cc08209357fce5589fefadf398af Mon Sep 17 00:00:00 2001 +From: Jan Chaloupka +Date: Tue, 17 May 2016 21:44:45 +0200 +Subject: [PATCH] change import paths + +--- + tools/benchmark/cmd/put.go | 2 +- + tools/benchmark/cmd/range.go | 2 +- + tools/benchmark/cmd/root.go | 2 +- + tools/benchmark/cmd/stm.go | 2 +- + tools/benchmark/cmd/watch.go | 2 +- + 5 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/tools/benchmark/cmd/put.go b/tools/benchmark/cmd/put.go +index 5f92dd6..557d3f5 100644 +--- a/tools/benchmark/cmd/put.go ++++ b/tools/benchmark/cmd/put.go +@@ -24,7 +24,7 @@ import ( + v3 "github.com/coreos/etcd/clientv3" + "github.com/spf13/cobra" + "golang.org/x/net/context" +- "gopkg.in/cheggaaa/pb.v1" ++ "github.com/cheggaaa/pb" + ) + + // putCmd represents the put command +diff --git a/tools/benchmark/cmd/range.go b/tools/benchmark/cmd/range.go +index 6e67e96..89a5f66 100644 +--- a/tools/benchmark/cmd/range.go ++++ b/tools/benchmark/cmd/range.go +@@ -22,7 +22,7 @@ import ( + v3 "github.com/coreos/etcd/clientv3" + "github.com/spf13/cobra" + "golang.org/x/net/context" +- "gopkg.in/cheggaaa/pb.v1" ++ "github.com/cheggaaa/pb" + ) + + // rangeCmd represents the range command +diff --git a/tools/benchmark/cmd/root.go b/tools/benchmark/cmd/root.go +index a40731b..a7678c2 100644 +--- a/tools/benchmark/cmd/root.go ++++ b/tools/benchmark/cmd/root.go +@@ -19,7 +19,7 @@ import ( + + "github.com/coreos/etcd/pkg/transport" + "github.com/spf13/cobra" +- "gopkg.in/cheggaaa/pb.v1" ++ "github.com/cheggaaa/pb" + ) + + // This represents the base command when called without any subcommands +diff --git a/tools/benchmark/cmd/stm.go b/tools/benchmark/cmd/stm.go +index ce29637..ac677fd 100644 +--- a/tools/benchmark/cmd/stm.go ++++ b/tools/benchmark/cmd/stm.go +@@ -25,7 +25,7 @@ import ( + v3sync "github.com/coreos/etcd/clientv3/concurrency" + "github.com/spf13/cobra" + "golang.org/x/net/context" +- "gopkg.in/cheggaaa/pb.v1" ++ "github.com/cheggaaa/pb" + ) + + // stmCmd represents the STM benchmark command +diff --git a/tools/benchmark/cmd/watch.go b/tools/benchmark/cmd/watch.go +index cd20251..376ee74 100644 +--- a/tools/benchmark/cmd/watch.go ++++ b/tools/benchmark/cmd/watch.go +@@ -26,7 +26,7 @@ import ( + + "github.com/spf13/cobra" + "golang.org/x/net/context" +- "gopkg.in/cheggaaa/pb.v1" ++ "github.com/cheggaaa/pb" + ) + + // watchCmd represents the watch command +-- +1.9.3 + diff --git a/SOURCES/bz1350875-disaster-recovery-with-copies.patch b/SOURCES/bz1350875-disaster-recovery-with-copies.patch new file mode 100644 index 0000000..ca64473 --- /dev/null +++ b/SOURCES/bz1350875-disaster-recovery-with-copies.patch @@ -0,0 +1,56 @@ +From 7ad700a716c2122c3b6db6677a6f717919b88926 Mon Sep 17 00:00:00 2001 +From: Jan Chaloupka +Date: Tue, 2 May 2017 09:56:02 +0200 +Subject: [PATCH] bz1350875-disaster-recovery-with-copies: + +--- + etcdctl/ctlv2/command/backup_command.go | 19 +++++++++++++++++-- + 1 file changed, 17 insertions(+), 2 deletions(-) + +diff --git a/etcdctl/ctlv2/command/backup_command.go b/etcdctl/ctlv2/command/backup_command.go +index feda4b1..e77791f 100644 +--- a/etcdctl/ctlv2/command/backup_command.go ++++ b/etcdctl/ctlv2/command/backup_command.go +@@ -18,6 +18,7 @@ import ( + "fmt" + "log" + "path/filepath" ++ "strconv" + "time" + + "github.com/coreos/etcd/etcdserver/etcdserverpb" +@@ -40,6 +41,9 @@ func NewBackupCommand() cli.Command { + cli.StringFlag{Name: "wal-dir", Value: "", Usage: "Path to the etcd wal dir"}, + cli.StringFlag{Name: "backup-dir", Value: "", Usage: "Path to the backup dir"}, + cli.StringFlag{Name: "backup-wal-dir", Value: "", Usage: "Path to the backup wal dir"}, ++ cli.BoolFlag{Name: "keep-cluster-id", Usage: "Do not rewrite the cluster id"}, ++ cli.StringFlag{Name: "node-id", Value: "", Usage: "Use custom node id instead of a random value"}, ++ + }, + Action: handleBackup, + } +@@ -99,8 +103,19 @@ func handleBackup(c *cli.Context) error { + var metadata etcdserverpb.Metadata + pbutil.MustUnmarshal(&metadata, wmetadata) + idgen := idutil.NewGenerator(0, time.Now()) +- metadata.NodeID = idgen.Next() +- metadata.ClusterID = idgen.Next() ++ explicitNodeId := c.String("node-id") ++ if explicitNodeId != "" { ++ metadata.NodeID, err = strconv.ParseUint(explicitNodeId, 16, 64) ++ if err != nil { ++ log.Fatal(err) ++ } ++ } else { ++ metadata.NodeID = idgen.Next() ++ } ++ keepClusterId := c.Bool("keep-cluster-id") ++ if !keepClusterId { ++ metadata.ClusterID = idgen.Next() ++ } + + neww, err := wal.Create(destWAL, pbutil.MustMarshal(&metadata)) + if err != nil { +-- +2.7.4 + diff --git a/SOURCES/etcd.conf b/SOURCES/etcd.conf new file mode 100644 index 0000000..fd3d934 --- /dev/null +++ b/SOURCES/etcd.conf @@ -0,0 +1,65 @@ +#[Member] +#ETCD_CORS="" +ETCD_DATA_DIR="/var/lib/etcd/default.etcd" +#ETCD_WAL_DIR="" +#ETCD_LISTEN_PEER_URLS="http://localhost:2380" +ETCD_LISTEN_CLIENT_URLS="http://localhost:2379" +#ETCD_MAX_SNAPSHOTS="5" +#ETCD_MAX_WALS="5" +ETCD_NAME="default" +#ETCD_SNAPSHOT_COUNT="100000" +#ETCD_HEARTBEAT_INTERVAL="100" +#ETCD_ELECTION_TIMEOUT="1000" +#ETCD_QUOTA_BACKEND_BYTES="0" +# +#[Clustering] +#ETCD_INITIAL_ADVERTISE_PEER_URLS="http://localhost:2380" +ETCD_ADVERTISE_CLIENT_URLS="http://localhost:2379" +#ETCD_DISCOVERY="" +#ETCD_DISCOVERY_FALLBACK="proxy" +#ETCD_DISCOVERY_PROXY="" +#ETCD_DISCOVERY_SRV="" +#ETCD_INITIAL_CLUSTER="default=http://localhost:2380" +#ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster" +#ETCD_INITIAL_CLUSTER_STATE="new" +#ETCD_STRICT_RECONFIG_CHECK="true" +#ETCD_ENABLE_V2="true" +# +#[Proxy] +#ETCD_PROXY="off" +#ETCD_PROXY_FAILURE_WAIT="5000" +#ETCD_PROXY_REFRESH_INTERVAL="30000" +#ETCD_PROXY_DIAL_TIMEOUT="1000" +#ETCD_PROXY_WRITE_TIMEOUT="5000" +#ETCD_PROXY_READ_TIMEOUT="0" +# +#[Security] +#ETCD_CERT_FILE="" +#ETCD_KEY_FILE="" +#ETCD_CLIENT_CERT_AUTH="false" +#ETCD_TRUSTED_CA_FILE="" +#ETCD_AUTO_TLS="false" +#ETCD_PEER_CERT_FILE="" +#ETCD_PEER_KEY_FILE="" +#ETCD_PEER_CLIENT_CERT_AUTH="false" +#ETCD_PEER_TRUSTED_CA_FILE="" +#ETCD_PEER_AUTO_TLS="false" +# +#[Logging] +#ETCD_DEBUG="false" +#ETCD_LOG_PACKAGE_LEVELS="" +#ETCD_LOG_OUTPUT="default" +# +#[Unsafe] +#ETCD_FORCE_NEW_CLUSTER="false" +# +#[Version] +#ETCD_VERSION="false" +#ETCD_AUTO_COMPACTION_RETENTION="0" +# +#[Profiling] +#ETCD_ENABLE_PPROF="false" +#ETCD_METRICS="basic" +# +#[Auth] +#ETCD_AUTH_TOKEN="simple" diff --git a/SOURCES/etcd.service b/SOURCES/etcd.service new file mode 100644 index 0000000..afe51ea --- /dev/null +++ b/SOURCES/etcd.service @@ -0,0 +1,18 @@ +[Unit] +Description=Etcd Server +After=network.target +After=network-online.target +Wants=network-online.target + +[Service] +Type=notify +WorkingDirectory=/var/lib/etcd/ +EnvironmentFile=-/etc/etcd/etcd.conf +User=etcd +# set GOMAXPROCS to number of processors +ExecStart=/bin/bash -c "GOMAXPROCS=$(nproc) /usr/bin/etcd --name=\"${ETCD_NAME}\" --data-dir=\"${ETCD_DATA_DIR}\" --listen-client-urls=\"${ETCD_LISTEN_CLIENT_URLS}\"" +Restart=on-failure +LimitNOFILE=65536 + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/expand-etcd-arch-validation.patch b/SOURCES/expand-etcd-arch-validation.patch new file mode 100644 index 0000000..d6c4fba --- /dev/null +++ b/SOURCES/expand-etcd-arch-validation.patch @@ -0,0 +1,30 @@ +From b3e78645c1ffa84bcde511c90df4e3dde652c3fa Mon Sep 17 00:00:00 2001 +From: Jan Chaloupka +Date: Tue, 8 Aug 2017 15:01:04 +0200 +Subject: [PATCH] expand etcd arch validation + +--- + etcdmain/etcd.go | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/etcdmain/etcd.go b/etcdmain/etcd.go +index 2f7f00d..61553d4 100644 +--- a/etcdmain/etcd.go ++++ b/etcdmain/etcd.go +@@ -396,6 +396,13 @@ func checkSupportArch() { + if runtime.GOARCH == "amd64" || runtime.GOARCH == "ppc64le" { + return + } ++ ++ if runtime.GOARCH == "arm64" || runtime.GOARCH == "s390x" { ++ plog.Warningf("Running etcd on %s architecture is experimental.", runtime.GOARCH) ++ plog.Warningf("Please report any bugs you encounter: https://bugzilla.redhat.com/") ++ return ++ } ++ + if env, ok := os.LookupEnv("ETCD_UNSUPPORTED_ARCH"); ok && env == runtime.GOARCH { + plog.Warningf("running etcd on unsupported architecture %q since ETCD_UNSUPPORTED_ARCH is set", env) + return +-- +2.7.5 + diff --git a/SPECS/etcd.spec b/SPECS/etcd.spec new file mode 100644 index 0000000..fd249a5 --- /dev/null +++ b/SPECS/etcd.spec @@ -0,0 +1,569 @@ +%global with_devel 0 +%global with_bundled 1 +%global with_debug 1 +%global with_check 0 +%global with_unit_test 0 + +%if 0%{?with_debug} +%global _dwz_low_mem_die_limit 0 +%else +%global debug_package %{nil} +%endif + +%if ! 0%{?gobuild:1} +%define gobuild(o:) go build -buildmode pie -tags=rpm_crashtraceback -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '-Wl,-z,relro'" -a -v -x %{?**}; +%endif + +%global provider github +%global provider_tld com +%global project coreos +%global repo etcd +# https://github.com/coreos/etcd +%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} +%global import_path %{provider_prefix} +%global commit f1d7dd87da3e8feab4aaf675b8e29c6a5ed5f58b +%global shortcommit %(c=%{commit}; echo ${c:0:7}) + +%global system_name etcd + +Name: etcd +Version: 3.2.9 +Release: 3%{?dist} +Summary: A highly-available key value store for shared configuration +License: ASL 2.0 +URL: https://%{provider_prefix} +Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz +Source1: %{system_name}.service +Source2: %{system_name}.conf +Source3: man-%{version}-1.tar.gz +Patch2: 0001-change-import-paths.patch +Patch3: bz1350875-disaster-recovery-with-copies.patch +Patch4: expand-etcd-arch-validation.patch + +# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required +ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:x86_64 aarch64 ppc64le s390x} +# If go_compiler is not set to 1, there is no virtual provide. Use golang instead. +BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} + +Obsoletes: etcd3 < 3.0.15 +Provides: etcd3 = %{version}-%{release} + +%if ! 0%{?with_bundled} +BuildRequires: golang(github.com/akrennmair/gopcap) +BuildRequires: golang(github.com/bgentry/speakeasy) +BuildRequires: golang(github.com/boltdb/bolt) +BuildRequires: golang(github.com/cheggaaa/pb) +BuildRequires: golang(github.com/cockroachdb/cmux) +BuildRequires: golang(github.com/codegangsta/cli) +BuildRequires: golang(github.com/coreos/go-semver/semver) +BuildRequires: golang(github.com/coreos/go-systemd/daemon) +BuildRequires: golang(github.com/coreos/go-systemd/util) +BuildRequires: golang(github.com/coreos/pkg/capnslog) +BuildRequires: golang(github.com/dustin/go-humanize) +BuildRequires: golang(github.com/ghodss/yaml) +BuildRequires: golang(github.com/gogo/protobuf/proto) +BuildRequires: golang(github.com/google/btree) +BuildRequires: golang(github.com/jonboulle/clockwork) +BuildRequires: golang(github.com/kr/pty) +BuildRequires: golang(github.com/olekukonko/tablewriter) +BuildRequires: golang(github.com/prometheus/client_golang/prometheus) +BuildRequires: golang(github.com/prometheus/procfs) +BuildRequires: golang(github.com/spacejam/loghisto) +BuildRequires: golang(github.com/spf13/cobra) +BuildRequires: golang(github.com/spf13/pflag) +BuildRequires: golang(github.com/ugorji/go/codec) +BuildRequires: golang(github.com/xiang90/probing) +BuildRequires: golang(golang.org/x/crypto/bcrypt) +BuildRequires: golang(golang.org/x/net/context) +BuildRequires: golang(golang.org/x/net/http2) +BuildRequires: golang(google.golang.org/grpc) +BuildRequires: golang(google.golang.org/grpc/codes) +BuildRequires: golang(google.golang.org/grpc/credentials) +BuildRequires: golang(google.golang.org/grpc/grpclog) +BuildRequires: golang(google.golang.org/grpc/transport) +%else +BuildRequires: libpcap-devel +%endif + +BuildRequires: systemd + +Requires(pre): shadow-utils +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd + +%description +A highly-available key value store for shared configuration. + +%if 0%{?with_devel} +%package devel +Summary: etcd golang devel libraries +BuildArch: noarch + +%if 0%{?with_check} +BuildRequires: golang(github.com/cheggaaa/pb) +BuildRequires: golang(github.com/bgentry/speakeasy) +BuildRequires: golang(github.com/boltdb/bolt) +BuildRequires: golang(github.com/cockroachdb/cmux) +BuildRequires: golang(github.com/codegangsta/cli) +BuildRequires: golang(github.com/coreos/go-semver/semver) +BuildRequires: golang(github.com/coreos/go-systemd/daemon) +BuildRequires: golang(github.com/coreos/go-systemd/util) +BuildRequires: golang(github.com/coreos/pkg/capnslog) +BuildRequires: golang(github.com/dustin/go-humanize) +BuildRequires: golang(github.com/ghodss/yaml) +BuildRequires: golang(github.com/gogo/protobuf/proto) +BuildRequires: golang(github.com/google/btree) +BuildRequires: golang(github.com/jonboulle/clockwork) +BuildRequires: golang(github.com/kr/pty) +BuildRequires: golang(github.com/olekukonko/tablewriter) +BuildRequires: golang(github.com/prometheus/client_golang/prometheus) +BuildRequires: golang(github.com/prometheus/procfs) +BuildRequires: golang(github.com/spf13/cobra) +BuildRequires: golang(github.com/spf13/pflag) +BuildRequires: golang(github.com/ugorji/go/codec) +BuildRequires: golang(github.com/xiang90/probing) +BuildRequires: golang(golang.org/x/crypto/bcrypt) +BuildRequires: golang(golang.org/x/net/context) +BuildRequires: golang(golang.org/x/net/http2) +BuildRequires: golang(google.golang.org/grpc) +BuildRequires: golang(google.golang.org/grpc/codes) +BuildRequires: golang(google.golang.org/grpc/credentials) +BuildRequires: golang(google.golang.org/grpc/grpclog) +%endif + +Requires: golang(github.com/cheggaaa/pb) +Requires: golang(github.com/bgentry/speakeasy) +Requires: golang(github.com/boltdb/bolt) +Requires: golang(github.com/cockroachdb/cmux) +Requires: golang(github.com/codegangsta/cli) +Requires: golang(github.com/coreos/go-semver/semver) +Requires: golang(github.com/coreos/go-systemd/daemon) +Requires: golang(github.com/coreos/go-systemd/util) +Requires: golang(github.com/coreos/pkg/capnslog) +Requires: golang(github.com/dustin/go-humanize) +Requires: golang(github.com/ghodss/yaml) +Requires: golang(github.com/gogo/protobuf/proto) +Requires: golang(github.com/google/btree) +Requires: golang(github.com/jonboulle/clockwork) +Requires: golang(github.com/kr/pty) +Requires: golang(github.com/olekukonko/tablewriter) +Requires: golang(github.com/prometheus/client_golang/prometheus) +Requires: golang(github.com/prometheus/procfs) +Requires: golang(github.com/spf13/cobra) +Requires: golang(github.com/spf13/pflag) +Requires: golang(github.com/ugorji/go/codec) +Requires: golang(github.com/xiang90/probing) +Requires: golang(golang.org/x/crypto/bcrypt) +Requires: golang(golang.org/x/net/context) +Requires: golang(golang.org/x/net/http2) +Requires: golang(google.golang.org/grpc) +Requires: golang(google.golang.org/grpc/codes) +Requires: golang(google.golang.org/grpc/credentials) +Requires: golang(google.golang.org/grpc/grpclog) + +Provides: golang(%{import_path}/alarm) = %{version}-%{release} +Provides: golang(%{import_path}/auth) = %{version}-%{release} +Provides: golang(%{import_path}/auth/authpb) = %{version}-%{release} +Provides: golang(%{import_path}/client) = %{version}-%{release} +Provides: golang(%{import_path}/clientv3) = %{version}-%{release} +Provides: golang(%{import_path}/clientv3/concurrency) = %{version}-%{release} +Provides: golang(%{import_path}/clientv3/integration) = %{version}-%{release} +Provides: golang(%{import_path}/clientv3/mirror) = %{version}-%{release} +Provides: golang(%{import_path}/compactor) = %{version}-%{release} +Provides: golang(%{import_path}/contrib/recipes) = %{version}-%{release} +Provides: golang(%{import_path}/discovery) = %{version}-%{release} +Provides: golang(%{import_path}/e2e) = %{version}-%{release} +Provides: golang(%{import_path}/error) = %{version}-%{release} +Provides: golang(%{import_path}/etcdctl/ctlv2) = %{version}-%{release} +Provides: golang(%{import_path}/etcdctl/ctlv2/command) = %{version}-%{release} +Provides: golang(%{import_path}/etcdctl/ctlv3) = %{version}-%{release} +Provides: golang(%{import_path}/etcdctl/ctlv3/command) = %{version}-%{release} +Provides: golang(%{import_path}/etcdmain) = %{version}-%{release} +Provides: golang(%{import_path}/etcdserver) = %{version}-%{release} +Provides: golang(%{import_path}/etcdserver/api) = %{version}-%{release} +Provides: golang(%{import_path}/etcdserver/api/v2http) = %{version}-%{release} +Provides: golang(%{import_path}/etcdserver/api/v2http/httptypes) = %{version}-%{release} +Provides: golang(%{import_path}/etcdserver/api/v3rpc) = %{version}-%{release} +Provides: golang(%{import_path}/etcdserver/api/v3rpc/rpctypes) = %{version}-%{release} +Provides: golang(%{import_path}/etcdserver/auth) = %{version}-%{release} +Provides: golang(%{import_path}/etcdserver/etcdserverpb) = %{version}-%{release} +Provides: golang(%{import_path}/etcdserver/membership) = %{version}-%{release} +Provides: golang(%{import_path}/etcdserver/stats) = %{version}-%{release} +Provides: golang(%{import_path}/integration) = %{version}-%{release} +Provides: golang(%{import_path}/lease) = %{version}-%{release} +Provides: golang(%{import_path}/lease/leasehttp) = %{version}-%{release} +Provides: golang(%{import_path}/lease/leasepb) = %{version}-%{release} +Provides: golang(%{import_path}/mvcc) = %{version}-%{release} +Provides: golang(%{import_path}/mvcc/backend) = %{version}-%{release} +Provides: golang(%{import_path}/mvcc/mvccpb) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/adt) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/contention) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/cors) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/crc) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/expect) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/fileutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/flags) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/httputil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/idutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/ioutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/logutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/mock/mockstorage) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/mock/mockstore) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/mock/mockwait) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/netutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/osutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/pathutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/pbutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/runtime) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/schedule) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/testutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/tlsutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/transport) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/types) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/wait) = %{version}-%{release} +Provides: golang(%{import_path}/proxy/httpproxy) = %{version}-%{release} +Provides: golang(%{import_path}/proxy/tcpproxy) = %{version}-%{release} +Provides: golang(%{import_path}/raft) = %{version}-%{release} +Provides: golang(%{import_path}/raft/raftpb) = %{version}-%{release} +Provides: golang(%{import_path}/raft/rafttest) = %{version}-%{release} +Provides: golang(%{import_path}/rafthttp) = %{version}-%{release} +Provides: golang(%{import_path}/snap) = %{version}-%{release} +Provides: golang(%{import_path}/snap/snappb) = %{version}-%{release} +Provides: golang(%{import_path}/store) = %{version}-%{release} +Provides: golang(%{import_path}/tools/benchmark/cmd) = %{version}-%{release} +Provides: golang(%{import_path}/tools/functional-tester/etcd-agent/client) = %{version}-%{release} +Provides: golang(%{import_path}/version) = %{version}-%{release} +Provides: golang(%{import_path}/wal) = %{version}-%{release} +Provides: golang(%{import_path}/wal/walpb) = %{version}-%{release} + +%description devel +golang development libraries for etcd, a highly-available key value store for +shared configuration. +%endif + +%if 0%{?with_unit_test} && 0%{?with_devel} +%package unit-test +Summary: Unit tests for %{name} package +# If go_compiler is not set to 1, there is no virtual provide. Use golang instead. +BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} + +%if 0%{?with_check} +#Here comes all BuildRequires: PACKAGE the unit tests +#in %%check section need for running +%endif + +# test subpackage tests code from devel subpackage +Requires: %{name}-devel = %{version}-%{release} + +%description unit-test +%{summary} + +This package contains unit tests for project +providing packages with %{import_path} prefix. +%endif + +%prep +%setup -q -n man-%{version} -T -b 3 +%setup -q -n %{repo}-%{commit} +mkdir -p man/man1 +cp ../man-%{version}/*.1 man/man1/. + +# move content of vendor under Godeps as has been so far +mkdir -p Godeps/_workspace/src +mv cmd/vendor/* Godeps/_workspace/src/. + +%if ! 0%{?with_bundled} +%patch2 -p1 +%endif + +%patch3 -p1 +%patch4 -p1 + +%build +mkdir -p src/github.com/coreos +ln -s ../../../ src/github.com/coreos/etcd + +%if ! 0%{?with_bundled} +export GOPATH=$(pwd):%{gopath} +%else +export GOPATH=$(pwd):$(pwd)/Godeps/_workspace:%{gopath} +%endif + +%if ! 0%{?with_debug} +export LDFLAGS="-X %{import_path}/version.GitSHA=%{shortcommit}" +%else +export LDFLAGS="-X %{import_path}/version.GitSHA=%{shortcommit} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" +%endif + +%gobuild -o bin/%{system_name} %{import_path} +%gobuild -o bin/%{system_name}ctl %{import_path}/%{system_name}ctl + +%install +install -D -p -m 0755 bin/%{system_name} %{buildroot}%{_bindir}/%{system_name} +install -D -p -m 0755 bin/%{system_name}ctl %{buildroot}%{_bindir}/%{system_name}ctl +install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{system_name}.service +install -d -m 0755 %{buildroot}%{_sysconfdir}/%{system_name} +install -m 644 -t %{buildroot}%{_sysconfdir}/%{system_name} %{SOURCE2} + +# install manpages +install -d %{buildroot}%{_mandir}/man1 +install -p -m 644 man/man1/* %{buildroot}%{_mandir}/man1 + +# And create /var/lib/etcd +install -d -m 0755 %{buildroot}%{_sharedstatedir}/%{system_name} + +# source codes for building projects +%if 0%{?with_devel} +install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ +echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list +# find all *.go but no *_test.go files and generate devel.file-list +for file in $(find . -iname "*.go" \! -iname "*_test.go") ; do + echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list + install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) + cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file + echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list +done +%endif + +# testing files for this project +%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.file-list +for file in $(find . -iname "*_test.go"); do + echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list + install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) + cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file + echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test.file-list +done +%endif + +%if 0%{?with_devel} +sort -u -o devel.file-list devel.file-list +%endif + +%check +%if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel} +%if ! 0%{?with_bundled} +export GOPATH=%{buildroot}/%{gopath}:%{gopath} +%else +export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath} +%endif + +%if ! 0%{?gotest:1} +%global gotest go test +%endif + +export BIN_PATH="$(pwd)/bin" + +%gotest %{import_path}/client +%gotest %{import_path}/clientv3 +%gotest %{import_path}/clientv3/integration +%gotest %{import_path}/compactor +%gotest %{import_path}/contrib/raftexample +%gotest %{import_path}/discovery +#%%gotest %%{import_path}/e2e +%gotest %{import_path}/error +%gotest %{import_path}/etcdctl/command +%gotest %{import_path}/etcdmain +%gotest %{import_path}/etcdserver +%gotest %{import_path}/etcdserver/auth +#%gotest %{import_path}/etcdserver/etcdhttp +#%gotest %{import_path}/etcdserver/etcdhttp/httptypes +#%%gotest %%{import_path}/integration +%gotest %{import_path}/lease +%gotest %{import_path}/pkg/adt +%gotest %{import_path}/pkg/cors +%gotest %{import_path}/pkg/crc +%gotest %{import_path}/pkg/fileutil +%gotest %{import_path}/pkg/flags +%gotest %{import_path}/pkg/idutil +%gotest %{import_path}/pkg/ioutil +%gotest %{import_path}/pkg/logutil +%gotest %{import_path}/pkg/netutil +%gotest %{import_path}/pkg/osutil +%gotest %{import_path}/pkg/pathutil +%gotest %{import_path}/pkg/pbutil +%gotest %{import_path}/pkg/schedule +%gotest %{import_path}/pkg/testutil +%gotest %{import_path}/pkg/transport +%gotest %{import_path}/pkg/types +%gotest %{import_path}/pkg/wait +%gotest %{import_path}/proxy +%gotest %{import_path}/raft +%gotest %{import_path}/raft/rafttest +%gotest %{import_path}/rafthttp +%gotest %{import_path}/snap +%gotest %{import_path}/storage +%gotest %{import_path}/storage/backend +%gotest %{import_path}/store +%gotest %{import_path}/tools/functional-tester/etcd-agent +%gotest %{import_path}/version +%gotest %{import_path}/wal +%endif + +%pre +getent group %{system_name} >/dev/null || groupadd -r %{system_name} +getent passwd %{system_name} >/dev/null || useradd -r -g %{system_name} -d %{_sharedstatedir}/%{system_name} \ + -s /sbin/nologin -c "etcd user" %{system_name} + +%post +%systemd_post %{system_name}.service + +%preun +%systemd_preun %{system_name}.service + +%postun +%systemd_postun %{system_name}.service + +#define license tag if not already defined +%{!?_licensedir:%global license %doc} + +%files +%license LICENSE +%doc *.md +%doc glide.lock +%config(noreplace) %{_sysconfdir}/%{system_name} +%{_bindir}/%{system_name} +%{_bindir}/%{system_name}ctl +%dir %attr(-,%{system_name},%{system_name}) %{_sharedstatedir}/%{system_name} +%{_unitdir}/%{system_name}.service +%{_mandir}/man1/*.1* + +%if 0%{?with_devel} +%files devel -f devel.file-list +%license LICENSE +%doc *.md +%doc glide.lock +%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} +%endif + +%if 0%{?with_unit_test} +%files unit-test -f unit-test.file-list +%license LICENSE +%doc *.md +%endif + +%changelog +* Mon Nov 20 2017 Jan Chaloupka - 3.2.9-3 +- Bump man-pages tarball + related: #1510480 + +* Mon Nov 20 2017 Jan Chaloupka - 3.2.9-2 +- Fix Synopsis of etcdctl3 man pages + related: #1510480 + +* Tue Nov 07 2017 Jan Chaloupka - 3.2.9-1 +- Update to 3.2.9 + resolves: #1510480 +- Generate etcd and etcdctl man-pages + resolves: #1444336 + +* Fri Sep 29 2017 Jan Chaloupka - 3.2.7-2 +- Rebuild with correct hardening flags + resolves: #1420783 + +* Tue Sep 19 2017 Jan Chaloupka - 3.2.7-1 +- Update to 3.2.7 + resolves: #1493165 + +* Tue Aug 08 2017 Jan Chaloupka - 3.2.5-1 +- Update to 3.2.5 + resolves: #1479371 + +* Mon Jun 12 2017 Jan Chaloupka - 3.1.9-2 +- Build for secondary architectures as well + +* Fri Jun 09 2017 Scott Dodson - 3.1.9-1 +- Update to 3.1.9 + resolves: #1458941 + +* Tue Jun 06 2017 Jan Chaloupka - 3.1.8-1 +- Update to 3.1.8 + resolves: #1459122 + +* Tue May 02 2017 Jan Chaloupka - 3.1.7-1 +- Update to 3.1.7 + resolves: #1447235 + +* Tue Apr 04 2017 Yaakov Selkowitz - 3.1.3-2 +- Circumvent runtime check of officially supported architectures + resolves: #1434973 + +* Tue Mar 21 2017 Jan Chaloupka - 3.1.3-1 +- Update to 3.1.3 + resolves: #1434364 + +* Mon Feb 27 2017 Josh Boyer - 3.1.0-2.1 +- Rebuild rebase on all architectures + +* Tue Feb 21 2017 Jan Chaloupka - 3.1.0-2 +- Apply "add --keep-cluster-id and --node-id to 'etcdctl backup'" + from extras-rhel-7.2 branch + resolves: #1350875 + +* Thu Feb 16 2017 Josh Boyer - 3.1.0-1.1 +- Rebuild rebase on all architectures + +* Mon Feb 06 2017 Jan Chaloupka - 3.1.0-1 +- Update to 3.1.0 + etcdctl-top removed by upstream + resolves: #1416440 + +* Fri Jan 20 2017 d.marlin +- Build for all archs (adding ppc64le and s390x) + +* Tue Jan 10 2017 d.marlin +- Add aarch64 to ExclusiveArch list. + +* Mon Jan 09 2017 d.marlin +- Correct 'link' warning for -X flag. + +* Thu Dec 01 2016 jchaloup - 3.0.15-1 +- Update to 3.0.15 + Obsolete etcd3 < 3.0.15 + +* Fri Nov 18 2016 jchaloup - 3.0.14-3 +- Build with debug-info subpackage +- Until etcd3 obsoletes etcd it conflicts with it + +* Tue Nov 15 2016 Avesh Agarwal - 3.0.14-2 +- Resolves: #1395359 etcd3 should not obsolete etcd + +* Mon Nov 07 2016 jchaloup - 3.0.14-1 +- Update to v3.0.14 + related: #1386963 + +* Thu Oct 27 2016 jchaloup - 3.0.13-1 +- Update to v3.0.13 + related: #1386963 + +* Fri Oct 21 2016 jchaloup - 3.0.12-3 +- etcdctl: fix migrate in outputing client.Node to json + resolves: #1386963 + +* Tue Oct 18 2016 jchaloup - 3.0.12-2 +- Replace etcd with etcd3 when upgrading + resolves: #1384161 + +* Thu Oct 13 2016 jchaloup - 3.0.12-1 +- Update to v3.0.12 + +* Thu Oct 06 2016 jchaloup - 3.0.10-1 +- Update to v3.0.10 + +* Fri Sep 23 2016 jchaloup - 3.0.3-2 +- Extend etcd.conf with new flags + resolves: #1378706 + +* Fri Jul 22 2016 jchaloup - 3.0.2-1 +- Update to v3.0.3 + related: #1347499 + +* Tue Jul 12 2016 jchaloup - 3.0.2-1 +- Update to v3.0.2 + related: #1347499 + +* Sun May 15 2016 jchaloup - 3.0.0-0.1.beta0 +- Build etcd3 v3.0.0-beta0 for AH 7.3 + resolves: #1347499