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

# https://github.com/protocolbuffers/protobuf-go
%global goipath         google.golang.org/protobuf
%global forgeurl        https://github.com/protocolbuffers/protobuf-go
Version:                1.31.0

%gometa -f

%global common_description %{expand:
Go support for Google's protocol buffers.}

%global golicenses      LICENSE PATENTS
%global godocs          CONTRIBUTING.md README.md

Name:           %{goname}
Release:        %autorelease
Summary:        Go support for Google's protocol buffers

%global godevelheader   %{expand:
Obsoletes:              compat-golang-github-protobuf-devel < 1.31.0-3
}

License:        BSD-3-Clause
URL:            %{gourl}
Source0:        %{gosource}

BuildRequires:  protobuf-compiler
Requires:       protobuf

Provides:       protoc-gen-go = %{version}-%{release}
Provides:       golang(%{goipath}/protoc-gen-go) = %{version}-%{release}

%description
%{common_description}

%gopkg

%prep
%goprep

%generate_buildrequires
%go_generate_buildrequires

%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 PATENTS
%doc CONTRIBUTING.md README.md
%{_bindir}/protoc-gen-go

%gopkgfiles

%changelog
%autochangelog