Blob Blame History Raw
# Generated by go2rpm 1
%bcond_without check

# https://github.com/deepmap/oapi-codegen
%global goipath         github.com/deepmap/oapi-codegen
Version:                1.3.12

%gometa

%global common_description %{expand:
Generate Go client and server boilerplate from OpenAPI 3 specifications.}

%global golicenses      LICENSE
%global godocs          README.md

Name:           %{goname}
Release:        1%{?dist}
Summary:        Generate Go client and server boilerplate from OpenAPI 3 specifications

# Upstream license specification: Apache-2.0
License:        ASL 2.0
URL:            %{gourl}
Source0:        %{gosource}

# One test requires internet connection, this patch removes it.
Patch0:         test-fix.patch

BuildRequires:  golang(github.com/getkin/kin-openapi/openapi3)
BuildRequires:  golang(github.com/getkin/kin-openapi/openapi3filter)
BuildRequires:  golang(github.com/go-chi/chi)
BuildRequires:  golang(github.com/labstack/echo/v4)
BuildRequires:  golang(github.com/labstack/echo/v4/middleware)
BuildRequires:  golang(github.com/pkg/errors)
BuildRequires:  golang(gopkg.in/yaml.v2)

%if %{with check}
# Tests
BuildRequires:  golang(github.com/golangci/lint-1)
BuildRequires:  golang(github.com/stretchr/testify/assert)
BuildRequires:  golang(github.com/stretchr/testify/require)
%endif

%description
%{common_description}

%gopkg

%prep
%goprep
%patch0 -p1

%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}/*

%gopkgfiles

%changelog
* Wed Aug 26 2020 Ondřej Budai <obudai@redhat.com> - 1.3.12-1
- Initial package