@cryptotaxi247 / netdata-1 / commits / 85206ac89

RPM: build go.d.plugin native for CentOS-Stream (#14551)

* enable build_ids for c8s & c9s * possibility to build netdata in closed environments (without Internet)

Konstantin Shalygin committed Sep 13, 2023 at 20:36 UTC 85206ac89fae5dc9f2d4f5a533b17308a549d106
1 file changed +162 -114
netdata.spec.in
+162 -114
@@ -1,9 +1,8 @@
1 # SPDX-License-Identifier: GPL-3.0-or-later
2 %global contentdir %{_datadir}/netdata
3 %global version @PACKAGE_VERSION@
4 -
5 -#TODO: Temporary fix for the build-id error during go.d plugin set up
6 -%global _missing_build_ids_terminate_build 0
4 +%global go_version @GO_PACKAGE_VERSION@
5 +%global go_name go.d.plugin
6
7 # XXX: We are using automatic `Requires:` generation for libraries
8 # whenever possible, DO NOT LIST LIBRARY DEPENDENCIES UNLESS THE RESULTANT
@@ -20,6 +19,16 @@ AutoReqProv: yes
19 # hours to finish).
20 %global _lto_cflags %nil
21
22 +# Disable go.d.plugin build on outdated golang distros
23 +%if 0%{?centos_ver:1}
24 +%if 0%{?centos_ver} >= 8 && 0%{!?almalinux_ver:1}
25 +%global _golang_build 1
26 +%else
27 +%global _golang_build 0
28 +%global _missing_build_ids_terminate_build 0
29 +%endif
30 +%endif
31 +
32 # Disable eBPF for architectures other than x86
33 %ifarch x86_64 i386
34 %global _have_ebpf 1
@@ -60,12 +69,14 @@ Version: %{version}
69 Release: 1%{?dist}
70 License: GPLv3+
71 Group: Applications/System
63 -Source0: https://github.com/netdata/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz
64 -URL: http://my-netdata.io
72 +Source0: https://github.com/%{name}/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz
73 +Source1: https://github.com/%{name}/%{go_name}/releases/download/v%{go_version}/config.tar.gz
74 +Source2: https://github.com/%{name}/%{go_name}/archive/refs/tags/v%{go_version}.tar.gz
75 +URL: http://my-%{name}.io
76
77 # Remove conflicting EPEL packages
67 -Obsoletes: %{name}-conf
68 -Obsoletes: %{name}-data
78 +Obsoletes: %{name}-conf
79 +Obsoletes: %{name}-data
80
81 # #####################################################################
82 # Core build/install/runtime dependencies
@@ -136,24 +147,24 @@ Requires(pre): /usr/sbin/useradd
147 # makes it impossible to properly test the packages prior to upload,
148 # so we just skip depending on them on CentOS 7.
149 %if 0%{?_have_ebpf}
139 -Requires: netdata-plugin-ebpf = %{version}
140 -%endif
141 -Requires: netdata-plugin-apps = %{version}
142 -Requires: netdata-plugin-pythond = %{version}
143 -Requires: netdata-plugin-go = %{version}
144 -Requires: netdata-plugin-debugfs = %{version}
145 -Requires: netdata-plugin-chartsd = %{version}
146 -Requires: netdata-plugin-slabinfo = %{version}
147 -Requires: netdata-plugin-perf = %{version}
150 +Requires: %{name}-plugin-ebpf = %{version}
151 +%endif
152 +Requires: %{name}-plugin-apps = %{version}
153 +Requires: %{name}-plugin-pythond = %{version}
154 +Requires: %{name}-plugin-go = %{version}
155 +Requires: %{name}-plugin-debugfs = %{version}
156 +Requires: %{name}-plugin-chartsd = %{version}
157 +Requires: %{name}-plugin-slabinfo = %{version}
158 +Requires: %{name}-plugin-perf = %{version}
159 %if 0%{?_have_nfacct}
149 -Requires: netdata-plugin-nfacct = %{version}
160 +Requires: %{name}-plugin-nfacct = %{version}
161 %endif
162 %if 0%{?_have_freeipmi} && 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7 && 0%{?amazon_linux} != 2
152 -Suggests: netdata-plugin-freeipmi = %{version}
163 +Suggests: %{name}-plugin-freeipmi = %{version}
164 %endif
165 %if 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7 && 0%{?amazon_linux} != 2
155 -Suggests: netdata-plugin-cups = %{version}
156 -Recommends: netdata-plugin-systemd-journal = %{version}
166 +Suggests: %{name}-plugin-cups = %{version}
167 +Recommends: %{name}-plugin-systemd-journal = %{version}
168 %endif
169
170
@@ -166,23 +177,23 @@ Recommends: netdata-plugin-systemd-journal = %{version}
177 # epbf plugin dependencies
178 %if 0%{?_have_ebpf}
179 %if 0%{?suse_version}
169 -BuildRequires: libelf-devel
180 +BuildRequires: libelf-devel
181 %else
171 -BuildRequires: elfutils-libelf-devel
182 +BuildRequires: elfutils-libelf-devel
183 %endif
184 %endif
185 # end ebpf plugin dependencies
186
187 # nfacct plugin dependencies
188 %if 0%{?_have_nfacct}
178 -BuildRequires: libmnl-devel
179 -BuildRequires: libnetfilter_acct-devel
189 +BuildRequires: libmnl-devel
190 +BuildRequires: libnetfilter_acct-devel
191 %endif
192 # end nfacct plugin dependencies
193
194 # freeipmi plugin dependencies
195 %if 0%{?_have_freeipmi}
185 -BuildRequires: freeipmi-devel
196 +BuildRequires: freeipmi-devel
197 %endif
198 # end - freeipmi plugin dependencies
199
@@ -192,6 +203,14 @@ BuildRequires: cups-devel >= 1.7
203 %endif
204 # end - cups plugin dependencies
205
206 +# go.d.plugin dependencies
207 +%if 0%{?suse_version}
208 +BuildRequires: go
209 +%else
210 +BuildRequires: golang
211 +%endif
212 +# end - go.d.plugin plugin dependencies
213 +
214 # systemd-journal dependencies
215 BuildRequires: systemd-devel
216 # end - systemd-journal dependencies
@@ -214,7 +233,7 @@ so that you can get insights of what is happening now and what just
233 happened, on your systems and applications.
234
235 %prep
217 -%setup -q -n %{name}-%{version}
236 +%setup -q -n "%{name}-%{version}"
237 # Only bundle protobuf on CentOS 7 or earlier
238 %if 0%{?centos_ver:1}
239 %if %{centos_ver} < 8
@@ -236,6 +255,15 @@ export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging
255 %endif
256 %endif
257
258 +# go.d.plugin
259 +%if 0%{?_golang_build}
260 +mkdir -p "%{_builddir}/%{go_name}"
261 +tar -xzf "%{SOURCE1}" -C "%{_builddir}/%{go_name}"
262 +tar -xzf "%{SOURCE2}" -C "%{_builddir}/%{go_name}"
263 +cd "%{_builddir}/%{go_name}/%{go_name}-%{go_version}"
264 +make download
265 +%endif
266 +
267 %build
268 # Conf step
269 autoreconf -ivf
@@ -261,12 +289,19 @@ autoreconf -ivf
289 --libdir="%{_libdir}" \
290 --with-zlib \
291 --with-math \
264 - --with-user=netdata \
292 + --with-user=%{name} \
293 --disable-dependency-tracking
294
295 # Build step
296 %{__make} %{?_smp_mflags}
297
298 +# Build go.d.plugin
299 +%if 0%{?_golang_build}
300 +cd "%{_builddir}/%{go_name}/%{go_name}-%{go_version}"
301 +sed -i 's|CGO_ENABLED=0 ||' "hack/go-build.sh"
302 +TRAVIS_TAG="%{go_version}" %{__make} build
303 +%endif
304 +
305 %install
306
307 # ###########################################################
@@ -274,16 +309,16 @@ autoreconf -ivf
309 rm -rf "${RPM_BUILD_ROOT}"
310 %{__make} %{?_smp_mflags} DESTDIR="${RPM_BUILD_ROOT}" install
311
277 -install -m 644 -p system/netdata.conf "${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}"
312 +install -m 644 -p "system/%{name}.conf" "${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}"
313
314 # ###########################################################
315 # Install updater script
281 -install -m 755 -p packaging/installer/netdata-updater.sh "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/netdata-updater.sh"
316 +install -m 755 -p packaging/installer/%{name}-updater.sh "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/%{name}-updater.sh"
317
318 # ###########################################################
319 # logrotate settings
320 install -m 755 -d "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d"
286 -install -m 644 -p system/logrotate/netdata "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}"
321 +install -m 644 -p "system/logrotate/%{name}" "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}"
322
323 # ###########################################################
324 # Install freeipmi
@@ -334,23 +369,32 @@ install -m 755 -d "${RPM_BUILD_ROOT}%{_localstatedir}/lib/%{name}/registry"
369
370 # ###########################################################
371 # Install uninstaller script
337 -install -m 750 -p packaging/installer/netdata-uninstaller.sh \
338 - "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/netdata-uninstaller.sh"
372 +install -m 750 -p packaging/installer/%{name}-uninstaller.sh \
373 +"${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/%{name}-uninstaller.sh"
374
375 # ###########################################################
376 # Install netdata service
377
378 install -m 755 -d "${RPM_BUILD_ROOT}%{_unitdir}"
379 %if 0%{?centos_ver} != 7 && 0%{?amazon_linux} != 2
345 -install -m 644 -p system/systemd/netdata.service "${RPM_BUILD_ROOT}%{_unitdir}/netdata.service"
380 +install -m 644 -p "system/systemd/%{name}.service" "${RPM_BUILD_ROOT}%{_unitdir}/%{name}.service"
381 %else
347 -install -m 644 -p system/systemd/netdata.service.v235 "${RPM_BUILD_ROOT}%{_unitdir}/netdata.service"
382 +install -m 644 -p "system/systemd/%{name}.service.v235" "${RPM_BUILD_ROOT}%{_unitdir}/%{name}.service"
383 %endif
384 install -m 755 -d "${RPM_BUILD_ROOT}%{_presetdir}"
350 -install -m 644 -p system/systemd/50-netdata.preset "${RPM_BUILD_ROOT}%{_presetdir}/50-netdata.preset"
385 +install -m 644 -p "system/systemd/50-%{name}.preset" "${RPM_BUILD_ROOT}%{_presetdir}/50-%{name}.preset"
386
387 # ############################################################
353 -# Package Go within netdata (TBD: Package it separately)
388 +# Package Go within netdata
389 +
390 +# Install builded go.d.plugin
391 +%if 0%{?_golang_build}
392 +install -m 0640 "%{_builddir}/%{go_name}/%{go_name}-%{go_version}/bin/godplugin" \
393 +"${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/%{go_name}"
394 +cp -r "%{_builddir}/%{go_name}/go.d.conf" "%{_builddir}/%{go_name}/go.d" \
395 +"${RPM_BUILD_ROOT}%{_libdir}/%{name}/conf.d/"
396 +%else
397 +# Install binary go.d.plugin
398 safe_sha256sum() {
399 # Within the context of the installer, we only use -c option that is common between the two commands
400 # We will have to reconsider if we start non-common options
@@ -442,48 +486,50 @@ install_go() {
486 return 0
487 }
488 install_go
445 -install -m 0640 -p go.d.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/go.d.plugin"
489 +install -m 0640 -p "%{go_name}" "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/%{go_name}"
490 +%endif
491
492 %if 0%{?_have_ebpf}
448 -${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-ebpf.sh ${RPM_BUILD_DIR}/%{name}-%{version} ${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d
493 +${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-ebpf.sh ${RPM_BUILD_DIR}/%{name}-%{version} \
494 +${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d
495 %endif
496
497 %pre
498
453 -if ! getent group netdata > /dev/null; then
454 - groupadd --system netdata
499 +if ! getent group %{name} > /dev/null; then
500 + groupadd --system %{name}
501 fi
502
457 -if ! getent passwd netdata > /dev/null; then
458 - useradd --system -g netdata --home %{contentdir} --no-create-home -s /sbin/nologin -c "Netdata pseudo user" netdata
503 +if ! getent passwd %{name} > /dev/null; then
504 + useradd --system -g %{name} --home %{contentdir} --no-create-home -s /sbin/nologin -c "Netdata pseudo user" %{name}
505 fi
506
507 # I am not sure that the corresponding group names are exactly the same as in Debian, but we should start somewhere, shouldn't we?
508 for item in docker nginx varnish haproxy adm nsd proxy squid ceph nobody I2C; do
509 if getent group $item > /dev/null 2>&1; then
464 - usermod -a -G $item netdata
510 + usermod -a -G ${item} %{name}
511 fi
512 done
513
514 %post
515 %if 0%{?suse_version}
470 -%service_add_post netdata.service
516 +%service_add_post %{name}.service
517 %else
472 -%systemd_post netdata.service
518 +%systemd_post %{name}.service
519 %endif
520
521 %preun
522 %if 0%{?suse_version}
477 -%service_del_preun netdata.service
523 +%service_del_preun %{name}.service
524 %else
479 -%systemd_preun netdata.service
525 +%systemd_preun %{name}.service
526 %endif
527
528 %postun
529 %if 0%{?suse_version}
484 -%service_del_postun netdata.service
530 +%service_del_postun %{name}.service
531 %else
486 -%systemd_postun_with_restart netdata.service
532 +%systemd_postun_with_restart %{name}.service
533 %endif
534
535 %clean
@@ -491,8 +537,8 @@ rm -rf "${RPM_BUILD_ROOT}"
537
538 %files
539 %doc README.md
494 -%config(noreplace) %{_sysconfdir}/%{name}/netdata.conf
495 -%config(noreplace) %{_sysconfdir}/%{name}/netdata-updater.conf
540 +%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
541 +%config(noreplace) %{_sysconfdir}/%{name}/%{name}-updater.conf
542 %attr(0755,root,netdata) %{_sysconfdir}/%{name}/edit-config
543 %attr(0644,root,netdata) %{_sysconfdir}/%{name}/.install-type
544 %dir %{_sysconfdir}/%{name}/health.d
@@ -501,17 +547,17 @@ rm -rf "${RPM_BUILD_ROOT}"
547 %{_libdir}/%{name}
548 %{_sbindir}/%{name}
549 %{_sbindir}/netdatacli
504 -%{_sbindir}/netdata-claim.sh
550 +%{_sbindir}/%{name}-claim.sh
551
506 -%{_unitdir}/netdata.service
507 -%{_presetdir}/50-netdata.preset
552 +%{_unitdir}/%{name}.service
553 +%{_presetdir}/50-%{name}.preset
554
555 %dir %{_libexecdir}/%{name}
556 %dir %{_libexecdir}/%{name}/plugins.d
557 %defattr(0750,root,netdata,0750)
558 %{_libexecdir}/%{name}/install-service.sh
513 -%{_libexecdir}/%{name}/netdata-updater.sh
514 -%{_libexecdir}/%{name}/netdata-uninstaller.sh
559 +%{_libexecdir}/%{name}/%{name}-updater.sh
560 +%{_libexecdir}/%{name}/%{name}-uninstaller.sh
561 %{_libexecdir}/%{name}/plugins.d/acl.sh
562 %{_libexecdir}/%{name}/plugins.d/alarm.sh
563 %{_libexecdir}/%{name}/plugins.d/alarm-email.sh
@@ -583,7 +629,7 @@ rm -rf "${RPM_BUILD_ROOT}"
629 %exclude %{_libdir}/%{name}/conf.d/python.d
630
631 # Go.d belongs to a different sub-package
586 -%exclude %{_libexecdir}/%{name}/plugins.d/go.d.plugin
632 +%exclude %{_libexecdir}/%{name}/plugins.d/%{go_name}
633 %exclude %{_libdir}/%{name}/conf.d/go.d.conf
634 %exclude %{_libdir}/%{name}/conf.d/go.d
635
@@ -608,15 +654,15 @@ rm -rf "${RPM_BUILD_ROOT}"
654 Summary: The CUPS metrics collection plugin for the Netdata Agent
655 Group: Applications/System
656 Requires: cups >= 1.7
611 -Requires: netdata = %{version}
657 +Requires: %{name} = %{version}
658
659 %description plugin-cups
660 This plugin allows the Netdata Agent to collect metrics from the Common UNIX Printing System.
661
662 %pre plugin-cups
663
618 -if ! getent group netdata > /dev/null; then
619 - groupadd --system netdata
664 +if ! getent group %{name} > /dev/null; then
665 + groupadd --system %{name}
666 fi
667
668 %files plugin-cups
@@ -628,15 +674,15 @@ fi
674 Summary: The FreeIPMI metrics collection plugin for the Netdata Agent
675 Group: Applications/System
676 Requires: freeipmi
631 -Requires: netdata = %{version}
677 +Requires: %{name} = %{version}
678
679 %description plugin-freeipmi
680 This plugin allows the Netdata Agent to collect metrics from hardware using FreeIPMI.
681
682 %pre plugin-freeipmi
683
638 -if ! getent group netdata > /dev/null; then
639 - groupadd --system netdata
684 +if ! getent group %{name} > /dev/null; then
685 + groupadd --system %{name}
686 fi
687
688 %files plugin-freeipmi
@@ -647,16 +693,16 @@ fi
693 %package plugin-nfacct
694 Summary: The NFACCT metrics collection plugin for the Netdata Agent
695 Group: Applications/System
650 -Requires: netdata = %{version}
651 -Conflicts: netdata < %{version}
696 +Requires: %{name} = %{version}
697 +Conflicts: %{name} < %{version}
698
699 %description plugin-nfacct
700 This plugin allows the Netdata Agent to collect metrics from the firewall using NFACCT objects.
701
702 %pre plugin-nfacct
703
658 -if ! getent group netdata > /dev/null; then
659 - groupadd --system netdata
704 +if ! getent group %{name} > /dev/null; then
705 + groupadd --system %{name}
706 fi
707
708 %files plugin-nfacct
@@ -667,8 +713,8 @@ fi
713 Summary: The charts.d metrics collection plugin for the Netdata Agent
714 Group: Applications/System
715 Requires: bash
670 -Requires: netdata = %{version}
671 -Conflicts: netdata < %{version}
716 +Requires: %{name} = %{version}
717 +Conflicts: %{name} < %{version}
718 %if 0%{?centos_ver} != 7
719 Suggests: nut
720 Suggests: apcupsd
@@ -682,8 +728,8 @@ It includes collectors for NUT, APCUPSD, LibreSWAN, OpenSIPS, and Wireless acces
728
729 %pre plugin-chartsd
730
685 -if ! getent group netdata > /dev/null; then
686 - groupadd --system netdata
731 +if ! getent group %{name} > /dev/null; then
732 + groupadd --system %{name}
733 fi
734
735 %files plugin-chartsd
@@ -699,14 +745,14 @@ fi
745 %package plugin-ebpf
746 Summary: The eBPF metrics collection plugin for the Netdata Agent
747 Group: Applications/System
702 -Requires: netdata = %{version}
703 -Conflicts: netdata < %{version}
748 +Requires: %{name} = %{version}
749 +Conflicts: %{name} < %{version}
750 %if 0%{?centos_ver} != 7
705 -Recommends: netdata-plugin-apps = %{version}
706 -Recommends: netdata-ebpf-legacy-code >= %{version}
751 +Recommends: %{name}-plugin-apps = %{version}
752 +Recommends: %{name}-ebpf-legacy-code >= %{version}
753 %else
708 -Requires: netdata-plugin-apps = %{version}
709 -Requires: netdata-ebpf-legacy-code >= %{version}
754 +Requires: %{name}-plugin-apps = %{version}
755 +Requires: %{name}-ebpf-legacy-code >= %{version}
756 %endif
757
758 %description plugin-ebpf
@@ -714,8 +760,8 @@ Requires: netdata-ebpf-legacy-code >= %{version}
760
761 %pre plugin-ebpf
762
717 -if ! getent group netdata > /dev/null; then
718 - groupadd --system netdata
763 +if ! getent group %{name} > /dev/null; then
764 + groupadd --system %{name}
765 fi
766
767 %files plugin-ebpf
@@ -728,8 +774,8 @@ fi
774 %package ebpf-legacy-code
775 Summary: Compiled eBPF legacy code for the Netdata eBPF plugin
776 Group: Applications/System
731 -Requires: netdata-plugin-ebpf = %{version}
732 -Conflicts: netdata < %{version}
777 +Requires: %{name}-plugin-ebpf = %{version}
778 +Conflicts: %{name} < %{version}
779
780 %description ebpf-legacy-code
781 This package provides the pre-compiled eBPF legacy code for use by the Netdata eBPF plugin.
@@ -737,8 +783,8 @@ Conflicts: netdata < %{version}
783
784 %pre ebpf-legacy-code
785
740 -if ! getent group netdata > /dev/null; then
741 - groupadd --system netdata
786 +if ! getent group %{name} > /dev/null; then
787 + groupadd --system %{name}
788 fi
789
790 %files ebpf-legacy-code
@@ -750,8 +796,8 @@ fi
796 %package plugin-pythond
797 Summary: The python.d metrics collection plugin for the Netdata Agent
798 Group: Applications/System
753 -Requires: netdata = %{version}
754 -Conflicts: netdata < %{version}
799 +Requires: %{name} = %{version}
800 +Conflicts: %{name} < %{version}
801 %if 0%{?centos_ver} == 7 || 0%{?centos_ver} == 6
802 Requires: python
803 %else
@@ -768,8 +814,8 @@ want to use those versions instead of the Python versions.
814
815 %pre plugin-pythond
816
771 -if ! getent group netdata > /dev/null; then
772 - groupadd --system netdata
817 +if ! getent group %{name} > /dev/null; then
818 + groupadd --system %{name}
819 fi
820
821 %files plugin-pythond
@@ -783,8 +829,8 @@ fi
829 %package plugin-go
830 Summary: The go.d metrics collection plugin for the Netdata Agent
831 Group: Applications/System
786 -Requires: netdata = %{version}
787 -Conflicts: netdata < %{version}
832 +Requires: %{name} = %{version}
833 +Conflicts: %{name} < %{version}
834 %if 0%{?centos_ver} != 7
835 Suggests: nvme-cli
836 Suggests: sudo
@@ -797,15 +843,15 @@ so most users will want it installed.
843
844 %pre plugin-go
845
800 -if ! getent group netdata > /dev/null; then
801 - groupadd --system netdata
846 +if ! getent group %{name} > /dev/null; then
847 + groupadd --system %{name}
848 fi
849
850 %files plugin-go
851 %defattr(0750,root,netdata,0750)
852 # CAP_NET_ADMIN needed for WireGuard collector
853 # CAP_NET_RAW needed for ping collector
808 -%caps(cap_net_admin,cap_net_raw=eip) %{_libexecdir}/%{name}/plugins.d/go.d.plugin
854 +%caps(cap_net_admin,cap_net_raw=eip) %{_libexecdir}/%{name}/plugins.d/%{go_name}
855 %defattr(0644,root,netdata,0755)
856 %{_libdir}/%{name}/conf.d/go.d.conf
857 %{_libdir}/%{name}/conf.d/go.d
@@ -813,16 +859,16 @@ fi
859 %package plugin-apps
860 Summary: The per-application metrics collection plugin for the Netdata Agent
861 Group: Applications/System
816 -Requires: netdata = %{version}
817 -Conflicts: netdata < %{version}
862 +Requires: %{name} = %{version}
863 +Conflicts: %{name} < %{version}
864
865 %description plugin-apps
866 This plugin allows the Netdata Agent to collect per-application and per-user metrics without using cgroups.
867
868 %pre plugin-apps
869
824 -if ! getent group netdata > /dev/null; then
825 - groupadd --system netdata
870 +if ! getent group %{name} > /dev/null; then
871 + groupadd --system %{name}
872 fi
873
874 %files plugin-apps
@@ -835,16 +881,16 @@ fi
881 %package plugin-slabinfo
882 Summary: The slabinfo metrics collector for the Netdata Agent
883 Group: Applications/System
838 -Requires: netdata = %{version}
839 -Conflicts: netdata < %{version}
884 +Requires: %{name} = %{version}
885 +Conflicts: %{name} < %{version}
886
887 %description plugin-slabinfo
888 This plugin allows the Netdata Agent to collect perfromance and utilization metrics for the Linux kernel’s SLAB allocator.
889
890 %pre plugin-slabinfo
891
846 -if ! getent group netdata > /dev/null; then
847 - groupadd --system netdata
892 +if ! getent group %{name} > /dev/null; then
893 + groupadd --system %{name}
894 fi
895
896 %files plugin-slabinfo
@@ -855,16 +901,16 @@ fi
901 %package plugin-perf
902 Summary: The perf metrics collector for the Netdata Agent
903 Group: Applications/System
858 -Requires: netdata = %{version}
859 -Conflicts: netdata < %{version}
904 +Requires: %{name} = %{version}
905 +Conflicts: %{name} < %{version}
906
907 %description plugin-perf
908 This plugin allows the Netdata to collect metrics from the Linux perf subsystem.
909
910 %pre plugin-perf
911
866 -if ! getent group netdata > /dev/null; then
867 - groupadd --system netdata
912 +if ! getent group %{name} > /dev/null; then
913 + groupadd --system %{name}
914 fi
915
916 %files plugin-perf
@@ -880,16 +926,16 @@ fi
926 %package plugin-debugfs
927 Summary: The debugfs metrics collector for the Netdata Agent
928 Group: Applications/System
883 -Requires: netdata = %{version}
884 -Conflicts: netdata < %{version}
929 +Requires: %{name} = %{version}
930 +Conflicts: %{name} < %{version}
931
932 %description plugin-debugfs
933 This plugin allows the Netdata Agent to collect Linux kernel metrics exposed through debugfs.
934
935 %pre plugin-debugfs
936
891 -if ! getent group netdata > /dev/null; then
892 - groupadd --system netdata
937 +if ! getent group %{name} > /dev/null; then
938 + groupadd --system %{name}
939 fi
940
941 %files plugin-debugfs
@@ -900,8 +946,8 @@ fi
946 %package plugin-systemd-journal
947 Summary: The systemd-journal plugin for the Netdata Agent
948 Group: Applications/System
903 -Requires: netdata = %{version}
904 -Conflicts: netdata < %{version}
949 +Requires: %{name} = %{version}
950 +Conflicts: %{name} < %{version}
951
952 %description plugin-systemd-journal
953 This plugin allows the Netdata Agent to present entries from the systemd
@@ -909,8 +955,8 @@ Conflicts: netdata < %{version}
955
956 %pre plugin-systemd-journal
957
912 -if ! getent group netdata > /dev/null; then
913 - groupadd --system netdata
958 +if ! getent group %{name} > /dev/null; then
959 + groupadd --system %{name}
960 fi
961
962 %files plugin-systemd-journal
@@ -919,7 +965,10 @@ fi
965 %caps(cap_dac_read_search=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/systemd-journal.plugin
966
967 %changelog
968 +* Mon Aug 28 2023 Konstantin Shalygin <k0ste@k0ste.ru> 0.0.0-23
969 +- Build go.d.plugin natively for CentOS Stream distro
970 * Mon Aug 21 2023 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-22
971 +- Explicitly depend on version-matched plugins in native packages
972 * Thu Aug 03 2023 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-21
973 - Added systemd-journal plugin handling
974 * Wed Jun 14 2023 Konstantin Shalygin <k0ste@k0ste.ru> 0.0.0-20
@@ -931,7 +980,7 @@ fi
980 - Drop pre-systemd init support.
981 * Thu Feb 16 2023 Konstantin Shalygin <k0ste@k0ste.ru> 0.0.0-17
982 - Added eBPF build dependency
934 -* Fri Feb 03 2022 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-16
983 +* Thu Feb 03 2022 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-16
984 - Bundle updater script in native packages.
985 * Mon Oct 11 2021 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-15
986 - Remove support code for legacy ACLK implementation.
@@ -973,4 +1022,3 @@ First draft refactor on package dependencies section
1022 - Fix permissions for log files
1023 * Sun Nov 15 2015 Alon Bar-Lev <alonbl@redhat.com> - 0.0.0-1
1024 - Initial add.
976 -