# 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: rhc Version: 0.2.5 Release: 0.0.git.5ced8ee%{?dist} Epoch: 1 Summary: Client for registering Red Hat Enterprise Linux systems License: GPLv3 URL: https://github.com/redhatinsights/rhc Source0: %{name}-%{version}-0.0.git.5ced8ee.tar.gz Source1: https://github.com/RedHatInsights/yggdrasil/releases/download/0.2.4/yggdrasil-0.2.4.tar.gz Source2: https://github.com/RedHatInsights/yggdrasil-worker-package-manager/releases/download/0.1.2/yggdrasil-worker-package-manager-0.1.2.tar.xz ExclusiveArch: %{go_arches} Requires: insights-client BuildRequires: git 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. %prep %setup -T -D -c -n %{name} -a 0 %setup -T -D -c -n %{name} -a 1 %setup -T -D -c -n %{name} -a 2 %build cd %{_builddir}/%{name}/yggdrasil-0.2.4 make PREFIX=%{_prefix} \ SYSCONFDIR=%{_sysconfdir} \ LOCALSTATEDIR=%{_localstatedir} \ SHORTNAME=rhc \ LONGNAME=rhc \ PKGNAME=rhc \ TOPICPREFIX=redhat/insights \ VERSION=%{version} \ DATAHOST=cert.cloud.redhat.com \ SERVICENAME="rhcd" \ 'PROVIDER=Red Hat' cd %{_builddir}/%{name}/yggdrasil-worker-package-manager-0.1.2 go build -o rhc-package-manager-worker -mod=vendor . cd %{_builddir}/%{name}/%{name}-%{version}-0.0.git.5ced8ee make PREFIX=%{_prefix} \ SYSCONFDIR=%{_sysconfdir} \ LOCALSTATEDIR=%{_localstatedir} \ SHORTNAME=rhc \ LONGNAME=rhc \ PKGNAME=rhc \ TOPICPREFIX=redhat/insights \ VERSION=%{version} \ DATAHOST=cert.cloud.redhat.com \ SERVICENAME="rhcd" \ 'PROVIDER=Red Hat' %install cd %{_builddir}/%{name}/yggdrasil-0.2.4 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="rhcd" \ 'PROVIDER=Red Hat' \ install cd %{_builddir}/%{name}/yggdrasil-worker-package-manager-0.1.2 install -D -m 755 rhc-package-manager-worker %{buildroot}%{_libexecdir}/rhc/ install -D -m 644 config.toml %{buildroot}%{_sysconfdir}/rhc/workers/rhc-package-manager.toml cd %{_builddir}/%{name}/%{name}-%{version}-0.0.git.5ced8ee 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="rhcd" \ 'PROVIDER=Red Hat' \ install %files %doc %{name}-%{version}-0.0.git.5ced8ee/README.md %{_bindir}/rhc %{_sbindir}/rhcd %{_sysconfdir}/rhc/ %config(noreplace) %{_sysconfdir}/rhc/config.toml %config(noreplace) %{_sysconfdir}/rhc/workers/*.toml %{_unitdir}/rhcd.service %{_datadir}/bash-completion/completions/* %{_mandir}/man1/* %{_prefix}/share/pkgconfig/rhc.pc %{_libexecdir}/rhc %changelog