# Generated by go2rpm 1.9.0 %bcond_without check %bcond_with bootstrap %if %{with bootstrap} %global debug_package %{nil} %global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^golang\\(.*\\)$ %endif # https://github.com/etcd-io/etcd %global goipath go.etcd.io/etcd %global forgeurl https://github.com/etcd-io/etcd Version: 3.5.9 %global goaltipaths go.etcd.io/etcd/v3 %gometa -f %global common_description %{expand: Distributed reliable key-value store for the most critical data of a distributed system.} %global golicenses LICENSE %global godocs CONTRIBUTING.md README.md Documentation\\\ README-*.md READMEv2-etcdctl.md Name: etcd Release: %autorelease Summary: Distributed reliable key-value store for the most critical data of a distributed system License: Apache-2.0 URL: %{gourl} Source: %{gosource} Source1: %{name}.service Source2: %{name}.conf BuildRequires: python3-devel BuildRequires: systemd-rpm-macros BuildRequires: golang(go.etcd.io/etcd/etcdctl/v3/ctlv3/command) BuildRequires: golang(go.etcd.io/etcd/etcdutl/v3/etcdutl) BuildRequires: golang(go.etcd.io/etcd/tests/v3/integration) Requires(pre): shadow-utils %description %{common_description} %gopkg %prep %goprep %autopatch -p1 rm -rf cmd/vendor rm -rf raft/rafttest find ./* -type l -exec sh -c 'for i in "$@"; do cp --preserve --remove-destination "$(readlink -f "$i")" "$i"; done' sh {} + for d in contrib etcdctl etcdutl pkg raft hack security; do mv $d/README.md README-$d.md done mv etcdctl/READMEv2.md READMEv2-etcdctl.md mv client/v2/README.md README-clientv2.md mv client/v3/README.md README-clientv3.md rm -rfv api client/pkg client/v2 client/v3 pkg raft tests %if %{without bootstrap} %generate_buildrequires %go_generate_buildrequires %endif %build %if %{without bootstrap} %gobuild -o %{gobuilddir}/bin/etcd %{goipath}/server for cmd in etcdctl etcdutl; do %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done %endif rm -rfv etcdctl etcdutl server %install %gopkginstall %if %{without bootstrap} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ install -Dpm 0644 %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service install -dm 0755 %{buildroot}%{_sysconfdir}/%{name} install -pm 644 -t %{buildroot}%{_sysconfdir}/%{name} %{SOURCE2} # And create /var/lib/etcd install -dm 0755 %{buildroot}%{_sharedstatedir}/%{name} %endif %if %{without bootstrap} %if %{with check} %check %gocheck %endif %endif %if %{without bootstrap} %pre 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 %preun %systemd_preun %{name}.service %postun %systemd_postun %{name}.service %files %license LICENSE %doc CONTRIBUTING.md README.md %doc Documentation README-*.md READMEv2-etcdctl.md %{_bindir}/etcd* %config(noreplace) %{_sysconfdir}/%{name} %dir %attr(-,%{name},%{name}) %{_sharedstatedir}/%{name} %{_unitdir}/%{name}.service %endif %gopkgfiles %changelog %autochangelog