# This RPM spec file exists primarily to enable CI/CD pipelines and automatic
# testing of built RPMs. This RPM can be used as a suitable baseline for a
# proper distribution package, but changes should be made to suit the needs of
# the package.

%define debug_package %{nil}


Name:    yggdrasil
Version: 0.2.6
Release: 0.20250305161700370218.pr307.1.g0f950da%{?dist}
Summary: Message dispatch agent for cloud-connected systems
License: GPLv3
URL: https://github.com/redhatinsights/yggdrasil

Source: yggdrasil-0.2.6.tar.gz

ExclusiveArch: %{go_arches}

BuildRequires: git-core
BuildRequires: golang
BuildRequires: pkgconfig(systemd)


%description
yggdrasil is pair of utilities that register systems with RHSM and establishes
a receiving queue for instructions to be sent to the system via a broker.

%prep
%autosetup -n yggdrasil-0.2.6


%build
make PREFIX=%{_prefix} \
     SYSCONFDIR=%{_sysconfdir} \
     LOCALSTATEDIR=%{_localstatedir} \
     SHORTNAME=ygg \
     LONGNAME=yggdrasil \
     PKGNAME=@PKGNAME@ \
     BRANDNAME=yggdrasil \
     TOPICPREFIX=yggdrasil \
     VERSION=%{version} \
     DATAHOST= \
     'PROVIDER='


%install
make PREFIX=%{_prefix} \
     SYSCONFDIR=%{_sysconfdir} \
     LOCALSTATEDIR=%{_localstatedir} \
     DESTDIR=%{buildroot} \
     SHORTNAME=ygg \
     LONGNAME=yggdrasil \
     PKGNAME=@PKGNAME@ \
     BRANDNAME=yggdrasil \
     TOPICPREFIX=yggdrasil \
     VERSION=%{version} \
     DATAHOST= \
     'PROVIDER=' \
     install


%files
%doc README.md doc/tags.toml
%{_bindir}/ygg
%{_sbindir}/yggd
%config(noreplace) %{_sysconfdir}/yggdrasil/config.toml
%{_unitdir}/yggd.service
%{_datadir}/bash-completion/completions/*
%{_mandir}/man1/*
%{_prefix}/share/pkgconfig/yggdrasil.pc
%{_libexecdir}/yggdrasil


%changelog
* Wed Mar 05 2025 Packit <hello@packit.dev> - 0.2.6-0.20250305161700370218.pr307.1.g0f950da
- ci: fix packit configuration for versions & coprs (Pino Toscano)