# 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} %define source_date_epoch_from_changelog 0 Name: rhc Version: 0.2.4 Release: 0%{?dist} Epoch: 1 Summary: Client for registering Red Hat Enterprise Linux systems License: GPL-3.0-only URL: https://github.com/redhatinsights/rhc Source0: %{name}-%{version}.tar.gz ExclusiveArch: %{go_arches} Requires: insights-client Requires: yggdrasil >= 0.4 Requires: yggdrasil-worker-package-manager Requires: subscription-manager BuildRequires: golang BuildRequires: dbus-devel BuildRequires: systemd-devel BuildRequires: systemd %description rhc is a client that registers a system with RHSM and activates the Red Hat yggd MQTT client. %package compat Summary: Transition package to support migrating from rhcd to yggd Requires: yggdrasil >= 0.4.2 Recommends: rhc %description compat Transition package to support migrating from rhcd to yggd. %prep %setup -c %build cd %{name}-%{version} make PREFIX=%{_prefix} \ SYSCONFDIR=%{_sysconfdir} \ LOCALSTATEDIR=%{_localstatedir} \ SHORTNAME=rhc \ LONGNAME=rhc \ PKGNAME=rhc \ TOPICPREFIX=redhat/insights \ VERSION=%{version} \ DATAHOST=cert.cloud.redhat.com \ SERVICENAME=yggdrasil \ 'PROVIDER=Red Hat' %install cd %{name}-%{version} make PREFIX=%{_prefix} \ SYSCONFDIR=%{_sysconfdir} \ LOCALSTATEDIR=%{_localstatedir} \ DESTDIR=%{buildroot} \ SHORTNAME=rhc \ LONGNAME=rhc \ PKGNAME=rhc \ TOPICPREFIX=redhat/insights \ VERSION=%{version} \ DATAHOST=cert.cloud.redhat.com \ SERVICENAME=yggdrasil \ 'PROVIDER=Red Hat' \ install install --directory %{buildroot}%{_unitdir} install --directory %{buildroot}%{_sysconfdir}/rhc ln -sf yggdrasil.service %{buildroot}%{_unitdir}/rhcd.service ln -sf ../yggdrasil/config.toml %{buildroot}%{_sysconfdir}/rhc/config.toml %post %systemd_post rhc-canonical-facts.timer if [ $1 -gt 1 ]; then systemctl daemon-reload systemctl enable --now rhc-canonical-facts.timer fi %preun %systemd_preun rhc-canonical-facts.timer %postun %systemd_postun_with_restart rhc-canonical-facts.timer if [ $1 -eq 0 ]; then systemctl daemon-reload fi %files %doc %{name}-%{version}/README.md %{_bindir}/rhc %{_datadir}/bash-completion/completions/* %{_mandir}/man1/* %{_unitdir}/* %{_presetdir}/* %files compat %{_unitdir}/rhcd.service %{_sysconfdir}/rhc/config.toml %changelog %if (0%{?fedora} || 0%{?rhel} >= 9) %autochangelog %endif