# obscene macro junk %global ghowner infobloxopen %global owner %{ghowner} %global githost github.com %global proj infoblox %global module terraform-provider-%{proj} %global archive v%{version}.tar.gz %global dir %{module}-%{version} %global namespace %{githost}/%{owner}/%{module} %global v13base %{_datadir}/terraform/plugins/%{regsite}/%{regorg}/%{proj}/%{version}/%{regos}_%{regarch} %global regsite registry.terraform.io %global regorg hashicorp %global regarch amd64 %global regos %{_target_os} Name: golang-github-%{module} Version: 2.1.0 Release: 1%{!?dis:%{?dist}} Summary: Terraform %{plugin} provider Group: Applications/System License: MPL-2.0 License URL: https://registry.terraform.io/providers/%{ghowner}/%{plugin}/latest #https://github.com/infobloxopen/terraform-provider-infoblox/archive/refs/tags/v2.1.0.tar.gz Source0: https://%{namespace}/archive/v%{version}.tar.gz BuildRequires: golang make git Requires: terraform %description This is a provider plugin for Terraform to manage Infoblox NIOS (Network Identity Operating System) resources using Terraform infrastructure as code solutions. The plugin enables lifecycle management of Infoblox NIOS DDI resources. %prep %setup -q -n %{module}-%{version} %build %define debug_package %{nil} export GOPATH=$PWD export GOOS=%{_target_os} export GOARCH=%{regarch} export GOFLAGS=-modcacherw export GOPROXY=https://proxy.golang.org # actually hack to avoid git shallow mkdir -p src/%{namespace}/ shopt -s extglob dotglob mv !(src) src/%{namespace}/ shopt -u extglob dotglob pushd src/%{namespace}/ go build -o bin/%{module} popd %install [ "%{buildroot}" = "/" ] || [ ! -d %{buildroot} ] || rm -rf %{buildroot} install -d -m 755 %{buildroot}%{_bindir} install -m 0755 \ src/%{namespace}/bin/%{module} \ %{buildroot}%{_bindir} %clean find %{buildroot} -exec chmod 777 \{\} \; # modcacherw is imperfect still rm -rf %{buildroot} %files %license src/%{namespace}/LICENSE %doc src/%{namespace}/{CHANGELOG.md,README.md} %{_bindir}/%{module} %changelog