# Generated by go2rpm 1.18.0 %bcond check 1 # https://github.com/hetznercloud/cli %global goipath github.com/hetznercloud/cli Version: 1.59.0 %gometa -L -f Name: hcloud Release: %autorelease Summary: Command-line interface for Hetzner Cloud # Generated by go-vendor-tools License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND ISC AND MIT URL: %{gourl} Source0: %{gosource} # Generated by go-vendor-tools Source1: %{archivename}-vendor.tar.bz2 Source2: go-vendor-tools.toml ExcludeArch: %{ix86} ppc64le s390x BuildRequires: go-vendor-tools %description A command-line interface for Hetzner Cloud. %prep %goprep -A %setup -q -T -D -a1 %{forgesetupargs} %autopatch -p1 # Upstream uses goreleaser to set the version, but we need to set it manually here. sed 's/versionPrerelease = "dev"/versionPrerelease = ""/' -i internal/version/version.go %generate_buildrequires %go_vendor_license_buildrequires -c %{S:2} %build %global gomodulesmode GO111MODULE=on for cmd in cmd/* ; do %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd done # Build shell completions. for SHELL in bash fish zsh; do %{gobuilddir}/bin/%{name} completion $SHELL > %{name}.${SHELL} done %install %go_vendor_license_install -c %{S:2} install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ # Install shell completions. install -Dpm 0644 %{name}.bash %{buildroot}%{bash_completions_dir}/%{name} install -Dpm 0644 %{name}.fish %{buildroot}%{fish_completions_dir}/%{name}.fish install -Dpm 0644 %{name}.zsh %{buildroot}%{zsh_completions_dir}/_%{name} %check %go_vendor_license_check -c %{S:2} %if %{with check} %gotest ./... %endif %files -f %{go_vendor_license_filelist} %license vendor/modules.txt %doc docs examples CHANGELOG.md CONTRIBUTING.md README.md %{_bindir}/hcloud %{bash_completions_dir}/%{name} %{fish_completions_dir}/%{name}.fish %{zsh_completions_dir}/_%{name} %changelog %autochangelog