## START: Set by rpmautospec
## (rpmautospec version 0.3.0)
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 2;
    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
#
# This specfile is licensed under:
# SPDX-License-Identifier: MIT
# License text: https://spdx.org/licenses/MIT.html
# SPDX-FileCopyrightText: 2022 Maxwell G <gotmax@e.email>
# SPDX-FileCopyrightText: Fedora Project Authors

%bcond_without check

# https://git.sr.ht/~emersion/gqlclient
%global goipath         git.sr.ht/~emersion/gqlclient
%global commit          e4b2ae1fac10f151f917364bf3334c69076bea15
%global scm             git
%global topdir          gqlclient-%{commit}
%global archivename     %{topdir}
%global archiveext      tar.gz

%gometa -f

%global common_description %{expand:
gqlclient can be used as a thin GraphQL client, and can be augmented with code
generation. See the [GoDoc examples][1] for direct usage.

[1]: https://godocs.io/git.sr.ht/~emersion/gqlclient#example-Client-Execute}

%global golicenses      LICENSE
%global godocs          README.md

Name:           %{goname}
Version:        0
Release:        %autorelease -p
Summary:        A GraphQL client and code generator for Go

License:        MIT
URL:            %{gourl}
# The forge macros don't support Sourcehut.
# https://src.fedoraproject.org/rpms/redhat-rpm-config/pull-request/209
Source:         %{gourl}/archive/%{commit}.tar.gz#/gqlclient-%{commit}.tar.gz

%description %{common_description}

%gopkg

%prep
%goprep

%generate_buildrequires
%go_generate_buildrequires

%build
for cmd in cmd/* ; do
  %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd
done

%install
%gopkginstall
install -m 0755 -vd                     %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/

%if %{with check}
%check
%gocheck
%endif

%files
%license LICENSE
%doc README.md
%{_bindir}/{gqlclient,gqlintrospect,gqlclientgen}

%gopkgfiles

%changelog
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> 0-0.2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

* Wed Sep 28 2022 Maxwell G <gotmax@e.email> 0-0.1
- Initial import (rhbz#21240200