File stripe-cli.spec of Package stripe-cli

#
# spec file for package stripe-cli
#
# 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.

Name:           stripe-cli
Version:        1.30.0
Release:        0
Summary:        Command-line interface for Stripe
License:        Apache-2.0
Group:          Development/Tools/Other
URL:            https://github.com/stripe/stripe-cli
Source0:        %{name}-%{version}.tar.zst
Source1:        vendor.tar.gz
BuildRequires:  git-core
BuildRequires:  go >= 1.23
BuildRequires:  make
BuildRequires:  zstd
BuildRequires:  rpm-build >= 4.20.0
BuildRequires:  librpmbuild10 >= 4.20.0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The Stripe CLI allows developers to interact with Stripe from the command line.
It enables API requests, webhook testing, and local development.

%prep
%setup -q
# Extract vendored dependencies
%autosetup -n %{name}-%{version} -a 1

%build
export GO111MODULE=on
export CGO_ENABLED=0
%define gopath %{_builddir}/go
%define gobuilddir %{_builddir}/go/src/github.com/stripe/%{name}
mkdir -p %{gobuilddir}
cp -r * %{gobuilddir}/
cd %{gobuilddir}
go build -mod=vendor -trimpath -ldflags="-s -w -X main.version=%{version}" -o stripe ./cmd/stripe

%install
install -D -m 0755 %{gobuilddir}/stripe %{buildroot}%{_bindir}/stripe

%files
%defattr(-,root,root)
%doc README.md
%license LICENSE
%{_bindir}/stripe

%changelog
openSUSE Build Service is sponsored by