Blob Blame History Raw
# 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}
# Update to govcr v4
Patch:          https://github.com/wjdp/htmltest/pull/201.patch

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.v4) >= 4.5.0
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
%autochangelog