# Generated by go2rpm 1.10.0
%bcond_without check
# https://github.com/sibprogrammer/xq
%global goipath github.com/sibprogrammer/xq
Version: 1.2.4
%gometa -L -f
%global goname xq
%global common_description %{expand:
Command-line XML and HTML beautifier and content extractor, similar to jq.}
%global golicenses LICENSE
%global godocs README.md
Name: xq
Release: %autorelease
Summary: Command-line XML and HTML beautifier and content extractor
License: MIT
URL: %{gourl}
Source: %{gosource}
%description %{common_description}
%gopkg
%prep
%goprep
%autopatch -p1
%generate_buildrequires
%go_generate_buildrequires
%build
export LDFLAGS="-X main.commit=fedora \
-X main.version=%{version} \
-X main.date=$(date -d "@${SOURCE_DATE_EPOCH}" +%Y-%m-%d)"
%gobuild -o %{gobuilddir}/bin/xq %{goipath}/
%install
install -m 0755 -vd %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
mv ./docs/%{name}.man ./docs/%{name}.1
install -Dpm 0644 ./docs/%{name}.1 -t %{buildroot}%{_mandir}/man1/
%if %{with check}
%check
%gocheck
%endif
%files
%license LICENSE
%doc README.md
%{_bindir}/*
%{_mandir}/man1/%{name}.1*
%changelog
%autochangelog