# Generated by go2rpm 1.10.0 %bcond_without check %global major 1 %global minor 104 %global patchlevel 0 # https://github.com/digitalocean/doctl %global goipath github.com/digitalocean/doctl Version: 1.104.0 %gometa -L -f %global goname doctl %global common_description %{expand: The official command line interface for the DigitalOcean API.} %global golicenses LICENSE.txt %global godocs CONTRIBUTING.md CHANGELOG.md README.md Name: doctl Release: %autorelease Summary: The official command line interface for the DigitalOcean API License: Apache-2.0 URL: %{gourl} Source: %{gosource} %description %{common_description} %gopkg %prep %goprep %autopatch -p1 # remove integration tests to avoid extra deps rm -rf integration %generate_buildrequires %go_generate_buildrequires %build export LDFLAGS="-X github.com/digitalocean/doctl.Major=%{major} \ -X github.com/digitalocean/doctl.Minor=%{minor} \ -X github.com/digitalocean/doctl.Patch=%{patchlevel} \ -X github.com/digitalocean/doctl.Label=Fedora" %gobuild -o %{gobuilddir}/bin/%{name} %{goipath}/cmd/%{name} %{gobuilddir}/bin/%{name} completion bash > %{name}.bash %{gobuilddir}/bin/%{name} completion fish > %{name}.fish %{gobuilddir}/bin/%{name} completion zsh > %{name}.zsh %install install -m 0755 -vd %{buildroot}%{_bindir} install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/ 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} %if %{with check} %check for test in "TestRunAppsDevConfigSet" "TestRunAppsDevConfigUnset" \ ; do awk -i inplace '/^func.*'"$test"'\(/ { print; print "\tt.Skip(\"disabled failing test\")"; next}1' $(grep -rl $test) done %gocheck %endif %files %license LICENSE.txt %doc CONTRIBUTING.md CHANGELOG.md README.md %{_bindir}/* %{bash_completions_dir}/%{name} %{fish_completions_dir}/%{name}.fish %{zsh_completions_dir}/_%{name} %changelog %autochangelog