From 728b5f3e48f2bffc3e6bb04d74ecd5f94bbb436a Mon Sep 17 00:00:00 2001 From: Thomas Roehl Date: Mon, 22 Nov 2021 16:32:41 +0100 Subject: [PATCH] Add initial RPM spec file --- scripts/cc-metric-collector.spec | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 scripts/cc-metric-collector.spec diff --git a/scripts/cc-metric-collector.spec b/scripts/cc-metric-collector.spec new file mode 100644 index 0000000..967a585 --- /dev/null +++ b/scripts/cc-metric-collector.spec @@ -0,0 +1,51 @@ +Name: cc-metric-collector +Version: 0.1 +Release: 1%{?dist} +Summary: Metric collection daemon from the ClusterCockpit suite + +License: MIT +Source0: %{name}-%{version}.tar.gz + +BuildRequires: golang +BuildRequires: systemd-rpm-macros + +Provides: %{name} = %{version} + +%description +A simple web app + +%global debug_package %{nil} + +%prep +%autosetup + + +%build +cd collectors +make +go build -v -o %{name} + + +%install +install -Dpm 0755 %{name} %{buildroot}%{_bindir}/%{name} +install -Dpm 0755 config.json %{buildroot}%{_sysconfdir}/%{name}/config.json +install -Dpm 644 scripts/%{name}.service %{buildroot}%{_unitdir}/%{name}.service + +%check +# go test should be here... :) + +%post +%systemd_post %{name}.service + +%preun +%systemd_preun %{name}.service + +%files +%dir %{_sysconfdir}/%{name} +%{_bindir}/%{name} +%{_unitdir}/%{name}.service +%config(noreplace) %{_sysconfdir}/%{name}/config.json + + +%changelog +- Initial spec file