%bcond_without check

%global goipath         github.com/go-debos/debos
Version:                1.1.1

%gometa

%global common_description %{expand:
debos is a tool to make creation of various Debian based OS "images" simpler.
While most other tools focus on a specific use-case, debos is more meant as
a toolchain to make common actions trivial while providing enough rope to do
whatever tweaking that might be required behind the scenes.}

%global golicenses      LICENSE
%global godocs          README.md

Name:           debos
Release:        1%{?dist}
Summary:        Debian OS builder

License:        Apache-2.0
URL:            %{gourl}
Source0:        %{gosource}

BuildRequires:  golang(github.com/docker/go-units)
BuildRequires:  golang(github.com/go-debos/fakemachine)
BuildRequires:  golang(github.com/google/uuid)
BuildRequires:  golang(github.com/jessevdk/go-flags)
BuildRequires:  golang(github.com/sjoerdsimons/ostree-go/pkg/otbuiltin)
BuildRequires:  golang(gopkg.in/freddierice/go-losetup.v1)
BuildRequires:  golang(gopkg.in/yaml.v2)
%if %{with check}
BuildRequires:  golang(github.com/stretchr/testify)
BuildRequires:  qemu-kvm
BuildRequires:  dpkg
%endif

%description
%{common_description}


%gopkg


%prep
%goprep


%build
%gobuild -o %{gobuilddir}/bin/debos %{goipath}/cmd/debos


%install
install -Dpm 0755 %{gobuilddir}/bin/debos %{buildroot}%{_bindir}/debos
install -Dm644 doc/man/debos.1 -t %{buildroot}%{_mandir}/man1/


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


%files
%license LICENSE
%{_bindir}/debos
%{_mandir}/man1/debos.1.gz


%changelog
* Sat Nov 26 2022 gasinvein <gasinvein@gmail.com> - 1.1.1-1
- new version