# Generated by go2rpm
%bcond_without check
# https://github.com/exercism/cli
%global goipath github.com/exercism/cli
Version: 3.1.0
%gometa
# Uncomment if we start providing devel packages:
#global common_description #{expand:
#A Go based command line tool for exercism.io.}
#global golicenses LICENSE
#global godocs RELEASE.md CHANGELOG.md CONTRIBUTING.md README.md
Name: exercism
Release: %autorelease
Summary: Exercism command-line interface
License: MIT
URL: %{gourl}
Source0: %{gosource}
# Remove the github.com/inconshreveable/go-update dependency
Patch0001: 0001-Disable-self-update.patch
# https://github.com/exercism/cli/pull/1066
Patch0002: 0002-Fix-tests-with-Go1.17.patch
BuildRequires: golang(github.com/blang/semver)
BuildRequires: golang(github.com/spf13/cobra)
BuildRequires: golang(github.com/spf13/pflag)
BuildRequires: golang(github.com/spf13/viper)
BuildRequires: golang(golang.org/x/net/html/charset)
BuildRequires: golang(golang.org/x/text/transform)
%if %{with check}
# Tests
BuildRequires: golang(github.com/stretchr/testify/assert)
%endif
%description
Exercism provides a way to do the problems on https://exercism.io.
This CLI ships as a binary with no additional run-time requirements. This means
that if you're doing the Haskell problems on exercism you don't need a working
Python or Ruby environment simply to fetch and submit exercises.
%prep
%goprep
%autopatch -p1
%build
%gobuild -o %{gobuilddir}/bin/exercism %{goipath}/exercism
%install
# main exercism binary
install -d -p %{buildroot}%{_bindir}/
install -p %{gobuilddir}/bin/exercism %{buildroot}%{_bindir}/
# shell completion
install -d %{buildroot}%{_datadir}/bash-completion/completions
install -Dpm0644 shell/exercism_completion.bash %{buildroot}%{_datadir}/bash-completion/completions/exercism
install -d %{buildroot}%{_datadir}/fish/vendor_completions.d
install -Dpm0644 shell/exercism.fish %{buildroot}%{_datadir}/fish/vendor_completions.d/exercism.fish
install -d %{buildroot}%{_datadir}/zsh/site-functions
install -Dpm0644 shell/exercism_completion.zsh %{buildroot}%{_datadir}/zsh/site-functions/_exercism
%if %{with check}
%check
%gocheck
%endif
%files
%license LICENSE
%doc CHANGELOG.md RELEASE.md README.md
%{_bindir}/exercism
%dir %{_datadir}/bash-completion
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/exercism
%dir %{_datadir}/fish
%dir %{_datadir}/fish/vendor_completions.d
%{_datadir}/fish/vendor_completions.d/exercism.fish
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_exercism
%changelog
%autochangelog