terraform-provider-yandex/terraform-provider-yandex.spec
Your Name 9b224f1f28
All checks were successful
Run CI/CD... / main (push) Successful in 16m26s
0.138.0
2025-02-20 08:27:38 +00:00

66 lines
1.3 KiB
RPMSpec

%define debug %nil
%define debug_package %nil
%define tfprovider yandex
%ifarch x86_64 amd64
%global goarch amd64
%else
%global goarch 386
%endif
%define secscan 0
Name: terraform-provider-%{tfprovider}
Version: 0.138.0
Release: 1
Summary: Terraform provider for Yandex cloud
URL: https://github.com/yandex-cloud/%{name}
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
License: MPL-2.0
Group: Development/Other
BuildRequires: go >= 1.16
BuildRequires: git-core
BuildRequires: upx
BuildRequires: terraform
BuildRequires: pkgconfig(openssl3.3)
%if %{secscan}
BuildRequires: clamav
BuildRequires: trivy
%endif
%description
%{summary}
%prep
%setup -q
%if %{secscan}
clamscan -ir .
trivy fs --scanners vuln --format cosign-vuln .
%endif
%build
export GOPROXY=https://proxy.golang.org/cached-only
#go mod tidy
go build --ldflags="-s -w" -o bin/%{name} .
upx bin/%{name}
%install
install -Dm0755 bin/%{name} %{buildroot}/%{_datadir}/terraform/plugins/tf.%{tfprovider}.online/mylocal/%{tfprovider}/%{version}/linux_%{goarch}/%{name}
%files
%doc README.md LICENSE
%{_datadir}/terraform/plugins/tf.%{tfprovider}.online/mylocal/%{tfprovider}/%{version}/linux_%{goarch}/%{name}
%check
export GOPROXY=https://proxy.golang.org/cached-only
#go test ./...
%if %{secscan}
clamscan -ir %{buildroot}
%endif