## START: Set by rpmautospec
## (rpmautospec version 0.3.0)
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
    release_number = 1;
    base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
    print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
## END: Set by rpmautospec

# Generated by go2rpm
%bcond_without check
%bcond_with network

# https://github.com/wjdp/htmltest
%global goipath         github.com/wjdp/htmltest
Version:                0.17.0

%gometa

%global common_description %{expand:
htmltest runs your HTML output through a series of checks to ensure all your
links, images, scripts references work, your alt tags are filled in, et
cetera.}

%global golicenses      LICENCE
%global godocs          README.md

Name:           htmltest
Release:        %autorelease
Summary:        Test generated HTML for problems

License:        MIT
URL:            %{gourl}
Source0:        %{gosource}

BuildRequires:  golang(github.com/badoux/checkmail) >= 1.2.1
BuildRequires:  golang(github.com/docopt/docopt-go)
BuildRequires:  golang(github.com/fatih/color) >= 1.10.0
BuildRequires:  golang(github.com/imdario/mergo) >= 0.3.11
BuildRequires:  golang(golang.org/x/net/html)
BuildRequires:  golang(gopkg.in/seborama/govcr.v2) >= 2.4.2
BuildRequires:  golang(gopkg.in/yaml.v2) >= 2.4.0

%if %{with check}
# Tests
BuildRequires:  golang(github.com/daviddengcn/go-assert)
%endif

%description
%{common_description}

%gopkg

%prep
%goprep
%autopatch -p1

%build
%gobuild -o %{gobuilddir}/bin/htmltest %{goipath}

%install
%gopkginstall
install -m 0755 -vd                     %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/

%if %{with check}
%check
%if %{without network}
# Skips network tests
%global gotestflags %{gotestflags} -short
%endif
%gocheck
%endif

%files
%doc README.md
%license LICENCE
%{_bindir}/*

%gopkgfiles

%changelog
* Sun Nov 27 2022 Elliott Sales de Andrade <quantum.analyst@gmail.com> 0.17.0-1
- Update to latest version (#2140215)

* Mon Aug 08 2022 Elliott Sales de Andrade <quantum.analyst@gmail.com> 0.16.0-2
- Remove old patch

* Mon Aug 08 2022 Elliott Sales de Andrade <quantum.analyst@gmail.com> 0.16.0-1
- Update to latest version (#2073885)

* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> 0.15.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

* Tue Jul 19 2022 Maxwell G <gotmax@e.email> 0.15.0-4
- Rebuild for
  CVE-2022-{1705,32148,30631,30633,28131,30635,30632,30630,1962} in golang

* Sat Jun 18 2022 Robert-André Mauchin <zebob.m@gmail.com> 0.15.0-3
- Rebuilt for CVE-2022-1996, CVE-2022-24675, CVE-2022-28327,
  CVE-2022-27191, CVE-2022-29526, CVE-2022-30629

* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> 0.15.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

* Sat Oct 02 2021 Elliott Sales de Andrade <quantum.analyst@gmail.com> 0.15.0-1
- Update to latest version (#2009439)

* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

* Fri Feb 05 2021 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.14.0-1
- Update to latest version (#1917065)

* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.13.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Fri Jan 15 2021 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.13.0-2
- Backport fix to tests

* Thu Aug 13 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.13.0-1
- Update to latest version (#1868545)

* Sat Aug 01 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.1-3
- Second attempt - Rebuilt for
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Sat Feb 22 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.12.1-1
- Update to latest version

* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.11.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Thu Jan 02 2020 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.11.0-1
- Update to latest version

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

* Mon Jun 10 21:46:45 EDT 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.10.3-1
- Initial package