# obscene macro junk %global ghowner oVirt %global owner %{ghowner} %global githost github.com %global plugin ovirt %global module terraform-provider-%{plugin} %global archive v%{version}.tar.gz %global dir %{module}-%{version} %global namespace %{githost}/%{owner}/%{module} %global v13base %{_datadir}/terraform/plugins/%{regsite}/%{regorg}/%{plugin}/%{version}/%{regos}_%{regarch} %global regsite registry.terraform.io %global regorg hashicorp %global regarch amd64 %global regos %{_target_os} Name: golang-github-%{module} Version: 2.0.1 Release: 1%{!?dis:%{?dist}} Summary: Terraform %{plugin} provider Group: Applications/System License: BSD3 URL: https://registry.terraform.io/providers/%{ghowner}/%{plugin}/latest Source0: https://%{namespace}/archive/v%{version}.tar.gz BuildRequires: golang make git Requires: terraform %description The %{plugin} provider for Terraform See https://registry.terraform.io/providers/%{ghowner}/%{plugin}/%{version} %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.md %doc src/%{namespace}/README.md src/%{namespace}/docs/ src/%{namespace}/examples %{_bindir}/%{module} %changelog