# Generated by go2rpm 1.3
%bcond_without check

# https://git.sr.ht/~adnano/kiln
%global goipath         git.sr.ht/~adnano/kiln
%global forgeurl        https://git.sr.ht/~adnano/kiln
Version:                0.2.0
%global tag             0.2.0
%global repo            kiln
%global archivename     %{repo}-%{tag}
%global archiveext      tar.gz
%global archiveurl      %{forgeurl}/archive/%{tag}.%{archiveext}
%global topdir          %{repo}-%{tag}
%global extractdir      %{repo}-%{tag}
%global scm             git

%gometa

%global common_description %{expand:
A simple static site generator.

Features
 - Simple
 - Extensible
 - Gemini support
 - Atom feeds
 - Go templates}

Name:           kiln
Release:        3%{?dist}
Summary:        Simple static site generator.

License:        MIT
URL:            %{gourl}
Source0:        %{gosource}
# Disable building of kiln that we handle manually in the SPEC
Patch0:         kiln-fix-makefile.patch

BuildRequires:  scdoc
BuildRequires:  golang(github.com/pelletier/go-toml)
BuildRequires:  golang(gopkg.in/yaml.v3)

%description
%{common_description}

%prep
%goprep
%patch0 -p1

%build
export LDFLAGS="-X main.Version=%{version} "
%gobuild -o %{gobuilddir}/bin/%{name} %{goipath}

%install
install -m 0755 -vd                     %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
export PREFIX=%{_prefix}
%make_install

%if %{with check}
%check
%gocheck
%endif

%files
%license COPYING
%doc config.toml README.md
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*

%changelog
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild

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

* Tue Jun 15 21:05:48 CEST 2021 Robert-André Mauchin <zebob.m@gmail.com> - 0.2.0-1
- Initial package