Blame SPECS/rhc.spec

15b0da
%define debug_package %{nil}
d60c09
%global buildflags -buildmode pie -compiler gc -a -v -x
d60c09
%global goldflags %{expand:-linkmode=external -compressdwarf=false -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'}
15b0da
15b0da
%global go_arches x86_64 s390x ppc64le
15b0da
1fc9cc
%global yggdrasil_ver   0.2.4
d60c09
%global ygg_pkg_mgr_ver 0.1.0
d60c09
15b0da
Name:    rhc
d60c09
Version: 0.2.4
1fc9cc
Release: 2%{?dist}
15b0da
Epoch:   1
d60c09
Summary: rhc connects the system to Red Hat hosted services
15b0da
License: GPLv3
d60c09
URL:     https://github.com/RedHatInsights/rhc
15b0da
d60c09
Source0: https://github.com/RedHatInsights/rhc/releases/download/%{version}/%{name}-%{version}.tar.gz
15b0da
Source1: config.toml
d60c09
Source2: https://github.com/RedHatInsights/yggdrasil/releases/download/%{yggdrasil_ver}/yggdrasil-%{yggdrasil_ver}.tar.gz
d60c09
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
d60c09
Source4: rhc-package-manager.toml
15b0da
d60c09
# Remove Makefile preamble and use gzip -c instead of -k
d60c09
Patch0:  yggdrasil-patch-Makefile.patch
d60c09
Patch1:  rhc-patch-Makefile.patch
d60c09
Patch2:  0001-feat-default-config-file-location.patch
d60c09
Patch3:  0001-revert-drop-enable_content-option.patch
15b0da
15b0da
ExclusiveArch: %{go_arches}
15b0da
d60c09
Requires:      insights-client
d60c09
d60c09
%global go_toolset_version 1.19
15b0da
BuildRequires: git
d60c09
BuildRequires: go-toolset-%{go_toolset_version}-golang
15b0da
BuildRequires: dbus-devel
15b0da
BuildRequires: systemd-devel
15b0da
15b0da
d60c09
%define _description %{expand:%{name} is a client tool and daemon that connects
d60c09
the system to Red Hat hosted services enabling system and subscription
d60c09
management.}
d60c09
15b0da
%description
d60c09
%{_description}
15b0da
d60c09
%global makeflags %{expand:PREFIX=%{_prefix} \\
d60c09
     SYSCONFDIR=%{_sysconfdir} \\
d60c09
     LOCALSTATEDIR=%{_localstatedir} \\
d60c09
     SHORTNAME=%{name} \\
d60c09
     LONGNAME=%{name} \\
d60c09
     PKGNAME=%{name} \\
d60c09
     'BRANDNAME=Remote Host Configuration' \\
d60c09
     TOPICPREFIX=redhat/insights \\
d60c09
     VERSION=%{version} \\
d60c09
     DATAHOST=cert.cloud.redhat.com \\
d60c09
     'PROVIDER=Red Hat'}
15b0da
d60c09
d60c09
%prep
d60c09
%setup -q -T -D -c -n %{name} -a 0
d60c09
%setup -q -T -D -c -n %{name} -a 2
d60c09
%setup -q -T -D -c -n %{name} -a 3
d60c09
sed -i -e "s/LDFLAGS :=/LDFLAGS ?=/" %{_builddir}/%{name}/yggdrasil-%{yggdrasil_ver}/Makefile
d60c09
sed -i -e "s/LDFLAGS :=/LDFLAGS ?=/" %{_builddir}/%{name}/%{name}-%{version}/Makefile
d60c09
cd %{_builddir}/%{name}/yggdrasil-%{yggdrasil_ver}
d60c09
%patch -P 0 -p1
d60c09
cd %{_builddir}/%{name}/%{name}-%{version}
d60c09
%patch -P 1 -p1
d60c09
%patch -P 3 -p1
d60c09
cd %{_builddir}/%{name}/yggdrasil-worker-package-manager
d60c09
%patch -P 2 -p0
15b0da
15b0da
%build
d60c09
export CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-all"
d60c09
export BUILDFLAGS="%{buildflags}"
d60c09
export LDFLAGS="%{goldflags}"
d60c09
cd %{_builddir}/%{name}/yggdrasil-%{yggdrasil_ver}
d60c09
scl enable go-toolset-%{go_toolset_version} -- \
d60c09
make %{makeflags}
d60c09
d60c09
cd %{_builddir}/%{name}/yggdrasil-worker-package-manager
d60c09
scl enable go-toolset-%{go_toolset_version} -- \
d60c09
go build %{buildflags} -ldflags="%{goldflags}" -o rhc-package-manager-worker -mod=vendor .
d60c09
d60c09
cd %{_builddir}/%{name}/%{name}-%{version}
d60c09
scl enable go-toolset-%{go_toolset_version} -- \
d60c09
make %{makeflags}
15b0da
15b0da
15b0da
%install
d60c09
export CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-all"
d60c09
export BUILDFLAGS="%{buildflags}"
d60c09
export LDFLAGS="%{goldflags}"
d60c09
cd %{_builddir}/%{name}/yggdrasil-%{yggdrasil_ver}
d60c09
scl enable go-toolset-%{go_toolset_version} -- \
d60c09
make %{makeflags} \
15b0da
     DESTDIR=%{buildroot} \
15b0da
     install
d60c09
15b0da
%{__install} -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/
15b0da
d60c09
cd %{_builddir}/%{name}/yggdrasil-worker-package-manager
d60c09
%{__install} -D -m 755 rhc-package-manager-worker %{buildroot}%{_libexecdir}/%{name}/
d60c09
%{__install} -D -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/%{name}/workers/rhc-package-manager.toml
d60c09
d60c09
cd %{_builddir}/%{name}/%{name}-%{version}
d60c09
make %{makeflags} \
d60c09
     DESTDIR=%{buildroot} \
d60c09
     install
d60c09
15b0da
15b0da
%files
d60c09
%doc %{name}-%{version}/README.md yggdrasil-%{yggdrasil_ver}/doc/tags.toml
15b0da
%{_bindir}/%{name}
15b0da
%{_sbindir}/%{name}d
15b0da
%config(noreplace) %{_sysconfdir}/%{name}/config.toml
d60c09
%config(noreplace) %{_sysconfdir}/%{name}/workers/rhc-package-manager.toml
15b0da
%{_unitdir}/%{name}d.service
15b0da
%{_datadir}/bash-completion/completions/*
15b0da
%{_mandir}/man1/*
15b0da
%{_prefix}/share/pkgconfig/%{name}.pc
15b0da
%{_libexecdir}/%{name}
15b0da
15b0da
15b0da
%changelog
1fc9cc
* Tue Mar 26 2024 Link Dupont <link@redhat.com> - 0.2.4-2
1fc9cc
- Update embedded yggdrasil to 0.2.4 (RHEL-32930)
1fc9cc
d60c09
* Wed Aug 30 2023 Link Dupont <link@redhat.com> - 0.2.4-1
d60c09
- Update rhc to 0.2.4 (RHBZ#2227142)
d60c09
- Update yggdrasion to 0.2.2 (RHBZ#2227142)
d60c09
- Include rhc-worker-package-manager
d60c09
- Rebuild with Go 1.19
d60c09
723677
* Mon Oct 24 2022 Link Dupont <link@redhat.com> - 0.2.0-3
723677
- Rebuild with Go 1.16 (RHBZ#2028560)
723677
15b0da
* Wed Aug 25 2021 Link Dupont <link@redhat.com> - 0.2.0-2
15b0da
- Rebuild for new build target
15b0da
15b0da
* Mon Jun 28 2021 Link Dupont <link@redhat.com> - 0.2.0-1
15b0da
- New upstream release
15b0da
- Mark config file as a noreplace config file
15b0da
15b0da
* Fri Apr  9 2021 Link Dupont <link@redhat.com> - 0.1.4-1
15b0da
- New upstream release
15b0da
15b0da
* Fri Feb 19 2021 Link Dupont <link@redhat.com> - 0.1.2-2
15b0da
- Update default broker URI
15b0da
- Set Epoch to 1
15b0da
15b0da
* Thu Feb 18 2021 Link Dupont <link@redhat.com> - 0.1.2-1
15b0da
- New upstream release
15b0da
15b0da
* Wed Feb 17 2021 Link Dupont <link@redhat.com> - 0.1.1-1
15b0da
- New upstream release
15b0da
15b0da
* Fri Feb 12 2021 Link Dupont <link@redhat.com> - 0.1-1
15b0da
- Initial release