Skip to content

Commit 102988a

Browse files
committed
Initial commit after sync, including RPM packaging
1 parent b306b63 commit 102988a

1 file changed

Lines changed: 101 additions & 0 deletions

File tree

node_exporter.spec

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
Autoreq: 0
2+
%define cl_dir /usr/share/cloudlinux/
3+
%define _clshare_plus %{cl_dir}cl_plus
4+
%define pkg_version_file %{cl_dir}%{name}
5+
6+
Name: cl-node-exporter
7+
Version: 1.2.0
8+
Release: 1%{dist}.cloudlinux
9+
Summary: CL Node Exporter tool
10+
License: Apache License, Version 2.0
11+
Group: System Environment/Base
12+
Source0: %{name}-%{version}.tar.bz2
13+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
14+
15+
16+
# Disable the building of the debug package(s).
17+
%define debug_package %{nil}
18+
19+
20+
%package tests
21+
Summary: Tests for CL Node Exporter version %{version}
22+
AutoReq: 0
23+
Group: Applications/System
24+
License: Apache License, Version 2.0
25+
26+
27+
%description
28+
This package provides Node Exporter tool
29+
30+
%description tests
31+
This package provides end-to-end tests for Node Exporter tool
32+
33+
34+
%prep
35+
%setup -q
36+
37+
38+
%build
39+
# download new version of Go compiler
40+
%ifarch x86_64 amd64 ia32e
41+
curl https://dl.google.com/go/go1.24.0.linux-amd64.tar.gz --output %{_tmppath}/go.tar.gz
42+
%else
43+
curl https://dl.google.com/go/go1.24.0.linux-386.tar.gz --output %{_tmppath}/go.tar.gz
44+
%endif
45+
tar xzf %{_tmppath}/go.tar.gz -C %{_tmppath}
46+
export PATH=$PATH:%{_tmppath}/go/bin
47+
export GOROOT=%{_tmppath}/go
48+
export GOPATH=%{_tmppath}
49+
make build
50+
make test
51+
# run cross-testing
52+
%ifarch x86_64 amd64 ia32e
53+
make test-32bit
54+
%endif
55+
56+
# build tests
57+
rm -rf collector/fixtures/sys
58+
./ttar -C collector/fixtures -x -f collector/fixtures/sys.ttar
59+
60+
61+
%install
62+
rm -rf $RPM_BUILD_ROOT
63+
64+
install -D -m 755 node_exporter $RPM_BUILD_ROOT%{_clshare_plus}/node_exporter
65+
66+
#install tests
67+
mkdir -p $RPM_BUILD_ROOT/opt/node_exporter_tests/collector
68+
cp -r collector/fixtures $RPM_BUILD_ROOT/opt/node_exporter_tests/collector/
69+
install -D -m 755 end-to-end-test.sh $RPM_BUILD_ROOT/opt/node_exporter_tests/end-to-end-test.sh
70+
install -D -m 755 node_exporter $RPM_BUILD_ROOT/opt/node_exporter_tests/node_exporter
71+
72+
# write package version to file
73+
if [[ ! -d "$RPM_BUILD_ROOT%{cl_dir}" ]]; then
74+
mkdir -p $RPM_BUILD_ROOT%{cl_dir}
75+
fi
76+
echo "%{version}-%{release}" > $RPM_BUILD_ROOT%{pkg_version_file}
77+
78+
exit 0
79+
80+
81+
%files
82+
%{_clshare_plus}/node_exporter
83+
%{pkg_version_file}
84+
85+
%files tests
86+
/opt/node_exporter_tests/*
87+
88+
89+
%changelog
90+
91+
* Mon Dec 01 2025 Ruslan Koliada <rkoliada@cloudlinux.com> 1.2.0-1
92+
- CLPRO-2902: Sync repository with upstream
93+
94+
* Wed Aug 19 2020 Stepan Oksanichenko <soksanichenko@cloudlinux.com> 1.1.0-2
95+
- CMT-221: Add package versions tags to sentry
96+
97+
* Fri Jun 26 2020 Stepan Oksanichenko <soksanichenko@cloudlinux.com> 1.1.0-1
98+
- CMT-75: Added ability to use unix socket instead http connection
99+
100+
* Mon Jun 03 2020 Stepan Oksanichenko <soksanichenko@cloudlinux.com> 1.0.1-1
101+
- CMT-18: [End Server tools] Build node exporter from sources in cloudlinux

0 commit comments

Comments
 (0)