# Generated by go2rpm %bcond_without check # https://github.com/googleapis/gnostic %global goipath github.com/googleapis/gnostic Version: 0.2.0 %gometa %global common_description %{expand: This package contains a Go command line tool which converts JSON and YAML OpenAPI descriptions to and from equivalent Protocol Buffer representations. Protocol Buffers provide a language-neutral, platform-neutral, extensible mechanism for serializing structured data. gnostic's Protocol Buffer models for the OpenAPI Specification can be used to generate code that includes data structures with explicit fields for the elements of an OpenAPI description. This makes it possible for developers to work with OpenAPI descriptions in type-safe ways, which is particularly useful in strongly-typed languages like Go and Swift. gnostic reads OpenAPI descriptions into these generated data structures, reports errors, resolves internal dependencies, and writes the results in a binary form that can be used in any language that is supported by the Protocol Buffer tools. A plugin interface simplifies integration with API tools written in a variety of different languages, and when necessary, Protocol Buffer OpenAPI descriptions can be reexported as JSON or YAML. gnostic compilation code and OpenAPI Protocol Buffer models are automatically generated from an OpenAPI JSON Schema. Source code for the generator is in the generate-gnostic directory.} %global golicenses LICENSE %global godocs examples CONTRIBUTING.md README.md README-disco.md\\\ README-gnostic-report.md README-petstore-builder.md\\\ README-report-messages.md README-generate-gnostic.md Name: %{goname} Release: 1%{?dist} Summary: Compiler for APIs described by the OpenAPI Specification # Upstream license specification: Apache-2.0 License: ASL 2.0 URL: %{gourl} Source0: %{gosource} BuildRequires: golang(github.com/docopt/docopt-go) BuildRequires: golang(github.com/golang/protobuf/proto) BuildRequires: golang(github.com/golang/protobuf/ptypes) BuildRequires: golang(github.com/golang/protobuf/ptypes/any) BuildRequires: golang(golang.org/x/net/context) BuildRequires: golang(golang.org/x/oauth2) BuildRequires: golang(gopkg.in/yaml.v2) %description %{common_description} %gopkg %prep %goprep mv apps/disco/README.md README-disco.md mv apps/petstore-builder/README.md README-petstore-builder.md mv apps/report-messages/README.md README-report-messages.md mv apps/report/README.md README-gnostic-report.md mv generate-gnostic/README.md README-generate-gnostic.md %build %gobuild -o %{gobuilddir}/bin/gnostic %{goipath} for cmd in apps/report apps/report-messages apps/petstore-builder generate-gnostic apps/disco; do %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done mv %{gobuilddir}/bin/report %{gobuilddir}/bin/gnostic-report %install %gopkginstall install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ %if %{with check} %check # Needs network %gocheck -d . -d generate-gnostic %endif %files %license LICENSE %doc examples CONTRIBUTING.md README.md README-disco.md README-gnostic-report.md %doc README-petstore-builder.md README-report-messages.md %doc README-generate-gnostic.md %{_bindir}/* %gopkgfiles %changelog * Thu May 09 17:27:45 CEST 2019 Robert-André Mauchin - 0.2.0-1 - Initial package