Add Github Action to build RPM (#14)

* Update SPEC file

* Add clean target to Makefile

* add rpmbuild action

* Add missing build dependency

* Fix package name of golang for CentOS8

* Change outputs

* Fix file list and build requires

* Fix for file list

* Also upload SRPM
This commit is contained in:
Thomas Gruber
2021-11-29 16:04:50 +01:00
committed by GitHub
parent 28163f5d2e
commit 15cf16b46f
3 changed files with 41 additions and 8 deletions

View File

@@ -6,12 +6,14 @@ Summary: Metric collection daemon from the ClusterCockpit suite
License: MIT
Source0: %{name}-%{version}.tar.gz
BuildRequires: golang
BuildRequires: go-toolset
# for internal LIKWID installation
BuildRequires: wget perl-Data-Dumper
Provides: %{name} = %{version}
%description
A simple web app
Metric collection daemon from the ClusterCockpit suite
%global debug_package %{nil}
@@ -20,15 +22,15 @@ A simple web app
%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 0755 %{name} %{buildroot}%{_sbindir}/%{name}
install -Dpm 0600 config.json %{buildroot}%{_sysconfdir}/%{name}/%{name}.json
install -Dpm 644 scripts/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
install -Dpm 600 scripts/%{name}.config %{buildroot}%{_sysconfdir}/default/%{name}
%check
# go test should be here... :)
@@ -41,9 +43,10 @@ install -Dpm 644 scripts/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
%files
%dir %{_sysconfdir}/%{name}
%{_bindir}/%{name}
%{_sbindir}/%{name}
%{_unitdir}/%{name}.service
%config(noreplace) %{_sysconfdir}/%{name}/config.json
%{_sysconfdir}/default/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.json
%changelog