# obscene macro junk %global ghowner hashicorp %global owner %{ghowner} %global githost github.com %global proj dns %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: 3.2.1 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/hashicorp/terraform-provider-dns/archive/refs/tags/v3.2.1.tar.gz Source0: https://%{namespace}/archive/v%{version}.tar.gz BuildRequires: golang make git Requires: terraform %description The DNS provider supports resources that perform DNS updates (RFC 2136) and data sources for reading DNS information. The provider can be configured with secret key based transaction authentication (RFC 2845) or GSS-TSIG (RFC 3645). %prep %setup -q -n %{module}-%{version} %build %define debug_package %{nil} export GOPATH=$PWD export GOOS=%{_target_os} export GOARCH=%{regarch} export GOFLAGS=-modcacherw 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