|
|
@ -1,150 +1,166 @@
|
|
|
|
%global buildflags -buildmode pie -compiler gc -a -v -x
|
|
|
|
## START: Set by rpmautospec
|
|
|
|
%global goldflags %{expand:-linkmode=external -compressdwarf=false -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'}
|
|
|
|
## (rpmautospec version 0.6.5)
|
|
|
|
|
|
|
|
## RPMAUTOSPEC: autorelease, autochangelog
|
|
|
|
|
|
|
|
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
|
|
|
|
|
|
|
|
release_number = 1;
|
|
|
|
|
|
|
|
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
|
|
|
|
|
|
|
|
print(release_number + base_release_number - 1);
|
|
|
|
|
|
|
|
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
|
|
|
|
|
|
|
|
## END: Set by rpmautospec
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%bcond_without check
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# https://github.com/redhatinsights/rhc
|
|
|
|
|
|
|
|
%global goipath github.com/redhatinsights/rhc
|
|
|
|
|
|
|
|
Version: 0.3.0
|
|
|
|
|
|
|
|
%global tag v%{version}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%gometa -f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%global golicenses LICENSE
|
|
|
|
|
|
|
|
%global godocs CONTRIBUTING.md README.md
|
|
|
|
|
|
|
|
|
|
|
|
%global yggdrasil_ver 0.2.1
|
|
|
|
|
|
|
|
%global ygg_pkg_mgr_ver 0.1.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Name: rhc
|
|
|
|
Name: rhc
|
|
|
|
Version: 0.2.2
|
|
|
|
Release: %autorelease
|
|
|
|
Release: 1%{?dist}
|
|
|
|
|
|
|
|
Epoch: 1
|
|
|
|
Epoch: 1
|
|
|
|
Summary: rhc connects the system to Red Hat hosted services
|
|
|
|
Summary: rhc connects the system to Red Hat hosted services
|
|
|
|
License: GPLv3
|
|
|
|
License: GPL-3.0-only
|
|
|
|
URL: https://github.com/redhatinsights/rhc
|
|
|
|
URL: %{gourl}
|
|
|
|
|
|
|
|
|
|
|
|
Source0: https://github.com/RedHatInsights/rhc/releases/download/%{version}/%{name}-%{version}.tar.gz
|
|
|
|
|
|
|
|
Source1: config.toml
|
|
|
|
|
|
|
|
Source2: https://github.com/RedHatInsights/yggdrasil/releases/download/%{yggdrasil_ver}/yggdrasil-%{yggdrasil_ver}.tar.gz
|
|
|
|
|
|
|
|
Source3: https://github.com/RedHatInsights/yggdrasil-worker-package-manager/releases/download/%{ygg_pkg_mgr_ver}/yggdrasil-worker-package-manager-%{ygg_pkg_mgr_ver}.tar.gz
|
|
|
|
|
|
|
|
Source4: rhc-package-manager.toml
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Fixed upstream https://github.com/RedHatInsights/yggdrasil-worker-package-manager/commit/22105b0016abfc7c743c1eadb0372e4ef93cc65e
|
|
|
|
Source: %{url}/releases/download/%{tag}/%{name}-%{version}.tar.xz
|
|
|
|
Patch0: 0001-feat-default-config-file-location.patch
|
|
|
|
|
|
|
|
# Fixed upstream https://github.com/RedHatInsights/yggdrasil/pull/100/commits/d75dc60df73a88b0a14c799f3b6f1e8f66cee3d4
|
|
|
|
|
|
|
|
Patch2: 0001-fix-read-worker-output-using-io.Read.patch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExclusiveArch: %{go_arches}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Recommends: insights-client
|
|
|
|
Recommends: insights-client
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Requires: subscription-manager
|
|
|
|
|
|
|
|
Requires: yggdrasil >= 0.4
|
|
|
|
|
|
|
|
Requires: yggdrasil-worker-package-manager
|
|
|
|
Requires(post): policycoreutils-python-utils
|
|
|
|
Requires(post): policycoreutils-python-utils
|
|
|
|
|
|
|
|
|
|
|
|
BuildRequires: git
|
|
|
|
BuildRequires: git-core
|
|
|
|
BuildRequires: golang
|
|
|
|
BuildRequires: golang
|
|
|
|
BuildRequires: go-rpm-macros
|
|
|
|
BuildRequires: go-rpm-macros
|
|
|
|
BuildRequires: dbus-devel
|
|
|
|
BuildRequires: meson
|
|
|
|
BuildRequires: systemd-devel
|
|
|
|
BuildRequires: systemd-rpm-macros
|
|
|
|
|
|
|
|
BuildRequires: pkgconfig(dbus-1)
|
|
|
|
|
|
|
|
BuildRequires: pkgconfig(systemd)
|
|
|
|
%define _description %{expand:%{name} is a client tool and daemon that connects the system to Red Hat hosted
|
|
|
|
BuildRequires: pkgconfig(bash-completion)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%global common_description %{expand:
|
|
|
|
|
|
|
|
%{name} is a client tool and daemon that connects the system to Red Hat hosted
|
|
|
|
services enabling system and subscription management.}
|
|
|
|
services enabling system and subscription management.}
|
|
|
|
|
|
|
|
|
|
|
|
%description
|
|
|
|
%description
|
|
|
|
%{_description}
|
|
|
|
%{common_description}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
%package compat
|
|
|
|
Summary: Development files for %{name}
|
|
|
|
Summary: Transition package to support migrating from rhcd to yggd
|
|
|
|
Requires: %{name} = %{epoch}:%{version}-%{release}
|
|
|
|
Requires: yggdrasil >= 0.4.2
|
|
|
|
|
|
|
|
Recommends: rhc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%description compat
|
|
|
|
|
|
|
|
%{common_description}
|
|
|
|
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
Transition package to support migrating from rhcd to yggd.
|
|
|
|
%{_description}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This package includes files necessary for building rhc workers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%global makeflags %{expand:PREFIX=%{_prefix} \\
|
|
|
|
|
|
|
|
SYSCONFDIR=%{_sysconfdir} \\
|
|
|
|
|
|
|
|
LOCALSTATEDIR=%{_localstatedir} \\
|
|
|
|
|
|
|
|
SHORTNAME=%{name} \\
|
|
|
|
|
|
|
|
LONGNAME=%{name} \\
|
|
|
|
|
|
|
|
PKGNAME=%{name} \\
|
|
|
|
|
|
|
|
'BRANDNAME=Remote Host Configuration' \\
|
|
|
|
|
|
|
|
TOPICPREFIX=redhat/insights \\
|
|
|
|
|
|
|
|
VERSION=%{version} \\
|
|
|
|
|
|
|
|
DATAHOST=cert.cloud.redhat.com \\
|
|
|
|
|
|
|
|
'PROVIDER=Red Hat'}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%prep
|
|
|
|
%setup -T -D -c -n %{name} -a 0
|
|
|
|
%goprep %{?rhel:-k}
|
|
|
|
%setup -T -D -c -n %{name} -a 2
|
|
|
|
%autopatch -p1
|
|
|
|
%setup -T -D -c -n %{name} -a 3
|
|
|
|
|
|
|
|
sed -i -e "s/LDFLAGS :=/LDFLAGS ?=/" %{_builddir}/%{name}/yggdrasil-%{yggdrasil_ver}/Makefile
|
|
|
|
|
|
|
|
sed -i -e "s/LDFLAGS :=/LDFLAGS ?=/" %{_builddir}/%{name}/%{name}-%{version}/Makefile
|
|
|
|
|
|
|
|
cd %{_builddir}/%{name}/yggdrasil-worker-package-manager
|
|
|
|
|
|
|
|
%patch0 -p0
|
|
|
|
|
|
|
|
cd %{_builddir}/%{name}/yggdrasil-%{yggdrasil_ver}
|
|
|
|
|
|
|
|
%patch2 -p1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if %{undefined rhel}
|
|
|
|
|
|
|
|
%generate_buildrequires
|
|
|
|
|
|
|
|
%go_generate_buildrequires
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
%build
|
|
|
|
%set_build_flags
|
|
|
|
%undefine _auto_set_build_flags
|
|
|
|
export BUILDFLAGS="%{buildflags}"
|
|
|
|
export %gomodulesmode
|
|
|
|
export LDFLAGS="%{goldflags}"
|
|
|
|
%{?gobuilddir:export GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"}
|
|
|
|
cd %{_builddir}/%{name}/yggdrasil-%{yggdrasil_ver}
|
|
|
|
%meson -Dvendor=True "-Dgobuildflags=[%(echo %{expand:%gocompilerflags} | sed -e s/"^"/"'"/ -e s/" "/"', '"/g -e s/"$"/"'"/), '-tags', '"rpm_crashtraceback\ ${BUILDTAGS:-}"', '-a', '-v', '-x']" -Dgoldflags='%{?currentgoldflags} -B 0x%(head -c20 /dev/urandom|od -An -tx1|tr -d " \n") -compressdwarf=false -linkmode=external -extldflags "%{build_ldflags} %{?__golang_extldflags}"'
|
|
|
|
make %{makeflags}
|
|
|
|
%meson_build
|
|
|
|
|
|
|
|
|
|
|
|
cd %{_builddir}/%{name}/yggdrasil-worker-package-manager
|
|
|
|
|
|
|
|
go build %{buildflags} -ldflags="%{goldflags}" -o rhc-package-manager-worker -mod vendor .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cd %{_builddir}/%{name}/%{name}-%{version}
|
|
|
|
|
|
|
|
make %{makeflags}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
%install
|
|
|
|
%set_build_flags
|
|
|
|
%meson_install
|
|
|
|
export BUILDFLAGS="%{buildflags}"
|
|
|
|
install --directory %{buildroot}%{_unitdir}
|
|
|
|
export LDFLAGS="%{goldflags}"
|
|
|
|
install --directory %{buildroot}%{_sysconfdir}/rhc
|
|
|
|
cd %{_builddir}/%{name}/yggdrasil-%{yggdrasil_ver}
|
|
|
|
ln -sf yggdrasil.service %{buildroot}%{_unitdir}/rhcd.service
|
|
|
|
make %{makeflags} \
|
|
|
|
ln -sf ../yggdrasil/config.toml %{buildroot}%{_sysconfdir}/rhc/config.toml
|
|
|
|
DESTDIR=%{buildroot} \
|
|
|
|
|
|
|
|
install
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%{__install} -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cd %{_builddir}/%{name}/yggdrasil-worker-package-manager
|
|
|
|
|
|
|
|
%{__install} -D -m 755 rhc-package-manager-worker %{buildroot}%{_libexecdir}/%{name}/
|
|
|
|
|
|
|
|
%{__install} -D -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/%{name}/workers/rhc-package-manager.toml
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cd %{_builddir}/%{name}/%{name}-%{version}
|
|
|
|
|
|
|
|
make %{makeflags} \
|
|
|
|
|
|
|
|
DESTDIR=%{buildroot} \
|
|
|
|
|
|
|
|
install
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%if %{with check}
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
|
|
|
%gocheck
|
|
|
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
|
|
%post
|
|
|
|
%post
|
|
|
|
if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
|
|
|
|
/usr/sbin/semanage permissive --add rhcd_t || true
|
|
|
|
/usr/sbin/semanage permissive --add rhcd_t || true
|
|
|
|
%systemd_post rhc-canonical-facts.timer
|
|
|
|
|
|
|
|
if [ $1 -eq 1 ]; then
|
|
|
|
|
|
|
|
systemctl daemon-reload
|
|
|
|
|
|
|
|
systemctl start rhc-canonical-facts.timer
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%preun
|
|
|
|
|
|
|
|
%systemd_preun rhc-canonical-facts.timer
|
|
|
|
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%postun
|
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
|
|
|
|
|
|
|
|
/usr/sbin/semanage permissive --delete rhcd_t || true
|
|
|
|
/usr/sbin/semanage permissive --delete rhcd_t || true
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
%systemd_postun_with_restart rhc-canonical-facts.timer
|
|
|
|
|
|
|
|
if [ $1 -eq 0 ]; then
|
|
|
|
|
|
|
|
systemctl daemon-reload
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
%files
|
|
|
|
%doc %{name}-%{version}/README.md yggdrasil-%{yggdrasil_ver}/doc/tags.toml
|
|
|
|
%license LICENSE
|
|
|
|
%{_bindir}/%{name}
|
|
|
|
%doc CONTRIBUTING.md README.md
|
|
|
|
%{_sbindir}/%{name}d
|
|
|
|
%{_bindir}/*
|
|
|
|
%config(noreplace) %{_sysconfdir}/%{name}/config.toml
|
|
|
|
|
|
|
|
%config(noreplace) %{_sysconfdir}/%{name}/workers/rhc-package-manager.toml
|
|
|
|
|
|
|
|
%{_unitdir}/%{name}d.service
|
|
|
|
|
|
|
|
%{_datadir}/bash-completion/completions/*
|
|
|
|
%{_datadir}/bash-completion/completions/*
|
|
|
|
%{_mandir}/man1/*
|
|
|
|
%{_mandir}/man1/*
|
|
|
|
%{_libexecdir}/%{name}
|
|
|
|
%{_unitdir}/rhc-canonical-facts.*
|
|
|
|
|
|
|
|
%{_presetdir}/*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%files compat
|
|
|
|
|
|
|
|
%{_unitdir}/rhcd.service
|
|
|
|
|
|
|
|
%{_sysconfdir}/rhc/config.toml
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|
|
|
|
## START: Generated by rpmautospec
|
|
|
|
|
|
|
|
* Mon Dec 02 2024 Link Dupont <link@sub-pop.net> - 1:0.3.0-1
|
|
|
|
|
|
|
|
- Update to 0.3.0 (RHEL-69743)
|
|
|
|
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1:0.2.4-7
|
|
|
|
%{_prefix}/share/pkgconfig/%{name}.pc
|
|
|
|
- Bump release for October 2024 mass rebuild:
|
|
|
|
|
|
|
|
Resolves: RHEL-64018
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Tue May 21 2024 Link Dupont <link@redhat.com> - 0.2.4-6
|
|
|
|
|
|
|
|
- Require systemd instead of systemd-devel during compilation (RHEL-37674)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Mon Feb 12 2024 Link Dupont <link@redhat.com> - 0.2.4-5
|
|
|
|
|
|
|
|
- Update embedded yggdrasil-worker-package-manager to 0.1.3 (RHEL-17179)
|
|
|
|
|
|
|
|
- Update embedded yggdrasil to 0.2.4 (RHEL-17179)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Mon Jan 8 2024 Jiri Hnidek <jhnidek@redhat.com> - 0.2.4-4
|
|
|
|
|
|
|
|
- Add dependency on subscription-manager (RHEL-18974)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Mon Oct 23 2023 Link Dupont <link@redhat.com> - 0.2.4-3
|
|
|
|
|
|
|
|
- Update embedded yggdrasil-worker-package-manager (RHEL-14200)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Wed Oct 18 2023 Link Dupont <link@redhat.com> - 0.2.4-2
|
|
|
|
|
|
|
|
- Update embedded yggdrasil to 0.2.3 (RHEL-14200)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Tue Aug 01 2023 Alba Hita Catala <ahitacat@redhat.com> - 0.2.4-1
|
|
|
|
|
|
|
|
- Configure proxy for http connections (RHBZ#2227018)
|
|
|
|
|
|
|
|
- Failling to get system profile is not an error but a warning (RHBZ#2227012)
|
|
|
|
|
|
|
|
- Prevent message content being logged at any level (RHBZ#2227010)
|
|
|
|
|
|
|
|
- Added bash completion (RHBZ#2145198)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Tue Jul 25 2023 Vit Mojzis <vmojzis@redhat.com> - 0.2.3-2
|
|
|
|
|
|
|
|
- Make rhcd_t permissive even when SELinux is disabled (RHBZ#2226701)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Tue Jul 04 2023 Alba Hita Catala <ahitacat@redhat.com> - 0.2.3-1
|
|
|
|
|
|
|
|
- New upstream version (RHBZ#2219563)
|
|
|
|
|
|
|
|
|
|
|
|
%changelog
|
|
|
|
|
|
|
|
* Tue Feb 14 2023 Alba Hita Catala <ahitacat@redhat.com> - 0.2.2-1
|
|
|
|
* Tue Feb 14 2023 Alba Hita Catala <ahitacat@redhat.com> - 0.2.2-1
|
|
|
|
- New upstream version (RHBZ#2169772)
|
|
|
|
- New upstream version (RHBZ#2169772)
|
|
|
|
- RHC renaming (RHBZ#2167427)
|
|
|
|
- RHC renaming (RHBZ#2167427)
|
|
|
@ -243,3 +259,5 @@ fi
|
|
|
|
|
|
|
|
|
|
|
|
* Fri Feb 12 2021 Link Dupont <link@redhat.com> - 0.1-1
|
|
|
|
* Fri Feb 12 2021 Link Dupont <link@redhat.com> - 0.1-1
|
|
|
|
- Initial release
|
|
|
|
- Initial release
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## END: Generated by rpmautospec
|
|
|
|