266 lines
8.9 KiB
RPMSpec
266 lines
8.9 KiB
RPMSpec
%bcond_with netfilteracct
|
|
|
|
%bcond_without cups
|
|
%global _hardened_build 1
|
|
# Build release candidate
|
|
Name: netdata
|
|
Version: 1.37.1
|
|
Release: 1
|
|
Summary: Real-time performance monitoring
|
|
License: GPLv3 and GPLv3+ and ASL 2.0 and CC-BY-4.0 and MIT and WTFPL
|
|
URL: https://github.com/%{name}/%{name}/
|
|
Source0: https://github.com/%{name}/%{name}/releases/download/v%{version}/%{name}-v%{version}.tar.gz
|
|
Source1: netdata.tmpfiles.conf
|
|
Source2: netdata.init
|
|
Source3: netdata.conf
|
|
Source4: netdata.profile
|
|
Source5: README-packager.md
|
|
Patch0: netdata-fix-shebang-1.37.0.patch
|
|
# Remove embedded font
|
|
Patch10: netdata-remove-fonts-1.37.0.patch
|
|
|
|
BuildRequires: zlib-devel
|
|
BuildRequires: git
|
|
BuildRequires: autoconf
|
|
BuildRequires: autoconf-archive
|
|
BuildRequires: automake
|
|
BuildRequires: pkgconfig
|
|
BuildRequires: libuuid-devel
|
|
BuildRequires: freeipmi-devel
|
|
BuildRequires: httpd
|
|
BuildRequires: gcc
|
|
BuildRequires: libuv-devel
|
|
BuildRequires: Judy-devel
|
|
BuildRequires: lz4-devel
|
|
BuildRequires: openssl-devel
|
|
BuildRequires: libmnl-devel
|
|
BuildRequires: make
|
|
BuildRequires: libcurl-devel
|
|
BuildRequires: systemd
|
|
BuildRequires: openssl-devel
|
|
BuildRequires: libpfm-devel
|
|
BuildRequires: autogen
|
|
|
|
# Prometheus
|
|
BuildRequires: snappy-devel
|
|
BuildRequires: protobuf-devel
|
|
BuildRequires: protobuf-c-devel
|
|
BuildRequires: findutils
|
|
|
|
# Cloud client
|
|
BuildRequires: cmake
|
|
BuildRequires: gcc-c++
|
|
BuildRequires: json-c-devel
|
|
BuildRequires: libcap-devel
|
|
|
|
# For tests
|
|
BuildRequires: libcmocka-devel
|
|
|
|
%if %{with cups}
|
|
BuildRequires: cups-devel >= 1.7
|
|
%endif
|
|
%if %{with netfilteracct}
|
|
BuildRequires: libnetfilter_acct-devel
|
|
%endif
|
|
BuildRequires: python3
|
|
|
|
|
|
Requires: nodejs
|
|
Requires: curl
|
|
Requires: nc
|
|
Requires: snappy
|
|
Requires: protobuf-c
|
|
Requires: protobuf
|
|
Requires: logrotate
|
|
Requires: %{name}-data = %{version}-%{release}
|
|
Requires: %{name}-conf = %{version}-%{release}
|
|
%description
|
|
netdata is the fastest way to visualize metrics. It is a resource
|
|
efficient, highly optimized system for collecting and visualizing any
|
|
type of realtime time-series data, from CPU usage, disk activity, SQL
|
|
queries, API calls, web site visitors, etc.
|
|
netdata tries to visualize the truth of now, in its greatest detail,
|
|
so that you can get insights of what is happening now and what just
|
|
happened, on your systems and applications.
|
|
|
|
%package data
|
|
BuildArch: noarch
|
|
Summary: Data files for netdata
|
|
Requires: /usr/sbin/useradd
|
|
Requires: /usr/sbin/groupadd
|
|
Requires: /usr/bin/systemctl
|
|
%description data
|
|
Data files for netdata
|
|
|
|
%package conf
|
|
BuildArch: noarch
|
|
Summary: Configuration files for netdata
|
|
Requires: logrotate
|
|
%description conf
|
|
Configuration files for netdata
|
|
|
|
%package freeipmi
|
|
Summary: FreeIPMI plugin for netdata
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
License: GPLv3
|
|
%description freeipmi
|
|
freeipmi plugin for netdata
|
|
|
|
%prep
|
|
%setup -qn %{name}-v%{version}
|
|
%patch0 -p1
|
|
# Remove embedded font(added in requires)
|
|
%patch10 -p1
|
|
rm -rf web/fonts web/gui/dashboard/static/media
|
|
cp %{SOURCE5} .
|
|
|
|
%build
|
|
autoreconf -ivf
|
|
%configure \
|
|
--enable-plugin-freeipmi \
|
|
%if %{with netfilteracct}
|
|
--enable-plugin-nfacct \
|
|
%endif
|
|
%if %{with cups}
|
|
--enable-plugin-cups \
|
|
%endif
|
|
--with-zlib \
|
|
--with-math \
|
|
--with-user=netdata
|
|
|
|
%make_build
|
|
|
|
%install
|
|
%make_install
|
|
find %{buildroot} -name '.keep' -delete
|
|
# Unit file
|
|
mkdir -p %{buildroot}%{_unitdir}
|
|
mkdir -p %{buildroot}%{_tmpfilesdir}
|
|
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
|
|
install -Dp -m 0644 system/netdata.service %{buildroot}%{_unitdir}/%{name}.service
|
|
install -p -m 0644 %{SOURCE1} %{buildroot}%{_tmpfilesdir}/%{name}.conf
|
|
install -Dp -m 0644 system/netdata.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/netdata
|
|
|
|
mkdir -p %{buildroot}%{_localstatedir}/lib/%{name}
|
|
mkdir -p %{buildroot}%{_localstatedir}/log/%{name}
|
|
mkdir -p %{buildroot}%{_localstatedir}/cache/%{name}
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
|
|
install -p -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/%{name}/
|
|
install -p -m 0644 system/netdata.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
|
# Conf files must be in /etc, dixit FHS and it's better in a noarch pkg
|
|
mv %{buildroot}%{_libdir}/%{name}/conf.d %{buildroot}%{_sysconfdir}/%{name}/
|
|
# Scripts must not be in /etc, /usr/libexec is a better place
|
|
mv %{buildroot}%{_sysconfdir}/%{name}/edit-config %{buildroot}%{_libexecdir}/%{name}/edit-config
|
|
# Fix EOL
|
|
sed -i -e 's/\r//' %{buildroot}%{_datadir}/%{name}/web/lib/tableExport-1.6.0.min.js
|
|
# Delete system dir with init scripts or unit files
|
|
rm -rf %{buildroot}%{_libdir}/%{name}/system
|
|
# Delete useless hidden dir
|
|
rm -rf %{buildroot}%{_datadir}/%{name}/web/.well-known
|
|
# Delete useless file (ubuntu)
|
|
rm -f %{buildroot}%{_sysconfdir}/%{name}/conf.d/ebpf.d/ebpf_kernel_reject_list.txt
|
|
|
|
for dir in charts.d health.d python.d statsd.d ; do
|
|
mkdir -p %{buildroot}%{_sysconfdir}/%{name}/${dir}
|
|
done
|
|
|
|
mkdir -p %{buildroot}%{_sysconfdir}/profile.d
|
|
install -p -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/profile.d/netdata.sh
|
|
|
|
%check
|
|
make tests
|
|
|
|
%pre data
|
|
getent group netdata > /dev/null || groupadd -r netdata
|
|
getent passwd netdata > /dev/null || useradd -r -g netdata -c "NetData User" -s /sbin/nologin -d /var/log/%{name} netdata
|
|
|
|
%post
|
|
sed -i -e '/web files group/ s/root/netdata/' /etc/netdata/netdata.conf ||:
|
|
%systemd_post %{name}.service
|
|
echo "The current config file can be downloaded with the following command"
|
|
echo "curl -o /etc/netdata/netdata.conf http://localhost:19999/netdata.conf"
|
|
echo "Config should be edited with %{_libexecdir}/%{name}/edit-config"
|
|
|
|
%preun
|
|
%systemd_preun %{name}.service
|
|
|
|
%postun
|
|
%systemd_postun_with_restart %{name}.service
|
|
|
|
%files
|
|
%doc README.md CHANGELOG.md README-packager.md
|
|
%license LICENSE REDISTRIBUTED.md
|
|
%{_sbindir}/%{name}
|
|
%{_sbindir}/%{name}-claim.sh
|
|
%{_sbindir}/%{name}cli
|
|
%{_libexecdir}/%{name}/*
|
|
%{_unitdir}/%{name}.service
|
|
%{_tmpfilesdir}/%{name}.conf
|
|
%caps(cap_dac_read_search,cap_sys_ptrace=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/apps.plugin
|
|
%caps(cap_setuid=ep) %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cgroup-network
|
|
%attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cgroup-network-helper.sh
|
|
%caps(cap_setuid=ep) %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/perf.plugin
|
|
%caps(cap_setuid=ep) %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/slabinfo.plugin
|
|
%if %{with cups}
|
|
%attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cups.plugin
|
|
%endif
|
|
%exclude %{_libexecdir}/%{name}/edit-config
|
|
%exclude %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
|
|
%attr(0755, netdata, netdata) %{_localstatedir}/lib/%{name}
|
|
%attr(0755, netdata, netdata) %dir %{_localstatedir}/cache/%{name}
|
|
%attr(0755, netdata, netdata) %dir %{_localstatedir}/log/%{name}
|
|
%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
|
|
|
|
%files conf
|
|
%doc README.md
|
|
%license LICENSE REDISTRIBUTED.md
|
|
%dir %{_sysconfdir}/%{name}
|
|
%dir %{_sysconfdir}/%{name}/charts.d
|
|
%dir %{_sysconfdir}/%{name}/health.d
|
|
%dir %{_sysconfdir}/%{name}/python.d
|
|
%dir %{_sysconfdir}/%{name}/statsd.d
|
|
%dir %{_sysconfdir}/%{name}/conf.d
|
|
%dir %{_sysconfdir}/%{name}/conf.d/charts.d
|
|
%dir %{_sysconfdir}/%{name}/conf.d/health.d
|
|
%dir %{_sysconfdir}/%{name}/conf.d/python.d
|
|
%dir %{_sysconfdir}/%{name}/conf.d/statsd.d
|
|
%dir %{_sysconfdir}/%{name}/conf.d/ebpf.d
|
|
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
|
|
%config %{_sysconfdir}/%{name}/conf.d/*.conf
|
|
%config %{_sysconfdir}/%{name}/conf.d/charts.d/*.conf
|
|
%config %{_sysconfdir}/%{name}/conf.d/health.d/*.conf
|
|
%config %{_sysconfdir}/%{name}/conf.d/python.d/*.conf
|
|
%config %{_sysconfdir}/%{name}/conf.d/statsd.d/*.conf
|
|
%config %{_sysconfdir}/%{name}/conf.d/ebpf.d/*.conf
|
|
%config %{_sysconfdir}/logrotate.d/netdata
|
|
%config %{_sysconfdir}/profile.d/netdata.sh
|
|
%dir %{_libexecdir}/%{name}
|
|
%{_libexecdir}/%{name}/edit-config
|
|
%{_sysconfdir}/netdata/.install-type
|
|
|
|
%files data
|
|
%doc README.md
|
|
%license LICENSE REDISTRIBUTED.md
|
|
%dir %{_datadir}/%{name}
|
|
%attr(-, root, netdata) %{_datadir}/%{name}/web
|
|
|
|
|
|
%files freeipmi
|
|
%doc README.md
|
|
%license LICENSE REDISTRIBUTED.md
|
|
%caps(cap_setuid=ep) %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
|
|
|
|
%changelog
|
|
* Mon Jan 30 2023 wangkai <wangkai385@h-partners.com> - 1.37.1-1
|
|
- Upgrade to version 1.37.1 for fix CVE-2023-22496,CVE-2023-22497
|
|
|
|
* Sat Jan 29 2022 caodongxia <caodongxia@huawei.com> - 1.16.0-3
|
|
- remove install requires glyphicons-halfings-fonts
|
|
|
|
* Wed Aug 04 2021 sunguoshuai <sunguoshuai@huawei.com> - 1.16.0-2
|
|
- Fix missing extern in some global variables
|
|
|
|
* Thu Jun 24 2021 baizhonggui <baizhonggui@huawei.com> - 1.16.0-1
|
|
- package init
|