0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-14 09:38:34 +00:00

Assorted cleanup of native packaging code. ()

* Assorted cleanup of DEB packaging code.

* Assorted cleanup of the RPM spec file.

* DEB package fixes.
This commit is contained in:
Austin S. Hemmelgarn 2024-02-06 09:29:57 -05:00 committed by GitHub
parent ae07ffe7b7
commit 9dec08180c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 14 additions and 126 deletions

View file

@ -4,7 +4,7 @@ set -e
case "$1" in
configure|reconfigure)
chown root:netdata /usr/libexec/netdata/plugins.d/ebpf.plugin
grep /usr/libexec/netdata /var/lib/dpkg/info/netdata-plugin-ebpf.list | xargs -n 30 chown root:netdata
chmod -f 4750 /usr/libexec/netdata/plugins.d/ebpf.plugin
;;
esac

View file

@ -4,7 +4,7 @@ set -e
case "$1" in
configure|reconfigure)
chown root:netdata /usr/libexec/netdata/plugins.d/logs-management.plugin
grep /usr/libexec/netdata /var/lib/dpkg/info/netdata-plugin-logs-management.list | xargs -n 30 chown root:netdata
chmod 0750 /usr/libexec/netdata/plugins.d/logs-management.plugin
if ! setcap "cap_dac_read_search=eip cap_syslog=eip" /usr/libexec/netdata/plugins.d/logs-management.plugin; then
chmod -f 4750 /usr/libexec/netdata/plugins.d/logs-management.plugin

View file

@ -1,16 +0,0 @@
# See Debian policy 10.9. apps.plugin has extra capabilities, so don't let
# normal users run it.
netdata: non-standard-executable-perm usr/lib/*/netdata/plugins.d/apps.plugin 0754 != 0755
# FontAwesome is at least in the fonts-font-awesome package, but this is
# not available in wheezy. glyphicons-halflings-regular isn't currently in
# a Debian package. Therefore don't complain about shipping them with netdata
# for the time being.
netdata: duplicate-font-file usr/share/netdata/fonts/*
netdata: font-in-non-font-package usr/share/netdata/fonts/*
# Files here are marked as conffiles so that local updates to the html files
# isn't clobbered on upgrade.
netdata: non-etc-file-marked-as-conffile var/lib/netdata/www/*

View file

@ -2,29 +2,12 @@
set -e
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/.well-known /usr/share/netdata/www/.well-known 1.18.1~ netdata -- "$@"
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/css /usr/share/netdata/www/css 1.18.1~ netdata -- "$@"
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/fonts /usr/share/netdata/www/fonts 1.18.1~ netdata -- "$@"
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/images /usr/share/netdata/www/images 1.18.1~ netdata -- "$@"
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/lib /usr/share/netdata/www/lib 1.18.1~ netdata -- "$@"
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/static /usr/share/netdata/www/static 1.18.1~ netdata -- "$@"
case "$1" in
configure|reconfigure)
if ! dpkg-statoverride --list /var/lib/netdata > /dev/null 2>&1; then
dpkg-statoverride --update --add netdata netdata 0755 /var/lib/netdata
fi
if ! dpkg-statoverride --list /var/lib/netdata/www > /dev/null 2>&1; then
dpkg-statoverride --update --add root netdata 0755 /var/lib/netdata/www
fi
if ! dpkg-statoverride --list /var/cache/netdata > /dev/null 2>&1; then
dpkg-statoverride --update --add netdata netdata 0755 /var/cache/netdata
fi
@ -37,17 +20,17 @@ case "$1" in
dpkg-statoverride --update --add netdata adm 02750 /var/log/netdata
fi
if ! dpkg-statoverride --list /usr/share/netdata/www > /dev/null 2>&1; then
dpkg-statoverride --update --add root netdata 0755 /usr/share/netdata/www
fi
dpkg-statoverride --force --update --add root netdata 0775 /var/lib/netdata/registry > /dev/null 2>&1
grep /usr/libexec/netdata /var/lib/dpkg/info/netdata.list | xargs -n 30 chown root:netdata
chmod 4750 /usr/libexec/netdata/plugins.d/ndsudo
chmod 4750 /usr/libexec/netdata/plugins.d/cgroup-network
chmod 4750 /usr/libexec/netdata/plugins.d/local-listeners
chmod 4750 /usr/libexec/netdata/plugins.d/network-viewer.plugin
# Workaround for other plugins not installed directly by this package
chmod -f 4750 /usr/libexec/netdata/plugins.d/ioping || true
for f in ndsudo cgroup-network local-listeners ioping network-viewer.plugin; do
chmod 4750 "/usr/libexec/netdata/plugins.d/${f}" || true
done
;;
esac

View file

@ -2,19 +2,6 @@
set -e
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/.well-known /usr/share/netdata/www/.well-known 1.18.1~ netdata -- "$@"
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/css /usr/share/netdata/www/css 1.18.1~ netdata -- "$@"
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/fonts /usr/share/netdata/www/fonts 1.18.1~ netdata -- "$@"
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/images /usr/share/netdata/www/images 1.18.1~ netdata -- "$@"
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/lib /usr/share/netdata/www/lib 1.18.1~ netdata -- "$@"
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/static /usr/share/netdata/www/static 1.18.1~ netdata -- "$@"
case "$1" in
remove) ;;
@ -27,6 +14,10 @@ case "$1" in
dpkg-statoverride --remove /var/lib/netdata/www
fi
if dpkg-statoverride --list | grep -qw /usr/share/netdata/www; then
dpkg-statoverride --remove /usr/share/netdata/www
fi
if dpkg-statoverride --list | grep -qw /var/lib/netdata/registry; then
dpkg-statoverride --remove /var/lib/netdata/registry
fi

View file

@ -2,19 +2,6 @@
set -e
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/.well-known /usr/share/netdata/www/.well-known 1.18.1~ netdata -- "$@"
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/css /usr/share/netdata/www/css 1.18.1~ netdata -- "$@"
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/fonts /usr/share/netdata/www/fonts 1.18.1~ netdata -- "$@"
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/images /usr/share/netdata/www/images 1.18.1~ netdata -- "$@"
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/lib /usr/share/netdata/www/lib 1.18.1~ netdata -- "$@"
dpkg-maintscript-helper dir_to_symlink \
/var/lib/netdata/www/static /usr/share/netdata/www/static 1.18.1~ netdata -- "$@"
case "$1" in
install)
if ! getent group netdata > /dev/null; then

View file

@ -223,15 +223,6 @@ override_dh_install:
#
cp -v packaging/installer/netdata-updater.sh $(TOP)/usr/libexec/netdata/netdata-updater.sh
# Move files that local user shouldn't be editing to /usr/share/netdata
#
mkdir -p "$(TOP)/usr/share/netdata/www"
for D in $$(find "$(TOP)/var/lib/netdata/www/" -maxdepth 1 -type d -printf '%f '); do \
echo Relocating $$D; \
mv "$(TOP)/var/lib/netdata/www/$$D" "$(TOP)/usr/share/netdata/www/$$D"; \
ln -s "/usr/share/netdata/www/$$D" "$(TOP)/var/lib/netdata/www/$$D"; \
done
# Handle eBPF code
#
if [ $(HAVE_EBPF) -eq 1 ]; then \
@ -271,7 +262,6 @@ override_dh_fixperms:
# apps.plugin should only be runnable by the netdata user. It will be
# given extra capabilities in the postinst script.
#
chmod 0750 $(TOP)-plugin-apps/usr/libexec/netdata/plugins.d/apps.plugin
# slabinfo package

View file

@ -10,15 +10,10 @@
AutoReqProv: yes
# This is temporary and should eventually be resolved. This bypasses
# the default rhel __os_install_p,ost which throws a python compile
# the default rhel __os_install_post which throws a python compile
# error.
%global __os_install_post %{nil}
# We dont want LTO as it has a minimal performance impact at runtime
# but a huge impact on build times (we want our CI to not take multiple
# hours to finish).
%global _lto_cflags %nil
# Use our custom CMake version from our package builders if we cant find cmake.
%if 0%{?centos_ver} == 7
%global __cmake /cmake/bin/cmake
@ -445,48 +440,6 @@ install -m 755 -p packaging/installer/%{name}-updater.sh "${RPM_BUILD_ROOT}%{_li
install -m 755 -d "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d"
install -m 644 -p "%{__cmake_builddir}/system/logrotate/%{name}" "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}"
# ###########################################################
# Install freeipmi
#%if 0%{?_have_freeipmi}
#install -m 4750 -p freeipmi.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/freeipmi.plugin"
#%endif
# ###########################################################
# Install apps.plugin
#install -m 4750 -p apps.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/apps.plugin"
# ###########################################################
# Install debugfs.plugin
#install -m 0750 -p debugfs.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/debugfs.plugin"
# ###########################################################
# Install systemd-journal.plugin
#install -m 4750 -p systemd-journal.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/systemd-journal.plugin"
# ###########################################################
# Install logs-management.plugin
#install -m 4750 -p logs-management.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/logs-management.plugin"
# ###########################################################
# Install perf.plugin
#install -m 4750 -p perf.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/perf.plugin"
# ###########################################################
# Install ebpf.plugin
#%if 0%{?_have_ebpf}
#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"
#%endif
# ###########################################################
# Install slabinfo.plugin
#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}"