etcd/etcd.spec

139 lines
3.9 KiB
RPMSpec
Raw Normal View History

#
# spec file for package etcd
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define project go.etcd.io/etcd
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir %{_localstatedir}/adm/fillup-templates
%endif
Name: etcd
Version: 3.4.15
Release: 0
Summary: Highly-available key value store for configuration and service discovery
License: Apache-2.0
Group: System/Management
URL: https://github.com/etcd-io/etcd
Accepting request 770475 from home:mjura:branches:devel:kubic - Update to version 3.4.3: * version: 3.4.3 * *: use Go 1.12.12 * rafthttp: add 3.4 stream type * etcdserver: strip patch version in metrics * etcdserver: strip patch version in cluster version * etcdserver: unset old cluster version in metrics * Add version, tag and branch checks to release script * scripts: fix read failure prompt in release; use https for git clone. * version: 3.4.2 * etcdserver: trace compaction request; add return parameter 'trace' to applierV3.Compaction() mvcc: trace compaction request; add input parameter 'trace' to KV.Compact() * etcdserver: trace raft requests. * etcdserver: add put request steps. mvcc: add put request steps; add trace to KV.Write() as input parameter. * pkg: use zap logger to format the structure log output. * pkg: add field to record additional detail of trace; add stepThreshold to reduce log volume. * pkg: create package traceutil for tracing. mvcc: add tracing steps:range from the in-memory index tree; range from boltdb. etcdserver: add tracing steps: agreement among raft nodes before linerized reading; authentication; filter and sort kv pairs; assemble the response. * clientv3: Replace endpoint.ParseHostPort with net.SplitHostPort to fix IPv6 client endpoints * clientv3: Set authority used in cert checks to host of endpoint * tests/e2e: fix metrics tests * etcdctl: fix member add command * scripts/build-binary: fix darwin tar commands * scripts/release: fix SHA256SUMS command * version: 3.4.1 * scripts/release: fix docker push command * integration: fix bug in for loop, make it break properly * embed: expose ZapLoggerBuilder * vendor: upgrade to gRPC v1.23.1 OBS-URL: https://build.opensuse.org/request/show/770475 OBS-URL: https://build.opensuse.org/package/show/devel:kubic/etcd?expand=0&rev=4
2020-02-06 11:19:08 +01:00
Source: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
Source11: %{name}.conf
Source12: %{name}.service
Source15: README.security
Accepting request 824853 from home:RBrownSUSE:branches:devel:kubic - Update to version 3.4.10 [CVE-2020-15106][boo#1174951]: * version: 3.4.10 * Documentation: note on data encryption * etcdserver: change protobuf field type from int to int64 (#12000) * pkg: consider umask when use MkdirAll * etcdmain: let grpc proxy warn about insecure-skip-tls-verify * etcdmain: fix shadow error * pkg/fileutil: print desired file permission in error log * pkg: Fix dir permission check on Windows * auth: Customize simpleTokenTTL settings. * mvcc: chanLen 1024 is to biger,and it used more memory. 128 seems to be enough. Sometimes the consumption speed is more than the production speed. * auth: return incorrect result 'ErrUserNotFound' when client request without username or username was empty. * etcdmain: fix shadow error * doc: add TLS related warnings * etcdserver:FDUsage set ticker to 10 minute from 5 seconds. This ticker will check File Descriptor Requirements ,and count all fds in used. And recorded some logs when in used >= limit/5*4. Just recorded message. If fds was more than 10K,It's low performance due to FDUsage() works. So need to increase it. * clientv3: cancel watches proactively on client context cancellation * wal: check out of range slice in "ReadAll", "decoder" * etcdctl, etcdmain: warn about --insecure-skip-tls-verify options * Documentation: note on the policy of insecure by default * etcdserver: don't let InternalAuthenticateRequest have password * auth: a new error code for the case of password auth against no password user * Documentation: note on password strength * etcdmain: best effort detection of self pointing in tcp proxy * Discovery: do not allow passing negative cluster size * wal: fix panic when decoder not set * embed: fix compaction runtime err * pkg: check file stats * etcdserver, et al: add --unsafe-no-fsync flag * version: 3.4.9 * wal: add TestValidSnapshotEntriesAfterPurgeWal testcase OBS-URL: https://build.opensuse.org/request/show/824853 OBS-URL: https://build.opensuse.org/package/show/devel:kubic/etcd?expand=0&rev=6
2020-08-07 15:38:01 +02:00
BuildRequires: golang(API) = 1.14
BuildRequires: golang-packaging
BuildRequires: shadow
BuildRequires: systemd-rpm-macros
BuildRequires: xz
Requires(post): %fillup_prereq
ExcludeArch: s390 %ix86
%{?systemd_requires}
%{go_provides}
# Make sure that the binary is not getting stripped.
%{go_nostrip}
%description
etcd is a distributed, consistent key-value store for shared configuration and
service discovery, with a focus on being:
- Simple: well-defined, user-facing API (gRPC)
- Secure: automatic TLS with optional client cert authentication
- Fast: benchmarked 10,000 writes/sec
- Reliable: properly distributed using Raft
%package -n etcdctl
Summary: A simple command line client for etcd
Group: System/Management
%description -n etcdctl
A command line client for etcd. It can be used in scripts or for administrators
to explore an etcd cluster.
%prep
Accepting request 770475 from home:mjura:branches:devel:kubic - Update to version 3.4.3: * version: 3.4.3 * *: use Go 1.12.12 * rafthttp: add 3.4 stream type * etcdserver: strip patch version in metrics * etcdserver: strip patch version in cluster version * etcdserver: unset old cluster version in metrics * Add version, tag and branch checks to release script * scripts: fix read failure prompt in release; use https for git clone. * version: 3.4.2 * etcdserver: trace compaction request; add return parameter 'trace' to applierV3.Compaction() mvcc: trace compaction request; add input parameter 'trace' to KV.Compact() * etcdserver: trace raft requests. * etcdserver: add put request steps. mvcc: add put request steps; add trace to KV.Write() as input parameter. * pkg: use zap logger to format the structure log output. * pkg: add field to record additional detail of trace; add stepThreshold to reduce log volume. * pkg: create package traceutil for tracing. mvcc: add tracing steps:range from the in-memory index tree; range from boltdb. etcdserver: add tracing steps: agreement among raft nodes before linerized reading; authentication; filter and sort kv pairs; assemble the response. * clientv3: Replace endpoint.ParseHostPort with net.SplitHostPort to fix IPv6 client endpoints * clientv3: Set authority used in cert checks to host of endpoint * tests/e2e: fix metrics tests * etcdctl: fix member add command * scripts/build-binary: fix darwin tar commands * scripts/release: fix SHA256SUMS command * version: 3.4.1 * scripts/release: fix docker push command * integration: fix bug in for loop, make it break properly * embed: expose ZapLoggerBuilder * vendor: upgrade to gRPC v1.23.1 OBS-URL: https://build.opensuse.org/request/show/770475 OBS-URL: https://build.opensuse.org/package/show/devel:kubic/etcd?expand=0&rev=4
2020-02-06 11:19:08 +01:00
%setup -q -a1
cp %{SOURCE15} .
%build
Accepting request 770475 from home:mjura:branches:devel:kubic - Update to version 3.4.3: * version: 3.4.3 * *: use Go 1.12.12 * rafthttp: add 3.4 stream type * etcdserver: strip patch version in metrics * etcdserver: strip patch version in cluster version * etcdserver: unset old cluster version in metrics * Add version, tag and branch checks to release script * scripts: fix read failure prompt in release; use https for git clone. * version: 3.4.2 * etcdserver: trace compaction request; add return parameter 'trace' to applierV3.Compaction() mvcc: trace compaction request; add input parameter 'trace' to KV.Compact() * etcdserver: trace raft requests. * etcdserver: add put request steps. mvcc: add put request steps; add trace to KV.Write() as input parameter. * pkg: use zap logger to format the structure log output. * pkg: add field to record additional detail of trace; add stepThreshold to reduce log volume. * pkg: create package traceutil for tracing. mvcc: add tracing steps:range from the in-memory index tree; range from boltdb. etcdserver: add tracing steps: agreement among raft nodes before linerized reading; authentication; filter and sort kv pairs; assemble the response. * clientv3: Replace endpoint.ParseHostPort with net.SplitHostPort to fix IPv6 client endpoints * clientv3: Set authority used in cert checks to host of endpoint * tests/e2e: fix metrics tests * etcdctl: fix member add command * scripts/build-binary: fix darwin tar commands * scripts/release: fix SHA256SUMS command * version: 3.4.1 * scripts/release: fix docker push command * integration: fix bug in for loop, make it break properly * embed: expose ZapLoggerBuilder * vendor: upgrade to gRPC v1.23.1 OBS-URL: https://build.opensuse.org/request/show/770475 OBS-URL: https://build.opensuse.org/package/show/devel:kubic/etcd?expand=0&rev=4
2020-02-06 11:19:08 +01:00
%{goprep} go.etcd.io/etcd
export GOPATH=$HOME/go
mkdir -pv $HOME/go/src/%{project}
rm -rf $HOME/go/src/%{project}/*
cp -avr * $HOME/go/src/%{project}
cd $HOME/go/src/%{project}
go build -v -buildmode=pie -o etcd
cd $HOME/go/src/%{project}/etcdctl
go build -v -buildmode=pie -o etcdctl
%install
Accepting request 770475 from home:mjura:branches:devel:kubic - Update to version 3.4.3: * version: 3.4.3 * *: use Go 1.12.12 * rafthttp: add 3.4 stream type * etcdserver: strip patch version in metrics * etcdserver: strip patch version in cluster version * etcdserver: unset old cluster version in metrics * Add version, tag and branch checks to release script * scripts: fix read failure prompt in release; use https for git clone. * version: 3.4.2 * etcdserver: trace compaction request; add return parameter 'trace' to applierV3.Compaction() mvcc: trace compaction request; add input parameter 'trace' to KV.Compact() * etcdserver: trace raft requests. * etcdserver: add put request steps. mvcc: add put request steps; add trace to KV.Write() as input parameter. * pkg: use zap logger to format the structure log output. * pkg: add field to record additional detail of trace; add stepThreshold to reduce log volume. * pkg: create package traceutil for tracing. mvcc: add tracing steps:range from the in-memory index tree; range from boltdb. etcdserver: add tracing steps: agreement among raft nodes before linerized reading; authentication; filter and sort kv pairs; assemble the response. * clientv3: Replace endpoint.ParseHostPort with net.SplitHostPort to fix IPv6 client endpoints * clientv3: Set authority used in cert checks to host of endpoint * tests/e2e: fix metrics tests * etcdctl: fix member add command * scripts/build-binary: fix darwin tar commands * scripts/release: fix SHA256SUMS command * version: 3.4.1 * scripts/release: fix docker push command * integration: fix bug in for loop, make it break properly * embed: expose ZapLoggerBuilder * vendor: upgrade to gRPC v1.23.1 OBS-URL: https://build.opensuse.org/request/show/770475 OBS-URL: https://build.opensuse.org/package/show/devel:kubic/etcd?expand=0&rev=4
2020-02-06 11:19:08 +01:00
cd $HOME/go/src/%{project}
install -d %{buildroot}/%{_sbindir}
install -D -m 0755 etcd %{buildroot}/%{_sbindir}/etcd
install -d %{buildroot}/%{_bindir}
install -D -m 0755 etcdctl/etcdctl %{buildroot}/%{_bindir}/etcdctl
# Service
Accepting request 770475 from home:mjura:branches:devel:kubic - Update to version 3.4.3: * version: 3.4.3 * *: use Go 1.12.12 * rafthttp: add 3.4 stream type * etcdserver: strip patch version in metrics * etcdserver: strip patch version in cluster version * etcdserver: unset old cluster version in metrics * Add version, tag and branch checks to release script * scripts: fix read failure prompt in release; use https for git clone. * version: 3.4.2 * etcdserver: trace compaction request; add return parameter 'trace' to applierV3.Compaction() mvcc: trace compaction request; add input parameter 'trace' to KV.Compact() * etcdserver: trace raft requests. * etcdserver: add put request steps. mvcc: add put request steps; add trace to KV.Write() as input parameter. * pkg: use zap logger to format the structure log output. * pkg: add field to record additional detail of trace; add stepThreshold to reduce log volume. * pkg: create package traceutil for tracing. mvcc: add tracing steps:range from the in-memory index tree; range from boltdb. etcdserver: add tracing steps: agreement among raft nodes before linerized reading; authentication; filter and sort kv pairs; assemble the response. * clientv3: Replace endpoint.ParseHostPort with net.SplitHostPort to fix IPv6 client endpoints * clientv3: Set authority used in cert checks to host of endpoint * tests/e2e: fix metrics tests * etcdctl: fix member add command * scripts/build-binary: fix darwin tar commands * scripts/release: fix SHA256SUMS command * version: 3.4.1 * scripts/release: fix docker push command * integration: fix bug in for loop, make it break properly * embed: expose ZapLoggerBuilder * vendor: upgrade to gRPC v1.23.1 OBS-URL: https://build.opensuse.org/request/show/770475 OBS-URL: https://build.opensuse.org/package/show/devel:kubic/etcd?expand=0&rev=4
2020-02-06 11:19:08 +01:00
install -D -p -m 0644 %{SOURCE12} %{buildroot}%{_unitdir}/%{name}.service
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
# Sysconfig
Accepting request 770475 from home:mjura:branches:devel:kubic - Update to version 3.4.3: * version: 3.4.3 * *: use Go 1.12.12 * rafthttp: add 3.4 stream type * etcdserver: strip patch version in metrics * etcdserver: strip patch version in cluster version * etcdserver: unset old cluster version in metrics * Add version, tag and branch checks to release script * scripts: fix read failure prompt in release; use https for git clone. * version: 3.4.2 * etcdserver: trace compaction request; add return parameter 'trace' to applierV3.Compaction() mvcc: trace compaction request; add input parameter 'trace' to KV.Compact() * etcdserver: trace raft requests. * etcdserver: add put request steps. mvcc: add put request steps; add trace to KV.Write() as input parameter. * pkg: use zap logger to format the structure log output. * pkg: add field to record additional detail of trace; add stepThreshold to reduce log volume. * pkg: create package traceutil for tracing. mvcc: add tracing steps:range from the in-memory index tree; range from boltdb. etcdserver: add tracing steps: agreement among raft nodes before linerized reading; authentication; filter and sort kv pairs; assemble the response. * clientv3: Replace endpoint.ParseHostPort with net.SplitHostPort to fix IPv6 client endpoints * clientv3: Set authority used in cert checks to host of endpoint * tests/e2e: fix metrics tests * etcdctl: fix member add command * scripts/build-binary: fix darwin tar commands * scripts/release: fix SHA256SUMS command * version: 3.4.1 * scripts/release: fix docker push command * integration: fix bug in for loop, make it break properly * embed: expose ZapLoggerBuilder * vendor: upgrade to gRPC v1.23.1 OBS-URL: https://build.opensuse.org/request/show/770475 OBS-URL: https://build.opensuse.org/package/show/devel:kubic/etcd?expand=0&rev=4
2020-02-06 11:19:08 +01:00
install -D -p -m 0644 %{SOURCE11} %{buildroot}%{_fillupdir}/sysconfig.%{name}
%ifarch aarch64
# arm64 is not yet officially supported
echo -e "\n#Enable arm64\nETCD_UNSUPPORTED_ARCH=arm64\n" >> %{buildroot}%{_fillupdir}/sysconfig.%{name}
%endif
# Additional
install -d -m 750 %{buildroot}%{_localstatedir}/lib/%{name}
%pre
getent group %{name} >/dev/null || %{_sbindir}/groupadd -r %{name}
getent passwd %{name} >/dev/null || %{_sbindir}/useradd -r -g %{name} -d %{_localstatedir}/lib/%{name} -s /bin/false -c "etcd daemon" %{name}
%service_add_pre %{name}.service
%post
%service_add_post %{name}.service
%{fillup_only -n %{name}}
%preun
%service_del_preun %{name}.service
%postun
%service_del_postun %{name}.service
%files
%license LICENSE
%doc CONTRIBUTING.md README.md DCO NOTICE README.security
%{_sbindir}/%{name}
# Service
%{_unitdir}/%{name}.service
%{_sbindir}/rc%{name}
# Sysconfig
%{_fillupdir}/sysconfig.%{name}
# Additional
%dir %attr(0750,%{name},%{name}) %{_localstatedir}/lib/%{name}
%files -n etcdctl
%{_bindir}/etcdctl
%changelog