@cryptotaxi247 / netdata-1 / commits / c4ec0791b

Package ebpf plugin only if enabled in config.h (#9752)

Adrien Mahieux committed Aug 24, 2020 at 14:19 UTC c4ec0791bf2944cd32093c51b622c9ff583ce82f
1 file changed +12
netdata.spec.in
+12
@@ -5,6 +5,12 @@
5 #TODO: Temporary fix for the build-id error during go.d plugin set up
6 %global _missing_build_ids_terminate_build 0
7
8 +%if "@HAVE_LIBBPF@" == "1"
9 +%global have_bpf 1
10 +%else
11 +%global have_bpf 0
12 +%endif
13 +
14 # This is temporary and should eventually be resolved. This bypasses
15 # the default rhel __os_install_post which throws a python compile
16 # error.
@@ -239,7 +245,9 @@ happened, on your systems and applications.
245 %setup -q -n %{name}-%{version}
246 export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-mosquitto.sh ${RPM_BUILD_DIR}/%{name}-%{version}
247 export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-lws.sh ${RPM_BUILD_DIR}/%{name}-%{version}
248 +%if 0%{?have_bpf}
249 export CFLAGS="${CFLAGS} -fPIC" && ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-libbpf.sh ${RPM_BUILD_DIR}/%{name}-%{version}
250 +%endif
251
252 %build
253 # Conf step
@@ -285,7 +293,9 @@ install -m 4750 -p perf.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.
293
294 # ###########################################################
295 # Install ebpf.plugin
296 +%if 0%{?have_bpf}
297 install -m 4750 -p ebpf.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/ebpf.plugin"
298 +%endif
299
300 # ###########################################################
301 # Install cups.plugin
@@ -413,7 +423,9 @@ install_go
423 install -m 0640 -p go.d.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/go.d.plugin"
424
425 ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-dashboard.sh ${RPM_BUILD_DIR}/%{name}-%{version} ${RPM_BUILD_ROOT}%{_datadir}/%{name}/web
426 +%if 0%{?have_bpf}
427 ${RPM_BUILD_DIR}/%{name}-%{version}/packaging/bundle-ebpf.sh ${RPM_BUILD_DIR}/%{name}-%{version} ${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d
428 +%endif
429
430 %pre
431