Merge commits from 8.6 into 9.0.0 branch.

Resolves: rhbz#2006430
Related: rhbz#1991764
This commit is contained in:
Nathan Scott 2021-10-05 17:17:15 +11:00
parent 4812ec6447
commit ba813e3733
2 changed files with 88 additions and 29 deletions

115
pcp.spec
View File

@ -1,6 +1,6 @@
Name: pcp
Version: 5.3.1
Release: 6%{?dist}
Version: 5.3.3
Release: 1%{?dist}
Summary: System-level performance monitoring and performance management
License: GPLv2+ and LGPLv2+ and CC-BY
URL: https://pcp.io
@ -8,12 +8,6 @@ URL: https://pcp.io
%global artifactory https://performancecopilot.jfrog.io/artifactory
Source0: %{artifactory}/pcp-source-release/pcp-%{version}.src.tar.gz
Patch000: redhat-bugzilla-1947989.patch
Patch001: redhat-bugzilla-1974266.patch
Patch002: redhat-bugzilla-1975069.patch
Patch003: redhat-bugzilla-1879350.patch
Patch004: redhat-bugzilla-1962019.patch
%if 0%{?fedora} >= 26 || 0%{?rhel} > 7
%global __python2 python2
%else
@ -96,6 +90,17 @@ Patch004: redhat-bugzilla-1962019.patch
%global disable_bcc 1
%endif
# support for pmdabpf, check bpf.spec for supported architectures of bpf
%if 0%{?fedora} >= 33 || 0%{?rhel} > 8
%ifarch x86_64 %{power64} aarch64 s390x
%global disable_bpf 0
%else
%global disable_bpf 1
%endif
%else
%global disable_bpf 1
%endif
# support for pmdabpftrace, check bpftrace.spec for supported architectures of bpftrace
%if 0%{?fedora} >= 30 || 0%{?rhel} > 7
%ifarch x86_64 %{power64} aarch64 s390x
@ -364,6 +369,12 @@ Requires: pcp-selinux = %{version}-%{release}
%global _with_bcc --with-pmdabcc=yes
%endif
%if %{disable_bpf}
%global _with_bpf --with-pmdabpf=no
%else
%global _with_bpf --with-pmdabpf=yes
%endif
%if %{disable_bpftrace}
%global _with_bpftrace --with-pmdabpftrace=no
%else
@ -510,7 +521,7 @@ Requires: pcp-pmda-samba pcp-pmda-slurm pcp-pmda-vmware pcp-pmda-zimbra
Requires: pcp-pmda-dm pcp-pmda-apache
Requires: pcp-pmda-bash pcp-pmda-cisco pcp-pmda-gfs2 pcp-pmda-mailq pcp-pmda-mounts
Requires: pcp-pmda-nvidia-gpu pcp-pmda-roomtemp pcp-pmda-sendmail pcp-pmda-shping pcp-pmda-smart
Requires: pcp-pmda-hacluster pcp-pmda-lustrecomm pcp-pmda-logger pcp-pmda-docker pcp-pmda-bind2
Requires: pcp-pmda-hacluster pcp-pmda-lustrecomm pcp-pmda-logger pcp-pmda-denki pcp-pmda-docker pcp-pmda-bind2
Requires: pcp-pmda-sockets
%if !%{disable_podman}
Requires: pcp-pmda-podman
@ -524,6 +535,9 @@ Requires: pcp-pmda-nutcracker
%if !%{disable_bcc}
Requires: pcp-pmda-bcc
%endif
%if !%{disable_bpf}
Requires: pcp-pmda-bpf
%endif
%if !%{disable_bpftrace}
Requires: pcp-pmda-bpftrace
%endif
@ -543,9 +557,7 @@ Requires: pcp-pmda-snmp
Requires: pcp-pmda-json
%endif
Requires: pcp-pmda-summary pcp-pmda-trace pcp-pmda-weblog
%if !%{disable_python2} || !%{disable_python3}
Requires: pcp-system-tools
%endif
%if !%{disable_qt}
Requires: pcp-gui
%endif
@ -1113,6 +1125,20 @@ This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about a GPS Daemon.
#end pcp-pmda-gpsd
#
# pcp-pmda-denki
#
%package pmda-denki
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics dealing with electrical power
URL: https://pcp.io
Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
%description pmda-denki
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics related to the electrical power consumed by and inside
the system.
# end pcp-pmda-denki
#
# pcp-pmda-docker
#
@ -1438,6 +1464,23 @@ extracting performance metrics from eBPF/BCC Python modules.
# end pcp-pmda-bcc
%endif
%if !%{disable_bpf}
#
# pcp-pmda-bpf
#
%package pmda-bpf
License: ASL 2.0 and GPLv2+
Summary: Performance Co-Pilot (PCP) metrics from eBPF ELF modules
URL: https://pcp.io
Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
Requires: libbpf
BuildRequires: libbpf-devel clang llvm
%description pmda-bpf
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
extracting performance metrics from eBPF ELF modules.
# end pcp-pmda-bpf
%endif
%if !%{disable_bpftrace}
#
# pcp-pmda-bpftrace
@ -2127,7 +2170,6 @@ Performance Metric API (PMAPI) monitor tools and Performance
Metric Domain Agent (PMDA) collector tools written in Python3.
%endif
%if !%{disable_python2} || !%{disable_python3}
#
# pcp-system-tools
#
@ -2135,23 +2177,24 @@ Metric Domain Agent (PMDA) collector tools written in Python3.
License: GPLv2+
Summary: Performance Co-Pilot (PCP) System and Monitoring Tools
URL: https://pcp.io
Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
%if !%{disable_python2} || !%{disable_python3}
%if !%{disable_python3}
Requires: python3-pcp = %{version}-%{release}
%else
Requires: %{__python2}-pcp = %{version}-%{release}
%endif
Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
%if !%{disable_dstat}
# https://fedoraproject.org/wiki/Packaging:Guidelines "Renaming/Replacing Existing Packages"
Provides: dstat = %{version}-%{release}
Provides: /usr/bin/dstat
Obsoletes: dstat <= 0.8
%endif
%endif
%description system-tools
This PCP module contains additional system monitoring tools written
in the Python language.
%endif
%if !%{disable_qt}
#
@ -2220,15 +2263,14 @@ interface rules, type enforcement and file context adjustments for an
updated policy package.
%endif
%prep
%setup -q
%patch000 -p1
%patch001 -p1
%patch002 -p1
%patch003 -p1
%patch004 -p1
%build
# the buildsubdir macro gets defined in %setup and is apparently only available in the next step (i.e. the %build step)
%global __strip %{_builddir}/%{?buildsubdir}/build/rpm/custom-strip
# fix up build version
_build=`echo %{release} | sed -e 's/\..*$//'`
sed -i "/PACKAGE_BUILD/s/=[0-9]*/=$_build/" VERSION.pcp
@ -2236,7 +2278,7 @@ sed -i "/PACKAGE_BUILD/s/=[0-9]*/=$_build/" VERSION.pcp
%if !%{disable_python2} && 0%{?default_python} != 3
export PYTHON=python%{?default_python}
%endif
%configure %{?_with_initd} %{?_with_doc} %{?_with_dstat} %{?_with_ib} %{?_with_podman} %{?_with_statsd} %{?_with_perfevent} %{?_with_bcc} %{?_with_bpftrace} %{?_with_json} %{?_with_snmp} %{?_with_nutcracker} %{?_with_python2}
%configure %{?_with_initd} %{?_with_doc} %{?_with_dstat} %{?_with_ib} %{?_with_podman} %{?_with_statsd} %{?_with_perfevent} %{?_with_bcc} %{?_with_bpf} %{?_with_bpftrace} %{?_with_json} %{?_with_snmp} %{?_with_nutcracker} %{?_with_python2}
make %{?_smp_mflags} default_pcp
%install
@ -2373,7 +2415,7 @@ total_manifest | keep 'testsuite|etc/systemd/system' >pcp-testsuite-files
basic_manifest | keep "$PCP_GUI|pcp-gui|applications|pixmaps|hicolor" | cull 'pmtime.h' >pcp-gui-files
basic_manifest | keep 'selinux' | cull 'tmp|GNUselinuxdefs' >pcp-selinux-files
basic_manifest | keep 'zeroconf|daily[-_]report|/sa$' >pcp-zeroconf-files
basic_manifest | grep -E -e 'pmiostat|pmrep|dstat|pcp2csv' \
basic_manifest | grep -E -e 'pmiostat|pmrep|dstat|htop|pcp2csv' \
-e 'pcp-atop|pcp-dmcache|pcp-dstat|pcp-free|pcp-htop' \
-e 'pcp-ipcs|pcp-iostat|pcp-lvmcache|pcp-mpstat' \
-e 'pcp-numastat|pcp-pidstat|pcp-shping|pcp-tapestat' \
@ -2401,11 +2443,13 @@ basic_manifest | keep '(etc/pcp|pmdas)/bash(/|$)' >pcp-pmda-bash-files
basic_manifest | keep '(etc/pcp|pmdas)/bcc(/|$)' >pcp-pmda-bcc-files
basic_manifest | keep '(etc/pcp|pmdas)/bind2(/|$)' >pcp-pmda-bind2-files
basic_manifest | keep '(etc/pcp|pmdas)/bonding(/|$)' >pcp-pmda-bonding-files
basic_manifest | keep '(etc/pcp|pmdas)/bpf(/|$)' >pcp-pmda-bpf-files
basic_manifest | keep '(etc/pcp|pmdas)/bpftrace(/|$)' >pcp-pmda-bpftrace-files
basic_manifest | keep '(etc/pcp|pmdas)/cifs(/|$)' >pcp-pmda-cifs-files
basic_manifest | keep '(etc/pcp|pmdas)/cisco(/|$)' >pcp-pmda-cisco-files
basic_manifest | keep '(etc/pcp|pmdas)/dbping(/|$)' >pcp-pmda-dbping-files
basic_manifest | keep '(etc/pcp|pmdas|pmieconf)/dm(/|$)' >pcp-pmda-dm-files
basic_manifest | keep '(etc/pcp|pmdas)/denki(/|$)' >pcp-pmda-denki-files
basic_manifest | keep '(etc/pcp|pmdas)/docker(/|$)' >pcp-pmda-docker-files
basic_manifest | keep '(etc/pcp|pmdas)/ds389log(/|$)' >pcp-pmda-ds389log-files
basic_manifest | keep '(etc/pcp|pmdas)/ds389(/|$)' >pcp-pmda-ds389-files
@ -2471,9 +2515,9 @@ basic_manifest | keep '(etc/pcp|pmdas)/zswap(/|$)' >pcp-pmda-zswap-files
rm -f packages.list
for pmda_package in \
activemq apache \
bash bcc bind2 bonding bpftrace \
bash bcc bind2 bonding bpf bpftrace \
cifs cisco \
dbping docker dm ds389 ds389log \
dbping denki docker dm ds389 ds389log \
elasticsearch \
gfs2 gluster gpfs gpsd \
hacluster haproxy \
@ -2715,6 +2759,9 @@ exit 0
%preun pmda-dbping
%{pmda_remove "$1" "dbping"}
%preun pmda-denki
%{pmda_remove "$1" "denki"}
%preun pmda-docker
%{pmda_remove "$1" "docker"}
@ -2788,6 +2835,11 @@ exit 0
%{pmda_remove "$1" "bcc"}
%endif
%if !%{disable_bpf}
%preun pmda-bpf
%{pmda_remove "$1" "bpf"}
%endif
%if !%{disable_bpftrace}
%preun pmda-bpftrace
%{pmda_remove "$1" "bpftrace"}
@ -2885,8 +2937,6 @@ if [ "$1" -eq 0 ]
then
%systemd_preun pmlogger_daily_report.timer
%systemd_preun pmlogger_daily_report.service
%systemd_preun pmlogger_daily_report-poll.timer
%systemd_preun pmlogger_daily_report-poll.service
fi
%endif
@ -2901,7 +2951,6 @@ then
%systemd_preun pmcd.service
%systemd_preun pmie_daily.timer
%systemd_preun pmlogger_daily.timer
%systemd_preun pmlogger_daily-poll.timer
%systemd_preun pmlogger_check.timer
systemctl stop pmlogger.service >/dev/null 2>&1
@ -2975,6 +3024,8 @@ PCP_LOG_DIR=%{_logsdir}
%{install_file "$PCP_PMNS_DIR" .NeedRebuild}
%{install_file "$PCP_LOG_DIR/pmlogger" .NeedRewrite}
%if !%{disable_systemd}
# clean up any stale symlinks for deprecated pm*-poll services
rm -f %{_sysconfdir}/systemd/system/pm*.requires/pm*-poll.* >/dev/null 2>&1 || true
%systemd_postun_with_restart pmcd.service
%systemd_post pmcd.service
%systemd_postun_with_restart pmlogger.service
@ -3106,6 +3157,8 @@ PCP_LOG_DIR=%{_logsdir}
%files pmda-zimbra -f pcp-pmda-zimbra-files.rpm
%endif
%files pmda-denki -f pcp-pmda-denki-files.rpm
%files pmda-docker -f pcp-pmda-docker-files.rpm
%files pmda-lustrecomm -f pcp-pmda-lustrecomm-files.rpm
@ -3138,6 +3191,10 @@ PCP_LOG_DIR=%{_logsdir}
%files pmda-bcc -f pcp-pmda-bcc-files.rpm
%endif
%if !%{disable_bpf}
%files pmda-bpf -f pcp-pmda-bpf-files.rpm
%endif
%if !%{disable_bpftrace}
%files pmda-bpftrace -f pcp-pmda-bpftrace-files.rpm
%endif
@ -3277,13 +3334,15 @@ PCP_LOG_DIR=%{_logsdir}
%files -n python3-pcp -f python3-pcp.list.rpm
%endif
%if !%{disable_python2} || !%{disable_python3}
%files system-tools -f pcp-system-tools-files.rpm
%endif
%files zeroconf -f pcp-zeroconf-files.rpm
%changelog
* Tue Oct 05 2021 Nathan Scott <nathans@redhat.com> - 5.3.3-1
- Resolve pmdakvm(1) selinux AVC denials (BZ 2006430)
- Related: rhbz#1991764
* Mon Aug 30 2021 Nathan Scott <nathans@redhat.com> - 5.3.1-6
- Fix pmdapodman initialization and selinux policy
- Related: rhbz#1957575

View File

@ -1 +1 @@
SHA512 (pcp-5.3.1.src.tar.gz) = c669d08cff66bba0cd747d2e0ca37f967497945cf1913358e7523c5f9877d68d0ffa810d960a42c168f3f75d52ec08b71ed350f23bad64b181223c6c8874c697
SHA512 (pcp-5.3.3.src.tar.gz) = 3d2b1e1c4f71ae637ee61d2172063f4577f34661ee0701c62929bba137d5279a8ea7414192aff22b0fd7e0dcac10ff9c56866a4053598524b52c388238daa410