terraform-provider-yandex/terraform-provider-yandex.spec

66 lines
1.3 KiB
RPMSpec
Raw Normal View History

2022-06-30 01:00:01 +03:00
%define debug %nil
%define debug_package %nil
%define tfprovider yandex
%ifarch x86_64 amd64
%global goarch amd64
%else
%global goarch 386
%endif
2024-10-08 19:45:25 +00:00
%define secscan 0
2024-07-02 22:14:28 +00:00
2022-06-30 01:00:01 +03:00
Name: terraform-provider-%{tfprovider}
2024-10-08 19:45:25 +00:00
Version: 0.130.0
2022-06-30 01:00:01 +03:00
Release: 1
2024-05-21 21:06:27 +00:00
Summary: Terraform provider for Yandex cloud
2022-06-30 01:00:01 +03:00
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
2024-06-10 15:28:10 +00:00
BuildRequires: terraform
2022-06-30 01:00:01 +03:00
2024-07-02 22:14:28 +00:00
%if %{secscan}
BuildRequires: clamav
BuildRequires: trivy
%endif
2022-06-30 01:00:01 +03:00
%description
%{summary}
%prep
%setup -q
2024-07-02 22:14:28 +00:00
%if %{secscan}
clamscan -ir .
trivy fs --scanners vuln --format cosign-vuln .
%endif
2022-06-30 01:00:01 +03:00
%build
2024-04-05 10:41:24 +00:00
export GOPROXY=https://proxy.golang.org/cached-only
2024-05-15 12:46:59 +00:00
#go mod tidy
go build --ldflags="-s -w" -o bin/%{name} .
2022-06-30 01:00:01 +03:00
2024-06-10 15:28:10 +00:00
upx bin/%{name}
2022-06-30 01:00:01 +03:00
%install
2024-06-10 15:28:10 +00:00
install -Dm0755 bin/%{name} %{buildroot}/%{_datadir}/terraform/plugins/tf.%{tfprovider}.online/mylocal/%{tfprovider}/%{version}/linux_%{goarch}/%{name}
2022-06-30 01:00:01 +03:00
%files
%doc README.md LICENSE
%{_datadir}/terraform/plugins/tf.%{tfprovider}.online/mylocal/%{tfprovider}/%{version}/linux_%{goarch}/%{name}
2024-07-02 22:14:28 +00:00
%check
export GOPROXY=https://proxy.golang.org/cached-only
#go test ./...
%if %{secscan}
clamscan -ir %{buildroot}
%endif
2022-06-30 01:00:01 +03:00