diff --git a/.etcd.metadata b/.etcd.metadata index 040093c..f88fe89 100644 --- a/.etcd.metadata +++ b/.etcd.metadata @@ -1,2 +1 @@ -80b405fd01527eea6668fde0186ca6b119c1185c SOURCES/etcd-0.4.6.tar.gz -924668c26a30bfe65ac88971965b1dad819be630 SOURCES/etcdctl-0.4.6.tar.gz +082df0ea53403731ef3bcf9e49c341674dc0f486 SOURCES/v2.0.9.tar.gz diff --git a/.gitignore b/.gitignore index 60a3728..33e313d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -SOURCES/etcd-0.4.6.tar.gz -SOURCES/etcdctl-0.4.6.tar.gz +SOURCES/v2.0.9.tar.gz diff --git a/SOURCES/etcd.conf b/SOURCES/etcd.conf index bd091f5..086b740 100644 --- a/SOURCES/etcd.conf +++ b/SOURCES/etcd.conf @@ -1,34 +1,34 @@ -# This configuration file is written in [TOML](https://github.com/mojombo/toml) - -# addr = "127.0.0.1:4001" -# bind_addr = "127.0.0.1:4001" -# ca_file = "" -# cert_file = "" -# cors = [] -# cpu_profile_file = "" -data_dir = "/var/lib/etcd/default.etcd/" -# discovery = "http://etcd.local:4001/v2/keys/_etcd/registry/examplecluster" -# http_read_timeout = 10 -# http_write_timeout = 10 -# key_file = "" -# peers = [] -# peers_file = "" -# max_cluster_size = 9 -# max_result_buffer = 1024 -# max_retry_attempts = 3 -name = "default" -# snapshot = false -# verbose = false -# very_verbose = false - -# [peer] -# addr = "127.0.0.1:7001" -# bind_addr = "127.0.0.1:7001" -# ca_file = "" -# cert_file = "" -# key_file = "" - -# [cluster] -# active_size = 9 -# remove_delay = 1800.0 -# sync_interval = 5.0 +# [member] +ETCD_NAME=default +ETCD_DATA_DIR="/var/lib/etcd/default.etcd" +#ETCD_SNAPSHOT_COUNTER="10000" +#ETCD_HEARTBEAT_INTERVAL="100" +#ETCD_ELECTION_TIMEOUT="1000" +#ETCD_LISTEN_PEER_URLS="http://localhost:2380,http://localhost:7001" +ETCD_LISTEN_CLIENT_URLS="http://localhost:4001" +#ETCD_MAX_SNAPSHOTS="5" +#ETCD_MAX_WALS="5" +#ETCD_CORS="" +# +#[cluster] +#ETCD_INITIAL_ADVERTISE_PEER_URLS="http://localhost:2380,http://localhost:7001" +# if you use different ETCD_NAME (e.g. test), set ETCD_INITIAL_CLUSTER value for this name, i.e. "test=http://..." +#ETCD_INITIAL_CLUSTER="default=http://localhost:2380,default=http://localhost:7001" +#ETCD_INITIAL_CLUSTER_STATE="new" +#ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster" +#ETCD_ADVERTISE_CLIENT_URLS="http://localhost:2379,http://localhost:4001" +#ETCD_DISCOVERY="" +#ETCD_DISCOVERY_SRV="" +#ETCD_DISCOVERY_FALLBACK="proxy" +#ETCD_DISCOVERY_PROXY="" +# +#[proxy] +#ETCD_PROXY="off" +# +#[security] +#ETCD_CA_FILE="" +#ETCD_CERT_FILE="" +#ETCD_KEY_FILE="" +#ETCD_PEER_CA_FILE="" +#ETCD_PEER_CERT_FILE="" +#ETCD_PEER_KEY_FILE="" diff --git a/SOURCES/etcd.service b/SOURCES/etcd.service index fd5733c..7b8169a 100644 --- a/SOURCES/etcd.service +++ b/SOURCES/etcd.service @@ -4,9 +4,8 @@ After=network.target [Service] Type=simple -# etc logs to the journal directly, suppress double logging -StandardOutput=null -WorkingDirectory=/var/lib/etcd +WorkingDirectory=/var/lib/etcd/ +EnvironmentFile=-/etc/etcd/etcd.conf User=etcd ExecStart=/usr/bin/etcd diff --git a/SPECS/etcd.spec b/SPECS/etcd.spec index 05a4f93..aa4cb14 100644 --- a/SPECS/etcd.spec +++ b/SPECS/etcd.spec @@ -1,33 +1,42 @@ -%global debug_package %{nil} - -%global provider github -%global provider_tld com -%global project coreos -%global repo etcd -%global commit 4f330a9ba2097222a9add8136115f3a670dd0642 - -%global import_path %{provider}.%{provider_tld}/%{project}/%{repo} -%global gopath %{_datadir}/gocode -%global shortcommit %(c=%{commit}; echo ${c:0:7}) - - -Name: etcd -Version: 0.4.6 -Release: 0.13%{?dist} +%if 0%{?fedora} +# https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12 +%global _dwz_low_mem_die_limit 0 +%else +%global debug_package %{nil} +%endif +%global provider github +%global provider_tld com +%global project coreos +%global repo etcd +%global commit 02697ca725e5c790cc1f9d0918ff22fad84cb4c5 + +%global import_path %{provider}.%{provider_tld}/%{project}/%{repo} + +Name: %{repo} +Version: 2.0.9 +Release: 2%{?dist} Summary: A highly-available key value store for shared configuration - License: ASL 2.0 -URL: https://github.com/coreos/etcd/ -Source0: https://github.com/coreos/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz -Source1: httpd://github.com/coreos/etcdctl/archive/v%{version}/etcdctl-%{version}.tar.gz -Source2: etcd.service -Source3: etcd.conf - -ExclusiveArch: x86_64 - -BuildRequires: golang +URL: https://%{import_path} +Source0: https://%{import_path}/archive/v%{version}.tar.gz +Source1: %{name}.service +Source2: %{name}.conf + +%if 0%{?fedora} +Patch0: etcd-2.0.1-Replace-depricated-ErrWrongType-with-its-local-defin.patch +%endif + +ExclusiveArch: %{ix86} x86_64 %{arm} +BuildRequires: golang >= 1.2.1-3 +%if 0%{?fedora} +BuildRequires: golang(code.google.com/p/gogoprotobuf/proto) +BuildRequires: golang(github.com/codegangsta/cli) +BuildRequires: golang(github.com/coreos/go-etcd/etcd) +BuildRequires: golang(github.com/jonboulle/clockwork) +BuildRequires: golang(github.com/stretchr/testify/assert) +BuildRequires: golang(golang.org/x/net/context) +%endif BuildRequires: systemd - Requires(pre): shadow-utils Requires(post): systemd Requires(preun): systemd @@ -36,33 +45,155 @@ Requires(postun): systemd %description A highly-available key value store for shared configuration. +%if 0%{?fedora} +%package devel +BuildRequires: golang >= 1.2.1-3 +BuildRequires: golang(code.google.com/p/gogoprotobuf/proto) +BuildRequires: golang(github.com/codegangsta/cli) +BuildRequires: golang(github.com/coreos/go-etcd/etcd) +BuildRequires: golang(golang.org/x/net/context) +BuildRequires: golang(github.com/jonboulle/clockwork) +BuildRequires: golang(github.com/stretchr/testify/assert) +Requires: golang >= 1.2.1-3 +Provides: golang(%{import_path}/client) = %{version}-%{release} +Provides: golang(%{import_path}/discovery) = %{version}-%{release} +Provides: golang(%{import_path}/error) = %{version}-%{release} +Provides: golang(%{import_path}/etcdctl/command) = %{version}-%{release} +Provides: golang(%{import_path}/etcdmain) = %{version}-%{release} +Provides: golang(%{import_path}/etcdserver) = %{version}-%{release} +Provides: golang(%{import_path}/etcdserver/etcdhttp) = %{version}-%{release} +Provides: golang(%{import_path}/etcdserver/etcdhttp/httptypes) = %{version}-%{release} +Provides: golang(%{import_path}/etcdserver/etcdserverpb) = %{version}-%{release} +Provides: golang(%{import_path}/etcdserver/stats) = %{version}-%{release} +Provides: golang(%{import_path}/integration) = %{version}-%{release} +Provides: golang(%{import_path}/migrate) = %{version}-%{release} +Provides: golang(%{import_path}/migrate/etcd4pb) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/coreos) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/cors) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/crc) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/fileutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/flags) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/idutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/ioutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/metrics) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/netutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/osutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/pbutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/testutil) = %{version}-%{release} +Provides: golang(%{import_path}/pkg/timeutil) = %{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) = %{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}/version) = %{version}-%{release} +Provides: golang(%{import_path}/wal) = %{version}-%{release} +Provides: golang(%{import_path}/wal/walpb) = %{version}-%{release} +Summary: etcd golang devel libraries +ExclusiveArch: %{ix86} x86_64 %{arm} + +%description devel +golang development libraries for etcd, a highly-available key value store for +shared configuration. +%endif + %prep -%setup -q -n %{name}-%{version} -a 1 +%setup -qn %{name}-%{version} +%if 0%{?fedora} +rm -rf Godeps/_workspace/src/github.com/{codegangsta,coreos,stretchr,jonboulle} +rm -rf Godeps/_workspace/src/{code.google.com,bitbucket.org,golang.org} + +find . -name "*.go" \ + -print |\ + xargs sed -i 's/github.com\/coreos\/etcd\/Godeps\/_workspace\/src\///g' + +%patch0 -p1 +%endif %build +%if 0%{?fedora} +# Make link for etcd itself +mkdir -p src/github.com/coreos +ln -s ../../../ src/github.com/coreos/etcd + +export GOPATH=$(pwd):%{gopath}:$GOPATH +# *** ERROR: No build ID note found in /.../BUILDROOT/etcd-2.0.0-1.rc1.fc22.x86_64/usr/bin/etcd +function gobuild { go build -a -ldflags "-B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \n')" -v -x "$@"; } +gobuild -o bin/etcd %{import_path} +gobuild -o bin/etcdctl %{import_path}/etcdctl +gobuild -o bin/etcd-migrate %{import_path}/tools/%{name}-migrate +%else ./build -cd etcdctl-%{version} -./build +%endif + %install +install -D -p -m 0755 bin/%{name} %{buildroot}%{_bindir}/%{name} +install -D -p -m 0755 bin/%{name}ctl %{buildroot}%{_bindir}/%{name}ctl +%if 0%{?fedora} +install -D -p -m 0755 bin/%{name}-migrate %{buildroot}%{_bindir}/%{name}-migrate +%endif +install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service +install -d -m 0755 %{buildroot}%{_sysconfdir}/%{name} +install -m 644 -t %{buildroot}%{_sysconfdir}/%{name} %{SOURCE2} -install -d -m 0755 %{buildroot}%{_sysconfdir}/etcd -install -m 644 -t %{buildroot}%{_sysconfdir}/etcd %{SOURCE3} -install -D -p -m 0755 bin/etcd %{buildroot}%{_bindir}/etcd -install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service # And create /var/lib/etcd -install -d -m 0755 %{buildroot}%{_localstatedir}/lib/etcd - -install -D -p -m 0755 etcdctl-%{version}/bin/etcdctl %{buildroot}%{_bindir}/etcdctl +install -d -m 0755 %{buildroot}%{_sharedstatedir}/%{name} + +%if 0%{?fedora} +# Install files for devel sub-package +install -d %{buildroot}/%{gopath}/src/%{import_path} +cp -pav main.go %{buildroot}/%{gopath}/src/%{import_path}/ +for dir in client discovery error etcdctl etcdmain etcdserver \ + migrate pkg proxy raft rafthttp snap store version wal \ + integration +do + cp -rpav ${dir} %{buildroot}/%{gopath}/src/%{import_path}/ +done +%endif %check -# empty for now +%if 0%{?fedora} +export GOPATH=%{buildroot}%{gopath}:%{gopath} +go test %{import_path}/client +go test %{import_path}/discovery +go test %{import_path}/error +go test %{import_path}/etcdctl/command +go test %{import_path}/etcdmain +#go test %{import_path}/etcdserver +#go test %{import_path}/etcdserver/etcdhttp +#go test %{import_path}/etcdserver/etcdhttp/httptypes +#go test %{import_path}/integration +go test %{import_path}/migrate +#go test %{import_path}/pkg/fileutil +go test %{import_path}/pkg/flags +go test %{import_path}/pkg/ioutil +#go test %{import_path}/pkg/transport +go test %{import_path}/pkg/types +go test %{import_path}/pkg/wait +go test %{import_path}/proxy +go test %{import_path}/raft +go test %{import_path}/rafthttp +go test %{import_path}/snap +#go test %{import_path}/store +go test %{import_path}/wal +%else +#./cover // requires golang cover +#./test // requires golang cover +%endif %pre -getent group etcd >/dev/null || groupadd -r etcd -getent passwd etcd >/dev/null || useradd -r -g etcd -d %{_localstatedir}/lib/etcd \ - -s /sbin/nologin -c "etcd user" etcd +getent group %{name} >/dev/null || groupadd -r %{name} +getent passwd %{name} >/dev/null || useradd -r -g %{name} -d %{_sharedstatedir}/%{name} \ + -s /sbin/nologin -c "etcd user" %{name} + %post %systemd_post %{name}.service @@ -73,44 +204,99 @@ getent passwd etcd >/dev/null || useradd -r -g etcd -d %{_localstatedir}/lib/etc %systemd_postun %{name}.service %files -%config(noreplace) %{_sysconfdir}/etcd -%{_bindir}/etcd -%{_bindir}/etcdctl -%dir %attr(-,etcd,etcd) %{_localstatedir}/lib/etcd +%config(noreplace) %{_sysconfdir}/%{name} +%{_bindir}/%{name} +%{_bindir}/%{name}ctl +%if 0%{?fedora} +%{_bindir}/%{name}-migrate +%endif +%dir %attr(-,%{name},%{name}) %{_sharedstatedir}/%{name} %{_unitdir}/%{name}.service %doc LICENSE README.md Documentation/internal-protocol-versioning.md +%doc Godeps/Godeps.json -%changelog -* Tue Jan 27 2015 Eric Paris - 0.4.6-0.13 -- build and include etcdctl -- return etcd tarball to sources - resolves: #1186439 - -* Wed Jan 21 2015 Eric Paris - 0.4.6-0.12 -- set config to use /var/lib/etcd/default.etcd/ for storeage (like 2.0 will use) - -* Mon Oct 06 2014 jchaloup - 0.4.6-0.11 -- back to 0.4.6 version - -* Mon Oct 06 2014 jchaloup - 0.4.6-0.10.git4f330a9 -- replace BuildArch with ExclusiveArch - -* Sun Oct 05 2014 Eric Paris - 0.4.6-0.9.git378cadf -- Fix the .service file to it can launch! - -* Fri Oct 03 2014 jchaloup - 0.4.6-0.8.git378cadf -- Bump to upstream 4f330a9ba2097222a9add8136115f3a670dd0642 -- the last commit before golang-cover (not in rhel7.1 so far) - -* Thu Oct 02 2014 jchaloup - 0.4.6-7 -- upstream commit to fix the bug caused by random iteration order over map in store/store_test.go -- upstrema commit cc1df691cc7e752f1589fe796b7c1d589316a96f - -* Thu Oct 02 2014 jchaloup - 0.4.6-6 -- removing devel part in install section +%if 0%{?fedora} +%files devel +%doc LICENSE README.md Documentation/internal-protocol-versioning.md +%dir %{gopath}/src/%{provider}.%{provider_tld}/%{project} +%{gopath}/src/%{import_path} +%doc Godeps/Godeps.json +%endif -* Thu Oct 02 2014 Eric Paris - 0.4.6-5 -- Clean up prep and build section +%changelog +* Wed Apr 08 2015 jchaloup - 2.0.9-2 +- No debug info + related: #1199223 + +* Wed Apr 08 2015 jchaloup - 2.0.9-1 +- Update to v2.0.9 + related: #1199223 + +* Fri Apr 03 2015 jchaloup - 2.0.8-0.2 +- Update spec file to fit for rhel too (thanks to eparis) + resolves: #1199223 + +* Wed Apr 01 2015 jchaloup - 2.0.8-0.1 +- Update to v2.0.8 + resolves: #1207881 + +* Tue Mar 31 2015 jchaloup - 2.0.7-0.1 +- Update to v2.0.7 + Add Godeps.json to doc + related: #1191441 + +* Thu Mar 12 2015 jchaloup - 2.0.5-0.1 +- Bump to 9481945228b97c5d019596b921d8b03833964d9e (v2.0.5) + +* Tue Mar 10 2015 Eric Paris - 2.0.3-0.2 +- Fix .service files to work if no config file + +* Fri Feb 20 2015 jchaloup - 2.0.3-0.1 +- Bump to upstream 4d728cc8c488a545a8bdeafd054d9ccc2bfb6876 + +* Wed Feb 18 2015 jchaloup - 2.0.1-0.2 +- Update configuration and service file + Fix depricated ErrWrongType after update of gogo/protobuf + related: #1191441 + +* Wed Feb 11 2015 jchaloup - 2.0.1-0.1 +- Update to 2.0.1 + resolves: #1191441 + +* Mon Feb 09 2015 jchaloup - 2.0.0-0.5 +- Add missing debug info to binaries (patch from Jan Kratochvil) + resolves: #1184257 + +* Fri Jan 30 2015 jchaloup - 2.0.0-0.4 +- Update to etcd-2.0.0 +- use gopath as the last directory to search for source code + related: #1176138 + +* Mon Jan 26 2015 jchaloup - 2.0.0-0.3.rc1 +- default to /var/lib/etcd/default.etcd as 2.0 uses that default (f21 commit byt eparis) + related: #1176138 + fix /etc/etcd/etcd.conf path + +* Tue Jan 20 2015 jchaloup - 2.0.0-0.2.rc1 +- Update of BuildRequires/Requires, Provides and test + Add BuildRequire on jonboulle/clockwork + related: #1176138 + +* Tue Dec 23 2014 Lokesh Mandvekar - 2.0.0-0.1.rc1 +- Resolves: rhbz#1176138 - update to v2.0.0-rc1 +- do not redefine gopath +- use jonboulle/clockwork from within Godeps + +* Fri Oct 17 2014 jchaloup - 0.4.6-7 +- Add ExclusiveArch for go_arches + +* Mon Oct 06 2014 jchaloup - 0.4.6-6 +- related: #1047194 + Remove dependency on go.net + +* Mon Oct 06 2014 jchaloup - 0.4.6-5 +- Fix the .service file so it can launch! + related: #1047194 * Mon Sep 22 2014 jchaloup - 0.4.6-4 - resolves: #1047194