File golang-github-grpc-ecosystem-rpc-gateway.spec of Package golang-github-grpc-ecosystem-rpc-gateway

#
# spec file for package golang-github-grpc-ecosystem-rpc-gateway
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%global provider_prefix github.com/grp-ecosystem/rpc-gateway
%global import_path     %{provider_prefix}

Name:           golang-github-grpc-ecosystem-rpc-gateway
Version:        2.8.0
Release:        0
Summary:        gRPC to JSON proxy generator following the gRPC HTTP spec
License:        BSD-3-Clause
URL:            https://github.com/grpc-ecosystem/grpc-gateway
Source0:        https://github.com/grpc-ecosystem/grpc-gateway/archive/refs/tags/v2.8.0.tar.gz#/grpc-gateway-%{version}.tar.gz
Source1:        vendor.tar.gz
BuildRequires:  go
BuildRequires:  golang-packaging
BuildRequires:  protobuf-devel
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The gRPC-Gateway is a plugin of the Google protocol buffers compiler protoc. It
reads protobuf service definitions and generates a reverse-proxy server which
translates a RESTful HTTP API into gRPC. This server is generated according to
the google.api.http annotations in your service definitions.

This helps you provide your APIs in both gRPC and RESTful style at the same
time.

%prep
%setup -q -n grpc-gateway-%{version}
# setup vendor dir
%setup -q -D -T -a 1 -n  grpc-gateway-%{version}

%build
%goprep %{import_path}

%install
go install     \
	./protoc-gen-openapiv2 \
	./protoc-gen-grpc-gateway

install -D ~/go/bin/protoc-gen-grpc-gateway %{buildroot}%{_bindir}/protoc-gen-grpc-gateway
install -D ~/go/bin/protoc-gen-openapiv2 %{buildroot}%{_bindir}/protoc-gen-openapiv2
%gofilelist

%files -f file.lst
%{_bindir}/protoc-gen-grpc-gateway
%{_bindir}/protoc-gen-openapiv2
%license LICENSE.txt

%changelog
openSUSE Build Service is sponsored by