2017-01-31 12:39:33 +01:00
|
|
|
#
|
|
|
|
# spec file for package etcd
|
|
|
|
#
|
2022-03-10 13:02:06 +01:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2017-01-31 12:39:33 +01:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2020-06-08 08:40:40 +02:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2017-01-31 12:39:33 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2020-06-08 08:40:40 +02:00
|
|
|
%define project go.etcd.io/etcd
|
2017-11-30 12:44:59 +01:00
|
|
|
#Compat macro for new _fillupdir macro introduced in Nov 2017
|
|
|
|
%if ! %{defined _fillupdir}
|
2020-06-08 08:40:40 +02:00
|
|
|
%define _fillupdir %{_localstatedir}/adm/fillup-templates
|
2017-11-30 12:44:59 +01:00
|
|
|
%endif
|
2017-01-31 12:39:33 +01:00
|
|
|
Name: etcd
|
2023-01-26 10:28:22 +01:00
|
|
|
Version: 3.5.7
|
2017-01-31 12:39:33 +01:00
|
|
|
Release: 0
|
|
|
|
Summary: Highly-available key value store for configuration and service discovery
|
|
|
|
License: Apache-2.0
|
|
|
|
Group: System/Management
|
2020-06-08 08:40:40 +02:00
|
|
|
URL: https://github.com/etcd-io/etcd
|
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
|
2021-08-09 16:00:42 +02:00
|
|
|
Source16: system-user-etcd.conf
|
2022-03-10 13:18:39 +01:00
|
|
|
Source17: vendor-update.sh
|
2023-01-26 10:28:22 +01:00
|
|
|
BuildRequires: golang(API) >= 1.17
|
2017-01-31 12:39:33 +01:00
|
|
|
BuildRequires: golang-packaging
|
|
|
|
BuildRequires: systemd-rpm-macros
|
2022-03-10 13:02:06 +01:00
|
|
|
BuildRequires: sysuser-tools
|
2017-01-31 12:39:33 +01:00
|
|
|
BuildRequires: xz
|
|
|
|
Requires(post): %fillup_prereq
|
2022-03-10 13:02:06 +01:00
|
|
|
ExcludeArch: s390 %{ix86}
|
2021-08-09 16:00:42 +02:00
|
|
|
%sysusers_requires
|
2017-01-31 12:39:33 +01:00
|
|
|
%{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.
|
|
|
|
|
2022-03-10 13:02:06 +01:00
|
|
|
%package -n etcdutl
|
|
|
|
Summary: A simple command line client for etcd
|
|
|
|
Group: System/Management
|
|
|
|
|
|
|
|
%description -n etcdutl
|
|
|
|
A command line administration utility for etcd.
|
|
|
|
It's designed to operate directly on etcd data files.
|
|
|
|
|
|
|
|
For operations over a network, please use `etcdctl`.
|
|
|
|
|
2017-01-31 12:39:33 +01:00
|
|
|
%prep
|
2020-02-06 11:19:08 +01:00
|
|
|
%setup -q -a1
|
|
|
|
cp %{SOURCE15} .
|
2022-03-10 13:02:06 +01:00
|
|
|
cp -rla vendor/* ./ && rm -r vendor/
|
2017-01-31 12:39:33 +01:00
|
|
|
|
|
|
|
%build
|
2021-05-17 11:48:52 +02:00
|
|
|
%{goprep} %{project}
|
2020-02-06 11:19:08 +01:00
|
|
|
|
2021-05-17 11:48:52 +02:00
|
|
|
mkdir -p ./bin
|
2020-02-06 11:19:08 +01:00
|
|
|
|
2022-03-10 13:02:06 +01:00
|
|
|
dir=$(pwd)
|
|
|
|
for item in server etcdctl etcdutl;do
|
|
|
|
cd "$dir/$item"
|
|
|
|
go build -v \
|
|
|
|
-buildmode=pie \
|
|
|
|
-mod=vendor \
|
2023-01-26 10:28:22 +01:00
|
|
|
-trimpath \
|
|
|
|
-ldflags="-s -w -X main.Version=%{version}" \
|
2022-03-10 13:02:06 +01:00
|
|
|
-o ../bin/"$item"
|
|
|
|
done
|
|
|
|
cd "$dir"
|
2017-01-31 12:39:33 +01:00
|
|
|
|
2021-08-09 16:00:42 +02:00
|
|
|
%sysusers_generate_pre %{SOURCE16} %{name} system-user-etcd.conf
|
|
|
|
|
2017-01-31 12:39:33 +01:00
|
|
|
%install
|
2022-03-10 13:02:06 +01:00
|
|
|
install -d %{buildroot}%{_sbindir}
|
|
|
|
install -D -m 0755 ./bin/server %{buildroot}%{_sbindir}/etcd
|
2020-02-06 11:19:08 +01:00
|
|
|
|
|
|
|
install -d %{buildroot}/%{_bindir}
|
2022-03-10 13:02:06 +01:00
|
|
|
install -D -m 0755 ./bin/etcdctl %{buildroot}%{_bindir}/etcdctl
|
|
|
|
install -D -m 0755 ./bin/etcdutl %{buildroot}%{_bindir}/etcdutl
|
2017-01-31 12:39:33 +01:00
|
|
|
|
|
|
|
# Service
|
2020-02-06 11:19:08 +01:00
|
|
|
install -D -p -m 0644 %{SOURCE12} %{buildroot}%{_unitdir}/%{name}.service
|
2017-01-31 12:39:33 +01:00
|
|
|
ln -sf %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
|
|
|
|
|
|
|
|
# Sysconfig
|
2020-02-06 11:19:08 +01:00
|
|
|
install -D -p -m 0644 %{SOURCE11} %{buildroot}%{_fillupdir}/sysconfig.%{name}
|
2017-01-31 12:39:33 +01:00
|
|
|
|
|
|
|
# Additional
|
|
|
|
install -d -m 750 %{buildroot}%{_localstatedir}/lib/%{name}
|
2021-08-09 16:00:42 +02:00
|
|
|
install -Dm0644 %{SOURCE16} %{buildroot}%{_sysusersdir}/system-user-etcd.conf
|
|
|
|
|
|
|
|
%pre -f %{name}.pre
|
2017-01-31 12:39:33 +01:00
|
|
|
%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
|
2018-06-05 12:45:12 +02:00
|
|
|
%license LICENSE
|
2022-03-10 13:02:06 +01:00
|
|
|
%doc CONTRIBUTING.md README.md DCO README.security
|
2017-01-31 12:39:33 +01:00
|
|
|
%{_sbindir}/%{name}
|
2021-08-09 16:00:42 +02:00
|
|
|
%{_sysusersdir}/system-user-etcd.conf
|
2017-01-31 12:39:33 +01:00
|
|
|
|
|
|
|
# Service
|
|
|
|
%{_unitdir}/%{name}.service
|
|
|
|
%{_sbindir}/rc%{name}
|
|
|
|
|
|
|
|
# Sysconfig
|
2017-11-30 12:44:59 +01:00
|
|
|
%{_fillupdir}/sysconfig.%{name}
|
2017-01-31 12:39:33 +01:00
|
|
|
|
|
|
|
# Additional
|
2017-03-02 19:43:40 +01:00
|
|
|
%dir %attr(0750,%{name},%{name}) %{_localstatedir}/lib/%{name}
|
2017-01-31 12:39:33 +01:00
|
|
|
|
|
|
|
%files -n etcdctl
|
|
|
|
%{_bindir}/etcdctl
|
2022-03-10 13:02:06 +01:00
|
|
|
%doc etcdctl/README.md etcdctl/READMEv2.md
|
|
|
|
|
|
|
|
%files -n etcdutl
|
|
|
|
%{_bindir}/etcdutl
|
|
|
|
%doc etcdutl/README.md
|
2017-01-31 12:39:33 +01:00
|
|
|
|
|
|
|
%changelog
|