forked from eclipse-bluechi/bluechi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbluechi.spec.in
328 lines (269 loc) · 10.4 KB
/
bluechi.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# python bluechi module is enabled by default, it can be disabled passing `--define "with_python 0"` option to rpmbuild
%if 0%{!?with_python:1}
%global with_python 1
%endif
# coverage collection is disabled by default , it can be enabled passing `--define "with_coverage 1"` option to rpmbuild
%if 0%{?with_coverage}
%global coverage_flags -Dwith_coverage=true
%endif
Name: bluechi
Version: @VERSION@
Release: @RELEASE@%{?dist}
Summary: A systemd service controller for multi-nodes environments
License: LGPL-2.1-or-later
URL: https://github.com/containers/bluechi
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: gcc
# Meson needs to detect C++, because part of inih library (which we don't use) provides C++ functionality
BuildRequires: gcc-c++
BuildRequires: meson
BuildRequires: systemd-devel
BuildRequires: systemd-rpm-macros
BuildRequires: golang-github-cpuguy83-md2man
%description
BlueChi is a systemd service controller for multi-nodes environements with a
predefined number of nodes and with a focus on highly regulated environment
such as those requiring functional safety (for example in cars).
%package controller
Summary: BlueChi service controller
Requires: systemd
Recommends: bluechi-selinux
%if 0%{?with_coverage}
Requires: bluechi-coverage = %{version}-%{release}
%endif
Obsoletes: hirte < 0.6.0
Provides: hirte = %{version}-%{release}
Obsoletes: bluechi < 0.7.0
Provides: bluechi = %{version}-%{release}
%description controller
BlueChi is a systemd service controller for multi-nodes environements with a
predefined number of nodes and with a focus on highly regulated environment
such as those requiring functional safety (for example in cars).
This package contains the controller service.
%post controller
%systemd_post bluechi-controller.service
%preun controller
%systemd_preun bluechi-controller.service
%postun controller
%systemd_postun_with_restart bluechi-controller.service
%files controller
%ghost %{_sysconfdir}/bluechi/controller.conf
%dir %{_sysconfdir}/bluechi
%dir %{_sysconfdir}/bluechi/controller.conf.d
%doc README.md
%doc README.developer.md
%license LICENSE
%{_libexecdir}/bluechi-controller
%{_datadir}/dbus-1/interfaces/org.eclipse.bluechi.Job.xml
%{_datadir}/dbus-1/interfaces/org.eclipse.bluechi.Manager.xml
%{_datadir}/dbus-1/interfaces/org.eclipse.bluechi.Monitor.xml
%{_datadir}/dbus-1/interfaces/org.eclipse.bluechi.Node.xml
%{_datadir}/dbus-1/system.d/org.eclipse.bluechi.conf
%{_datadir}/bluechi/config/controller.conf
%{_mandir}/man1/bluechi-controller.*
%{_mandir}/man5/bluechi-controller.conf.*
%{_sysconfdir}/bluechi/controller.conf.d/README.md
%{_unitdir}/bluechi-controller.service
%{_unitdir}/bluechi-controller.socket
%package agent
Summary: BlueChi service controller agent
Requires: systemd
Recommends: bluechi-selinux
%if 0%{?with_coverage}
Requires: bluechi-coverage = %{version}-%{release}
%endif
Obsoletes: hirte-agent < 0.6.0
Provides: hirte-agent = %{version}-%{release}
%description agent
BlueChi is a systemd service controller for multi-nodes environements with a
predefined number of nodes and with a focus on highly regulated environment
such as those requiring functional safety (for example in cars).
This package contains the node agent.
%post agent
%systemd_post bluechi-agent.service
%preun agent
%systemd_preun bluechi-agent.service
%postun agent
%systemd_postun_with_restart bluechi-agent.service
%files agent
%ghost %{_sysconfdir}/bluechi/agent.conf
%dir %{_sysconfdir}/bluechi
%dir %{_sysconfdir}/bluechi/agent.conf.d
%doc README.md
%license LICENSE
%{_libexecdir}/bluechi-agent
%{_libexecdir}/bluechi-proxy
%{_datadir}/dbus-1/system.d/org.eclipse.bluechi.Agent.conf
%{_datadir}/bluechi-agent/config/agent.conf
%{_datadir}/dbus-1/interfaces/org.eclipse.bluechi.Agent.xml
%{_mandir}/man1/bluechi-agent.*
%{_mandir}/man1/bluechi-proxy.*
%{_mandir}/man5/bluechi-agent.conf.*
%{_sysconfdir}/bluechi/agent.conf.d/README.md
%{_unitdir}/bluechi-agent.service
%{_userunitdir}/bluechi-agent.service
%{_unitdir}/[email protected]
%{_userunitdir}/[email protected]
%{_unitdir}/[email protected]
%{_userunitdir}/[email protected]
%package selinux
Summary: BlueChi SELinux policy
BuildRequires: checkpolicy
BuildRequires: selinux-policy-devel
%if "%{_selinux_policy_version}" != ""
Requires: selinux-policy >= %{_selinux_policy_version}
%endif
Requires(post): policycoreutils
Requires(post): policycoreutils-python-utils
Requires(postun): policycoreutils-python-utils
Obsoletes: hirte-selinux < 0.6.0
Provides: hirte-selinux = %{version}-%{release}
%global selinuxtype targeted
%description selinux
SELinux policy associated with the bluechi and bluechi-agent daemons
%files selinux
%{_datadir}/selinux/devel/include/services/bluechi.if
%{_datadir}/selinux/packages/bluechi.pp.bz2
%{_mandir}/man8/bluechi*selinux.*
%post selinux
# Remove hirte policy
if [ $1 -eq 1 ]; then
semanage port -N -d -p udp 842 2>/dev/null || true
semanage port -N -d -p tcp 842 2>/dev/null || true
semodule -N -X 200 -r hirte 2>/dev/null || true
fi
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/bluechi.pp.bz2
restorecon -R %{_bindir}/bluechi* &> /dev/null || :
semanage port -a -t bluechi_port_t -p udp 842 2>/dev/null || semanage port -m -t bluechi_port_t -p udp 842
semanage port -a -t bluechi_port_t -p tcp 842 2>/dev/null || semanage port -m -t bluechi_port_t -p tcp 842
%postun selinux
if [ $1 -eq 0 ]; then
semanage port -d -p udp 842 2>/dev/null || true
semanage port -d -p tcp 842 2>/dev/null || true
%selinux_modules_uninstall -s %{selinuxtype} bluechi
restorecon -R %{_bindir}/bluechi* &> /dev/null || :
fi
%triggerpostun selinux -- hirte-selinux
semanage port -a -t bluechi_port_t -p udp 842 2>/dev/null || semanage port -m -t bluechi_port_t -p udp 842
semanage port -a -t bluechi_port_t -p tcp 842 2>/dev/null || semanage port -m -t bluechi_port_t -p tcp 842
%package ctl
Summary: BlueChi service controller command line tool
Requires: %{name} = %{version}-%{release}
%if 0%{?with_coverage}
Requires: bluechi-coverage = %{version}-%{release}
%endif
Obsoletes: hirte-ctl < 0.6.0
Provides: hirte-ctl = %{version}-%{release}
%description ctl
BlueChi is a systemd service controller for multi-nodes environements with a
predefined number of nodes and with a focus on highly regulated environment
such as those requiring functional safety (for example in cars).
This package contains the service controller command line tool.
%files ctl
%doc README.md
%license LICENSE
%{_bindir}/bluechictl
%{_mandir}/man1/bluechictl.*
%if %{with_python}
%package -n python3-bluechi
Summary: Python bindings for BlueChi
BuildRequires: python3-devel
BuildRequires: python3-setuptools
Requires: python3-dasbus
Obsoletes: python3-hirte < 0.6.0
Provides: python3-hirte = %{version}-%{release}
%description -n python3-bluechi
bluechi is a python module to access the public D-Bus API of BlueChi project.
It contains typed python code that is auto-generated from BlueChi's
API description and manually written code to simplify recurring tasks.
%files -n python3-bluechi
%license LICENSE
%doc README.md
%{python3_sitelib}/bluechi-*.egg-info/
%{python3_sitelib}/bluechi/
%endif
%if 0%{?with_coverage}
%package coverage
Summary: Code coverage files for BlueChi
%description coverage
This package contains code coverage files created during the build. Those files
will be used during integration tests when creating code coverage report.
%files coverage
%license LICENSE
%{_datadir}/bluechi-coverage/*.gcno
%dir %{_localstatedir}/tmp/bluechi-coverage/
%endif
%prep
%autosetup
%build
%meson -Dapi_bus=system %{?coverage_flags}
%meson_build
%if %{with_python}
pushd src/bindings/python
%py3_build
popd
%endif
%install
%meson_install
%if 0%{?with_coverage}
mkdir -p %{buildroot}/%{_localstatedir}/tmp/bluechi-coverage/
%endif
%if %{with_python}
pushd src/bindings/python
%py3_install
popd
%endif
%check
%meson_test
%changelog
* Mon Sep 04 2023 Michael Engel <[email protected]> - 0.5.0-1
- Changing the name of the project from hirte to BlueChi
- Changing the license of the project from GPL-2.0-or-later to LGPL-2.1-or-later
- Changing the license of API examples to CC0-1.0
- Changing the license of typed python bindings package to CC0-1.0
- New feature: freeze and thaw units via BlueChi
- Added CLI option to all binaries to print the version
- A heartbeat interval of 0 disables it instead of spamming the signal
- A disconnecting, anonymous node doesn't lead to a segfault anymore
- Fixed a few smaller memory leaks
- Increased the maximum line length and added multi-line support for configuration files
- Improved error message when parsing configuration file fails
- Python bindings use the property annotation for D-Bus properties
- Fixes in the typed python bindings generator
- Fixes in the D-Bus API description
- The default log target has been set to journald
- Updates to Mkdocs like adding GoLang and Rust example
- Added more unit and integration tests
* Mon Jul 10 2023 Michael Engel <[email protected]> - 0.4.0-1
- Defaults for hirtectl monitor defaults defined and documented
- Dedicated signal is emitted when a node changes its connection state
- Added a last seen timestamp of a node as a D-Bus property
- Added new command to hirtectl to monitor node connections
- Support of FQDN in ManagerHost
- Support of IPv6 in ManagerHost
- Added hirtectl command to get the status of a unit
- Autogenerated, typed python bindings
- New rpm package for the typed python bindings of hirte's D-Bus API
- API and hirtectl commands for setting the loglevel at runtime
- Fixes in the D-Bus API description
* Wed May 31 2023 Michael Engel <[email protected]> - 0.3.0-1
- API and hirtectl commands for enabling, disabling and reloading of systemd units added
- Glob filter option to hirtectl list-units
- Collecting metrics for unit startup time
- Improvements for building hirte RPMs
- Allow hirte to run with unconfined user
- Aligned naming of hirte config files
- Fixed for invalid type cast of ProxyMonitor
- Mkdocs-based documentation added
- Wildcard support for monitoring units
* Wed May 03 2023 Michael Engel <[email protected]> - 0.2.1-1
- RPM and unit test fixes
* Tue Apr 25 2023 Michael Engel <[email protected]> - 0.2.0-1
- Heartbeat interval configurable
- Restart for hirte and hirte-agent systemd unit added
- Logging improvements
- SELinux policy added
- Defaults for node name and manager host in code
- Fix conf.d usage and memory leaks
* Tue Mar 21 2023 Martin Perina <[email protected]> - 0.1.0-1
- Initial release