diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e761b92 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/oapi-codegen-1.3.12.tar.gz diff --git a/golang-github-deepmap-oapi-codegen.spec b/golang-github-deepmap-oapi-codegen.spec new file mode 100644 index 0000000..0a156f4 --- /dev/null +++ b/golang-github-deepmap-oapi-codegen.spec @@ -0,0 +1,78 @@ +# 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 - 1.3.12-1 +- Initial package + diff --git a/sources b/sources new file mode 100644 index 0000000..9f39e8a --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (oapi-codegen-1.3.12.tar.gz) = ba3fd3f511e74d3f5ca0810756cf0ff4ab52690089a8bae16efb512a55c6f930501bc826ea549f48526a9ef3c5732fb10315721e37e6d9be26b6e1cd7d5faaf0 diff --git a/test-fix.patch b/test-fix.patch new file mode 100644 index 0000000..30b99f0 --- /dev/null +++ b/test-fix.patch @@ -0,0 +1,12 @@ +diff --git a/cmd/oapi-codegen/oapi-codegen_test.go b/cmd/oapi-codegen/oapi-codegen_test.go +index 06992d9..891f2c9 100644 +--- a/cmd/oapi-codegen/oapi-codegen_test.go ++++ b/cmd/oapi-codegen/oapi-codegen_test.go +@@ -10,7 +10,6 @@ func TestLoader(t *testing.T) { + + paths := []string{ + "../../examples/petstore-expanded/petstore-expanded.yaml", +- "https://petstore3.swagger.io/api/v3/openapi.json", + } + + for _, v := range paths {