2021-11-22 16:32:41 +01:00
|
|
|
Name: cc-metric-collector
|
2022-03-01 15:39:26 +01:00
|
|
|
Version: %{VERS}
|
2021-11-22 16:32:41 +01:00
|
|
|
Release: 1%{?dist}
|
|
|
|
Summary: Metric collection daemon from the ClusterCockpit suite
|
|
|
|
|
|
|
|
License: MIT
|
|
|
|
Source0: %{name}-%{version}.tar.gz
|
|
|
|
|
2021-11-29 16:04:50 +01:00
|
|
|
BuildRequires: go-toolset
|
2022-03-03 13:43:43 +01:00
|
|
|
BuildRequires: systemd-rpm-macros
|
2022-03-15 16:41:11 +01:00
|
|
|
# for header downloads
|
|
|
|
BuildRequires: wget
|
2022-12-20 13:04:24 +01:00
|
|
|
# Recommended when using the sysusers_create_package macro
|
|
|
|
Requires(pre): /usr/bin/systemd-sysusers
|
2021-11-22 16:32:41 +01:00
|
|
|
|
|
|
|
Provides: %{name} = %{version}
|
|
|
|
|
|
|
|
%description
|
2021-11-29 16:04:50 +01:00
|
|
|
Metric collection daemon from the ClusterCockpit suite
|
2021-11-22 16:32:41 +01:00
|
|
|
|
|
|
|
%global debug_package %{nil}
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
make
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
2022-02-14 15:20:38 +01:00
|
|
|
install -Dpm 0750 %{name} %{buildroot}%{_sbindir}/%{name}
|
2021-11-29 16:04:50 +01:00
|
|
|
install -Dpm 0600 config.json %{buildroot}%{_sysconfdir}/%{name}/%{name}.json
|
2022-02-14 15:20:38 +01:00
|
|
|
install -Dpm 0600 collectors.json %{buildroot}%{_sysconfdir}/%{name}/collectors.json
|
|
|
|
install -Dpm 0600 sinks.json %{buildroot}%{_sysconfdir}/%{name}/sinks.json
|
|
|
|
install -Dpm 0600 receivers.json %{buildroot}%{_sysconfdir}/%{name}/receivers.json
|
|
|
|
install -Dpm 0600 router.json %{buildroot}%{_sysconfdir}/%{name}/router.json
|
|
|
|
install -Dpm 0644 scripts/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
|
|
|
|
install -Dpm 0600 scripts/%{name}.config %{buildroot}%{_sysconfdir}/default/%{name}
|
2022-03-03 13:43:43 +01:00
|
|
|
install -Dpm 0644 scripts/%{name}.sysusers %{buildroot}%{_sysusersdir}/%{name}.conf
|
2021-11-29 16:04:50 +01:00
|
|
|
|
2021-11-22 16:32:41 +01:00
|
|
|
|
|
|
|
%check
|
|
|
|
# go test should be here... :)
|
|
|
|
|
2022-03-02 15:10:14 +01:00
|
|
|
%pre
|
2022-03-03 17:24:32 +01:00
|
|
|
%sysusers_create_package scripts/%{name}.sysusers
|
2022-03-02 15:10:14 +01:00
|
|
|
|
2021-11-22 16:32:41 +01:00
|
|
|
%post
|
|
|
|
%systemd_post %{name}.service
|
|
|
|
|
|
|
|
%preun
|
|
|
|
%systemd_preun %{name}.service
|
|
|
|
|
|
|
|
%files
|
2022-03-04 11:52:48 +01:00
|
|
|
# Binary
|
|
|
|
%attr(-,clustercockpit,clustercockpit) %{_sbindir}/%{name}
|
|
|
|
# Config
|
2021-11-22 16:32:41 +01:00
|
|
|
%dir %{_sysconfdir}/%{name}
|
2022-03-04 11:52:48 +01:00
|
|
|
%attr(0600,clustercockpit,clustercockpit) %config(noreplace) %{_sysconfdir}/%{name}/%{name}.json
|
|
|
|
%attr(0600,clustercockpit,clustercockpit) %config(noreplace) %{_sysconfdir}/%{name}/collectors.json
|
|
|
|
%attr(0600,clustercockpit,clustercockpit) %config(noreplace) %{_sysconfdir}/%{name}/sinks.json
|
|
|
|
%attr(0600,clustercockpit,clustercockpit) %config(noreplace) %{_sysconfdir}/%{name}/receivers.json
|
|
|
|
%attr(0600,clustercockpit,clustercockpit) %config(noreplace) %{_sysconfdir}/%{name}/router.json
|
|
|
|
# Systemd
|
2021-11-22 16:32:41 +01:00
|
|
|
%{_unitdir}/%{name}.service
|
2021-11-29 16:04:50 +01:00
|
|
|
%{_sysconfdir}/default/%{name}
|
2022-03-03 13:43:43 +01:00
|
|
|
%{_sysusersdir}/%{name}.conf
|
2021-11-22 16:32:41 +01:00
|
|
|
|
|
|
|
%changelog
|
2022-03-03 13:43:43 +01:00
|
|
|
* Thu Mar 03 2022 Thomas Gruber - 0.3
|
|
|
|
- Add clustercockpit user installation
|
2022-02-14 15:20:38 +01:00
|
|
|
* Mon Feb 14 2022 Thomas Gruber - 0.2
|
|
|
|
- Add component specific configuration files
|
|
|
|
- Add %attr to config files
|
2021-11-22 16:40:17 +01:00
|
|
|
* Mon Nov 22 2021 Thomas Gruber - 0.1
|
|
|
|
- Initial spec file
|