Blob Blame Raw
# Generated by go2rpm
%bcond_without check

# https://github.com/exercism/cli
%global goipath         github.com/exercism/cli
Version:                3.0.12

%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:        2%{?dist}
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

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
%patch1 -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/completions
install -Dpm0644 shell/exercism.fish %{buildroot}%{_datadir}/fish/completions/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/completions
%{_datadir}/fish/completions/exercism.fish
%dir %{_datadir}/zsh
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_exercism


%changelog
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Wed Jul 10 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 3.0.12-1
- Update to latest version
- Add fish completions
- Update to latest Go macros

* Sat Feb 09 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 3.0.11-1
- Update to latest version

* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.4.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Sep 06 2017 Clément David <c.david86@gmail.com> - 2.4.1-1
- First package for Fedora