summaryrefslogtreecommitdiffstats
path: root/netdata.spec.in
diff options
context:
space:
mode:
authorPaul Emm. Katsoulakis <34388743+paulkatsoulakis@users.noreply.github.com>2019-07-03 09:18:17 +0200
committerGitHub <noreply@github.com>2019-07-03 09:18:17 +0200
commit2c3b4cdd75802625eb5668d0b33964557c803764 (patch)
treeba5dbfd854a21a3bdf97fd3587ff8bf035a52dbe /netdata.spec.in
parent45bc7aeb6c6d5edbe03f98fe3d8cf2691cf6e7d7 (diff)
netdata/packaging: Netdata binary packages generation - spec file refinement, support for nightlies (RPM) (#6369)
Detailed list of changes: * netdata/packaging: First round of netdata.spec refactoring - package dependencies - Remove freeipmi/nfacct plugin flags. We auto-detect all plugins by decision - Start refactor of package dependencies - Add missing dependencies, with respect to distro peculiarities - Adjust existing dependencies, so that distro-specific package names is applied * netdata/packaging: add packaging trigger mechanism on binary-packages-specfile-cleanup to help testing * netdata/packaging: WIP - Allow building nightly versions for RPM (Still investigating the right version scheme) * netdata/packaging: Attempt to fix syntax errors - wow travis, mercy * netdata/packaging: tiny nits and fixes 1) there was a syntax error in version definition 2) bring default deploy repo name at the top, then overwrite when latest is published 3) Leave a comment * netdata/packaging: Move these core package requirements to the right section * netdata/packaging: libuv requires >= 1, missed to add that on devel libs * netdata/packaging: some comments, also when you put logrotate in our conf directory, link it to actual log rotate * netdata/packaging: Adjust configure options on spec file (align with netdata-installer.sh) * netdata/packaging: In order to properly support packaging both latest and stable releases, you need to star that extraction part, folder name contains the version with the hash that we cant tell * netdata/packaging: until we fix versioning, bring the original unprocessed spec file and pass the version we like in * netdata/packaging: fix version string in the spec file * netdata/packaging: Replace source path, we need to work with whatever we downloaded (to be refined) * netdata/packaging: [ci skip] you mixed the paths, reverse them * netdata/packaging: [ci skip] attempt to fix source path when needed * netdata/packaging: fixes and nits 1) generalize the spec file refinement method 2) Do both replacement that way 3) Adjust file names and paths * netdata/packaging: Replace Source0 explicitly and also make sure you remove extra new lines that may confuse the replacement later * netdata/packaging: [ci skip] move env outside, add some more log * netdata/packaging: [ci skip] adjust logic of replacing tag lines in spec file * netdata/packaging: [ci skip] Alas, fetch the archive, rename the structure to the new version, repack and proceed * netdata/packaging: [ci skip] Extract to specific path * netdata/packaging: [ci skip] replace problematic tar call with the respective pythonized one * netdata/packaging: [ci skip] Add new friendly octal format for chmod * netdata/packaging: [ci skip] more checks * netdata/packaging: [ci skip] dont chmod, chown the whole folder after extraction * netdata/packaging: nit * netdata/packaging: [ci skip] attempt to fix permissions differently * netdata/packaging: [ci skip] Another hack, attempt to fix permissions on the host directly * netdata/packaging: [ci skip] fine, do the move also on the host, pointless to run all through the container * netdata/packaging: [ci skip] Do the move through the container. Also, move a more specific folder * netdata/packaging: [ci skip] move as w00t * netdata/packaging: [ci skip] fix * netdata/packaging: sync permissions handling, round two * netdata/packaging: scratch those hacks, we should do latest differently * netdata/packaging: [ci skip] Set up rpm version string depending on whether we are on latest or not * netdata/packaging: [ci skip] Branch the code here, latest build up should be on the commit rather the tar files * netdata/packaging: Attempt to handle latest version build up * netdata/packaging: [ci skip] Dont continue processing if the file was not generated. Also do the tagging before autoreconf * netdata/packaging: [ci skip] fixes and nits * netdata/packaging: [ci skip] When doing annotated tags, you need to provide a message otherwise an editor pops up and will block the build * netdata/packaging: on the latest code case go all the way host level operations * netdata/packaging: [ci skip] Do not modify version, no longer need it because we properly generated the package with the right version * netdata/packaging: [ci skip] fix sensors line, you missed the Recommends keyword * netdata/packaging: Some code style (remove tabification from some tags) and also remove Recommends, we start with required packages for build and runtime and then we document further needs * netdata/packaging: [ci skip] Make sure you get epel in there, its needed * netdata/packaging: [ci skip] Fix bogus date * netdata/packaging: [ci skip] add these packages to include functionality * netdata/packaging: [ci skip] more fine grained dependency handling * netdata/packaging: [ci skip] Dependency hell - do not depend on libnetacctfilter if on el/7 * netdata/packaging: [ci skip] Be serious, that is not what you do when building the package silly * netdata/packaging: [ci skip] define directory attributes too * netdata/packaging: [ci skip] mystery unfold - comment out as we need to figure out how to handle missing directories that our installer creates if necessary * netdata/packaging: [ci skip] Make sure you properly set deployment repo based on commit message * netdata/packaging: [ci skip] Install these packages for specific versions, remove optimisations for now * netdata/packaging: [ci skip] Make package yanking flexible, so that we can manage both netdata and netdata-edge cleanup properly * netdata/packaging: [ci skip] Actually, set user at travis layer and let the script consume it only. We need to be sure the same user is used on yanking and the deployment process * netdata/packaging: [ci skip] wow pkatsoul * netdata/packaging: Dont forget to install some of the enabled plugins * netdata/packaging: nfacct.plugin not really working on rhel, disable temporarily * netdata/packaging: include installed directories to package * netdata/packaging: [ci skip] nits * netdata/packaging: fixes * netdata/packaging: [ci skip] dont add ghost files * netdata/packaging: [ci skip] Dont do that, make install already places the files in the right location. Also, seems that libexec is not really getting overriden there * netdata/packaging: [ci skip] Extreme - override _libexecdir macro * Revert "netdata/packaging: [ci skip] Dont do that, make install already places the files in the right location. Also, seems that libexec is not really getting overriden there" This reverts commit 320102c96284e4622266f6f089d6ce87319976f3. That wasnt really the problem here * netdata/packaging: [ci skip] Include contents of dir here * netdata/packaging: fixes * netdata/packaging: [ci skip] Fixes and additions - Tighter permissions for some files - Introduce go.d plugin install (likely broken like this, dont recall if bash style code is fine here) - Raise the path overrides to the spec level, otherwise we build with the overrides and package with the defaults * netdata/packaging: [ci skip] Missed an invalid variable. These files are under our current path, no need for complexity * netdata/packaging: [ci skip] bring sha method onboard * netdata/packaging: [ci skip] Wrong path provided, should be under build root * netdata/packaging: [ci skip] Add registry directory * netdata/packaging: [ci skip] add missing config directory definitions * netdata/packaging: [ci skip] Fix missing dirs * netdata/packaging:[ci fix] hos * netdata/packaging: [ci skip] Fixes and additions - Change versioning to v1.15.0.114 from v1.15.0114 - Add CUPS, Xenstat, json-c * netdata/packaging: [ci skip] fix package dependencies on the builder setup, otherwise spec will fail * netdata/packaging: [ci skip] limit xenstat to suse and fedora for now * netdata/packaging: [ci skip] separate fedora and suse cases, unfortunately suse has different package names.... * netdata/packaging: [ci skip] yajl is not the same package everywhere, of course * netdata/packagin: [ci skip] skip xenstat for now * netdata/packaging: [ci skip] remove the vvvvvvvvv * netdata/packaging: [ci skip] one more fix attempt * netdata/packaging: [ci skip] Spec file extraction is different when building from stable. We *must* fetch it from the tarball rather than the local one * netdata/packaging: [ci skip] spec_file defined on all cases, latest or stable. Also move latest spec file copy after make dist operation, that is where is suppose to be * netdata/packaging: [ci skip] Tag source with the local version, as we build upon the very latest * netdata/packaging: oopsie -- remove json-c from that place, it was forgotten * netdata/packaging: fix packaging, even though devel is consistent between fedora and suse, the binary one is not .... (also fix default perms to be root:netdata rather root:root) * netdata/packaging: Suse love - again, libuuid-devel same, but libuuid is named libuuid1 on suse...... * netdata/packaging: [ci skip] libcap same.... * netdata/packaging: [ci skip] use the noreplace directive for the configuration files * netdata/packaging: [ci skip] Bring back master as the triggering repository * netdata/packaging: [ci skip] attempt to enable/disable service where necessary. Default preset action requires further setup, so we override that * Revert "netdata/packaging: [ci skip] Bring back master as the triggering repository" This reverts commit 9b25a622dc5f12b1539f6863bab52d7bb225fd8d. ** Reverting as we need to test further the service enable action ** * netdata/packaging: [ci skip] revert this change - not the right way, we have empty files * netdata/packaging: [ci skip] Add daemon-reload option, to make sure systemd learns about the newly installed service * netdata/packaging: [ci skip] Attempt to silence codacy by factoring out the few small methods for common usage, then kill directories to reduce complexity adn thats it * netdata/packaging: [ci skip] Just making sure codacy reprocess everything * netdata/packaging: [ci skip] missed one adjustment * netdata/packaging: python style - print shouldnt have space before open parenthesis. Also, add restart on all cases on the spec file * netdata/packaging: [ci skip] fix syntax * netdata/packaging: [ci skip] syntax fixes 2 * netdata/packaging: [ci skip] another miss * netdata/packaging: [ci skip] You need to explicitly trigger a restart, apparently * netdata/packaging: [ci skip] override packaging user definition temporarily, to get things going on testing
Diffstat (limited to 'netdata.spec.in')
-rw-r--r--netdata.spec.in365
1 files changed, 296 insertions, 69 deletions
diff --git a/netdata.spec.in b/netdata.spec.in
index e201f4a193..25b5f9a46b 100644
--- a/netdata.spec.in
+++ b/netdata.spec.in
@@ -6,11 +6,15 @@
# error.
%global __os_install_post %{nil}
+# Mitigate the cross-distro mayhem by strictly defining the libexec destination
+%define _prefix /usr
+%define _sysconfdir /etc
+%define _localstatedir /var
+%define _libexecdir /usr/libexec
+
#
# Conditional build:
%bcond_without systemd # systemd
-%bcond_with nfacct # build with nfacct plugin
-%bcond_with freeipmi # build with freeipmi plugin
%bcond_with netns # build with netns support (cgroup-network)
%if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1140
@@ -27,8 +31,12 @@ BuildRequires: systemd-rpm-macros \
%global netdata_initd_requires \
%{?systemd_requires} \
%{nil}
-%global netdata_init_post %service_add_post netdata.service
-%global netdata_init_preun %service_del_preun netdata.service
+%global netdata_init_post %service_add_post netdata.service \
+/sbin/service netdata restart > /dev/null 2>&1 \
+%{nil}
+%global netdata_init_preun %service_del_preun netdata.service \
+/sbin/service netdata stop > /dev/null 2>&1 \
+%{nil}
%global netdata_init_postun %service_del_postun netdata.service
%else
%global netdata_initd_buildrequires \
@@ -38,7 +46,11 @@ Requires(preun): systemd-units \
Requires(postun): systemd-units \
Requires(post): systemd-units \
%{nil}
-%global netdata_init_post %systemd_post netdata.service
+%global netdata_init_post %systemd_post netdata.service \
+/usr/bin/systemctl enable netdata.service \
+/usr/bin/systemctl daemon-reload \
+/usr/bin/systemctl restart netdata.service \
+%{nil}
%global netdata_init_preun %systemd_preun netdata.service
%global netdata_init_postun %systemd_postun_with_restart netdata.service
%endif
@@ -49,6 +61,7 @@ Requires(post): chkconfig \
%{nil}
%global netdata_init_post \
/sbin/chkconfig --add netdata \
+/sbin/service netdata restart > /dev/null 2>&1 \
%{nil}
%global netdata_init_preun %{nil} \
if [ $1 = 0 ]; then \
@@ -63,23 +76,7 @@ fi \
%{nil}
%endif
-%if 0%{?_fedora}
-%global netdata_recommends \
-Recommends: curl \
-Recommends: iproute-tc \
-Recommends: lm_sensors \
-Recommends: nmap-ncat \
-Recommends: nodejs \
-Recommends: python \
-Recommends: PyYAML \
-Recommends: python2-PyMySQL \
-Recommends: python2-psycopg2 \
-%{nil}
-%else
-%global netdata_recommends %{nil}
-%endif
-
-Summary: Real-time performance monitoring, done right
+Summary: Real-time performance monitoring, done right!
Name: netdata
Version: @PACKAGE_VERSION@
Release: 1%{?dist}
@@ -87,43 +84,122 @@ License: GPLv3+
Group: Applications/System
Source0: https://github.com/netdata/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz
URL: http://my-netdata.io
-BuildRequires: pkgconfig
-BuildRequires: xz
-BuildRequires: zlib-devel
-BuildRequires: libuuid-devel
-BuildRequires: autoconf
-BuildRequires: automake
-Requires: zlib
-Requires: libuuid
-
-# Packages can be found in the EPEL repo
-%if %{with nfacct}
-BuildRequires: libmnl-devel
-BuildRequires: libnetfilter_acct-devel
-Requires: libmnl
-Requires: libnetfilter_acct
+
+# #####################################################################
+# Core build/install/runtime dependencies
+# #####################################################################
+
+# Build dependencies
+#
+BuildRequires: gcc
+BuildRequires: make
+BuildRequires: git
+BuildRequires: autoconf
+%if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1140
+BuildRequires: autoconf-archive
+BuildRequires: autogen
+%endif
+BuildRequires: automake
+BuildRequires: pkgconfig
+BuildRequires: curl
+BuildRequires: findutils
+BuildRequires: zlib-devel
+BuildRequires: libuuid-devel
+BuildRequires: libuv-devel >= 1
+BuildRequires: openssl-devel
+%if 0%{?suse_version}
+BuildRequires: judy-devel
+BuildRequires: liblz4-devel
+BuildRequires: netcat-openbsd
+BuildRequires: json-glib-devel
+%else
+BuildRequires: Judy-devel
+BuildRequires: lz4-devel
+BuildRequires: nc
+BuildRequires: json-c-devel
%endif
-%if %{with freeipmi}
-BuildRequires: freeipmi-devel
-Requires: freeipmi
+# Core build requirements for service install
+%{netdata_initd_buildrequires}
+
+# Runtime dependencies
+#
+Requires: python
+Requires: zlib
+%if 0%{?suse_version}
+# for libuv, Requires version >= 1
+Requires: libuv1
+Requires: libJudy1
+Requires: json-glib
+Requires: libuuid1
+%else
+# for libuv, Requires version >= 1
+Requires: libuv >= 1
+Requires: Judy
+Requires: json-c
+Requires: libuuid
%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_buildrequires}
-%{netdata_recommends}
%{netdata_initd_requires}
+# #####################################################################
+# Functionality-dependent package dependencies
+# #####################################################################
+# Note: Some or all of the Packages may be found in the EPEL repo,
+# rather than the standard ones
+
+# nfacct plugin dependencies
+BuildRequires: libmnl-devel
+%if 0%{?fedora} || 0%{?suse_version} >= 1140
+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
+BuildRequires: cups-devel
+Requires: cups
+# end - cups plugin dependencies
+
+# #####################################################################
+# End of dependency management configuration
+# #####################################################################
+
%description
-netdata is the fastest way to visualize metrics. It is a resource
+ netdata is the fastest way to visualize metrics. It is a resource
efficient, highly optimized system for collecting and visualizing any
type of realtime timeseries 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,
+ 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.
@@ -131,25 +207,57 @@ happened, on your systems and applications.
%setup -q -n %{name}-%{version}
%build
-autoreconf -i
+# Conf step
+autoreconf -ivf
%configure \
+ --prefix="%{_prefix}" \
+ --sysconfdir="%{_sysconfdir}" \
+ --localstatedir="%{_localstatedir}" \
+ --libexecdir="%{_libexecdir}" \
--with-zlib \
--with-math \
- %{?with_nfacct:--enable-plugin-nfacct} \
- %{?with_freeipmi:--enable-plugin-freeipmi} \
- --with-user=netdata
+ --with-user=netdata \
+
+# Build step
%{__make} %{?_smp_mflags}
%install
+
+# ###########################################################
+# Clear the directory, if already exists and install
rm -rf "${RPM_BUILD_ROOT}"
%{__make} %{?_smp_mflags} DESTDIR="${RPM_BUILD_ROOT}" install
find "${RPM_BUILD_ROOT}" -name .keep -delete
install -m 644 -p system/netdata.conf "${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}"
+
+# ###########################################################
+# logrotate settings
install -m 755 -d "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d"
install -m 644 -p system/netdata.logrotate "${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/%{name}"
+# ###########################################################
+# Install freeipmi
+install -m 4750 -p freeipmi.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/freeipmi.plugin"
+
+# ###########################################################
+# Install apps.plugin
+install -m 4750 -p apps.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/apps.plugin"
+
+# ###########################################################
+# Install perf.plugin
+install -m 4750 -p perf.plugin "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/perf.plugin"
+
+# ###########################################################
+# Install registry directory
+install -m 755 -d "${RPM_BUILD_ROOT}%{_localstatedir}/lib/%{name}/registry"
+install -m 755 -d "${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/custom-plugins.d"
+install -m 755 -d "${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/go.d"
+install -m 755 -d "${RPM_BUILD_ROOT}%{_sysconfdir}/%{name}/ssl"
+
+# ###########################################################
+# Install netdata service
%if %{with systemd}
install -m 755 -d "${RPM_BUILD_ROOT}%{_unitdir}"
install -m 644 -p system/netdata.service "${RPM_BUILD_ROOT}%{_unitdir}/netdata.service"
@@ -160,7 +268,100 @@ install -m 755 system/netdata-init-d \
"${RPM_BUILD_ROOT}/etc/rc.d/init.d/netdata"
%endif
+# ############################################################
+# Package Go within netdata (TBD: Package it separately)
+safe_sha256sum() {
+ # Within the contexct of the installer, we only use -c option that is common between the two commands
+ # We will have to reconsider if we start non-common options
+ if command -v sha256sum >/dev/null 2>&1; then
+ sha256sum $@
+ elif command -v shasum >/dev/null 2>&1; then
+ shasum -a 256 $@
+ else
+ fatal "I could not find a suitable checksum binary to use"
+ fi
+}
+
+download_go() {
+ url="${1}"
+ dest="${2}"
+
+ if command -v curl >/dev/null 2>&1; then
+ curl -sSL --connect-timeout 10 --retry 3 "${url}" > "${dest}"
+ elif command -v wget >/dev/null 2>&1; then
+ wget -T 15 -O - "${url}" > "${dest}"
+ else
+ echo >&2
+ echo >&2 "Downloading go.d plugin from '${url}' failed because of missing mandatory packages."
+ echo >&2 "Either add packages or disable it by issuing '--disable-go' in the installer"
+ echo >&2
+ exit 1
+ fi
+}
+
+install_go() {
+ # When updating this value, ensure correct checksums in packaging/go.d.checksums
+ GO_PACKAGE_VERSION="v0.7.0"
+ ARCH_MAP=(
+ 'i386::386'
+ 'i686::386'
+ 'x86_64::amd64'
+ 'aarch64::arm64'
+ 'armv64::arm64'
+ 'armv6l::arm'
+ 'armv7l::arm'
+ 'armv5tel::arm'
+ )
+
+ if [ -z "${NETDATA_DISABLE_GO+x}" ]; then
+ echo >&2 "Install go.d.plugin"
+ ARCH=$(uname -m)
+ OS=$(uname -s | tr '[:upper:]' '[:lower:]')
+
+ for index in "${ARCH_MAP[@]}" ; do
+ KEY="${index%%::*}"
+ VALUE="${index##*::}"
+ if [ "$KEY" = "$ARCH" ]; then
+ ARCH="${VALUE}"
+ break
+ fi
+ done
+ tmp=$(mktemp -d /tmp/netdata-go-XXXXXX)
+ GO_PACKAGE_BASENAME="go.d.plugin-${GO_PACKAGE_VERSION}.${OS}-${ARCH}"
+ download_go "https://github.com/netdata/go.d.plugin/releases/download/${GO_PACKAGE_VERSION}/${GO_PACKAGE_BASENAME}" "${tmp}/${GO_PACKAGE_BASENAME}"
+ download_go "https://github.com/netdata/go.d.plugin/releases/download/${GO_PACKAGE_VERSION}/config.tar.gz" "${tmp}/config.tar.gz"
+
+ if [ ! -f "${tmp}/${GO_PACKAGE_BASENAME}" ] || [ ! -f "${tmp}/config.tar.gz" ] || [ ! -s "${tmp}/config.tar.gz" ] || [ ! -s "${tmp}/${GO_PACKAGE_BASENAME}" ]; then
+ echo >&2 "Either check the error or consider disabling it by issuing '--disable-go' in the installer"
+ echo >&2
+ return 1
+ fi
+
+ grep "${GO_PACKAGE_BASENAME}\$" "packaging/go.d.checksums" > "${tmp}/sha256sums.txt" 2>/dev/null
+ grep "config.tar.gz" "packaging/go.d.checksums" >> "${tmp}/sha256sums.txt" 2>/dev/null
+
+ # Checksum validation
+ if ! (cd "${tmp}" && safe_sha256sum -c "sha256sums.txt"); then
+
+ echo >&2 "go.d plugin checksum validation failure."
+ echo >&2 "Either check the error or consider disabling it by issuing '--disable-go' in the installer"
+ echo >&2
+
+ echo "go.d.plugin package files checksum validation failed."
+ exit 1
+ fi
+
+ # Install files
+ tar -xf "${tmp}/config.tar.gz" -C "${RPM_BUILD_ROOT}%{_libdir}/%{name}/conf.d/"
+ mv "${tmp}/$GO_PACKAGE_BASENAME" "${RPM_BUILD_ROOT}%{_libexecdir}/%{name}/plugins.d/go.d.plugin"
+ fi
+ return 0
+}
+install_go
+
%pre
+
+# User/Group creations, as needed
getent group netdata >/dev/null || groupadd -r netdata
getent group docker >/dev/null || groupadd -r docker
getent passwd netdata >/dev/null || \
@@ -181,24 +382,28 @@ rm -rf "${RPM_BUILD_ROOT}"
%files
%doc README.md
-%defattr(-,root,root)
+%defattr(-,root,netdata)
%dir %{_sysconfdir}/%{name}
%dir %{_libdir}/%{name}
-%config %{_sysconfdir}/%{name}/*.conf
-#%config %{_sysconfdir}/%{name}/charts.d/*.conf
-#%config %{_sysconfdir}/%{name}/health.d/*.conf
-#%config %{_sysconfdir}/%{name}/node.d/*.conf
-#%config %{_sysconfdir}/%{name}/python.d/*.conf
-#%config %{_sysconfdir}/%{name}/statsd.d/*.conf
-%config %{_sysconfdir}/logrotate.d/%{name}
+%config(noreplace) %{_sysconfdir}/%{name}/*.conf
+%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
%{_libdir}/%{name}
+
+%defattr(0755,netdata,netdata,0755)
%{_libexecdir}/%{name}
%{_sbindir}/%{name}
%{_sysconfdir}/%{name}/edit-config
+%defattr(4750,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
%if %{with netns}
@@ -209,27 +414,25 @@ rm -rf "${RPM_BUILD_ROOT}"
%attr(0550,root,root) %{_libexecdir}/%{name}/plugins.d/cgroup-network-helper.sh
%endif
-%if %{with freeipmi}
-%caps(cap_setuid=ep) %attr(4550,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
-%endif
+# perf plugin
+%caps(cap_setuid=ep) %attr(4750,root,netdata) %{_libexecdir}/%{name}/plugins.d/perf.plugin
-%attr(0770,netdata,netdata) %dir %{_localstatedir}/cache/%{name}
-%attr(0755,netdata,root) %dir %{_localstatedir}/log/%{name}
-%attr(0770,netdata,netdata) %dir %{_localstatedir}/lib/%{name}
+# freeipmi files
+%caps(cap_setuid=ep) %attr(4550,root,netdata) %{_libexecdir}/%{name}/plugins.d/freeipmi.plugin
%dir %{_datadir}/%{name}
+%defattr(0750,netdata,netdata,0755)
+
%dir %{_sysconfdir}/%{name}/health.d
%dir %{_sysconfdir}/%{name}/python.d
%dir %{_sysconfdir}/%{name}/charts.d
+%dir %{_sysconfdir}/%{name}/custom-plugins.d
+%dir %{_sysconfdir}/%{name}/go.d
+%dir %{_sysconfdir}/%{name}/ssl
%dir %{_sysconfdir}/%{name}/node.d
%dir %{_sysconfdir}/%{name}/statsd.d
-
-%dir %{_libdir}/%{name}/conf.d/health.d
-%dir %{_libdir}/%{name}/conf.d/python.d
-%dir %{_libdir}/%{name}/conf.d/charts.d
-#%dir %{_libdir}/%{name}/conf.d/node.d
-%dir %{_libdir}/%{name}/conf.d/statsd.d
+%{_libdir}/%{name}/conf.d/
%if %{with systemd}
%{_unitdir}/netdata.service
@@ -242,7 +445,31 @@ rm -rf "${RPM_BUILD_ROOT}"
%defattr(0644,root,netdata,0755)
%{_datadir}/%{name}/web
+# Enforce 0660 for files and 0770 for directories
+# for the netdata lib, cache and log dirs
+%defattr(0660,root,netdata,0770)
+%attr(0770,netdata,netdata) %dir %{_localstatedir}/cache/%{name}
+%attr(0755,netdata,root) %dir %{_localstatedir}/log/%{name}
+%attr(0770,netdata,netdata) %dir %{_localstatedir}/lib/%{name}
+%attr(0770,netdata,netdata) %dir %{_localstatedir}/lib/%{name}/registry
+
+
%changelog
+* Fri Jun 28 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-7
+- Raise the path overrides to the spec file level, not just the configure.
+- Adjust tighter permissions on some folders, based on what we did on our installer
+- Introduce go.d plugin download and install, to include it on the package (Temporarily, to become separate package on next iteration)
+* Tue Jun 25 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-6
+- Adjust dependency list: Some packages are missing on some distros, adopt to build successfully
+* Mon Jun 24 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-5
+Another pass on cleaning up pre/post installation steps
+- Sync permission and ownership on files and directories
+* Sun Jun 16 2019 Pavlos Emm. Katsoulakis <paul@netdata.cloud> - 0.0.0-4
+First draft refactor on package dependencies section
+- Remove freeipmi/nfacct plugin flags. We auto-detect all plugins by decision
+- Start refactor of package dependencies
+- Add missing dependencies, with respect to distro peculiarities
+- Adjust existing dependencies, so that distro-specific package names is applied
* Wed Jan 02 2019 Pawel Krupa <pkrupa@redhat.com> - 0.0.0-3
- Temporary set version statically
- Fix changelog ordering