## START: Set by rpmautospec
## (rpmautospec version 0.3.0)
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 16;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

# Generated by go2rpm 1.8.0
%bcond_without check
%global debug_package %{nil}

# https://github.com/docker/libkv
%global goipath         github.com/docker/libkv
Version:                0.2.1
%global commit          dfacc563de57ee17ca54bb3b6b2a004454f3ce41

%gometa

%global common_description %{expand:
Libkv provides a Go native library to store metadata.

The goal of Libkv is to abstract common store operations for multiple
distributed and/or local Key/Value store backends.

For example, you can use it to store your metadata or for service discovery to
register machines and endpoints inside your cluster.

You can also easily implement a generic Leader Election on top of it (see the
docker/leadership repository).

As of now, Libkv offers support for Consul, Etcd, Zookeeper (Distributed store)
and BoltDB (Local store).}

%global golicenses      LICENSE.code LICENSE.docs
%global godocs          docs README.md

Name:           %{goname}
Release:        %autorelease
Summary:        Distributed key/value store abstraction library

License:        Apache-2.0 and CC-BY-SA-4.0
URL:            %{gourl}
Source:         %{gosource}

%description %{common_description}

%gopkg

%prep
%goprep
sed -i "s|github.com/coreos/etcd/client|go.etcd.io/etcd/client/v2|" $(find . -name "*.go")

%generate_buildrequires
%go_generate_buildrequires

%install
%gopkginstall

%if %{with check}
%check
for test in "TestConsulStore" \
            "TestEtcdStore" \
            "TestZkStore" \
            "TestGetActiveSession" \
; do
awk -i inplace '/^func.*'"$test"'\(/ { print; print "\tt.Skip(\"disabled failing test\")"; next}1' $(grep -rl $test)
done
%gocheck
%endif

%gopkgfiles

%changelog
* Wed Aug 24 2022 Robert-André Mauchin <zebob.m@gmail.com> 0.2.1-16
- Bump to commit dfacc563de57ee17ca54bb3b6b2a004454f3ce41

* Wed Aug 10 2022 Maxwell G <gotmax@e.email> 0.2.1-23
- Rebuild to fix FTBFS

* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> 0.2.1-22
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> 0.2.1-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Wed Sep 22 2021 Robert-André Mauchin <zebob.m@gmail.com> 0.2.1-20
- Bump to commit %%global commit 458977154600b9f23984d9f4b82e79570b5ae12b

* Sat Aug 21 2021 Robert-André Mauchin <zebob.m@gmail.com> 0.2.1-11
- Unbootstrap

* Sat Aug 21 2021 Robert-André Mauchin <zebob.m@gmail.com> 0.2.1-10
- Fix typo

* Sat Aug 21 2021 Robert-André Mauchin <zebob.m@gmail.com>
- Bootstrap

* Sat Aug 21 2021 Robert-André Mauchin <zebob.m@gmail.com> 0.2.1-8
- Update for etcd 3.5.0

* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Sun May 05 01:20:12 CEST 2019 Robert-André Mauchin <zebob.m@gmail.com> - 0.2.1-1
- Release 0.2.1

* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.11.gitb68985b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.10.gitb68985b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.9.gitb68985b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.8.gitb68985b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.7.gitb68985b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.6.gitb68985b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Jul 21 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.5.gitb68985b
- https://fedoraproject.org/wiki/Changes/golang1.7

* Mon Feb 22 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0-0.4.gitb68985b
- https://fedoraproject.org/wiki/Changes/golang1.6

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0-0.3.gitb68985b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sat Sep 12 2015 jchaloup <jchaloup@redhat.com> - 0-0.2.gitb68985b
- Update to spec-2.1
  resolves: #1250458

* Tue Jul 28 2015 jchaloup <jchaloup@redhat.com> - 0-0.1.gitb68985b
- First package for Fedora
  resolves: #1246766