# libuv-devel and Judy-devel are not available on el8 s390x %if 0%{?rhel} && 0%{?rhel} == 8 ExcludeArch: s390x %endif %bcond_without cups %bcond_without log2journal %if 0%{?rhel} %bcond_with netfilteracct %else %bcond_without netfilteracct %endif # Only on fedora %if 0%{?fedora} %ifarch x86_64 aarch64 %bcond_without xenstat %else %bcond_with xenstat %endif %else %bcond_with xenstat %endif %bcond_without ml # Fedora 45 has mongoc 2.x instead of 1.x, which netdata doesn't yet support %if 0%{?fedora} && 0%{fedora} >= 45 %bcond_with exporter_mongodb %else %bcond_without exporter_mongodb %endif %bcond_with ebpf %if 0%{?fedora} && 0%{?fedora} >= 41 %bcond_without plugin_go %else %bcond_with plugin_go %endif %if 0%{?fedora} && 0%{?fedora} >= 42 %bcond_without unified_bin_sbin %else %bcond_with unified_bin_sbin %endif # Workaround for Missing build-id on go.d.plugin %global _missing_build_ids_terminate_build 0 # We use some plugins which need suid grants %global _hardened_build 1 # Build release candidate %global upver 2.2.6 #global rcver rc0 %global netdata_conf_stock %{_prefix}/lib/%{name} Name: netdata Version: %{upver}%{?rcver:~%{rcver}} Release: 3%{?dist} Summary: Real-time performance monitoring # For a breakdown of the licensing, see license REDISTRIBUTED.md License: GPL-3.0-or-later URL: http://my-netdata.io # Use make-source.sh script to build tarball without closed source part Source0: %{name}-%{upver}%{?rcver:-%{rcver}}.tar.gz Source1: netdata.tmpfiles.conf Source3: netdata.conf Source4: netdata.profile Source5: README-packager.md # Only for fedora 40+ # Use create-go-vendor.sh script to build tarball with all go vendor parts Source20: go.d.plugin-vendor-%{upver}%{?rcver:-%{rcver}}.tar.gz # Use make-shebang-patch.sh script to build patch Patch0: netdata-fix-shebang-2.2.0.patch Patch1: netdata-remove-web-v2.patch Patch2: netdata-restore-python-sensors.patch %if 0%{?fedora} # Remove embedded font Patch10: netdata-remove-fonts-2.0.0.patch %endif BuildRequires: zlib-devel BuildRequires: git BuildRequires: cmake BuildRequires: gcc-c++ 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: openssl-devel BuildRequires: libpfm-devel BuildRequires: libyaml-devel BuildRequires: ninja-build %if %{with plugin_go} BuildRequires: golang >= 1.21 BuildRequires: go-rpm-macros %endif BuildRequires: systemd-devel # Prometheus BuildRequires: snappy-devel BuildRequires: protobuf-devel BuildRequires: protobuf-c-devel BuildRequires: findutils # Cloud client BuildRequires: json-c-devel BuildRequires: libcap-devel # For tests BuildRequires: libcmocka-devel # ebpf #BuildRequires: elfutils-libelf-devel # exporter mongodb %if %{with exporter_mongodb} BuildRequires: pkgconfig(libmongoc-1.0) %endif %if %{with xenstat} BuildRequires: xen-devel %endif %if %{with cups} BuildRequires: cups-devel >= 1.7 %endif %if %{with netfilteracct} BuildRequires: libnetfilter_acct-devel BuildRequires: libmnl-devel %endif # Only Fedora or el8+ %if 0%{?fedora} || 0%{?rhel} >= 8 BuildRequires: python3 %else BuildRequires: python2 %endif BuildRequires: flex BuildRequires: bison Requires: nodejs Requires: curl Requires: nc Requires: snappy Requires: protobuf-c Requires: protobuf %if 0%{?fedora} Requires: glyphicons-halflings-fonts %endif 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 License: GPL-3.0-or-later Requires: /usr/bin/systemctl %description data Data files for netdata %package conf BuildArch: noarch Summary: Configuration files for netdata License: GPL-3.0-or-later Requires: logrotate %description conf Configuration files for netdata %package freeipmi Summary: FreeIPMI plugin for netdata License: GPL-3.0-or-later Requires: %{name}%{?_isa} = %{version}-%{release} %description freeipmi freeipmi plugin for netdata %package go.d.plugin Summary: Go plugin for netdata License: GPL-3.0-or-later Requires: %{name}%{?_isa} = %{version}-%{release} %description go.d.plugin go plugin for netdata %prep %setup -qn %{name}-%{upver}%{?rcver:-%{rcver}} %patch -P0 -p1 %patch -P1 -p1 %patch -P2 -p1 %if 0%{?fedora} # Remove embedded font(added in requires) %patch -P10 -p1 rm -rf src/web/gui/v1/fonts/ %endif # Remove closed source parts if present if [ -d src/web/gui/v2 ] ; then rm -rf src/web/gui/v2 src/web/gui/index.html fi cp %{SOURCE5} . ### BEGIN go.d.plugin %if %{with plugin_go} pushd src/go tar -xf %{SOURCE20} popd %endif ### END go.d.plugin %if %{with unified_bin_sbin} sed -i -e '/set(BINDIR usr\/sbin)/s/sbin/bin/' CMakeLists.txt %endif # Create a sysusers.d config file cat >netdata.sysusers.conf <