-
Notifications
You must be signed in to change notification settings - Fork 18
/
rhc.spec.in
116 lines (93 loc) · 2.72 KB
/
rhc.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# 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: @LONGNAME@
Version: @VERSION@
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=@SHORTNAME@ \
LONGNAME=@LONGNAME@ \
PKGNAME=@PKGNAME@ \
TOPICPREFIX=@TOPICPREFIX@ \
VERSION=%{version} \
DATAHOST=@DATAHOST@ \
SERVICENAME=@SERVICENAME@ \
'PROVIDER=@PROVIDER@'
%install
cd %{name}-%{version}
make PREFIX=%{_prefix} \
SYSCONFDIR=%{_sysconfdir} \
LOCALSTATEDIR=%{_localstatedir} \
DESTDIR=%{buildroot} \
SHORTNAME=@SHORTNAME@ \
LONGNAME=@LONGNAME@ \
PKGNAME=@PKGNAME@ \
TOPICPREFIX=@TOPICPREFIX@ \
VERSION=%{version} \
DATAHOST=@DATAHOST@ \
SERVICENAME=@SERVICENAME@ \
'PROVIDER=@PROVIDER@' \
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 -eq 1 ]; then
systemctl daemon-reload
systemctl start 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}/@SHORTNAME@
%{_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