# Generated by go2rpm
# rounding error on some arch
%ifarch x86_64
%bcond_without check
%endif
# https://github.com/kubernetes/kube-openapi
%global goipath k8s.io/kube-openapi
%global forgeurl https://github.com/kubernetes/kube-openapi
%global commit 3c818078ee3de6569a8f02b6345ea3c4cc8b0998
%gometa
%global common_description %{expand:
Kubernetes OpenAPI spec generation & serving.}
%global golicenses LICENSE
%global godocs CONTRIBUTING.md README.md code-of-conduct.md
Name: %{goname}
Version: 0
Release: %autorelease -p
Summary: Kubernetes OpenAPI spec generation & serving
# Upstream license specification: Apache-2.0
License: ASL 2.0
URL: %{gourl}
Source0: %{gosource}
BuildRequires: golang(bitbucket.org/ww/goautoneg)
BuildRequires: golang(github.com/asaskevich/govalidator)
BuildRequires: golang(github.com/emicklei/go-restful)
BuildRequires: golang(github.com/go-openapi/jsonreference)
BuildRequires: golang(github.com/go-openapi/swag)
BuildRequires: golang(github.com/golang/protobuf/proto)
BuildRequires: golang(github.com/googleapis/gnostic/openapiv2)
BuildRequires: golang(github.com/json-iterator/go)
BuildRequires: golang(github.com/mitchellh/mapstructure)
BuildRequires: golang(github.com/NYTimes/gziphandler)
BuildRequires: golang(github.com/spf13/pflag)
BuildRequires: golang(gopkg.in/yaml.v2)
BuildRequires: golang(k8s.io/gengo/args)
# BuildRequires: golang(k8s.io/gengo/examples/set-gen/sets)
BuildRequires: golang(k8s.io/gengo/generator)
BuildRequires: golang(k8s.io/gengo/namer)
BuildRequires: golang(k8s.io/gengo/types)
BuildRequires: golang(k8s.io/klog/v2)
BuildRequires: golang(sigs.k8s.io/structured-merge-diff/v4/schema)
%if %{with check}
# Tests
BuildRequires: golang(github.com/davecgh/go-spew/spew)
BuildRequires: golang(github.com/google/gofuzz)
BuildRequires: golang(github.com/google/uuid)
BuildRequires: golang(github.com/onsi/ginkgo)
BuildRequires: golang(github.com/onsi/ginkgo/config)
BuildRequires: golang(github.com/onsi/ginkgo/types)
BuildRequires: golang(github.com/onsi/gomega)
BuildRequires: golang(github.com/stretchr/testify/assert)
BuildRequires: golang(github.com/stretchr/testify/require)
BuildRequires: golang(k8s.io/gengo/parser)
BuildRequires: golang(sigs.k8s.io/yaml)
%endif
%description
%{common_description}
%gopkg
%prep
%goprep
sed -i "s|github.com/munnerz/goautoneg|bitbucket.org/ww/goautoneg|" $(find . -name "*.go")
# sed -i 's|github.com/googleapis/gnostic|github.com/googleapis/gnostic-0.4|' $(find . -iname "*.go" -type f)
%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 -d pkg/aggregator -d pkg/handler
%endif
%files
%license LICENSE
%doc CONTRIBUTING.md README.md code-of-conduct.md pkg/generators/README.md
%{_bindir}/*
%gopkgfiles
%changelog
%autochangelog