diff --git a/.gitignore b/.gitignore
index b651edb..02817f0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1 @@
-SOURCES/pcp-4.3.2.src.tar.gz
-SOURCES/pcp-webapp-blinkenlights-1.0.1.tar.gz
-SOURCES/pcp-webapp-grafana-1.9.1-2.tar.gz
-SOURCES/pcp-webapp-graphite-0.9.10.tar.gz
-SOURCES/pcp-webapp-vector-1.3.1-1.tar.gz
+SOURCES/pcp-5.0.2.src.tar.gz
diff --git a/.pcp.metadata b/.pcp.metadata
index ad492b7..017406d 100644
--- a/.pcp.metadata
+++ b/.pcp.metadata
@@ -1,5 +1 @@
-940c068e6d34967f07f8c193acd5069a34de0835 SOURCES/pcp-4.3.2.src.tar.gz
-e328622bfc24ac4c93a5dcdb9dedf0277a870bc8 SOURCES/pcp-webapp-blinkenlights-1.0.1.tar.gz
-9fbce28ae069f9d1fb1408093a1d4303c5d60322 SOURCES/pcp-webapp-grafana-1.9.1-2.tar.gz
-05f083a4cddff47cf25ce50a27c20aaccad0dbcb SOURCES/pcp-webapp-graphite-0.9.10.tar.gz
-0ee76d05b4fe7465afcdb70a7d723d29a351dac7 SOURCES/pcp-webapp-vector-1.3.1-1.tar.gz
+95c6975c1af0c910a0e26ad5677a40bd8cd52ed2 SOURCES/pcp-5.0.2.src.tar.gz
diff --git a/SOURCES/pmcd-pmlogger-local-context.patch b/SOURCES/pmcd-pmlogger-local-context.patch
deleted file mode 100644
index 1c1e90d..0000000
--- a/SOURCES/pmcd-pmlogger-local-context.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/src/pmcd/pmcd.defaults b/src/pmcd/pmcd.defaults
-index 83ee4d9a9..56e125553 100644
---- a/src/pmcd/pmcd.defaults
-+++ b/src/pmcd/pmcd.defaults
-@@ -4,7 +4,7 @@
- # Behaviour regarding listening on external-facing interfaces;
- # unset PMCD_LOCAL to allow connections from remote hosts.
- # A value of 0 permits remote connections, 1 permits local only.
--# PMCD_LOCAL=1
-+PMCD_LOCAL=1
- 
- # Max length to which the queue of pending connections may grow
- # A value of 5 is the default.
-diff --git a/src/pmlogger/pmlogger.defaults b/src/pmlogger/pmlogger.defaults
-index 5462403ec..261a79039 100644
---- a/src/pmlogger/pmlogger.defaults
-+++ b/src/pmlogger/pmlogger.defaults
-@@ -4,7 +4,7 @@
- # Behaviour regarding listening on external-facing interfaces;
- # unset PMLOGGER_LOCAL to allow connections from remote hosts.
- # A value of 0 permits remote connections, 1 permits local only.
--# PMLOGGER_LOCAL=1
-+PMLOGGER_LOCAL=1
- 
- # Max length to which the queue of pending connections may grow
- # A value of 5 is the default.
diff --git a/SOURCES/qa-fixmod.patch b/SOURCES/qa-fixmod.patch
deleted file mode 100644
index 6e9f90a..0000000
--- a/SOURCES/qa-fixmod.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-commit 25f7bab80fea8676fa24435e275934fc81f68bc7
-Author: Nathan Scott <nathans@redhat.com>
-Date:   Fri May 3 15:58:17 2019 +1000
-
-    qa: fix _fixmod function name typo in test 994
-    
-    Thanks to Michal Kolar from the Red Hat QE team for
-    reporting this one.
-
-diff --git a/qa/994 b/qa/994
-index cdf9485b6..01de9449b 100755
---- a/qa/994
-+++ b/qa/994
-@@ -151,7 +151,7 @@ p
- 	then
- 	    echo "$target: wrong mode: expected $mode (from $makefile), found $_mode"
- 	    ls -ld $target
--	    $fix && _fixmod "$mode" "$target"
-+	    $fix && _fixmode "$mode" "$target"
- 	fi
- 	if [ "$_owner" != "$owner" ]
- 	then
diff --git a/SPECS/pcp.spec b/SPECS/pcp.spec
index 75872f6..212a8c4 100644
--- a/SPECS/pcp.spec
+++ b/SPECS/pcp.spec
@@ -1,20 +1,12 @@
 Name:    pcp
-Version: 4.3.2
+Version: 5.0.2
 Release: 2%{?dist}
 Summary: System-level performance monitoring and performance management
 License: GPLv2+ and LGPLv2+ and CC-BY
 URL:     https://pcp.io
 
 %global  bintray https://bintray.com/artifact/download
-%global  github https://github.com/performancecopilot
-
-Source0: %{bintray}/download/pcp/source/pcp-%{version}.src.tar.gz
-Source1: %{github}/pcp-webapp-vector/archive/1.3.1-1/pcp-webapp-vector-1.3.1-1.tar.gz
-Source2: %{github}/pcp-webapp-grafana/archive/1.9.1-2/pcp-webapp-grafana-1.9.1-2.tar.gz
-Source3: %{github}/pcp-webapp-graphite/archive/0.9.10/pcp-webapp-graphite-0.9.10.tar.gz
-Source4: %{github}/pcp-webapp-blinkenlights/archive/1.0.1/pcp-webapp-blinkenlights-1.0.1.tar.gz
-Patch0: pmcd-pmlogger-local-context.patch
-Patch1: qa-fixmod.patch
+Source0: %{bintray}/pcp/source/pcp-%{version}.src.tar.gz
 
 %if 0%{?fedora} >= 26 || 0%{?rhel} > 7
 %global __python2 python2
@@ -48,11 +40,14 @@ Patch1: qa-fixmod.patch
 %global disable_podman 1
 %endif
 
-%global disable_microhttpd 0
-%global disable_webapps 0
-%global disable_cairo 0
+# libchan, libhdr_histogram and pmdastatsd
+%if 0%{?fedora} >= 29 || 0%{?rhel} > 8
+%global disable_statsd 0
+%else
+%global disable_statsd 1
+%endif
 
-%if 0%{?rhel} > 7 || 0%{?fedora} >= 30
+%if 0%{?fedora} >= 30 || 0%{?rhel} > 7
 %global _with_python2 --with-python=no
 %global disable_python2 1
 %else
@@ -91,6 +86,17 @@ Patch1: qa-fixmod.patch
 %global disable_bcc 1
 %endif
 
+# support for pmdabpftrace
+%if 0%{?fedora} >= 30 || 0%{?rhel} > 7
+%ifarch s390 s390x armv7hl aarch64 i686
+%global disable_bpftrace 1
+%else
+%global disable_bpftrace 0
+%endif
+%else
+%global disable_bpftrace 1
+%endif
+
 # support for pmdajson
 %if 0%{?rhel} == 0 || 0%{?rhel} > 6
 %if !%{disable_python2} || !%{disable_python3}
@@ -133,7 +139,7 @@ Patch1: qa-fixmod.patch
 %global disable_systemd 1
 %endif
 
-# systemtap static probing, missing before el6 and on some architectures
+# static probes, missing before el6 and on some architectures
 %if 0%{?rhel} == 0 || 0%{?rhel} > 5
 %global disable_sdt 0
 %else
@@ -144,20 +150,15 @@ Patch1: qa-fixmod.patch
 %endif
 %endif
 
-# boost c++ library, widely available
-%if 0%{?rhel} == 0 || 0%{?rhel} > 5
-%global disable_boost 0
-%else
-%global disable_boost 1
-%endif
-
-# libuv
+# libuv async event library
 %if 0%{?fedora} >= 28 || 0%{?rhel} > 7
 %global disable_libuv 0
 %else
 %global disable_libuv 1
 %endif
 
+%global disable_openssl 0
+
 # rpm producing "noarch" packages
 %if 0%{?rhel} == 0 || 0%{?rhel} > 5
 %global disable_noarch 0
@@ -172,12 +173,17 @@ Patch1: qa-fixmod.patch
 %endif
 
 # prevent conflicting binary and man page install for pcp(1)
-Conflicts: librapi
+Conflicts: librapi < 0.16
 
 # KVM PMDA moved into pcp (no longer using Perl, default on)
-Obsoletes: pcp-pmda-kvm
+Obsoletes: pcp-pmda-kvm < 4.1.1
 Provides: pcp-pmda-kvm
 
+# PCP REST APIs are now provided by pmproxy
+Obsoletes: pcp-webapi-debuginfo < 5.0.0
+Obsoletes: pcp-webapi < 5.0.0
+Provides: pcp-webapi
+
 # https://fedoraproject.org/wiki/Packaging "C and C++"
 BuildRequires: gcc gcc-c++
 BuildRequires: procps autoconf bison flex
@@ -202,23 +208,20 @@ BuildRequires: cyrus-sasl-devel
 %if !%{disable_podman}
 BuildRequires: libvarlink-devel
 %endif
+%if !%{disable_statsd}
+BuildRequires: ragel chan-devel HdrHistogram_c-devel
+%endif
 %if !%{disable_perfevent}
 BuildRequires: libpfm-devel >= 4
 %endif
-%if !%{disable_microhttpd}
-BuildRequires: libmicrohttpd-devel
-%endif
-%if !%{disable_cairo}
-BuildRequires: cairo-devel
-%endif
 %if !%{disable_sdt}
 BuildRequires: systemtap-sdt-devel
 %endif
-%if !%{disable_boost}
-BuildRequires: boost-devel
-%endif
 %if !%{disable_libuv}
-BuildRequires: libuv-devel >= 1.16
+BuildRequires: libuv-devel >= 1.0
+%endif
+%if !%{disable_openssl}
+BuildRequires: openssl-devel >= 1.1.1
 %endif
 %if 0%{?rhel} == 0 || 0%{?rhel} > 7
 BuildRequires: perl-generators
@@ -226,7 +229,7 @@ BuildRequires: perl-generators
 BuildRequires: perl-devel perl(strict)
 BuildRequires: perl(ExtUtils::MakeMaker) perl(LWP::UserAgent) perl(JSON)
 BuildRequires: perl(LWP::UserAgent) perl(Time::HiRes) perl(Digest::MD5)
-BuildRequires: man
+BuildRequires: man hostname
 %if !%{disable_systemd}
 BuildRequires: systemd-devel
 %endif
@@ -240,7 +243,7 @@ BuildRequires: qt5-qtsvg-devel
 %endif
 %endif
 
-Requires: bash xz gawk sed grep findutils which
+Requires: bash xz gawk sed grep findutils which hostname
 Requires: pcp-libs = %{version}-%{release}
 %if !%{disable_selinux}
 Requires: pcp-selinux = %{version}-%{release}
@@ -248,29 +251,30 @@ Requires: pcp-selinux = %{version}-%{release}
 
 # Some older releases did not update or replace pcp-gui-debuginfo properly
 %if 0%{?fedora} < 27 && 0%{?rhel} <= 7 && "%{_vendor}" == "redhat"
-Obsoletes: pcp-gui-debuginfo
+Obsoletes: pcp-gui-debuginfo < 4.1.1
 %endif
 
-Obsoletes: pcp-pmda-nvidia
-
-# Obsoletes for distros that already have single install pmda's with compat package
-Obsoletes: pcp-compat pcp-collector pcp-monitor
+Obsoletes: pcp-compat < 4.2.0
+Obsoletes: pcp-monitor < 4.2.0
+Obsoletes: pcp-collector < 4.2.0
+Obsoletes: pcp-pmda-nvidia < 3.10.5
 
 Requires: pcp-libs = %{version}-%{release}
 
-%global tapsetdir      %{_datadir}/systemtap/tapset
-
-%global _confdir  %{_sysconfdir}/pcp
-%global _logsdir  %{_localstatedir}/log/pcp
-%global _pmnsdir  %{_localstatedir}/lib/pcp/pmns
-%global _tempsdir %{_localstatedir}/lib/pcp/tmp
-%global _pmdasdir %{_localstatedir}/lib/pcp/pmdas
-%global _testsdir %{_localstatedir}/lib/pcp/testsuite
-%global _selinuxdir %{_localstatedir}/lib/pcp/selinux
-%global _logconfdir %{_localstatedir}/lib/pcp/config/pmlogconf
-%global _pixmapdir %{_datadir}/pcp-gui/pixmaps
-%global _hicolordir %{_datadir}/icons/hicolor
-%global _booksdir %{_datadir}/doc/pcp-doc
+%global _confdir	%{_sysconfdir}/pcp
+%global _logsdir	%{_localstatedir}/log/pcp
+%global _pmnsdir	%{_localstatedir}/lib/pcp/pmns
+%global _tempsdir	%{_localstatedir}/lib/pcp/tmp
+%global _pmdasdir	%{_localstatedir}/lib/pcp/pmdas
+%global _testsdir	%{_localstatedir}/lib/pcp/testsuite
+%global _selinuxdir	%{_localstatedir}/lib/pcp/selinux
+%global _logconfdir	%{_localstatedir}/lib/pcp/config/pmlogconf
+%global _ieconfdir	%{_localstatedir}/lib/pcp/config/pmieconf
+%global _tapsetdir	%{_datadir}/systemtap/tapset
+%global _bashcompdir	%{_datadir}/bash-completion/completions
+%global _pixmapdir	%{_datadir}/pcp-gui/pixmaps
+%global _hicolordir	%{_datadir}/icons/hicolor
+%global _booksdir	%{_datadir}/doc/pcp-doc
 
 %if 0%{?fedora} >= 20 || 0%{?rhel} >= 8
 %global _with_doc --with-docdir=%{_docdir}/%{name}
@@ -319,12 +323,24 @@ Requires: pcp-libs = %{version}-%{release}
 %global _with_podman --with-podman=yes
 %endif
 
+%if %{disable_statsd}
+%global _with_statsd --with-statsd=no
+%else
+%global _with_statsd --with-statsd=yes
+%endif
+
 %if %{disable_bcc}
 %global _with_bcc --with-pmdabcc=no
 %else
 %global _with_bcc --with-pmdabcc=yes
 %endif
 
+%if %{disable_bpftrace}
+%global _with_bpftrace --with-pmdabpftrace=no
+%else
+%global _with_bpftrace --with-pmdabpftrace=yes
+%endif
+
 %if %{disable_json}
 %global _with_json --with-pmdajson=no
 %else
@@ -343,18 +359,14 @@ Requires: pcp-libs = %{version}-%{release}
 %global _with_snmp --with-pmdasnmp=yes
 %endif
 
-%if %{disable_webapps}
-%global _with_webapps --with-webapps=no
-%else
-%global _with_webapps --with-webapps=yes
-%endif
-
 %global pmda_remove() %{expand:
 if [ %1 -eq 0 ]
 then
-    if [ -f "%{_confdir}/pmcd/pmcd.conf" -a -f "%{_pmdasdir}/%2/domain.h" ]
+    PCP_PMDAS_DIR=%{_pmdasdir}
+    PCP_PMCDCONF_PATH=%{_confdir}/pmcd/pmcd.conf
+    if [ -f "$PCP_PMCDCONF_PATH" -a -f "$PCP_PMDAS_DIR/%2/domain.h" ]
     then
-	(cd %{_pmdasdir}/%2/ && ./Remove >/dev/null 2>&1)
+	(cd "$PCP_PMDAS_DIR/%2/" && ./Remove >/dev/null 2>&1)
     fi
 fi
 }
@@ -440,7 +452,7 @@ Requires: pcp = %{version}-%{release}
 Requires: pcp-libs = %{version}-%{release}
 Requires: pcp-libs-devel = %{version}-%{release}
 Requires: pcp-devel = %{version}-%{release}
-Obsoletes: pcp-gui-testsuite
+Obsoletes: pcp-gui-testsuite < 3.9.5
 # The following are inherited from pcp-collector and pcp-monitor,
 # both of which are now obsoleted by the base pcp package
 Requires: pcp-pmda-activemq pcp-pmda-bonding pcp-pmda-dbping pcp-pmda-ds389 pcp-pmda-ds389log
@@ -455,16 +467,22 @@ Requires: pcp-pmda-lustrecomm pcp-pmda-logger pcp-pmda-docker pcp-pmda-bind2
 %if !%{disable_podman}
 Requires: pcp-pmda-podman
 %endif
+%if !%{disable_statsd}
+Requires: pcp-pmda-statsd
+%endif
 %if !%{disable_nutcracker}
 Requires: pcp-pmda-nutcracker
 %endif
 %if !%{disable_bcc}
 Requires: pcp-pmda-bcc
 %endif
+%if !%{disable_bpftrace}
+Requires: pcp-pmda-bpftrace
+%endif
 %if !%{disable_python2} || !%{disable_python3}
 Requires: pcp-pmda-gluster pcp-pmda-zswap pcp-pmda-unbound pcp-pmda-mic
-Requires: pcp-pmda-libvirt pcp-pmda-lio pcp-pmda-prometheus pcp-pmda-haproxy
-Requires: pcp-pmda-lmsensors
+Requires: pcp-pmda-libvirt pcp-pmda-lio pcp-pmda-openmetrics pcp-pmda-haproxy
+Requires: pcp-pmda-lmsensors pcp-pmda-mssql pcp-pmda-netcheck
 %endif
 %if !%{disable_snmp}
 Requires: pcp-pmda-snmp
@@ -476,9 +494,6 @@ Requires: pcp-pmda-json
 Requires: pcp-pmda-rpm
 %endif
 Requires: pcp-pmda-summary pcp-pmda-trace pcp-pmda-weblog
-%if !%{disable_microhttpd}
-Requires: pcp-webapi
-%endif
 %if !%{disable_python2} || !%{disable_python3}
 Requires: pcp-system-tools
 %endif
@@ -509,100 +524,6 @@ daemons are running when appropriate, and manages their log rotation
 needs.  It is an alternative to the cron-based pmlogger/pmie service
 scripts.
 
-%if !%{disable_microhttpd}
-#
-# pcp-webapi
-#
-%package webapi
-License: GPLv2+
-Summary: Performance Co-Pilot (PCP) web API service
-URL: https://pcp.io
-Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
-Requires: liberation-sans-fonts
-
-%description webapi
-Provides a daemon (pmwebd) that binds a large subset of the Performance
-Co-Pilot (PCP) client API (PMAPI) to RESTful web applications using the
-HTTP (PMWEBAPI) protocol.
-%endif
-
-%if !%{disable_webapps}
-#
-# pcp-webjs and pcp-webapp packages
-#
-%package webjs
-License: ASL 2.0 and MIT and CC-BY and GPLv3
-Conflicts: pcp-webjs < 3.11.9
-%if !%{disable_noarch}
-BuildArch: noarch
-%endif
-Requires: pcp-webapp-vector pcp-webapp-blinkenlights
-Requires: pcp-webapp-graphite pcp-webapp-grafana
-Summary: Performance Co-Pilot (PCP) web applications
-URL: https://pcp.io
-
-%description webjs
-Javascript web application content for the Performance Co-Pilot (PCP)
-web service.
-
-%package webapp-vector
-License: ASL 2.0
-%if !%{disable_noarch}
-BuildArch: noarch
-%endif
-Summary: Vector web application for Performance Co-Pilot (PCP)
-URL: https://github.com/Netflix/vector
-
-%description webapp-vector
-Vector web application for the Performance Co-Pilot (PCP).
-
-%package webapp-grafana
-License: ASL 2.0
-Conflicts: pcp-webjs < 3.10.4
-%if !%{disable_noarch}
-BuildArch: noarch
-%endif
-Summary: Grafana web application for Performance Co-Pilot (PCP)
-URL: https://grafana.org
-
-%description webapp-grafana
-Grafana is an open source, feature rich metrics dashboard and graph
-editor.  This package provides a Grafana that uses the Performance
-Co-Pilot (PCP) as the data repository.  Other Grafana backends are
-not used.
-
-Grafana can render time series dashboards at the browser via flot.js
-(more interactive, slower, for beefy browsers) or alternately at the
-server via png (less interactive, faster).
-
-%package webapp-graphite
-License: ASL 2.0 and GPLv3
-Conflicts: pcp-webjs < 3.10.4
-%if !%{disable_noarch}
-BuildArch: noarch
-%endif
-Summary: Graphite web application for Performance Co-Pilot (PCP)
-URL: http://graphite.readthedocs.org
-
-%description webapp-graphite
-Graphite is a highly scalable real-time graphing system. This package
-provides a graphite version that uses the Performance Co-Pilot (PCP)
-as the data repository, and Graphites web interface renders it. The
-Carbon and Whisper subsystems of Graphite are not included nor used.
-
-%package webapp-blinkenlights
-License: ASL 2.0
-%if !%{disable_noarch}
-BuildArch: noarch
-%endif
-Summary: Blinking lights web application for Performance Co-Pilot (PCP)
-URL: https://pcp.io
-
-%description webapp-blinkenlights
-Demo web application showing traffic lights that change colour based
-on the periodic evaluation of performance metric expressions.
-%endif
-
 #
 # perl-PCP-PMDA. This is the PCP agent perl binding.
 #
@@ -929,6 +850,22 @@ This package contains the PCP Performance Metrics Domain Agent (PMDA) for
 collecting podman container and pod statistics through libvarlink.
 %endif
 
+%if !%{disable_statsd}
+#
+# pcp-pmda-statsd
+#
+%package pmda-statsd
+License: GPLv2+
+Summary: Performance Co-Pilot (PCP) metrics from statsd
+URL: https://pcp.io
+Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
+Requires: chan HdrHistogram_c
+
+%description pmda-statsd
+This package contains the PCP Performance Metrics Domain Agent (PMDA) for
+collecting statistics from the statsd daemon.
+%endif
+
 %if !%{disable_perfevent}
 #
 # pcp-pmda-perfevent
@@ -940,7 +877,8 @@ URL: https://pcp.io
 Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
 Requires: libpfm >= 4
 BuildRequires: libpfm-devel >= 4
-Obsoletes: pcp-pmda-papi pcp-pmda-papi-debuginfo
+Obsoletes: pcp-pmda-papi < 5.0.0
+Obsoletes: pcp-pmda-papi-debuginfo < 5.0.0
 
 %description pmda-perfevent
 This package contains the PCP Performance Metrics Domain Agent (PMDA) for
@@ -1286,6 +1224,7 @@ License: GPLv2+
 Summary: Performance Co-Pilot (PCP) metrics for the Postfix (MTA)
 URL: https://pcp.io
 Requires: perl-PCP-PMDA = %{version}-%{release}
+Requires: perl-Time-HiRes
 %if 0%{?fedora} > 16 || 0%{?rhel} > 5
 Requires: postfix-perl-scripts
 BuildRequires: postfix-perl-scripts
@@ -1425,6 +1364,23 @@ extracting performance metrics from eBPF/BCC Python modules.
 # end pcp-pmda-bcc
 %endif
 
+%if !%{disable_bpftrace}
+#
+# pcp-pmda-bpftrace
+#
+%package pmda-bpftrace
+License: ASL 2.0 and GPLv2+
+Summary: Performance Co-Pilot (PCP) metrics from bpftrace scripts
+URL: https://pcp.io
+Requires: bpftrace >= 0.9.2
+Requires: python3-pcp
+Requires: python3 >= 3.6
+%description pmda-bpftrace
+This package contains the PCP Performance Metrics Domain Agent (PMDA) for
+extracting performance metrics from bpftrace scripts.
+# end pcp-pmda-bpftrace
+%endif
+
 %if !%{disable_python2} || !%{disable_python3}
 #
 # pcp-pmda-gluster
@@ -1620,11 +1576,11 @@ target.
 #end pcp-pmda-lio
 
 #
-# pcp-pmda-prometheus
+# pcp-pmda-openmetrics
 #
-%package pmda-prometheus
+%package pmda-openmetrics
 License: GPLv2+
-Summary: Performance Co-Pilot (PCP) metrics from Prometheus endpoints
+Summary: Performance Co-Pilot (PCP) metrics from OpenMetrics endpoints
 URL: https://pcp.io
 Requires: pcp-libs = %{version}-%{release}
 %if !%{disable_python3}
@@ -1636,11 +1592,13 @@ Requires: %{__python2}-pcp
 Requires: %{__python2}-requests
 BuildRequires: %{__python2}-requests
 %endif
+Obsoletes: pcp-pmda-prometheus < 5.0.0
+Provides: pcp-pmda-prometheus < 5.0.0
 
-%description pmda-prometheus
+%description pmda-openmetrics
 This package contains the PCP Performance Metrics Domain Agent (PMDA) for
-extracting statistics from programs instrumented as Prometheus endpoints.
-#end pcp-pmda-prometheus
+extracting metrics from OpenMetrics (https://openmetrics.io/) endpoints.
+#end pcp-pmda-openmetrics
 
 #
 # pcp-pmda-lmsensors
@@ -1656,13 +1614,49 @@ Requires: python3-pcp
 Requires: %{__python2}-pcp
 %endif
 # rewritten in python, so there is no longer a debuginfo package
-Obsoletes: pcp-pmda-lmsensors-debuginfo
+Obsoletes: pcp-pmda-lmsensors-debuginfo < 4.2.0
 %description pmda-lmsensors
 This package contains the PCP Performance Metrics Domain Agent (PMDA) for
 collecting metrics about the Linux hardware monitoring sensors.
 # end pcp-pmda-lmsensors
 
-%endif # !%{disable_python2} || !%{disable_python3}
+#
+# pcp-pmda-mssql
+#
+%package pmda-mssql
+License: GPLv2+
+Summary: Performance Co-Pilot (PCP) metrics for Microsoft SQL Server
+URL: https://pcp.io
+Requires: pcp-libs = %{version}-%{release}
+%if !%{disable_python3}
+Requires: python3-pcp
+%else
+Requires: %{__python2}-pcp
+%endif
+%description pmda-mssql
+This package contains the PCP Performance Metrics Domain Agent (PMDA) for
+collecting metrics from Microsoft SQL Server.
+# end pcp-pmda-mssql
+
+#
+# pcp-pmda-netcheck
+#
+%package pmda-netcheck
+License: GPLv2+
+Summary: Performance Co-Pilot (PCP) metrics for simple network checks
+URL: https://pcp.io
+Requires: pcp-libs = %{version}-%{release}
+%if !%{disable_python3}
+Requires: python3-pcp
+%else
+Requires: %{__python2}-pcp
+%endif
+%description pmda-netcheck
+This package contains the PCP Performance Metrics Domain Agent (PMDA) for
+collecting metrics from simple network checks.
+# end pcp-pmda-netcheck
+
+%endif
 
 %if !%{disable_json}
 #
@@ -1685,7 +1679,7 @@ BuildRequires: %{__python2}-jsonpointer %{__python2}-six
 This package contains the PCP Performance Metrics Domain Agent (PMDA) for
 collecting metrics output in JSON.
 # end pcp-pmda-json
-%endif # !%{disable_json}
+%endif
 
 #
 # C pmdas
@@ -1942,8 +1936,6 @@ Summary: Performance Co-Pilot (PCP) Zeroconf Package
 URL: https://pcp.io
 Requires: pcp pcp-doc pcp-system-tools
 Requires: pcp-pmda-dm pcp-pmda-nfsclient
-# to make pcp-zeroconf replace sysstat, uncomment the next line
-# Obsoletes: sysstat
 %description zeroconf
 This package contains configuration tweaks and files to increase metrics
 gathering frequency, several extended pmlogger configurations, as well as
@@ -1962,7 +1954,7 @@ URL: https://pcp.io
 Requires: pcp = %{version}-%{release} pcp-libs = %{version}-%{release}
 %if 0%{?fedora} >= 26 || 0%{?rhel} > 7
 # on these platforms, python2-pcp replaces python-pcp
-Obsoletes: python-pcp
+Obsoletes: python-pcp < %{version}
 %endif
 %if 0%{?rhel} == 5
 Requires: python%{default_python}
@@ -2017,7 +2009,7 @@ Obsoletes: dstat <= 0.8
 %description system-tools
 This PCP module contains additional system monitoring tools written
 in the Python language.
-%endif #end pcp-system-tools
+%endif
 
 %if !%{disable_qt}
 #
@@ -2050,7 +2042,6 @@ Summary: Documentation and tutorial for the Performance Co-Pilot
 URL: https://pcp.io
 # http://fedoraproject.org/wiki/Packaging:Conflicts "Splitting Packages"
 # (all man pages migrated to pcp-doc during great package split of '15)
-Conflicts: pcp-pmda-pmda < 3.10.5
 Conflicts: pcp-pmda-infiniband < 3.10.5
 
 %description doc
@@ -2079,7 +2070,7 @@ BuildRequires: setools
 %else
 BuildRequires: setools-console
 %endif
-Requires: policycoreutils
+Requires: policycoreutils selinux-policy-targeted
 
 %description selinux
 This package contains SELinux support for PCP.  The package contains
@@ -2088,19 +2079,13 @@ updated policy package.
 %endif
 
 %prep
-%setup -q -T -D -a 1 -c -n vector
-%setup -q -T -D -a 2 -c -n grafana
-%setup -q -T -D -a 3 -c -n graphite
-%setup -q -T -D -a 4 -c -n blinkenlights
 %setup -q
-%patch0 -p1
-%patch1 -p1
 
 %build
 %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_perfevent} %{?_with_bcc} %{?_with_json} %{?_with_snmp} %{?_with_nutcracker} %{?_with_webapps} %{?_with_python2}
+%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}
 make %{?_smp_mflags} default_pcp
 
 %install
@@ -2120,20 +2105,6 @@ rm -f $RPM_BUILD_ROOT/%{_bindir}/sheet2pcp $RPM_BUILD_ROOT/%{_mandir}/man1/sheet
 rm -f $RPM_BUILD_ROOT/%{_includedir}/pcp/configsz.h
 rm -f $RPM_BUILD_ROOT/%{_includedir}/pcp/platformsz.h
 
-%if %{disable_microhttpd}
-rm -fr $RPM_BUILD_ROOT/%{_confdir}/pmwebd
-rm -fr $RPM_BUILD_ROOT/%{_initddir}/pmwebd
-rm -fr $RPM_BUILD_ROOT/%{_unitdir}/pmwebd.service
-rm -f $RPM_BUILD_ROOT/%{_libexecdir}/pcp/bin/pmwebd
-%endif
-%if !%{disable_webapps}
-for app in vector grafana graphite blinkenlights; do
-    pwd
-    webapp=`find ../$app -mindepth 1 -maxdepth 1`
-    mv $webapp $RPM_BUILD_ROOT/%{_datadir}/pcp/webapps/$app
-done
-%endif
-
 %if %{disable_infiniband}
 # remove pmdainfiniband on platforms lacking IB devel packages.
 rm -f $RPM_BUILD_ROOT/%{_pmdasdir}/ib
@@ -2158,8 +2129,17 @@ rm -rf $RPM_BUILD_ROOT/usr/share/doc/pcp-gui
 desktop-file-validate $RPM_BUILD_ROOT/%{_datadir}/applications/pmchart.desktop
 %endif
 
-# default chkconfig off for Fedora and RHEL
-for f in $RPM_BUILD_ROOT/%{_initddir}/{pcp,pmcd,pmlogger,pmie,pmwebd,pmmgr,pmproxy}; do
+%if %{disable_xlsx}
+rm -f $RPM_BUILD_ROOT/%{_bashcompdir}/pcp2xlsx
+%endif
+
+%if 0%{?rhel} || 0%{?fedora}
+# Fedora and RHEL default local only access for pmcd and pmlogger
+sed -i -e '/^# .*_LOCAL=1/s/^# //' $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig/{pmcd,pmlogger}
+%endif
+
+# default chkconfig off (all RPM platforms)
+for f in $RPM_BUILD_ROOT/%{_initddir}/{pcp,pmcd,pmlogger,pmie,pmmgr,pmproxy}; do
 	test -f "$f" || continue
 	sed -i -e '/^# chkconfig/s/:.*$/: - 95 05/' -e '/^# Default-Start:/s/:.*$/:/' $f
 done
@@ -2191,6 +2171,7 @@ ls -1 $RPM_BUILD_ROOT/%{_pmdasdir} |\
   grep -E -v '^nginx' |\
   grep -E -v '^nutcracker' |\
   grep -E -v '^oracle' |\
+  grep -E -v '^openmetrics' |\
   grep -E -v '^pdns' |\
   grep -E -v '^podman' |\
   grep -E -v '^postfix' |\
@@ -2200,6 +2181,7 @@ ls -1 $RPM_BUILD_ROOT/%{_pmdasdir} |\
   grep -E -v '^samba' |\
   grep -E -v '^slurm' |\
   grep -E -v '^snmp' |\
+  grep -E -v '^statsd' |\
   grep -E -v '^vmware' |\
   grep -E -v '^zimbra' |\
   grep -E -v '^dm' |\
@@ -2213,6 +2195,8 @@ ls -1 $RPM_BUILD_ROOT/%{_pmdasdir} |\
   grep -E -v '^logger' |\
   grep -E -v '^mailq' |\
   grep -E -v '^mounts' |\
+  grep -E -v '^mssql' |\
+  grep -E -v '^netcheck' |\
   grep -E -v '^nvidia' |\
   grep -E -v '^roomtemp' |\
   grep -E -v '^sendmail' |\
@@ -2225,6 +2209,7 @@ ls -1 $RPM_BUILD_ROOT/%{_pmdasdir} |\
   grep -E -v '^json' |\
   grep -E -v '^mic' |\
   grep -E -v '^bcc' |\
+  grep -E -v '^bpftrace' |\
   grep -E -v '^gluster' |\
   grep -E -v '^zswap' |\
   grep -E -v '^unbound' |\
@@ -2233,19 +2218,23 @@ ls -1 $RPM_BUILD_ROOT/%{_pmdasdir} |\
 
 # all base pcp package files except those split out into sub-packages
 ls -1 $RPM_BUILD_ROOT/%{_bindir} |\
-  grep -E -v 'pmiostat|pmcollectl|zabbix|zbxpcp|dstat' |\
-  grep -E -v 'pmrep|pcp2graphite|pcp2influxdb|pcp2zabbix' |\
+  grep -E -v 'pmiostat|zabbix|zbxpcp|dstat|pmrep' |\
+  grep -E -v 'pcp2spark|pcp2graphite|pcp2influxdb|pcp2zabbix' |\
   grep -E -v 'pcp2elasticsearch|pcp2json|pcp2xlsx|pcp2xml' |\
-  grep -E -v 'pcp2spark' |\
   grep -E -v 'pmdbg|pmclient|pmerr|genpmda' |\
 sed -e 's#^#'%{_bindir}'\/#' >base_bin.list
+ls -1 $RPM_BUILD_ROOT/%{_bashcompdir} |\
+  grep -E -v 'pcp2spark|pcp2graphite|pcp2influxdb|pcp2zabbix' |\
+  grep -E -v 'pcp2elasticsearch|pcp2json|pcp2xlsx|pcp2xml' |\
+  grep -E -v 'pmrep|pmdumptext' |\
+sed -e 's#^#'%{_bashcompdir}'\/#' >base_bashcomp.list
 
 # Separate the pcp-system-tools package files.
-# pmcollectl and pmiostat are back-compat symlinks to their
-# pcp(1) sub-command variants so are also in pcp-system-tools.
+# pmiostat is a back-compat symlink to its pcp(1) sub-command variant
+# so its also in pcp-system-tools.
 %if !%{disable_python2} || !%{disable_python3}
 ls -1 $RPM_BUILD_ROOT/%{_bindir} |\
-  egrep -e 'pmiostat|pmcollectl|pmrep|dstat' |\
+  egrep -e 'pmiostat|pmrep|dstat' |\
   sed -e 's#^#'%{_bindir}'\/#' >pcp-system-tools.list
 ls -1 $RPM_BUILD_ROOT/%{_libexecdir}/pcp/bin |\
   egrep -e 'atop|collectl|dmcache|dstat|free|iostat|ipcs|lvmcache|mpstat' \
@@ -2263,9 +2252,10 @@ ls -1 $RPM_BUILD_ROOT/%{_libexecdir}/pcp/bin |\
 
 ls -1 $RPM_BUILD_ROOT/%{_libexecdir}/pcp/bin |\
 %if !%{disable_python2} || !%{disable_python3}
-  grep -E -v 'atop|collectl|dmcache|dstat|free|iostat|mpstat|numastat' |\
-  grep -E -v 'shping|tapestat|uptime|verify|selinux-setup' |\
+  grep -E -v 'atop|collectl|dmcache|dstat|free|iostat|ipcs|lvmcache|mpstat' |\
+  grep -E -v 'numastat|shping|tapestat|uptime|verify|selinux-setup' |\
 %endif
+  grep -E -v 'pmlogger_daily_report' |\
   sed -e 's#^#'%{_libexecdir}/pcp/bin'\/#' >base_exec.list
 ls -1 $RPM_BUILD_ROOT/%{_booksdir} |\
   sed -e 's#^#'%{_booksdir}'\/#' > pcp-doc.list
@@ -2280,14 +2270,18 @@ ls -1 $RPM_BUILD_ROOT/%{_pixmapdir} |\
   sed -e 's#^#'%{_pixmapdir}'\/#' > pcp-gui.list
 ls -1 $RPM_BUILD_ROOT/%{_hicolordir} |\
   sed -e 's#^#'%{_hicolordir}'\/#' >> pcp-gui.list
-cat base_bin.list base_exec.list |\
+cat base_bin.list base_exec.list base_bashcomp.list |\
   grep -E "$PCP_GUI" >> pcp-gui.list
 %endif
 ls -1 $RPM_BUILD_ROOT/%{_logconfdir}/ |\
     sed -e 's#^#'%{_logconfdir}'\/#' |\
     grep -E -v 'zeroconf' >pcp-logconf.list
-cat base_pmdas.list base_bin.list base_exec.list pcp-logconf.list |\
-  grep -E -v 'pmdaib|pmmgr|pmweb|pmsnap|2pcp|pmdas/systemd' |\
+ls -1 $RPM_BUILD_ROOT/%{_ieconfdir}/ |\
+    sed -e 's#^#'%{_ieconfdir}'\/#' |\
+    grep -E -v 'zeroconf' >pcp-ieconf.list
+cat base_pmdas.list base_bin.list base_exec.list base_bashcomp.list \
+    pcp-logconf.list pcp-ieconf.list |\
+  grep -E -v 'pmdaib|pmmgr|pmsnap|2pcp|pmdas/systemd|zeroconf' |\
   grep -E -v "$PCP_GUI|pixmaps|hicolor|pcp-doc|tutorials|selinux" |\
   grep -E -v %{_confdir} | grep -E -v %{_logsdir} > base.list
 
@@ -2329,72 +2323,8 @@ exit 0
 getent group pcp >/dev/null || groupadd -r pcp
 getent passwd pcp >/dev/null || \
   useradd -c "Performance Co-Pilot" -g pcp -d %{_localstatedir}/lib/pcp -M -r -s /sbin/nologin pcp
-PCP_CONFIG_DIR=%{_localstatedir}/lib/pcp/config
-PCP_SYSCONF_DIR=%{_confdir}
-PCP_LOG_DIR=%{_logsdir}
-PCP_ETC_DIR=%{_sysconfdir}
-# rename crontab files to align with current Fedora packaging guidelines
-for crontab in pmlogger pmie
-do
-    test -f "$PCP_ETC_DIR/cron.d/$crontab" || continue
-    mv -f "$PCP_ETC_DIR/cron.d/$crontab" "$PCP_ETC_DIR/cron.d/pcp-$crontab"
-done
-# produce a script to run post-install to move configs to their new homes
-save_configs_script()
-{
-    _new="$1"
-    shift
-    for _dir
-    do
-        [ "$_dir" = "$_new" ] && continue
-        if [ -d "$_dir" ]
-        then
-            ( cd "$_dir" ; find . -maxdepth 1 -type f ) | sed -e 's/^\.\///' \
-            | while read _file
-            do
-                [ "$_file" = "control" ] && continue
-                _want=true
-                if [ -f "$_new/$_file" ]
-                then
-                    # file exists in both directories, pick the more
-                    # recently modified one
-                    _try=`find "$_dir/$_file" -newer "$_new/$_file" -print`
-                    [ -n "$_try" ] || _want=false
-                fi
-                $_want && echo cp -p "$_dir/$_file" "$_new/$_file"
-            done
-        fi
-    done
-}
-# migrate and clean configs if we have had a previous in-use installation
-[ -d "$PCP_LOG_DIR" ] || exit 0	# no configuration file upgrades required
-rm -f "$PCP_LOG_DIR/configs.sh"
-for daemon in pmie pmlogger
-do
-    save_configs_script >> "$PCP_LOG_DIR/configs.sh" "$PCP_CONFIG_DIR/$daemon" \
-        "$PCP_SYSCONF_DIR/$daemon"
-done
-for daemon in pmcd pmproxy
-do
-    save_configs_script >> "$PCP_LOG_DIR/configs.sh" "$PCP_SYSCONF_DIR/$daemon"\
-        "$PCP_CONFIG_DIR/$daemon" /etc/$daemon
-done
 exit 0
 
-%if !%{disable_microhttpd}
-%preun webapi
-if [ "$1" -eq 0 ]
-then
-%if !%{disable_systemd}
-    systemctl --no-reload disable pmwebd.service >/dev/null 2>&1
-    systemctl stop pmwebd.service >/dev/null 2>&1
-%else
-    /sbin/service pmwebd stop >/dev/null 2>&1
-    /sbin/chkconfig --del pmwebd >/dev/null 2>&1
-%endif
-fi
-%endif
-
 %preun manager
 if [ "$1" -eq 0 ]
 then
@@ -2410,32 +2340,37 @@ fi
 %if !%{disable_rpm}
 %preun pmda-rpm
 %{pmda_remove "$1" "rpm"}
-%endif #preun pmda-rpm
+%endif
 
 %if !%{disable_systemd}
 %preun pmda-systemd
 %{pmda_remove "$1" "systemd"}
-%endif #preun pmda-systemd
+%endif
 
 %if !%{disable_infiniband}
 %preun pmda-infiniband
 %{pmda_remove "$1" "infiniband"}
-%endif #preun pmda-infiniband
+%endif
 
 %if !%{disable_perfevent}
 %preun pmda-perfevent
 %{pmda_remove "$1" "perfevent"}
-%endif #preun pmda-perfevent
+%endif
 
 %if !%{disable_podman}
 %preun pmda-podman
 %{pmda_remove "$1" "podman"}
-%endif #preun pmda-podman
+%endif
+
+%if !%{disable_statsd}
+%preun pmda-statsd
+%{pmda_remove "$1" "statsd"}
+%endif
 
 %if !%{disable_json}
 %preun pmda-json
 %{pmda_remove "$1" "json"}
-%endif #preun pmda-json
+%endif
 
 %preun pmda-nginx
 %{pmda_remove "$1" "nginx"}
@@ -2490,8 +2425,8 @@ fi
 %preun pmda-lio
 %{pmda_remove "$1" "lio"}
 
-%preun pmda-prometheus
-%{pmda_remove "$1" "prometheus"}
+%preun pmda-openmetrics
+%{pmda_remove "$1" "openmetrics"}
 
 %preun pmda-lustre
 %{pmda_remove "$1" "lustre"}
@@ -2545,6 +2480,11 @@ fi
 %{pmda_remove "$1" "bcc"}
 %endif
 
+%if !%{disable_bpftrace}
+%preun pmda-bpftrace
+%{pmda_remove "$1" "bpftrace"}
+%endif
+
 %if !%{disable_python2} || !%{disable_python3}
 %preun pmda-gluster
 %{pmda_remove "$1" "gluster"}
@@ -2567,7 +2507,13 @@ fi
 %preun pmda-lmsensors
 %{pmda_remove "$1" "lmsensors"}
 
-%endif # !%{disable_python[2,3]}
+%preun pmda-mssql
+%{pmda_remove "$1" "mssql"}
+
+%preun pmda-netcheck
+%{pmda_remove "$1" "netcheck"}
+
+%endif
 
 %preun pmda-apache
 %{pmda_remove "$1" "apache"}
@@ -2658,17 +2604,6 @@ then
     rm -f "$PCP_PMNS_DIR/.NeedRebuild" >/dev/null 2>&1
 fi
 
-%if !%{disable_microhttpd}
-%post webapi
-chown -R pcp:pcp %{_logsdir}/pmwebd 2>/dev/null
-%if !%{disable_systemd}
-    systemctl condrestart pmwebd.service >/dev/null 2>&1
-%else
-    /sbin/chkconfig --add pmwebd >/dev/null 2>&1
-    /sbin/service pmwebd condrestart
-%endif
-%endif
-
 %post manager
 chown -R pcp:pcp %{_logsdir}/pmmgr 2>/dev/null
 %if !%{disable_systemd}
@@ -2700,8 +2635,6 @@ pmieconf -c enable dmthin
     systemctl restart pmie >/dev/null 2>&1
     systemctl enable pmcd >/dev/null 2>&1
     systemctl enable pmlogger >/dev/null 2>&1
-    systemctl enable pmlogger_daily_report >/dev/null 2>&1
-    systemctl enable pmlogger_daily_report-poll >/dev/null 2>&1
     systemctl enable pmie >/dev/null 2>&1
 %else
     /sbin/chkconfig --add pmcd >/dev/null 2>&1
@@ -2711,7 +2644,7 @@ pmieconf -c enable dmthin
     /sbin/service pmlogger condrestart
     /sbin/service pmie condrestart
 %endif
-%endif #zeroconf
+%endif
 
 %if !%{disable_selinux}
 %post selinux
@@ -2725,12 +2658,7 @@ pmieconf -c enable dmthin
 %endif
 
 %post
-PCP_LOG_DIR=%{_logsdir}
 PCP_PMNS_DIR=%{_pmnsdir}
-# restore saved configs, if any
-test -s "$PCP_LOG_DIR/configs.sh" && source "$PCP_LOG_DIR/configs.sh"
-rm -f $PCP_LOG_DIR/configs.sh
-
 chown -R pcp:pcp %{_logsdir}/pmcd 2>/dev/null
 chown -R pcp:pcp %{_logsdir}/pmlogger 2>/dev/null
 chown -R pcp:pcp %{_logsdir}/sa 2>/dev/null
@@ -2757,7 +2685,7 @@ chmod 644 "$PCP_PMNS_DIR/.NeedRebuild"
     /sbin/service pmproxy condrestart
 %endif
 
-cd $PCP_PMNS_DIR && ./Rebuild -s && rm -f .NeedRebuild
+cd "$PCP_PMNS_DIR" && ./Rebuild -s && rm -f .NeedRebuild
 cd
 
 %if 0%{?fedora} >= 26 || 0%{?rhel} > 7
@@ -2789,11 +2717,17 @@ cd
 %dir %{_confdir}
 %dir %{_pmdasdir}
 %dir %{_datadir}/pcp
+%dir %{_libexecdir}/pcp
+%dir %{_libexecdir}/pcp/bin
 %dir %{_localstatedir}/lib/pcp
 %dir %{_localstatedir}/lib/pcp/config
 %dir %attr(0775,pcp,pcp) %{_tempsdir}
+%dir %attr(0775,pcp,pcp) %{_tempsdir}/bash
+%dir %attr(0775,pcp,pcp) %{_tempsdir}/json
+%dir %attr(0775,pcp,pcp) %{_tempsdir}/mmv
 %dir %attr(0775,pcp,pcp) %{_tempsdir}/pmie
 %dir %attr(0775,pcp,pcp) %{_tempsdir}/pmlogger
+%dir %attr(0775,pcp,pcp) %{_tempsdir}/pmproxy
 %dir %attr(0700,root,root) %{_tempsdir}/pmcd
 
 %dir %{_datadir}/pcp/lib
@@ -2845,6 +2779,7 @@ cd
 %config(noreplace) %{_sysconfdir}/sysconfig/pmproxy
 %config(noreplace) %{_sysconfdir}/sysconfig/pmcd
 %config %{_sysconfdir}/pcp.env
+%dir %{_confdir}/pipe.conf.d
 %dir %{_confdir}/labels
 %dir %{_confdir}/pmcd
 %config(noreplace) %{_confdir}/pmcd/pmcd.conf
@@ -2879,11 +2814,9 @@ cd
 %{_localstatedir}/lib/pcp/config/pmlogrewrite
 %dir %attr(0775,pcp,pcp) %{_localstatedir}/lib/pcp/config/pmda
 
-%{_datadir}/bash-completion/completions/*
 %{_datadir}/zsh/site-functions/_pcp
-
 %if !%{disable_sdt}
-%{tapsetdir}/pmcd.stp
+%{_tapsetdir}/pmcd.stp
 %endif
 
 %files zeroconf
@@ -2897,7 +2830,8 @@ cd
 %else
 %config(noreplace) %{_sysconfdir}/cron.d/pcp-pmlogger-daily-report
 %endif
-%{_localstatedir}/lib/pcp/config/pmlogconf/zeroconf
+%{_ieconfdir}/zeroconf
+%{_logconfdir}/zeroconf
 
 #additional pmlogger config files
 
@@ -2945,51 +2879,6 @@ cd
 %defattr(-,pcpqa,pcpqa)
 %{_testsdir}
 
-%if !%{disable_microhttpd}
-%files webapi
-%{_initddir}/pmwebd
-%if !%{disable_systemd}
-%{_unitdir}/pmwebd.service
-%endif
-%{_libexecdir}/pcp/bin/pmwebd
-%attr(0775,pcp,pcp) %{_logsdir}/pmwebd
-%{_confdir}/pmwebd
-%config(noreplace) %{_confdir}/pmwebd/pmwebd.options
-# duplicate pcp, pcp-webapi and pcp-webjs directories, but rpm copes with that.
-%dir %{_datadir}/pcp
-%dir %{_datadir}/pcp/webapps
-%endif
-
-%if !%{disable_webapps}
-%files webjs
-# duplicate pcp, pcp-webapi and pcp-webjs directories, but rpm copes with that.
-%dir %{_datadir}/pcp
-%dir %{_datadir}/pcp/webapps
-%{_datadir}/pcp/webapps/*.png
-%{_datadir}/pcp/webapps/*.ico
-%{_datadir}/pcp/webapps/*.html
-
-%files webapp-blinkenlights
-%dir %{_datadir}/pcp
-%dir %{_datadir}/pcp/webapps
-%{_datadir}/pcp/webapps/blinkenlights
-
-%files webapp-grafana
-%dir %{_datadir}/pcp
-%dir %{_datadir}/pcp/webapps
-%{_datadir}/pcp/webapps/grafana
-
-%files webapp-graphite
-%dir %{_datadir}/pcp
-%dir %{_datadir}/pcp/webapps
-%{_datadir}/pcp/webapps/graphite
-
-%files webapp-vector
-%dir %{_datadir}/pcp
-%dir %{_datadir}/pcp/webapps
-%{_datadir}/pcp/webapps/vector
-%endif
-
 %files manager
 %{_initddir}/pmmgr
 %if !%{disable_systemd}
@@ -3020,6 +2909,12 @@ cd
 %{_pmdasdir}/podman
 %endif
 
+%if !%{disable_statsd}
+%files pmda-statsd
+%{_pmdasdir}/statsd
+%config(noreplace) %{_pmdasdir}/statsd/pmdastatsd.ini
+%endif
+
 %if !%{disable_perfevent}
 %files pmda-perfevent
 %{_pmdasdir}/perfevent
@@ -3065,8 +2960,8 @@ cd
 %files pmda-lio
 %{_pmdasdir}/lio
 
-%files pmda-prometheus
-%{_pmdasdir}/prometheus
+%files pmda-openmetrics
+%{_pmdasdir}/openmetrics
 
 %files pmda-lustre
 %{_pmdasdir}/lustre
@@ -3138,12 +3033,18 @@ cd
 
 %files pmda-dm
 %{_pmdasdir}/dm
+%{_ieconfdir}/dm
 
 %if !%{disable_bcc}
 %files pmda-bcc
 %{_pmdasdir}/bcc
 %endif
 
+%if !%{disable_bpftrace}
+%files pmda-bpftrace
+%{_pmdasdir}/bpftrace
+%endif
+
 %if !%{disable_python2} || !%{disable_python3}
 %files pmda-gluster
 %{_pmdasdir}/gluster
@@ -3165,34 +3066,48 @@ cd
 
 %files export-pcp2elasticsearch
 %{_bindir}/pcp2elasticsearch
+%{_bashcompdir}/pcp2elasticsearch
 
 %files export-pcp2graphite
 %{_bindir}/pcp2graphite
+%{_bashcompdir}/pcp2graphite
 
 %files export-pcp2influxdb
 %{_bindir}/pcp2influxdb
+%{_bashcompdir}/pcp2influxdb
 
 %files export-pcp2json
 %{_bindir}/pcp2json
+%{_bashcompdir}/pcp2json
 
 %files export-pcp2spark
 %{_bindir}/pcp2spark
+%{_bashcompdir}/pcp2spark
 
 %if !%{disable_xlsx}
 %files export-pcp2xlsx
 %{_bindir}/pcp2xlsx
+%{_bashcompdir}/pcp2xlsx
 %endif
 
 %files export-pcp2xml
 %{_bindir}/pcp2xml
+%{_bashcompdir}/pcp2xml
 
 %files export-pcp2zabbix
 %{_bindir}/pcp2zabbix
+%{_bashcompdir}/pcp2zabbix
 
 %files pmda-lmsensors
 %{_pmdasdir}/lmsensors
 
-%endif # !%{disable_python2} || !%{disable_python3}
+%files pmda-mssql
+%{_pmdasdir}/mssql
+
+%files pmda-netcheck
+%{_pmdasdir}/netcheck
+
+%endif
 
 %files export-zabbix-agent
 %{_libdir}/zabbix
@@ -3286,12 +3201,14 @@ cd
 %{_localstatedir}/lib/pcp/config/pmchart
 %{_localstatedir}/lib/pcp/config/pmafm/pcp-gui
 %{_datadir}/applications/pmchart.desktop
+%{_bashcompdir}/pmdumptext
 %endif
 
 %files doc -f pcp-doc.list
 
 %if !%{disable_selinux}
 %files selinux -f pcp-selinux.list
+%dir %{_selinuxdir}
 %endif
 
 %if !%{disable_python2} || !%{disable_python3}
@@ -3300,9 +3217,27 @@ cd
 %dir %{_confdir}/pmrep
 %config(noreplace) %{_confdir}/dstat/*
 %config(noreplace) %{_confdir}/pmrep/*
+%{_bashcompdir}/pmrep
 %endif
 
 %changelog
+* Thu Dec 12 2019 Nathan Scott <nathans@redhat.com> - 5.0.2-2
+- Reenable infiniband PMDA in the rpm spec, deps fixed.
+
+* Wed Dec 11 2019 Nathan Scott <nathans@redhat.com> - 5.0.2-1
+- Update to latest PCP v5 sources via rebase (BZ 1723598)
+- Resolve selinux policy issue with bcc PMDA (BZ 1709237)
+- Resolve selinux policy issue with unbound PMDA (BZ 1778813)
+- Updates to perfevent PMDA for hv_24x7 events (BZ 1765434, 1779507)
+- Fix perl packaging dependency for postfix PMDA (BZ 1773459)
+- Fix pcp-dstat handling of large numbers of disks (BZ 1779419)
+- Fix pmie exit status on receipt of TERM signal (BZ 1780003)
+- Fix pmlogger timeout handling on fresh install (BZ 1780073)
+
+* Mon Nov 11 2019 Nathan Scott <nathans@redhat.com> - 5.0.1-1
+- Update to latest PCP v5 sources via rebase (BZ 1723598)
+- Resolve selinux policy installation issues (BZ 1730206)
+
 * Mon May 06 2019 Nathan Scott <nathans@redhat.com> - 4.3.2-2
 - Update metrics for device mapper VDO driver (BZ 1670548)
 - Update to a more recent PCP bug fix release (BZ 1685302)