File buf.spec of Package buf

#
# spec file for package buf
#
# Copyright (c) 2025 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 http://bugs.opensuse.org/
#


Name:           buf
Version:        1.61.0
Release:        0
Summary:        CLI tool to provide the best way of working with Protocol Buffers
License:        Apache-2.0
Group:          Development/Languages/Go
Url:            https://github.com/bufbuild/buf
Source0:        %{name}-%{version}.tar.gz
Source1:        vendor.tar.gz
BuildRequires:  golang(API) >= 1.23

%description
The buf CLI is the best tool for working with Protocol Buffers. It provides:

* A linter that enforces good API design choices and structure.
* A breaking change detector that enforces compatibility at the source code or
  wire level.
* A generator that invokes your plugins based on configuration files.
* A formatter that formats your Protobuf files in accordance with industry
  standards.
* Integration with the Buf Schema Registry, including full dependency
  management.

%prep
%autosetup -a 1

%build
%ifnarch ppc64
export GOFLAGS="-buildmode=pie"
%endif
go build ./cmd/%{name}

%install
install -D -m 0755 %{name} %{buildroot}/%{_bindir}/%{name}

%check
# execute the binary as a basic check
./%{name} --help

%files
%{_bindir}/%{name}
%doc README.md
%license LICENSE

%changelog
openSUSE Build Service is sponsored by