diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-02-07 11:45:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-02-07 11:45:55 +0000 |
commit | a8220ab2d293bb7f4b014b79d16b2fb05090fa93 (patch) | |
tree | 77f0a30f016c0925cf7ee9292e644bba183c2774 /netdata.spec.in | |
parent | Adding upstream version 1.19.0. (diff) | |
download | netdata-a8220ab2d293bb7f4b014b79d16b2fb05090fa93.tar.xz netdata-a8220ab2d293bb7f4b014b79d16b2fb05090fa93.zip |
Adding upstream version 1.29.0.upstream/1.29.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'netdata.spec.in')
-rw-r--r-- | netdata.spec.in | 193 |
1 files changed, 118 insertions, 75 deletions
diff --git a/netdata.spec.in b/netdata.spec.in index 405e8f50e..ea2519603 100644 --- a/netdata.spec.in +++ b/netdata.spec.in @@ -5,6 +5,17 @@ #TODO: Temporary fix for the build-id error during go.d plugin set up %global _missing_build_ids_terminate_build 0 +# XXX: We are using automatic `Requires:` generation for libraries +# whenever possible, DO NOT LIST LIBRARY DEPENDENCIES UNLESS THE RESULTANT +# PACKAGE IS BROKEN WITHOUT THEM. +AutoReqProv: yes + +%if "@HAVE_LIBBPF@" == "1" +%global have_bpf 1 +%else +%global have_bpf 0 +%endif + # This is temporary and should eventually be resolved. This bypasses # the default rhel __os_install_post which throws a python compile # error. @@ -17,6 +28,9 @@ %define _libexecdir /usr/libexec %define _libdir /usr/lib +# Redefine centos_ver to standardize on a single macro +%{?rhel:%global centos_ver %rhel} + # # Conditional build: %bcond_without systemd # systemd @@ -90,6 +104,10 @@ Group: Applications/System Source0: https://github.com/netdata/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz URL: http://my-netdata.io +# Remove conflicting EPEL packages +Obsoletes: %{name}-conf +Obsoletes: %{name}-data + # ##################################################################### # Core build/install/runtime dependencies # ##################################################################### @@ -99,13 +117,14 @@ URL: http://my-netdata.io BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: make -BuildRequires: git +BuildRequires: git-core BuildRequires: autoconf %if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1140 BuildRequires: autoconf-archive BuildRequires: autogen %endif BuildRequires: automake +BuildRequires: cmake BuildRequires: pkgconfig BuildRequires: curl BuildRequires: findutils @@ -113,16 +132,22 @@ BuildRequires: zlib-devel BuildRequires: libuuid-devel BuildRequires: libuv-devel >= 1 BuildRequires: openssl-devel +%if 0%{?centos_ver} >= 8 || 0%{?fedora} +BuildRequires: libwebsockets-devel >= 3.2 +%endif %if 0%{?suse_version} BuildRequires: judy-devel BuildRequires: liblz4-devel -BuildRequires: netcat-openbsd -BuildRequires: json-glib-devel +BuildRequires: libjson-c-devel %else +%if 0%{?fedora} BuildRequires: Judy-devel BuildRequires: lz4-devel -BuildRequires: nc BuildRequires: json-c-devel +%else +BuildRequires: lz4-devel +BuildRequires: json-c-devel +%endif %endif # Core build requirements for service install @@ -130,32 +155,19 @@ BuildRequires: json-c-devel # Runtime dependencies # -Requires: python -Requires: zlib -%if 0%{?suse_version} -# for libuv, Requires version >= 1 -Requires: libuv1 -Requires: libJudy1 -Requires: json-glib -Requires: libuuid1 +%if 0%{?centos_ver} == 7 || 0%{?centos_ver} == 6 +Requires: python +%else +%if 0%{?centos_ver} == 8 +Requires: python38 %else -# for libuv, Requires version >= 1 -Requires: libuv >= 1 -Requires: Judy -Requires: json-c -Requires: libuuid +Requires: python3 +%endif %endif -Requires: openssl -Requires: lz4 # Core requirements for the install to succeed Requires(pre): /usr/sbin/groupadd Requires(pre): /usr/sbin/useradd -%if 0%{?suse_version} >= 1140 -Requires(post): libcap1 -%else -Requires(post): libcap -%endif %{netdata_initd_requires} @@ -171,24 +183,10 @@ BuildRequires: libmnl-devel BuildRequires: libnetfilter_acct-devel %endif -%if 0%{?suse_version} -Requires: libmnl0 -%else -Requires: libmnl -%endif - -%if 0%{?fedora} -Requires: libnetfilter_acct -%else -%if 0%{?suse_version} >= 1140 -Requires: libnetfilter_acct1 -%endif -%endif # end nfacct plugin dependencies # freeipmi plugin dependencies BuildRequires: freeipmi-devel -Requires: freeipmi # end - freeipmi plugin dependencies # CUPS plugin dependencies @@ -205,16 +203,6 @@ BuildRequires: libprotobuf-c-devel %else BuildRequires: protobuf-c-devel %endif - -%if 0%{?suse_version} -Requires: libsnappy1 -Requires: protobuf-c -Requires: libprotobuf15 -%else -Requires: snappy -Requires: protobuf-c -Requires: protobuf -%endif # end - prometheus remote write dependencies # ##################################################################### @@ -232,19 +220,36 @@ happened, on your systems and applications. %prep %setup -q -n %{name}-%{version} +export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-mosquitto.sh ${RPM_BUILD_DIR}/%{name}-%{version} +%if 0%{?centos_ver} >= 8 || 0%{?fedora} +export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-lws.sh ${RPM_BUILD_DIR}/%{name}-%{version} +%endif +# Only bundle libJudy if this isn't Fedora or SUSE +%if 0%{!?fedora:1} && 0%{!?suse_version:1} +export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-judy.sh ${RPM_BUILD_DIR}/%{name}-%{version} +%endif +%if 0%{?have_bpf} +export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-libbpf.sh ${RPM_BUILD_DIR}/%{name}-%{version} +%endif %build # Conf step autoreconf -ivf %configure \ + %if 0%{!?fedora:1} && 0%{!?suse_version:1} + --with-libJudy=externaldeps/libJudy \ + %endif + %if 0%{?centos_ver} >= 8 || 0%{?fedora} + --with-bundled-lws=externaldeps/libwebsockets \ + %endif --prefix="%{_prefix}" \ --sysconfdir="%{_sysconfdir}" \ --localstatedir="%{_localstatedir}" \ --libexecdir="%{_libexecdir}" \ - --libdir="%{_libdir}" \ + --libdir="%{_libdir}" \ --with-zlib \ --with-math \ - --with-user=netdata \ + --with-user=netdata # Build step %{__make} %{?_smp_mflags} @@ -256,8 +261,6 @@ autoreconf -ivf rm -rf "${RPM_BUILD_ROOT}" %{__make} %{?_smp_mflags} DESTDIR="${RPM_BUILD_ROOT}" install -find "${RPM_BUILD_ROOT}%{_localstatedir}" -name .keep -delete -print - install -m 644 -p system/netdata.conf "${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}" # ########################################################### @@ -278,6 +281,12 @@ install -m 4750 -p apps.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins. install -m 4750 -p perf.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/perf.plugin" # ########################################################### +# Install ebpf.plugin +%if 0%{?have_bpf} +install -m 4750 -p ebpf.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/ebpf.plugin" +%endif + +# ########################################################### # Install cups.plugin %if 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7 install -m 0750 -p cups.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/cups.plugin" @@ -288,6 +297,11 @@ install -m 0750 -p cups.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins. install -m 4750 -p slabinfo.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/slabinfo.plugin" # ########################################################### +# Install cache and log directories +install -m 755 -d "${RPM_BUILD_ROOT}%{_localstatedir}/cache/%{name}" +install -m 755 -d "${RPM_BUILD_ROOT}%{_localstatedir}/log/%{name}" + +# ########################################################### # Install registry directory install -m 755 -d "${RPM_BUILD_ROOT}%{_localstatedir}/lib/%{name}/registry" @@ -397,6 +411,11 @@ install_go() { install_go install -m 0640 -p go.d.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/go.d.plugin" +${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-dashboard.sh ${RPM_BUILD_DIR}/%{name}-%{version} ${RPM_BUILD_ROOT}%{_datadir}/%{name}/web +%if 0%{?have_bpf} +${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-ebpf.sh ${RPM_BUILD_DIR}/%{name}-%{version} ${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d +%endif + %pre # User/Group creations, as needed @@ -422,53 +441,51 @@ rm -rf "${RPM_BUILD_ROOT}" %doc README.md %{_sysconfdir}/%{name} %config(noreplace) %{_sysconfdir}/%{name}/netdata.conf - -%defattr(-,root,netdata) -%dir %{_libdir}/%{name} - %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} - +%dir %{_libdir}/%{name} +%dir %{_datadir}/%{name} %{_libdir}/%{name} - -%defattr(0755,netdata,netdata,0755) +%{_libdir}/%{name}/conf.d/ %{_libexecdir}/%{name} %{_sbindir}/%{name} +%{_sbindir}/netdatacli +%{_sbindir}/netdata-claim.sh + +%if %{with systemd} +%{_unitdir}/netdata.service +%else +%{_sysconfdir}/rc.d/init.d/netdata +%endif -%defattr(4750,root,netdata,0750) +%defattr(0750,root,netdata,0750) %dir %{_libexecdir}/%{name}/python.d %dir %{_libexecdir}/%{name}/charts.d %dir %{_libexecdir}/%{name}/plugins.d %dir %{_libexecdir}/%{name}/node.d -%caps(cap_dac_read_search,cap_sys_ptrace=ep) %attr(0550,root,netdata) %{_libexecdir}/%{name}/plugins.d/apps.plugin +%{_libexecdir}/%{name}/python.d +%{_libexecdir}/%{name}/plugins.d +%{_libexecdir}/%{name}/node.d + +%caps(cap_dac_read_search,cap_sys_ptrace=ep) %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/apps.plugin %if %{with netns} # cgroup-network detects the network interfaces of CGROUPs # it must be able to use setns() and run cgroup-network-helper.sh as root # the helper script reads /proc/PID/fdinfo/* files, runs virsh, etc. -%caps(cap_setuid=ep) %attr(4550,root,netdata) %{_libexecdir}/%{name}/plugins.d/cgroup-network -%attr(0550,root,root) %{_libexecdir}/%{name}/plugins.d/cgroup-network-helper.sh +%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 %endif # perf plugin %caps(cap_setuid=ep) %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/perf.plugin # perf plugin -%caps(cap_setuid=ep) %attr(4550,root,netdata) %{_libexecdir}/%{name}/plugins.d/slabinfo.plugin +%caps(cap_setuid=ep) %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/slabinfo.plugin # freeipmi files -%caps(cap_setuid=ep) %attr(4550,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin -%dir %{_datadir}/%{name} - -%defattr(0750,netdata,netdata,0755) -%{_libdir}/%{name}/conf.d/ - -%if %{with systemd} -%{_unitdir}/netdata.service -%else -%{_sysconfdir}/rc.d/init.d/netdata -%endif +%caps(cap_setuid=ep) %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin # Enforce 0644 for files and 0755 for directories # for the netdata web directory @@ -483,6 +500,9 @@ rm -rf "${RPM_BUILD_ROOT}" %attr(0770,netdata,netdata) %dir %{_localstatedir}/lib/%{name} %attr(0770,netdata,netdata) %dir %{_localstatedir}/lib/%{name}/registry +# Free IPMI belongs to a different sub-package +%exclude %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin + # CUPS belongs to a different sub package %if 0%{?centos_ver} != 6 && 0%{?centos_ver} != 7 %exclude %{_libexecdir}/%{name}/plugins.d/cups.plugin @@ -501,7 +521,30 @@ Use this plugin to enable metrics collection from cupsd, the daemon running when %attr(0750,root,netdata) %{_libexecdir}/%{name}/plugins.d/cups.plugin %endif +%package plugin-freeipmi +Summary: FreeIPMI - The Intelligent Platform Management System +Group: Applications/System +Requires: freeipmi +Requires: netdata = %{version} + +%description plugin-freeipmi + The IPMI specification defines a set of interfaces for platform management. +It is implemented by a number vendors for system management. The features of IPMI that most users will be interested in +are sensor monitoring, system event monitoring, power control, and serial-over-LAN (SOL). + +%files plugin-freeipmi +%attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin + %changelog +* Wed Sep 16 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-14 +- Convert to using 'AutoReq: yes' for library dependencies. +* Thu Feb 13 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-13 +- Add handling for custom libmosquitto fork +* Wed Jan 01 2020 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-12 +- Add explicit installation of log and cache directories +- Clean up build dependencies. +* Thu Dec 19 2019 Austin Hemmelgarn <austin@netdata.cloud> 0.0.0-11 +- Fix remaining ownership and permissions issues. * Mon Nov 04 2019 Konstantinos Natsakis <konstantinos.natsakis@gmail.com> 0.0.0-10 - Fix /etc/netdata permissions * Mon Sep 23 2019 Konstantinos Natsakis <konstantinos.natsakis@gmail.com> 0.0.0-9 |