Summary: System-level performance monitoring and performance management
Name: @package_name@
Version: @package_version@
Release: @package_release@@package_sgirelease@
License: GPLv2+ and LGPLv2+ and CC-BY
URL: https://pcp.io
Source: @package_name@-@package_version@.src.tar.gz
BuildRoot: @build_root@
Distribution: @package_distribution@
BuildRequires: procps bison flex
BuildRequires: ncurses-devel
BuildRequires: readline-devel
%if 0%{?rhel} > 7
%global __requires_exclude ^perl-LDAP$
%endif
%if 0%{?fedora} >= 26 || 0%{?rhel} > 7
%global __python2 python2
%else
%global __python2 python
%endif
%if 0%{?sles_version} == 11
# rpmbuild is in the rpm (not rpm-build) package for SLES11
%else
BuildRequires: rpm-build
%endif
%if "@enable_avahi@" == "true"
BuildRequires: avahi-devel
%endif
%if "@enable_lzma@" == "true"
BuildRequires: xz-devel
%endif
%if "@enable_secure@" == "true"
%if "%{_vendor}" == "suse"
BuildRequires: mozilla-nss-devel
%else
BuildRequires: nss-devel
%endif
%if "%{_vendor}" == "mandriva"
BuildRequires: %{_lib}sasl-devel
%else
BuildRequires: cyrus-sasl-devel
%endif
%endif
%if "@enable_probes@" == "true"
BuildRequires: systemtap-sdt-devel
%endif
%if "@enable_qt@" == "true" || "@enable_manager@" == "true"
BuildRequires: gcc-c++
%endif
%if "@enable_qt@" == "true"
%if "%{_vendor}" == "suse"
BuildRequires: qt-devel >= 4.4
%else
%if @qt_version@ >= 5
BuildRequires: qt5-qtbase-devel
BuildRequires: qt5-qtsvg-devel
%else
BuildRequires: qt4-devel >= 4.4
%endif
%endif
%endif
%if "%{_vendor}" == "redhat"
BuildRequires: man hostname
%if "@enable_systemd@" == "false"
BuildRequires: initscripts
%endif
%endif
%if "@pmda_rpm@" == "true"
BuildRequires: rpm-devel
%endif
%if "@pmda_podman@" == "true"
BuildRequires: libvarlink-devel
%endif
%if "@pmda_statsd@" == "true"
BuildRequires: ragel chan-devel HdrHistogram_c-devel
%endif
%if "@pmda_perfevent@" == "true"
BuildRequires: libpfm-devel >= 4.4
%endif
%if "@pmda_systemd@" == "true"
BuildRequires: systemd-devel
%endif

# prevent conflicting SGI package installation
Conflicts: pcp-pro < 2.2

# prevent conflicting binary and man page install for pcp(1)
Conflicts: librapi < 0.16

# KVM PMDA moved into pcp (no longer using Perl, default on)
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

# Utilities used indirectly e.g. by scripts we install
Requires: bash xz gawk sed grep coreutils findutils
%if "%{_vendor}" == "redhat"
Requires: hostname
%endif
# which(1) comes from different places
%if 0%{?suse_version} >= 1100
Requires: util-linux
%else
Requires: which
%endif
%if "%{_vendor}" == "suse"
Requires: sysconfig util-linux
%global _rcdir /etc/init.d
%else
%if "@enable_systemd@" == "false"
Requires: initscripts
%endif
%global _rcdir /etc/rc.d/init.d
%endif
%if "@enable_systemd@" == "true"
%global _configure_rcdir %{nil}
%else
%global _configure_rcdir --with-rcdir=%{_rcdir}
%endif
%global _tmpdir %{_localstatedir}/lib/pcp/tmp

%if 0%{?fedora} >= 24 || 0%{?rhel} > 7
%global perl_interpreter perl-interpreter
%else
%global perl_interpreter perl
%endif

# There is a problem here ... some distros are resisting adding more
# repackaged perl-Foo-Bar rpms, but the default find-requires script
# will turn all perl module we use into rpm package Requires clauses.
#
# The fix is to over-ride the default find-requires script and strip
# out the dodgey perl modules that don't have official rpms, based
# on the distro ... see the filter-requires script in this directory
#
# Recipe is a refinement of the one described at
# http://fedoraproject.org/wiki/PackagingDrafts/FilteringAutomaticDependencies#Disabling_dependency_auto-generation
#
# override the default automatic requires/provides generation
%define _use_internal_dependency_generator 0
# remember the real find-requires path (%%global avoids recursive %%define)
# macros below
%global __find_requires_save %{__find_requires}
# slip our filter into place
%define __find_requires %{_builddir}/%{?buildsubdir}/build/rpm/filter-requires -v %{_vendor} -f 0%{?fedora} -r 0%{?rhel} %{__find_requires_save}

%global pmda_remove() %{expand:
if [ %1 -eq 0 ]
then
    PCP_PMDAS_DIR=@pcp_pmdas_dir@
    PCP_PMCDCONF_PATH=@pcp_pmcdconf_path@
    if [ -f "$PCP_PMCDCONF_PATH" -a -f "$PCP_PMDAS_DIR/%2/domain.h" ]
    then
	(cd "$PCP_PMDAS_DIR/%2/" && ./Remove >/dev/null 2>&1)
    fi
fi
}

%global selinux_handle_policy() %{expand:
SELINUX_DIR=@pcp_var_dir@/selinux
PCP_BINADM_DIR=@pcp_binadm_dir@
if [ %1 -ge 1 ]
then
    $PCP_BINADM_DIR/selinux-setup $SELINUX_DIR install %2
elif [ %1 -eq 0 ]
then
    $PCP_BINADM_DIR/selinux-setup $SELINUX_DIR remove %2
fi
}

%if "@enable_selinux@" == "true"
Requires: pcp-selinux = @package_version@
%endif

Requires: pcp-libs = @package_version@

# 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 < 4.1.1
%endif

Obsoletes: pcp-compat < 4.2.0
Obsoletes: pcp-monitor < 4.2.0
Obsoletes: pcp-collector < 4.2.0

%description
Performance Co-Pilot (PCP) provides a framework and services to support
system-level performance monitoring and performance management.

The PCP open source release provides a unifying abstraction for all of
the interesting performance data in a system, and allows client
applications to easily retrieve and process any subset of that data.

#
# pcp-conf
#
%package conf
License: LGPLv2+
Summary: Performance Co-Pilot run-time configuration
URL: https://pcp.io

# http://fedoraproject.org/wiki/Packaging:Conflicts "Splitting Packages"
Conflicts: pcp-libs < 3.9

%description conf
Performance Co-Pilot (PCP) run-time configuration

#
# pcp-libs
#
%package libs
License: LGPLv2+
Summary: Performance Co-Pilot run-time libraries
URL: https://pcp.io
Requires: pcp-conf = @package_version@
Obsoletes: pcp < 3.0

%description libs
Performance Co-Pilot (PCP) run-time libraries

#
# pcp-libs-devel
#
%package libs-devel
License: GPLv2+ and LGPLv2+
Summary: Performance Co-Pilot (PCP) development headers
URL: https://pcp.io

%description libs-devel
Performance Co-Pilot (PCP) headers for development.

#
# pcp-devel
#
%package devel
License: GPLv2+ and LGPLv2+
Summary: Performance Co-Pilot (PCP) development tools and documentation
URL: https://pcp.io
Requires: pcp = @package_version@
Requires: pcp-libs = @package_version@
Requires: pcp-libs-devel = @package_version@

%description devel
Performance Co-Pilot (PCP) documentation and tools for development.

#
# pcp-testsuite
#
%package testsuite
License: GPLv2+
Summary: Performance Co-Pilot (PCP) test suite
URL: https://pcp.io
Requires: pcp = @package_version@
Requires: pcp-libs = @package_version@
Requires: pcp-libs-devel = @package_version@
Requires: pcp-devel = @package_version@
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
%if "@have_perl@" == "true"
Requires: pcp-pmda-bonding pcp-pmda-dbping pcp-pmda-ds389 pcp-pmda-ds389log
Requires: pcp-pmda-gpfs pcp-pmda-gpsd pcp-pmda-lustre pcp-pmda-pdns
Requires: pcp-pmda-memcache pcp-pmda-named pcp-pmda-netfilter pcp-pmda-news
Requires: pcp-pmda-samba pcp-pmda-slurm pcp-pmda-vmware pcp-pmda-zimbra
%endif
Requires: pcp-pmda-apache pcp-pmda-bash pcp-pmda-cisco pcp-pmda-dm pcp-pmda-gfs2
Requires: pcp-pmda-logger pcp-pmda-mailq pcp-pmda-mounts
Requires: pcp-pmda-nvidia-gpu pcp-pmda-roomtemp pcp-pmda-sendmail pcp-pmda-shping
Requires: pcp-pmda-lustrecomm pcp-pmda-redis pcp-pmda-docker pcp-pmda-smart
%if "@have_python@" == "true"
Requires: pcp-pmda-gluster pcp-pmda-zswap pcp-pmda-unbound pcp-pmda-mic
Requires: pcp-pmda-haproxy pcp-pmda-nfsclient pcp-pmda-lmsensors pcp-pmda-mssql
Requires: pcp-pmda-netcheck
%endif
%if "@pmda_podman@" == "true"
Requires: pcp-pmda-podman
%endif
%if "@pmda_statsd@" == "true"
Requires: pcp-pmda-statsd
%endif
%if "@pmda_bcc@" == "true"
Requires: pcp-pmda-bcc
%endif
%if "@pmda_bpftrace@" == "true"
Requires: pcp-pmda-bpftrace
%endif
%if "@pmda_json@" == "true"
Requires: pcp-pmda-json
%endif
%if "@pmda_libvirt@" == "true"
Requires: pcp-pmda-libvirt
%endif
%if "@pmda_lio@" == "true"
Requires: pcp-pmda-lio
%endif
%if "@pmda_openmetrics@" == "true"
Requires: pcp-pmda-openmetrics
%endif
%if "@pmda_rpm@" == "true"
Requires: pcp-pmda-rpm
%endif
%if "@pmda_snmp@" == "true"
Requires: pcp-pmda-snmp
%endif
%if "@pmda_mysql@" == "true"
Requires: pcp-pmda-mysql
%endif
%if "@pmda_oracle@" == "true"
Requires: pcp-pmda-oracle
%endif
%if "@pmda_postgresql@" == "true"
Requires: pcp-pmda-postgresql
%endif
%if "@pmda_nginx@" == "true"
Requires: pcp-pmda-nginx
%endif
%if "@pmda_activemq@" == "true"
Requires: pcp-pmda-activemq
%endif
%if "@pmda_bind2@" == "true"
Requires: pcp-pmda-bind2
%endif
%if "@pmda_nutcracker@" == "true"
Requires: pcp-pmda-nutcracker
%endif
%if "@pmda_elasticsearch@" == "true"
Requires: pcp-pmda-elasticsearch
%endif
%if "@pmda_postfix@" == "true"
Requires: pcp-pmda-postfix
%endif
%if "@have_python@" == "true"
Requires: pcp-system-tools
%endif
%if "@enable_qt@" == "true"
Requires: pcp-gui
%endif
Requires: gcc bc bzip2 gzip

%description testsuite
Quality assurance test suite for Performance Co-Pilot (PCP).
# end testsuite

%if "@enable_manager@" == "true"
#
# pcp-manager
#
%package manager
License: GPLv2+
Summary: Performance Co-Pilot (PCP) manager daemon
URL: https://pcp.io
Requires: pcp = @package_version@ pcp-libs = @package_version@

%description manager
An optional daemon (pmmgr) that manages a collection of pmlogger and
pmie daemons, for a set of discovered local and remote hosts running
the performance metrics collection daemon (pmcd).  It ensures these
daemons are running when appropriate, and manages their log rotation
needs.  It is an alternative to the cron-based pmlogger/pmie service
scripts.
%endif

%if "@have_perl@" == "true"
#
# perl-PCP-PMDA. This is the PCP agent perl binding.
#
%package -n perl-PCP-PMDA
License: GPLv2+
Summary: Performance Co-Pilot (PCP) Perl bindings and documentation
URL: https://pcp.io
BuildRequires: perl(ExtUtils::MakeMaker)
Requires: pcp-libs = @package_version@
Requires: %{perl_interpreter}

%description -n perl-PCP-PMDA
The PCP::PMDA Perl module contains the language bindings for
building Performance Metric Domain Agents (PMDAs) using Perl.
Each PMDA exports performance data for one specific domain, for
example the operating system kernel, Cisco routers, a database,
an application, etc.

#
# perl-PCP-MMV
#
%package -n perl-PCP-MMV
License: GPLv2+
Summary: Performance Co-Pilot (PCP) Perl bindings for PCP Memory Mapped Values
URL: https://pcp.io
Requires: pcp = @package_version@
Requires: %{perl_interpreter}

%description -n perl-PCP-MMV
The PCP::MMV module contains the Perl language bindings for
building scripts instrumented with the Performance Co-Pilot
(PCP) Memory Mapped Value (MMV) mechanism.
This mechanism allows arbitrary values to be exported from an
instrumented script into the PCP infrastructure for monitoring
and analysis with pmchart, pmie, pmlogger and other PCP tools.

#
# perl-PCP-LogImport
#
%package -n perl-PCP-LogImport
License: GPLv2+
Summary: Performance Co-Pilot (PCP) Perl bindings for importing external data into PCP archives
URL: https://pcp.io
Requires: pcp = @package_version@
Requires: %{perl_interpreter}

%description -n perl-PCP-LogImport
The PCP::LogImport module contains the Perl language bindings for
importing data in various 3rd party formats into PCP archives so
they can be replayed with standard PCP monitoring tools.

#
# perl-PCP-LogSummary
#
%package -n perl-PCP-LogSummary
License: GPLv2+
Summary: Performance Co-Pilot (PCP) Perl bindings for post-processing output of pmlogsummary
URL: https://pcp.io
Requires: pcp = @package_version@
Requires: %{perl_interpreter}

%description -n perl-PCP-LogSummary
The PCP::LogSummary module provides a Perl module for using the
statistical summary data produced by the Performance Co-Pilot
pmlogsummary utility.  This utility produces various averages,
minima, maxima, and other calculations based on the performance
data stored in a PCP archive.  The Perl interface is ideal for
exporting this data into third-party tools (e.g. spreadsheets).

#
# pcp-import-sar2pcp
#
%package import-sar2pcp
License: LGPLv2+
Summary: Performance Co-Pilot tools for importing sar data into PCP archive logs
URL: https://pcp.io
Requires: pcp-libs = @package_version@ perl-PCP-LogImport = @package_version@
Maybe-Requires: perl(XML::TokeParser)

%description import-sar2pcp
Performance Co-Pilot (PCP) front-end tools for importing sar data
into standard PCP archive logs for replay with any PCP monitoring tool.

#
# pcp-import-iostat2pcp
#
%package import-iostat2pcp
License: LGPLv2+
Summary: Performance Co-Pilot tools for importing iostat data into PCP archive logs
URL: https://pcp.io
Requires: pcp-libs = @package_version@ perl-PCP-LogImport = @package_version@

%description import-iostat2pcp
Performance Co-Pilot (PCP) front-end tools for importing iostat data
into standard PCP archive logs for replay with any PCP monitoring tool.

#
# pcp-import-sheet2pcp
#
%package import-sheet2pcp
License: LGPLv2+
Summary: Performance Co-Pilot tools for importing spreadsheet data into PCP archive logs
URL: https://pcp.io
Requires: pcp-libs = @package_version@ perl-PCP-LogImport = @package_version@
Maybe-Requires: perl(XML::TokeParser)

%description import-sheet2pcp
Performance Co-Pilot (PCP) front-end tools for importing spreadsheet data
into standard PCP archive logs for replay with any PCP monitoring tool.

#
# pcp-import-mrtg2pcp
#
%package import-mrtg2pcp
License: LGPLv2+
Summary: Performance Co-Pilot tools for importing MTRG data into PCP archive logs
URL: https://pcp.io
Requires: pcp-libs = @package_version@ perl-PCP-LogImport = @package_version@

%description import-mrtg2pcp
Performance Co-Pilot (PCP) front-end tools for importing MTRG data
into standard PCP archive logs for replay with any PCP monitoring tool.

#
# pcp-import-ganglia2pcp
#
%package import-ganglia2pcp
License: LGPLv2+
Summary: Performance Co-Pilot tools for importing ganglia data into PCP archive logs
URL: https://pcp.io
Requires: pcp-libs = @package_version@ perl-PCP-LogImport = @package_version@

%description import-ganglia2pcp
Performance Co-Pilot (PCP) front-end tools for importing ganglia data
into standard PCP archive logs for replay with any PCP monitoring tool.
%endif

#
# pcp-import-collectl2pcp
#
%package import-collectl2pcp
License: LGPLv2+
Summary: Performance Co-Pilot tools for importing collectl log files into PCP archive logs
URL: https://pcp.io
Requires: pcp-libs = @package_version@

%description import-collectl2pcp
Performance Co-Pilot (PCP) front-end tools for importing collectl data
into standard PCP archive logs for replay with any PCP monitoring tool.

#
# pcp-export-zabbix-agent
#
%package export-zabbix-agent
License: GPLv2+
Summary: Module for exporting PCP metrics to Zabbix agent
URL: https://pcp.io
Requires: pcp-libs = @package_version@

%description export-zabbix-agent
Performance Co-Pilot (PCP) module for exporting metrics from PCP to
Zabbix via the Zabbix agent - see zbxpcp(3) for further details.

%if "@pcp2elasticsearch@" == "true"
#
# pcp-export-pcp2elasticsearch
#
%package export-pcp2elasticsearch
License: GPLv2+
Summary: Performance Co-Pilot tools for exporting PCP metrics to ElasticSearch
URL: https://pcp.io
Requires: pcp-libs >= %{version}-%{release}
%if "@enable_python3@" == "true"
Requires: python3-pcp = @package_version@
Requires: python3-requests
%else
Requires: %{__python2}-pcp = @package_version@
Requires: %{__python2}-requests
%endif

%description export-pcp2elasticsearch
Performance Co-Pilot (PCP) front-end tools for exporting metric values
to Elasticsearch - a distributed, RESTful search and analytics engine.
See https://www.elastic.co/community for further details.
%endif

%if "@have_python@" == "true"
#
# pcp-export-pcp2graphite
#
%package export-pcp2graphite
License: GPLv2+
Summary: Performance Co-Pilot tools for exporting PCP metrics to Graphite
URL: https://pcp.io
Requires: pcp-libs >= %{version}-%{release}
%if "@enable_python3@" == "true"
Requires: python3-pcp = @package_version@
%else
Requires: %{__python2}-pcp = @package_version@
%endif

%description export-pcp2graphite
Performance Co-Pilot (PCP) front-end tools for exporting metric values
to graphite (http://graphite.readthedocs.org).

%if "@pcp2influxdb@" == "true"
#
# pcp-export-pcp2influxdb
#
%package export-pcp2influxdb
License: GPLv2+
Summary: Performance Co-Pilot tools for exporting PCP metrics to InfluxDB
URL: https://pcp.io
Requires: pcp-libs >= %{version}-%{release}
%if "@enable_python3@" == "true"
Requires: python3-pcp = @package_version@
Requires: python3-requests
%else
Requires: %{__python2}-pcp = @package_version@
Requires: %{__python2}-requests
%endif

%description export-pcp2influxdb
Performance Co-Pilot (PCP) front-end tools for exporting metric values
to InfluxDB (https://influxdata.com/time-series-platform/influxdb).
%endif

#
# pcp-export-pcp2json
#
%package export-pcp2json
License: GPLv2+
Summary: Performance Co-Pilot tools for exporting PCP metrics in JSON format
URL: https://pcp.io
Requires: pcp-libs >= @package_version@
%if "@enable_python3@" == "true"
Requires: python3-pcp = @package_version@
%else
Requires: %{__python2}-pcp = @package_version@
%endif

%description export-pcp2json
Performance Co-Pilot (PCP) front-end tools for exporting metric values
in JSON format.

#
# pcp-export-pcp2spark
#
%package export-pcp2spark
License: GPLv2+
Summary: Performance Co-Pilot tools for exporting PCP metrics to Apache Spark
URL: https://pcp.io
Requires: pcp-libs >= @package_version@
%if "@enable_python3@" == "true"
Requires: python3-pcp = @package_version@
%else
Requires: %{__python2}-pcp = @package_version@
%endif

%description export-pcp2spark
Performance Co-Pilot (PCP) front-end tools for exporting metric values
in JSON format to Apache Spark. See https://spark.apache.org/ for
further details on Apache Spark.

#
# pcp-export-pcp2xml
#
%package export-pcp2xml
License: GPLv2+
Summary: Performance Co-Pilot tools for exporting PCP metrics in XML format
URL: https://pcp.io
Requires: pcp-libs >= %{version}-%{release}
%if "@enable_python3@" == "true"
Requires: python3-pcp = @package_version@
%else
Requires: %{__python2}-pcp = @package_version@
%endif

%description export-pcp2xml
Performance Co-Pilot (PCP) front-end tools for exporting metric values
in XML format.

#
# pcp-export-pcp2zabbix
#
%package export-pcp2zabbix
License: GPLv2+
Summary: Performance Co-Pilot tools for exporting PCP metrics to Zabbix
URL: https://pcp.io
Requires: pcp-libs >= %{version}-%{release}
%if "@enable_python3@" == "true"
Requires: python3-pcp = @package_version@
%else
Requires: %{__python2}-pcp = @package_version@
%endif

%description export-pcp2zabbix
Performance Co-Pilot (PCP) front-end tools for exporting metric values
to the Zabbix (https://www.zabbix.org/) monitoring software.
%endif

%if "@pcp2xlsx@" == "true"
#
# pcp-export-pcp2xlsx
#
%package export-pcp2xlsx
License: GPLv2+
Summary: Performance Co-Pilot tools for exporting PCP metrics to Excel
URL: https://pcp.io
Requires: pcp-libs >= %{version}-%{release}
%if "@enable_python3@" == "true"
Requires: python3-pcp = @package_version@
Requires: python3-openpyxl
%else
Requires: %{__python2}-pcp = @package_version@
Requires: %{__python2}-openpyxl
%endif

%description export-pcp2xlsx
Performance Co-Pilot (PCP) front-end tools for exporting metric values
in Excel spreadsheet format.
%endif

%if "@enable_python2@" == "true"
#
# python2-pcp. This is the PCP library bindings for python.
#
%package -n %{__python2}-pcp
License: GPLv2+
Summary: Performance Co-Pilot (PCP) Python bindings and documentation
URL: https://pcp.io
BuildRequires: %{__python2}-devel
%if 0%{?fedora} >= 26 || 0%{?rhel} > 7
# on these platforms, python2-pcp replaces python-pcp
Obsoletes: python-pcp < @package_version@
%endif
%if "%{_vendor}" == "redhat" && 0%{?rhel} <= 5 && 0%{?fedora} <= 25
Requires: %{__python2}-ctypes
%endif
Requires: pcp-libs = @package_version@
Requires: %{__python2}

%description -n %{__python2}-pcp
This python PCP module contains the language bindings for
Performance Metric API (PMAPI) monitor tools and Performance
Metric Domain Agents (PMDA) collector tools written in Python.
%endif

%if "@enable_python3@" == "true"
#
# python3-pcp. This is the PCP library bindings for python.
#
%package -n python3-pcp
License: GPLv2+
Summary: Performance Co-Pilot (PCP) Python3 bindings and documentation
URL: https://pcp.io
%if 0%{?centos_ver} == 7
BuildRequires: python36-devel
Requires: python36
%else
BuildRequires: python3-devel
Requires: python3
%endif
Requires: pcp-libs = @package_version@

%description -n python3-pcp
This python PCP module contains the language bindings for
Performance Metric API (PMAPI) monitor tools and Performance
Metric Domain Agent (PMDA) collector tools written in Python3.
%endif

%if "@have_python@" == "true"
#
# pcp-system-tools
#
%package system-tools
License: GPLv2+
Summary: Performance Co-Pilot (PCP) System and Monitoring Tools
URL: https://pcp.io
%if "@enable_python3@" == "true"
Requires: python3-pcp = @package_version@
%else
Requires: %{__python2}-pcp = @package_version@
%endif
Requires: pcp-libs = @package_version@
%if "@enable_dstat@" == "true"
# https://fedoraproject.org/wiki/Packaging:Guidelines "Renaming/Replacing Existing Packages"
Provides: dstat = @package_version@
Provides: /usr/bin/dstat
Obsoletes: dstat <= 0.8
%endif

%description system-tools
This PCP module contains additional system monitoring tools written
in the Python language.
%endif

%if "@enable_qt@" == "true"
#
# pcp-gui package for Qt tools
#
%package gui
License: GPLv2+ and LGPLv2+ and LGPLv2+ with exceptions
Summary: Visualization tools for the Performance Co-Pilot toolkit
URL: https://pcp.io
Requires: pcp-libs = @package_version@

%description gui
Visualization tools for the Performance Co-Pilot toolkit.
The pcp-gui package primarily includes visualization tools for
monitoring systems using live and archived Performance Co-Pilot
(PCP) sources.
%endif

#
# pcp-doc package
#
%package doc
License: GPLv2+ and CC-BY
# BuildArch: requires rpm 4.6 or later ... ./get_rpm_vesion maps version
# 4.6.2.3 to the 7-digit "number" 4060203
%if @rpm_version@ >= 4060000
BuildArch: noarch
%endif
Summary: Documentation and tutorial for the Performance Co-Pilot
URL: https://pcp.io

%description doc
Documentation and tutorial for the Performance Co-Pilot
Performance Co-Pilot (PCP) provides a framework and services to support
system-level performance monitoring and performance management.

The pcp-doc package provides useful information on using and
configuring the Performance Co-Pilot (PCP) toolkit for system
level performance management.  It includes tutorials, HOWTOs,
and other detailed documentation about the internals of core
PCP utilities and daemons, and the PCP graphical tools.

#
# pcp-selinux package
#
%if "@enable_selinux@" == "true"
%package selinux
License: GPLv2+ and CC-BY
Summary: Selinux policy package
URL: https://pcp.io
BuildRequires: selinux-policy-devel
BuildRequires: selinux-policy-targeted
%if 0%{?fedora} >= 19 || 0%{?rhel} >= 6 || 0%{?suse_version} >= 1200
BuildRequires: setools-console
%else
BuildRequires: setools
%endif
Requires: policycoreutils selinux-policy-targeted
%if "%{_vendor}" == "suse"
# no libsemanage for SuSE other than libsemanage1 for OpenSuSE 12
%if 0%{?suse_version} >= 1200
Requires: libsemanage1
%endif
%else
Requires: libsemanage
%endif

%description selinux
This package contains SELinux support for PCP.  The package contains
interface rules, type enforcement and file context adjustments for an
updated policy package.
%endif

#
# pcp-pmda-docker
#
%package pmda-docker
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics from the Docker daemon
URL: https://pcp.io

%description pmda-docker
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics using the Docker daemon REST API.
#end pcp-pmda-docker

#
# pcp-pmda-lustrecomm
#
%package pmda-lustrecomm
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the Lustre Filesytem Comms
URL: https://pcp.io

%description pmda-lustrecomm
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the Lustre Filesystem Comms.
#end pcp-pmda-lustrecomm

%if "@pmda_infiniband@" == "true"
#
# pcp-pmda-infiniband
#
%package pmda-infiniband
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Infiniband HCAs and switches
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%if "%{_vendor}" == "suse"
%if 0%{suse_version} >= 1110
Requires: libibmad5 >= 1.1.7 libibumad3 >= 1.1.7
%else
Requires: libibmad1 >= 1.1.7 libibumad1 >= 1.1.7
%endif
%else
Requires: libibmad >= 1.1.7 libibumad >= 1.1.7
%endif
BuildRequires: libibmad-devel >= 1.1.7 libibumad-devel >= 1.1.7

%description pmda-infiniband
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting Infiniband statistics.  By default, it monitors the local HCAs
but can also be configured to monitor remote GUIDs such as IB switches.
#end pcp-pmda-infiniband
%endif

%if "@pmda_podman@" == "true"
#
# pcp-pmda-podman
#
%package pmda-podman
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for podman containers
URL: https://pcp.io
Requires: libvarlink
Requires: pcp-libs = @package_version@
BuildRequires: libvarlink-devel

%description pmda-podman
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting podman container and pod statistics through libvarlink.
#end pcp-pmda-podman
%endif

%if "@pmda_statsd@" == "true"
#
# pcp-pmda-statsd
#
%package pmda-statsd
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics from statsd
URL: https://pcp.io
Requires: chan HdrHistogram_c
Requires: pcp-libs = @package_version@
BuildRequires: ragel chan-devel HdrHistogram_c-devel

%description pmda-statsd
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting statistics from the statsd daemon.
#end pcp-pmda-statsd
%endif

%if "@pmda_perfevent@" == "true"
#
# pcp-pmda-perfevent
#
%package pmda-perfevent
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for hardware counters
URL: https://pcp.io
%if "%{_vendor}" == "suse"
Requires: libpfm4 >= 4.4
%else
Requires: libpfm >= 4.4
%endif
BuildRequires: libpfm-devel >= 4.4
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
collecting hardware counters statistics through libpfm.
#end pcp-pmda-perfevent
%endif

%if "@pmda_activemq@" == "true"
#
# pcp-pmda-activemq
#
%package pmda-activemq
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for ActiveMQ
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@
Maybe-Requires: perl(LWP::UserAgent)

%description pmda-activemq
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the ActiveMQ message broker.
#end pcp-pmda-activemq
%endif

%if "@pmda_bind2@" == "true"
#
# pcp-pmda-bind2
#
%package pmda-bind2
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for BIND servers
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@
Maybe-Requires: perl(LWP::UserAgent)
Maybe-Requires: perl(XML::LibXML)
Maybe-Requires: perl(File::Slurp)

%description pmda-bind2
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics from BIND (Berkeley Internet Name Domain).
#end pcp-pmda-bind2
%endif

%if "@pmda_nutcracker@" == "true"
#
# pcp-pmda-nutcracker
#
%package pmda-nutcracker
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for NutCracker (TwemCache)
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@
Maybe-Requires: perl(YAML::XS::LibYAML)
Maybe-Requires: perl(JSON)

%description pmda-nutcracker
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics from NutCracker (TwemCache).
#end pcp-pmda-nutcracker
%endif

%if "@have_perl@" == "true"
#
# pcp-pmda-redis
#
%package pmda-redis
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Redis
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-redis
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics from Redis servers (redis.io).
#end pcp-pmda-redis

#
# pcp-pmda-bonding
#
%package pmda-bonding
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Bonded network interfaces
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-bonding
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about bonded network interfaces.
#end pcp-pmda-bonding

#
# pcp-pmda-dbping
#
%package pmda-dbping
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Database response times and Availablility
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-dbping
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the Database response times and Availablility.
#end pcp-pmda-dbping

#
# pcp-pmda-ds389
#
%package pmda-ds389
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for 389 Directory Servers
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@
%if "%{_vendor}" == "suse"
Requires: perl-ldap
%else
%if 0%{?rhel} <= 7
Requires: perl-LDAP
%endif
%endif

%description pmda-ds389
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about a 389 Directory Server.
#end pcp-pmda-ds389

#
# pcp-pmda-ds389log
#
%package pmda-ds389log
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for 389 Directory Server Loggers
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@
Requires: perl-Date-Manip

%description pmda-ds389log
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics from a 389 Directory Server log.
#end pcp-pmda-ds389log

#
# pcp-pmda-gpfs
#
%package pmda-gpfs
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for GPFS Filesystem
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-gpfs
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the GPFS filesystem.
#end pcp-pmda-gpfs

#
# pcp-pmda-gpsd
#
%package pmda-gpsd
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for a GPS Daemon
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-gpsd
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about a GPS Daemon.
#end pcp-pmda-gpsd

#
# pcp-pmda-lustre
#
%package pmda-lustre
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the Lustre Filesytem
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-lustre
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the Lustre Filesystem.
#end pcp-pmda-lustre

#
# pcp-pmda-memcache
#
%package pmda-memcache
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Memcached
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-memcache
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about Memcached.
#end pcp-pmda-memcache
%endif

%if "@pmda_mysql@" == "true"
#
# pcp-pmda-mysql
#
%package pmda-mysql
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for MySQL
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@
Maybe-Requires: perl(DBI)
Maybe-Requires: perl(DBD::mysql)

%description pmda-mysql
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the MySQL database.
#end pcp-pmda-mysql
%endif

%if "@have_perl@" == "true"
#
# pcp-pmda-named
#
%package pmda-named
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Named
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-named
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the Named nameserver.
#end pcp-pmda-named

# pcp-pmda-netfilter
#
%package pmda-netfilter
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Netfilter framework
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-netfilter
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the Netfilter packet filtering framework.
#end pcp-pmda-netfilter

#
# pcp-pmda-news
#
%package pmda-news
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Usenet News
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-news
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about Usenet News.
#end pcp-pmda-news
%endif

%if "@pmda_nginx@" == "true"
#
# pcp-pmda-nginx
#
%package pmda-nginx
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the Nginx Webserver
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@
Maybe-Requires: perl(LWP::UserAgent)

%description pmda-nginx
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the Nginx Webserver.
#end pcp-pmda-nginx
%endif

%if "@pmda_oracle@" == "true"
#
# pcp-pmda-oracle
#
%package pmda-oracle
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the Oracle database
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@
Maybe-Requires: perl(DBI)

%description pmda-oracle
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the Oracle database.
#end pcp-pmda-oracle
%endif

%if "@have_perl@" == "true"
#
# pcp-pmda-pdns
#
%package pmda-pdns
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for PowerDNS
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-pdns
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the PowerDNS.
#end pcp-pmda-pdns
%endif

%if "@pmda_postfix@" == "true"
#
# pcp-pmda-postfix
#
%package pmda-postfix
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the Postfix (MTA)
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@
Requires: perl-Time-HiRes
%if 0%{?fedora} > 16 || 0%{?rhel} > 5
Requires: postfix-perl-scripts
%endif
%if 0%{?rhel} <= 5
Requires: postfix
%endif
Maybe-Requires: postfix-doc

%description pmda-postfix
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the Postfix (MTA).
#end pcp-pmda-postfix
%endif

%if "@have_perl@" == "true"
#
# pcp-pmda-rsyslog
#
%package pmda-rsyslog
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Rsyslog
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-rsyslog
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about Rsyslog.
#end pcp-pmda-rsyslog

#
# pcp-pmda-samba
#
%package pmda-samba
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Samba
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-samba
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about Samba.
#end pcp-pmda-samba

#
# pcp-pmda-slurm
#
%package pmda-slurm
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the SLURM Workload Manager
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-slurm
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics from the SLURM Workload Manager.
#end pcp-pmda-slurm
%endif

%if "@pmda_snmp@" == "true"
#
# pcp-pmda-snmp
#
%package pmda-snmp
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Simple Network Management Protocol
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@
Maybe-Requires: perl(Net::SNMP)

%description pmda-snmp
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about SNMP.
#end pcp-pmda-snmp
%endif

%if "@have_perl@" == "true"
#
# pcp-pmda-vmware
#
%package pmda-vmware
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for VMware
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-vmware
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics for VMware.
#end pcp-pmda-vmware

#
# pcp-pmda-zimbra
#
%package pmda-zimbra
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Zimbra
URL: https://pcp.io
Requires: perl-PCP-PMDA = @package_version@

%description pmda-zimbra
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about Zimbra.
#end pcp-pmda-zimbra
%endif

#
# pcp-pmda-dm
#
%package pmda-dm
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the Device Mapper Cache and Thin Client
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%description pmda-dm
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the Device Mapper Cache and Thin Client.
# end pcp-pmda-dm

%if "@pmda_bcc@" == "true"
#
# pcp-pmda-bcc
#
%package pmda-bcc
License: ASL 2.0 and GPLv2+
Summary: Performance Co-Pilot (PCP) metrics from eBPF/BCC modules
URL: https://pcp.io
Requires: python3-bcc
Requires: python3-pcp
%description pmda-bcc
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
extracting performance metrics from eBPF/BCC Python modules.
# end pcp-pmda-bcc
%endif

%if "@pmda_bpftrace@" == "true"
#
# pcp-pmda-bpftrace
#
%package pmda-bpftrace
License: 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 "@have_python@" == "true"
#
# pcp-pmda-gluster
#
%package pmda-gluster
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the Gluster filesystem
URL: https://pcp.io
%if "@enable_python3@" == "true"
Requires: python3-pcp
%else
Requires: %{__python2}-pcp
%endif
%description pmda-gluster
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the gluster filesystem.
# end pcp-pmda-gluster

#
# pcp-pmda-nfsclient
#
%package pmda-nfsclient
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for NFS Clients
URL: https://pcp.io
%if "@enable_python3@" == "true"
Requires: python3-pcp
%else
Requires: %{__python2}-pcp
%endif
%description pmda-nfsclient
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics for NFS Clients.
#end pcp-pmda-nfsclient

%if "@pmda_postgresql@" == "true"
#
# pcp-pmda-postgresql
#
%package pmda-postgresql
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for PostgreSQL
URL: https://pcp.io
%if "@enable_python3@" == "true"
Requires: python3-pcp
Requires: python3-psycopg2
%else
Requires: %{__python2}-psycopg2
Requires: %{__python2}-pcp
%endif
%description pmda-postgresql
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the PostgreSQL database.
#end pcp-pmda-postgresql
%endif

#
# pcp-pmda-zswap
#
%package pmda-zswap
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for compressed swap
URL: https://pcp.io
%if "@enable_python3@" == "true"
Requires: python3-pcp
%else
Requires: %{__python2}-pcp
%endif
%description pmda-zswap
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about compressed swap.
# end pcp-pmda-zswap

#
# pcp-pmda-unbound
#
%package pmda-unbound
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the Unbound DNS Resolver
URL: https://pcp.io
%if "@enable_python3@" == "true"
Requires: python3-pcp
%else
Requires: %{__python2}-pcp
%endif
%description pmda-unbound
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the Unbound DNS Resolver.
# end pcp-pmda-unbound

#
# pcp-pmda-mic
#
%package pmda-mic
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Intel MIC cards
URL: https://pcp.io
%if "@enable_python3@" == "true"
Requires: python3-pcp
%else
Requires: %{__python2}-pcp
%endif
%description pmda-mic
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about Intel MIC cards.
# end pcp-pmda-mic

#
# pcp-pmda-haproxy
#
%package pmda-haproxy
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for HAProxy
URL: https://pcp.io
%if "@enable_python3@" == "true"
Requires: python3-pcp
%else
Requires: %{__python2}-pcp
%endif
%description pmda-haproxy
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
extracting performance metrics from HAProxy over the HAProxy stats socket.
# end pcp-pmda-haproxy

#
# pcp-pmda-lmsensors
#
%package pmda-lmsensors
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for hardware sensors
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%if "@enable_python3@" == "true"
Requires: python3-pcp
%else
Requires: %{__python2}-pcp
%endif
# rewritten in python, so there is no longer a debuginfo package
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

#
# 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 = @package_version@
%if "@enable_python3@" == "true"
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 = @package_version@
%if "@enable_python3@" == "true"
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 "@pmda_libvirt@" == "true"
#
# pcp-pmda-libvirt
#
%package pmda-libvirt
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics from virtual machines
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%if "@enable_python3@" == "true"
Requires: python3-pcp
%if "%{_vendor}" == "suse"
Requires: libvirt-python %{__python2}-lxml
%else
Requires: libvirt-python3 python3-lxml
%endif
%else
Requires: %{__python2}-pcp
Requires: %{__python2}-lxml
# it appears the rpm name changed from libvirt-python to python-libvirt in
# Fedora 27
%if 0%{?fedora} >= 27
Requires: %{__python2}-libvirt
%else
Requires: libvirt-python
%endif
%endif

%description pmda-libvirt
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
extracting virtualisation statistics from libvirt about behaviour of guest
and hypervisor machines.
#end pcp-pmda-libvirt
%endif

%if "@pmda_lio@" == "true"
#
# pcp-pmda-lio
#
%package pmda-lio
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the LIO subsystem
URL: https://pcp.io
%if "@enable_python3@" == "true"
Requires: python3-pcp
Requires: python3-rtslib
%else
Requires: %{__python2}-rtslib
Requires: %{__python2}-pcp
%endif
%description pmda-lio
This package provides a PMDA to gather performance metrics from the kernels
iSCSI target interface (LIO). The metrics are stored by LIO within the Linux
kernels configfs filesystem. The PMDA provides per LUN level stats, and a
summary instance per iSCSI target, which aggregates all LUN metrics within the
target.
#end pcp-pmda-lio
%endif

%if "@pmda_elasticsearch@" == "true"
#
# pcp-pmda-elasticsearch
#
%package pmda-elasticsearch
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Elasticsearch
URL: https://pcp.io
%if "@enable_python3@" == "true"
Requires: python3-pcp
%else
Requires: %{__python2}-pcp
%endif
%description pmda-elasticsearch
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about Elasticsearch.
#end pcp-pmda-elasticsearch
%endif

%if "@pmda_openmetrics@" == "true"
#
# pcp-pmda-openmetrics
#
%package pmda-openmetrics
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics from OpenMetrics endpoints
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%if "@enable_python3@" == "true"
Requires: python3-pcp = @package_version@
Requires: python3-requests
%else
Requires: %{__python2}-pcp = @package_version@
Requires: %{__python2}-requests
%endif
Obsoletes: pcp-pmda-prometheus < 5.0.0
Provides: pcp-pmda-prometheus

%description pmda-openmetrics
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
extracting metrics from OpenMetrics (https://openmetrics.io/) endpoints.
#end pcp-pmda-openmetrics
%endif

%if "@pmda_json@" == "true"
#
# pcp-pmda-json
#
%package pmda-json
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for JSON data
URL: https://pcp.io
%if "@enable_python3@" == "true"
Requires: python3-pcp
%if "%{_vendor}" == "suse"
Requires: %{__python2}-jsonpointer
%else
Requires: python3-jsonpointer
%endif
Requires: python3-six
%else
Requires: %{__python2}-pcp
Requires: %{__python2}-jsonpointer
Requires: %{__python2}-six
%endif
%description pmda-json
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics output in JSON.
# end pcp-pmda-json
%endif

#
# C pmdas
# pcp-pmda-apache
#
%package pmda-apache
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the Apache webserver
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%description pmda-apache
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the Apache webserver.
# end pcp-pmda-apache

#
# pcp-pmda-bash
#
%package pmda-bash
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the Bash shell
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%description pmda-bash
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the Bash shell.
# end pcp-pmda-bash

#
# pcp-pmda-cifs
#
%package pmda-cifs
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the CIFS protocol
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%description pmda-cifs
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the Common Internet Filesytem.
# end pcp-pmda-cifs

#
# pcp-pmda-cisco
#
%package pmda-cisco
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Cisco routers
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%description pmda-cisco
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about Cisco routers.
# end pcp-pmda-cisco

#
# pcp-pmda-gfs2
#
%package pmda-gfs2
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the GFS2 filesystem
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%description pmda-gfs2
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the Global Filesystem v2.
# end pcp-pmda-gfs2

#
# pcp-pmda-logger
#
%package pmda-logger
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics from arbitrary log files
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%description pmda-logger
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics from a specified set of log files (or pipes).  The PMDA
supports both sampled and event-style metrics.
# end pcp-pmda-logger

#
# pcp-pmda-mailq
#
%package pmda-mailq
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the sendmail queue
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%description pmda-mailq
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about email queues managed by sendmail.
# end pcp-pmda-mailq

#
# pcp-pmda-mounts
#
%package pmda-mounts
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for filesystem mounts
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%description pmda-mounts
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about filesystem mounts.
# end pcp-pmda-mounts

#
# pcp-pmda-nvidia-gpu
#
%package pmda-nvidia-gpu
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the Nvidia GPU
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%description pmda-nvidia-gpu
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about Nvidia GPUs.
# end pcp-pmda-nvidia-gpu

#
# pcp-pmda-roomtemp
#
%package pmda-roomtemp
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the room temperature
URL: https://pcp.io
Requires: pcp = @package_version@
%description pmda-roomtemp
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the room temperature.
# end pcp-pmda-roomtemp

%if "@pmda_rpm@" == "true"
#
# pcp-pmda-rpm
#
%package pmda-rpm
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for the RPM package manager
URL: https://pcp.io
Requires: pcp = @package_version@
%description pmda-rpm
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about the installed RPM packages.
%endif
# end pcp-pmda-rpm


#
# pcp-pmda-sendmail
#
%package pmda-sendmail
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for Sendmail
URL: https://pcp.io
Requires: pcp = @package_version@
%description pmda-sendmail
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about Sendmail traffic.
# end pcp-pmda-sendmail

#
# pcp-pmda-shping
#
%package pmda-shping
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for shell command responses
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%description pmda-shping
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about quality of service and response time measurements of
arbitrary shell commands.
# end pcp-pmda-shping

#
# pcp-pmda-smart
#
%package pmda-smart
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for S.M.A.R.T values
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%description pmda-smart
This package contains the PCP Performance Metric Domain Agent (PMDA) for
collecting metrics of disk S.M.A.R.T values making use of data from the
smartmontools package.
#end pcp-pmda-smart

#
# pcp-pmda-summary
#
%package pmda-summary
License: GPLv2+
Summary: Performance Co-Pilot (PCP) summary metrics from pmie
URL: https://pcp.io
Requires: pcp = @package_version@
%description pmda-summary
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about other installed PMDAs.
# end pcp-pmda-summary

%if "@pmda_systemd@" == "true"
#
# pcp-pmda-systemd
#
%package pmda-systemd
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics from the Systemd journal
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%description pmda-systemd
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics from the Systemd journal.
# end pcp-pmda-systemd
%endif

#
# pcp-pmda-trace
#
%package pmda-trace
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics for application tracing
URL: https://pcp.io
Requires: pcp-libs = @package_version@
%description pmda-trace
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about trace performance data in applications.
# end pcp-pmda-trace

#
# pcp-pmda-weblog
#
%package pmda-weblog
License: GPLv2+
Summary: Performance Co-Pilot (PCP) metrics from web server logs
URL: https://pcp.io
Requires: pcp = @package_version@
%description pmda-weblog
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
collecting metrics about web server logs.
# end pcp-pmda-weblog
# end C pmdas


%package zeroconf
License: GPLv2+
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
%if "@have_python@" == "true"
Requires: pcp-pmda-nfsclient
%endif
# 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
automated pmie diagnosis, alerting and self-healing for the localhost.
A cron script also writes daily performance summary reports similar to
those written by sysstat.

%prep
%setup -q

%clean
[ ! -z "$DIST_ROOT" ] && rm -rf $DIST_ROOT
rm -Rf $RPM_BUILD_ROOT

%build
%configure @package_configure@ %{_configure_rcdir}
@make@ %{?_smp_mflags} default_pcp

%install
rm -Rf $RPM_BUILD_ROOT
NO_CHOWN=true
BACKDIR=`pwd`;
DIST_ROOT=$RPM_BUILD_ROOT
DIST_MANIFEST=`pwd`/install.manifest
PCP_SYSCONFIG_DIR=@pcp_sysconfig_dir@
export NO_CHOWN DIST_ROOT DIST_MANIFEST
rm -f $DIST_MANIFEST
@make@ install_pcp

%if 0%{?fedora} > 26
if [ "$1" -eq 1 ]
then
sed -i 's/^\#\ PMLOGGER_LOCAL.*/PMLOGGER_LOCAL=1/g' "$RPM_BUILD_ROOT/$PCP_SYSCONFIG_DIR/pmlogger"
sed -i 's/^\#\ PMCD_LOCAL.*/PMCD_LOCAL=1/g' "$RPM_BUILD_ROOT/$PCP_SYSCONFIG_DIR/pmcd"
fi
%endif

PCP_CONF=$BACKDIR/src/include/pcp.conf
export PCP_CONF
. $BACKDIR/src/include/pcp.env
CFGFILELIST=`ls -1 $BACKDIR/debian/pcp-conf.{install,dirs}`
LIBFILELIST=`ls -1 $BACKDIR/debian/lib*.{install,dirs} | fgrep -v -- -dev.`
DEVFILELIST=`ls -1 $BACKDIR/debian/lib*-dev.{install,dirs}`

#
# Package split: pcp{-conf,-libs,-libs-devel,-manager,-testsuite,
# -import-*,-export-*} ...
# The above list is ordered by file selection; files for each package are
# removed from a global set, then the base package catches all remaining.
sed -e 's/^/\//' $CFGFILELIST >cfg_files
sed -e 's/^/\//' $LIBFILELIST >libs_files
sed -e 's/^/\//' $DEVFILELIST >dev_files
grep "\.h$" $DEVFILELIST | cut -f2 -d":" >lib_devel_files
grep "\.pc$" $DEVFILELIST | cut -f2 -d":" >>lib_devel_files
grep "\.so$" $DEVFILELIST | cut -f2 -d":" >>lib_devel_files
grep "\.a$" $DEVFILELIST | cut -f2 -d":" >>lib_devel_files
sed -i -e 's/^/\//' lib_devel_files
sed -i '/.h$/d' dev_files
sed -i '/.pc$/d' dev_files
sed -i '/.so$/d' dev_files
sed -i '/.a$/d' dev_files

%ifarch x86_64 ppc64 ppc64le aarch64 s390x
sed -i -e 's/usr\/lib\//usr\/lib64\//' libs_files
sed -i -e 's/usr\/lib\//usr\/lib64\//' dev_files
sed -i -e 's/usr\/lib\//usr\/lib64\//' lib_devel_files
%endif
%ifarch ia64
%if "%{_vendor}" != "suse"
sed -i -e 's/usr\/lib\//usr\/lib64\//' libs_files
sed -i -e 's/usr\/lib\//usr\/lib64\//' dev_files
sed -i -e 's/usr\/lib\//usr\/lib64\//' lib_devel_files
%endif
%endif

#
# some special cases for devel
awk '{print $NF}' $DIST_MANIFEST |\
egrep 'pcp\/(examples|demos)|pmdas\/(sample|simple|trivial|txmon)|bin/(pmdbg|pmclient|pmerr|genpmda)' >>dev_files

#
# Patterns for files to be marked %config(noreplace).
# Note: /etc/pcp.{conf,env,sh} are %config but not noreplace
# and are treated specially below.
cat >conf_files <<EOF
etc/sysconfig/pmcd
etc/sysconfig/pmproxy
etc/sysconfig/pmlogger
etc/cron.d/pcp-pmie
etc/cron.d/pcp-pmlogger
etc/cron.d/pcp-pmlogger-daily-report
pmcd/pmcd.conf
pmcd/pmcd.options
pmcd/rc.local
pmie/control
pmie/stomp
pmlogger/control
pmproxy/pmproxy.options
pmproxy/pmproxy.conf
EOF
%if "@enable_manager@" == "true"
cat >>conf_files <<MGREOF
etc/pcp/pmmgr
MGREOF
%endif
%if "@enable_qt@" == "true"
cat >>conf_files <<GUIEOF
pmsnap/control
pmsnap/crontab
GUIEOF
%endif
%if "@pmda_perfevent@" == "true"
cat >>conf_files <<PFMEOF
perfevent/perfevent.conf
PFMEOF
%endif
%if "@have_python@" == "true"
cat >>conf_files <<SYSEOF
etc/pcp/dstat
etc/pcp/pmrep
SYSEOF
%endif

#
# Files for the various subpackages.  We use these subpackages
# to isolate the (somewhat exotic) dependencies for these tools.
# Likewise, for the pcp-pmda and pcp-testsuite subpackages.
%if "@enable_selinux@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep 'selinux' | egrep -v 'tmp' >selinux_files
%endif
awk '{print $NF}' $DIST_MANIFEST | egrep 'pcp-doc|man.*\.[1-9].*' | egrep -v 'out' >docs_files
awk '{print $NF}' $DIST_MANIFEST | egrep 'tutorials|/html/' >>docs_files
awk '{print $NF}' $DIST_MANIFEST | egrep 'testsuite|etc/systemd/system' >testsuite_files
%if "@enable_qt@" == "true"
PCP_GUI='pmchart|pmconfirm|pmdumptext|pmmessage|pmquery|pmsnap|pmtime'
awk '{print $NF}' $DIST_MANIFEST | egrep "$PCP_GUI|applications|pixmaps|hicolor" | egrep -v '/pcp-doc/|/man/|pmtime.h' > gui_files
%endif
%if "@enable_manager@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep 'pmmgr' | \
egrep -v 'testsuite|etc/systemd/system' >manager_files
%endif
%if "@have_perl@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep 'sar2pcp' >import_sar2pcp_files
awk '{print $NF}' $DIST_MANIFEST | egrep 'iostat2pcp' >import_iostat2pcp_files
awk '{print $NF}' $DIST_MANIFEST | egrep 'sheet2pcp' >import_sheet2pcp_files
awk '{print $NF}' $DIST_MANIFEST | egrep 'mrtg2pcp' >import_mrtg2pcp_files
awk '{print $NF}' $DIST_MANIFEST | egrep 'ganglia2pcp' >import_ganglia2pcp_files
%endif
awk '{print $NF}' $DIST_MANIFEST | egrep 'collectl2pcp' >import_collectl2pcp_files
%if "@pcp2elasticsearch@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep 'pcp2elasticsearch' >export_pcp2elasticsearch_files
%endif
%if "@pcp2influxdb@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep 'pcp2influxdb' >export_pcp2influxdb_files
%endif
%if "@pcp2xlsx@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep 'pcp2xlsx' >export_pcp2xlsx_files
%endif
%if "@have_python@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep 'pcp2graphite' >export_pcp2graphite_files
awk '{print $NF}' $DIST_MANIFEST | egrep 'pcp2json' >export_pcp2json_files
awk '{print $NF}' $DIST_MANIFEST | egrep 'pcp2spark' >export_pcp2spark_files
awk '{print $NF}' $DIST_MANIFEST | egrep 'pcp2xml' >export_pcp2xml_files
awk '{print $NF}' $DIST_MANIFEST | egrep 'pcp2zabbix' >export_pcp2zabbix_files
%endif
awk '{print $NF}' $DIST_MANIFEST | egrep 'zabbix|zbxpcp' | grep -v pcp2zabbix >export_zabbix_agent_files
%if "@pmda_infiniband@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep 'pmdas/infiniband|pmdaib|pmdas/ib' >pmda_infiniband_files
%endif
%if "@pmda_podman@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep 'pmdas/podman' > pmda_podman_files
%endif
%if "@pmda_statsd@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep 'pmdas/statsd' > pmda_statsd_files
%endif
%if "@pmda_perfevent@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep 'pmdas/perfevent|perfalloc.1' > pmda_perfevent_files
%endif
%if "@pmda_systemd@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep 'pmdas/systemd' > pmda_systemd_files
%endif
%if "@pmda_activemq@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/activemq' > pmda_activemq_files
%endif
%if "@pmda_bind2@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/bind2' > pmda_bind2_files
%endif
%if "@pmda_elasticsearch@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/elasticsearch' > pmda_elasticsearch_files
%endif
%if "@pmda_nutcracker@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/nutcracker' > pmda_nutcracker_files
%endif
%if "@have_perl@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/redis' > pmda_redis_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/bonding' > pmda_bonding_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/dbping' > pmda_dbping_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/ds389log' > pmda_ds389log_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/ds389' > pmda_ds389_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/gpfs' > pmda_gpfs_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/gpsd' > pmda_gpsd_files
%endif
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/docker' > pmda_docker_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/lustrecomm' > pmda_lustrecomm_files
%if "@pmda_mysql@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/mysql' > pmda_mysql_files
%endif
%if "@have_perl@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/lustre' > pmda_lustre_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/memcache' > pmda_memcache_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/named' > pmda_named_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/netfilter' > pmda_netfilter_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/news' > pmda_news_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/pdns' > pmda_pdns_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/rsyslog' > pmda_rsyslog_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/samba' > pmda_samba_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/slurm' > pmda_slurm_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/vmware' > pmda_vmware_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/zimbra' > pmda_zimbra_files
%endif
%if "@pmda_nginx@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/nginx' > pmda_nginx_files
%endif
%if "@pmda_postfix@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/postfix' > pmda_postfix_files
%endif
%if "@pmda_postgresql@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/postgresql' > pmda_postgresql_files
%endif
%if "@pmda_oracle@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/oracle' > pmda_oracle_files
%endif
%if "@pmda_snmp@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/snmp' > pmda_snmp_files
%endif
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/dm|pmieconf/dm' > pmda_dm_files
%if "@pmda_json@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/json' > pmda_json_files
%endif
%if "@pmda_libvirt@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/libvirt' > pmda_libvirt_files
%endif
%if "@pmda_lio@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/lio' > pmda_lio_files
%endif
%if "@pmda_openmetrics@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/openmetrics' > pmda_openmetrics_files
%endif
%if "@pmda_bcc@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/bcc' > pmda_bcc_files
%endif
%if "@pmda_bpftrace@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/bpftrace' > pmda_bpftrace_files
%endif
%if "@have_python@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/gluster' > pmda_gluster_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/zswap' > pmda_zswap_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/unbound' > pmda_unbound_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/mic' > pmda_mic_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/haproxy' > pmda_haproxy_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/nfsclient' > pmda_nfsclient_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/lmsensors' > pmda_lmsensors_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/mssql' > pmda_mssql_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/netcheck' > pmda_netcheck_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmcollectl|pmiostat|pmrep|dstat' \
      -e 'pcp-atop|pcp-collectl|pcp-dmcache|pcp-dstat|pcp-free|pcp-ipcs' \
      -e 'pcp-iostat|pcp-lvmcache|pcp-mpstat|pcp-numastat|pcp-pidstat' \
      -e 'pcp-shping|pcp-tapestat|pcp-uptime|pcp-verify' |\
egrep -v 'testsuite|selinux|pmlogconf|pmieconf' > system_tools_files
%endif
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/apache' > pmda_apache_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/bash' > pmda_bash_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/cifs' > pmda_cifs_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/cisco' > pmda_cisco_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/gfs2' > pmda_gfs2_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/logger' > pmda_logger_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/mailq' > pmda_mailq_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/mounts' > pmda_mounts_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/nvidia' > pmda_nvidia_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/roomtemp' > pmda_roomtemp_files
%if "@pmda_rpm@" == "true"
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/rpm' > pmda_rpm_files
%endif
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/sendmail' > pmda_sendmail_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/shping' > pmda_shping_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/smart' > pmda_smart_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/summary' > pmda_summary_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/trace' > pmda_trace_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'pmdas/weblog' > pmda_weblog_files
awk '{print $NF}' $DIST_MANIFEST | egrep -e 'zeroconf|daily[-_]report|/sa$' > zeroconf_files

touch gui_files manager_files pmda_infiniband_files \
      pmda_perfevent_files pmda_podman_files pmda_statsd_files \
      pmda_bonding_files pmda_dbping_files pmda_pdns_files \
      pmda_ds389_files pmda_ds389log_files pmda_gpfs_files \
      pmda_gpsd_files pmda_lustre_files pmda_lustrecomm_files \
      pmda_memcache_files pmda_named_files pmda_redis_files pmda_docker_files \
      pmda_netfilter_files pmda_news_files pmda_logger_files \
      pmda_rsyslog_files pmda_samba_files pmda_slurm_files \
      pmda_vmware_files pmda_zimbra_files pmda_apache_files pmda_bash_files \
      pmda_cifs_files pmda_cisco_files pmda_gfs2_files pmda_mic_files \
      pmda_mailq_files pmda_mounts_files pmda_nvidia_files pmda_roomtemp_files \
      pmda_rpm_files pmda_sendmail_files pmda_shping_files pmda_summary_files \
      pmda_trace_files pmda_weblog_files pmda_dm_files pmda_systemd_files \
      pmda_smart_files pmda_gluster_files pmda_zswap_files pmda_unbound_files \
      pmda_haproxy_files pmda_elasticsearch_files pmda_postfix_files \
      pmda_lmsensors_files pmda_nfsclient_files pmda_mssql_files \
      pmda_netcheck_files pmda_bcc_files pmda_bpftrace_files pmda_json_files \
      pmda_libvirt_files pmda_lio_files pmda_openmetrics_files pmda_snmp_files \
      pmda_mysql_files pmda_nginx_files pmda_activemq_files pmda_bind2_files \
      pmda_nutcracker_files pmda_postgresql_files pmda_oracle_files \
      zeroconf_files selinux_files system_tools_files

rm -f *_files.rpm
sort -u $DIST_MANIFEST | $PCP_AWK_PROG '
BEGIN {
    while( getline < "cfg_files") cfg[$0]=1;
    while( getline < "gui_files") gui[$0]=1;
    while( getline < "docs_files") doc[$0]=1;
    while( getline < "libs_files") lib[$0]=1;
    while( getline < "dev_files") dev[$0]=1;
    while( getline < "lib_devel_files") libdev[$0]=1;
    while( getline < "manager_files") manager[$0]=1;
    while( getline < "testsuite_files") testsuite[$0]=1;
    while( getline < "pmda_dm_files") pmda_dm[$0]=1;
    while( getline < "pmda_lustrecomm_files") pmda_lustrecomm[$0]=1;
    while( getline < "pmda_infiniband_files") pmda_infiniband[$0]=1;
%if "@pmda_podman@" == "true"
    while( getline < "pmda_podman_files") pmda_podman[$0]=1;
%endif
%if "@pmda_statsd@" == "true"
    while( getline < "pmda_statsd_files") pmda_statsd[$0]=1;
%endif
%if "@pmda_perfevent@" == "true"
    while( getline < "pmda_perfevent_files") pmda_perfevent[$0]=1;
%endif
%if "@pmda_activemq@" == "true"
    while( getline < "pmda_activemq_files") pmda_activemq[$0]=1;
%endif
%if "@pmda_bind2@" == "true"
    while( getline < "pmda_bind2_files") pmda_bind2[$0]=1;
%endif
%if "@pmda_nutcracker@" == "true"
    while( getline < "pmda_nutcracker_files") pmda_nutcracker[$0]=1;
%endif
%if "@pmda_elasticsearch@" == "true"
    while( getline < "pmda_elasticsearch_files") pmda_elasticsearch[$0]=1;
%endif
%if "@pmda_mysql@" == "true"
    while( getline < "pmda_mysql_files") pmda_mysql[$0]=1;
%endif
%if "@have_perl@" == "true"
    while( getline < "pmda_redis_files") pmda_redis[$0]=1;
    while( getline < "pmda_bonding_files") pmda_bonding[$0]=1;
    while( getline < "pmda_dbping_files") pmda_dbping[$0]=1;
    while( getline < "pmda_ds389log_files") pmda_ds389log[$0]=1;
    while( getline < "pmda_ds389_files") pmda_ds389[$0]=1;
    while( getline < "pmda_gpfs_files") pmda_gpfs[$0]=1;
    while( getline < "pmda_gpsd_files") pmda_gpsd[$0]=1;
    while( getline < "pmda_docker_files") pmda_docker[$0]=1;
    while( getline < "pmda_lustre_files") pmda_lustre[$0]=1;
    while( getline < "pmda_memcache_files") pmda_memcache[$0]=1;
    while( getline < "pmda_named_files") pmda_named[$0]=1;
    while( getline < "pmda_netfilter_files") pmda_netfilter[$0]=1;
    while( getline < "pmda_news_files") pmda_news[$0]=1;
    while( getline < "pmda_pdns_files") pmda_pdns[$0]=1;
    while( getline < "pmda_rsyslog_files") pmda_rsyslog[$0]=1;
    while( getline < "pmda_samba_files") pmda_samba[$0]=1;
    while( getline < "pmda_slurm_files") pmda_slurm[$0]=1;
    while( getline < "pmda_vmware_files") pmda_vmware[$0]=1;
    while( getline < "pmda_zimbra_files") pmda_zimbra[$0]=1;
%endif
%if "@pmda_nginx@" == "true"
    while( getline < "pmda_nginx_files") pmda_nginx[$0]=1;
%endif
%if "@pmda_postfix@" == "true"
    while( getline < "pmda_postfix_files") pmda_postfix[$0]=1;
%endif
%if "@pmda_postgresql@" == "true"
    while( getline < "pmda_postgresql_files") pmda_postgresql[$0]=1;
%endif
%if "@pmda_oracle@" == "true"
    while( getline < "pmda_oracle_files") pmda_oracle[$0]=1;
%endif
%if "@pmda_snmp@" == "true"
    while( getline < "pmda_snmp_files") pmda_snmp[$0]=1;
%endif
%if "@pmda_bcc@" == "true"
    while( getline < "pmda_bcc_files") pmda_bcc[$0]=1;
%endif
%if "@pmda_bpftrace@" == "true"
    while( getline < "pmda_bpftrace_files") pmda_bpftrace[$0]=1;
%endif
%if "@have_python@" == "true"
    while( getline < "system_tools_files") system_tools[$0]=1;
    while( getline < "pmda_gluster_files") pmda_gluster[$0]=1;
    while( getline < "pmda_zswap_files") pmda_zswap[$0]=1;
    while( getline < "pmda_unbound_files") pmda_unbound[$0]=1;
    while( getline < "pmda_mic_files") pmda_mic[$0]=1;
    while( getline < "pmda_haproxy_files") pmda_haproxy[$0]=1;
    while( getline < "pmda_lmsensors_files") pmda_lmsensors[$0]=1;
    while( getline < "pmda_mssql_files") pmda_mssql[$0]=1;
    while( getline < "pmda_netcheck_files") pmda_netcheck[$0]=1;
    while( getline < "pmda_nfsclient_files") pmda_nfsclient[$0]=1;
    while( getline < "export_pcp2graphite_files") export_pcp2graphite[$0]=1;
    while( getline < "export_pcp2json_files") export_pcp2json[$0]=1;
    while( getline < "export_pcp2spark_files") export_pcp2spark[$0]=1;
    while( getline < "export_pcp2xml_files") export_pcp2xml[$0]=1;
    while( getline < "export_pcp2zabbix_files") export_pcp2zabbix[$0]=1;
%endif
%if "@pcp2elasticsearch@" == "true"
    while( getline < "export_pcp2elasticsearch_files") export_pcp2elasticsearch[$0]=1;
%endif
%if "@pcp2influxdb@" == "true"
    while( getline < "export_pcp2influxdb_files") export_pcp2influxdb[$0]=1;
%endif
%if "@pcp2xlsx@" == "true"
    while( getline < "export_pcp2xlsx_files") export_pcp2xlsx[$0]=1;
%endif
    while( getline < "export_zabbix_agent_files") export_zabbix_agent[$0]=1;
%if "@pmda_json@" == "true"
    while( getline < "pmda_json_files") pmda_json[$0]=1;
%endif
%if "@pmda_libvirt@" == "true"
    while( getline < "pmda_libvirt_files") pmda_libvirt[$0]=1;
%endif
%if "@pmda_lio@" == "true"
    while( getline < "pmda_lio_files") pmda_lio[$0]=1;
%endif
%if "@pmda_openmetrics@" == "true"
    while( getline < "pmda_openmetrics_files") pmda_openmetrics[$0]=1;
%endif
%if "@pmda_systemd@" == "true"
    while( getline < "pmda_systemd_files") pmda_systemd[$0]=1;
%endif
    while( getline < "pmda_apache_files") pmda_apache[$0]=1;
    while( getline < "pmda_bash_files") pmda_bash[$0]=1;
    while( getline < "pmda_cifs_files") pmda_cifs[$0]=1;
    while( getline < "pmda_cisco_files") pmda_cisco[$0]=1;
    while( getline < "pmda_gfs2_files") pmda_gfs2[$0]=1;
    while( getline < "pmda_logger_files") pmda_logger[$0]=1;
    while( getline < "pmda_mailq_files") pmda_mailq[$0]=1;
    while( getline < "pmda_mounts_files") pmda_mounts[$0]=1;
    while( getline < "pmda_nvidia_files") pmda_nvidia[$0]=1;
    while( getline < "pmda_roomtemp_files") pmda_roomtemp[$0]=1;
    while( getline < "pmda_rpm_files") pmda_rpm[$0]=1;
    while( getline < "pmda_sendmail_files") pmda_sendmail[$0]=1;
    while( getline < "pmda_shping_files") pmda_shping[$0]=1;
    while( getline < "pmda_smart_files") pmda_smart[$0]=1;
    while( getline < "pmda_summary_files") pmda_summary[$0]=1;
    while( getline < "pmda_trace_files") pmda_trace[$0]=1;
    while( getline < "pmda_weblog_files") pmda_weblog[$0]=1;
%if "@have_perl@" == "true"
    while( getline < "import_sar2pcp_files") import_sar2pcp[$0]=1;
    while( getline < "import_iostat2pcp_files") import_iostat2pcp[$0]=1;
    while( getline < "import_sheet2pcp_files") import_sheet2pcp[$0]=1;
    while( getline < "import_mrtg2pcp_files") import_mrtg2pcp[$0]=1;
    while( getline < "import_ganglia2pcp_files") import_ganglia2pcp[$0]=1;
%endif
    while( getline < "import_collectl2pcp_files") import_collectl2pcp[$0]=1;
%if "@enable_selinux@" == "true"
    while( getline < "selinux_files") selinux[$0]=1;
%endif
    while( getline < "conf_files") conf[nconf++]=$0;
    while( getline < "zeroconf_files") zeroconf_files[$0]=1;
}
{
    if (cfg[$NF]) f="cfg_files.rpm";
    else if (gui[$NF]) f="gui_files.rpm";
%if "@enable_selinux@" == "true"
    else if (selinux[$NF]) f="selinux_files.rpm";
%endif
    else if (doc[$NF]) f="docs_files.rpm";
    else if (lib[$NF]) f="libs_files.rpm";
    else if (dev[$NF]) f="dev_files.rpm";
    else if (libdev[$NF]) f="lib_devel_files.rpm";
    else if (manager[$NF]) f="manager_files.rpm";
    else if (testsuite[$NF]) f="testsuite_files.rpm";
    else if (pmda_dm[$NF]) f="pmda_dm_files.rpm";
    else if (pmda_lustrecomm[$NF]) f="pmda_lustrecomm_files.rpm";
    else if (pmda_infiniband[$NF]) f="pmda_infiniband_files.rpm";
%if "@pmda_podman@" == "true"
    else if (pmda_podman[$NF]) f="pmda_podman_files.rpm";
%endif
%if "@pmda_statsd@" == "true"
    else if (pmda_statsd[$NF]) f="pmda_statsd_files.rpm";
%endif
%if "@pmda_perfevent@" == "true"
    else if (pmda_perfevent[$NF]) f="pmda_perfevent_files.rpm";
%endif
%if "@pmda_activemq@" == "true"
    else if (pmda_activemq[$NF]) f="pmda_activemq_files.rpm";
%endif
%if "@pmda_bind2@" == "true"
    else if (pmda_bind2[$NF]) f="pmda_bind2_files.rpm";
%endif
%if "@pmda_nutcracker@" == "true"
    else if (pmda_nutcracker[$NF]) f="pmda_nutcracker_files.rpm";
%endif
%if "@pmda_elasticsearch@" == "true"
    else if (pmda_elasticsearch[$NF]) f="pmda_elasticsearch_files.rpm";
%endif
%if "@pmda_mysql@" == "true"
    else if (pmda_mysql[$NF]) f="pmda_mysql_files.rpm";
%endif
%if "@have_perl@" == "true"
    else if (pmda_redis[$NF]) f="pmda_redis_files.rpm";
    else if (pmda_bonding[$NF]) f="pmda_bonding_files.rpm";
    else if (pmda_dbping[$NF]) f="pmda_dbping_files.rpm";
    else if (pmda_ds389log[$NF]) f="pmda_ds389log_files.rpm";
    else if (pmda_ds389[$NF]) f="pmda_ds389_files.rpm";
    else if (pmda_gpfs[$NF]) f="pmda_gpfs_files.rpm";
    else if (pmda_gpsd[$NF]) f="pmda_gpsd_files.rpm";
    else if (pmda_docker[$NF]) f="pmda_docker_files.rpm";
    else if (pmda_lustre[$NF]) f="pmda_lustre_files.rpm";
    else if (pmda_memcache[$NF]) f="pmda_memcache_files.rpm";
    else if (pmda_named[$NF]) f="pmda_named_files.rpm";
    else if (pmda_netfilter[$NF]) f="pmda_netfilter_files.rpm";
    else if (pmda_news[$NF]) f="pmda_news_files.rpm";
    else if (pmda_pdns[$NF]) f="pmda_pdns_files.rpm";
    else if (pmda_rsyslog[$NF]) f="pmda_rsyslog_files.rpm";
    else if (pmda_samba[$NF]) f="pmda_samba_files.rpm";
    else if (pmda_slurm[$NF]) f="pmda_slurm_files.rpm";
    else if (pmda_vmware[$NF]) f="pmda_vmware_files.rpm";
    else if (pmda_zimbra[$NF]) f="pmda_zimbra_files.rpm";
%endif
%if "@pmda_nginx@" == "true"
    else if (pmda_nginx[$NF]) f="pmda_nginx_files.rpm";
%endif
%if "@pmda_postfix@" == "true"
    else if (pmda_postfix[$NF]) f="pmda_postfix_files.rpm";
%endif
%if "@pmda_postgresql@" == "true"
    else if (pmda_postgresql[$NF]) f="pmda_postgresql_files.rpm";
%endif
%if "@pmda_oracle@" == "true"
    else if (pmda_oracle[$NF]) f="pmda_oracle_files.rpm";
%endif
%if "@pmda_snmp@" == "true"
    else if (pmda_snmp[$NF]) f="pmda_snmp_files.rpm";
%endif
%if "@pmda_bcc@" == "true"
    else if (pmda_bcc[$NF]) f="pmda_bcc_files.rpm";
%endif
%if "@pmda_bpftrace@" == "true"
    else if (pmda_bpftrace[$NF]) f="pmda_bpftrace_files.rpm";
%endif
%if "@have_python@" == "true"
    else if (system_tools[$NF]) f="system_tools_files.rpm";
    else if (pmda_gluster[$NF]) f="pmda_gluster_files.rpm";
    else if (pmda_zswap[$NF]) f="pmda_zswap_files.rpm";
    else if (pmda_unbound[$NF]) f="pmda_unbound_files.rpm";
    else if (pmda_mic[$NF]) f="pmda_mic_files.rpm";
    else if (pmda_haproxy[$NF]) f="pmda_haproxy_files.rpm";
    else if (pmda_lmsensors[$NF]) f="pmda_lmsensors_files.rpm";
    else if (pmda_mssql[$NF]) f="pmda_mssql_files.rpm";
    else if (pmda_netcheck[$NF]) f="pmda_netcheck_files.rpm";
    else if (pmda_nfsclient[$NF]) f="pmda_nfsclient_files.rpm";
    else if (export_pcp2graphite[$NF]) f="export_pcp2graphite_files.rpm";
    else if (export_pcp2json[$NF]) f="export_pcp2json_files.rpm";
    else if (export_pcp2spark[$NF]) f="export_pcp2spark_files.rpm";
    else if (export_pcp2xml[$NF]) f="export_pcp2xml_files.rpm";
    else if (export_pcp2zabbix[$NF]) f="export_pcp2zabbix_files.rpm";
%endif
%if "@pcp2elasticsearch@" == "true"
    else if (export_pcp2elasticsearch[$NF]) f="export_pcp2elasticsearch_files.rpm";
%endif
%if "@pcp2influxdb@" == "true"
    else if (export_pcp2influxdb[$NF]) f="export_pcp2influxdb_files.rpm";
%endif
%if "@pcp2xlsx@" == "true"
    else if (export_pcp2xlsx[$NF]) f="export_pcp2xlsx_files.rpm";
%endif
    else if (export_zabbix_agent[$NF]) f="export_zabbix_agent_files.rpm";
%if "@pmda_json@" == "true"
    else if (pmda_json[$NF]) f="pmda_json_files.rpm";
%endif
%if "@pmda_libvirt@" == "true"
    else if (pmda_libvirt[$NF]) f="pmda_libvirt_files.rpm";
%endif
%if "@pmda_lio@" == "true"
    else if (pmda_lio[$NF]) f="pmda_lio_files.rpm";
%endif
%if "@pmda_openmetrics@" == "true"
    else if (pmda_openmetrics[$NF]) f="pmda_openmetrics_files.rpm";
%endif
%if "@pmda_systemd@" == "true"
    else if (pmda_systemd[$NF]) f="pmda_systemd_files.rpm";
%endif
    else if (pmda_apache[$NF]) f="pmda_apache_files.rpm";
    else if (pmda_bash[$NF]) f="pmda_bash_files.rpm";
    else if (pmda_cifs[$NF]) f="pmda_cifs_files.rpm";
    else if (pmda_cisco[$NF]) f="pmda_cisco_files.rpm";
    else if (pmda_gfs2[$NF]) f="pmda_gfs2_files.rpm";
    else if (pmda_logger[$NF]) f="pmda_logger_files.rpm";
    else if (pmda_mailq[$NF]) f="pmda_mailq_files.rpm";
    else if (pmda_mounts[$NF]) f="pmda_mounts_files.rpm";
    else if (pmda_nvidia[$NF]) f="pmda_nvidia_files.rpm";
    else if (pmda_roomtemp[$NF]) f="pmda_roomtemp_files.rpm";
    else if (pmda_rpm[$NF]) f="pmda_rpm_files.rpm";
    else if (pmda_sendmail[$NF]) f="pmda_sendmail_files.rpm";
    else if (pmda_shping[$NF]) f="pmda_shping_files.rpm";
    else if (pmda_smart[$NF]) f="pmda_smart_files.rpm";
    else if (pmda_summary[$NF]) f="pmda_summary_files.rpm";
    else if (pmda_trace[$NF]) f="pmda_trace_files.rpm";
    else if (pmda_weblog[$NF]) f="pmda_weblog_files.rpm";
%if "@have_perl@" == "true"
    else if (import_sar2pcp[$NF]) f="import_sar2pcp_files.rpm";
    else if (import_iostat2pcp[$NF]) f="import_iostat2pcp_files.rpm";
    else if (import_sheet2pcp[$NF]) f="import_sheet2pcp_files.rpm";
    else if (import_mrtg2pcp[$NF]) f="import_mrtg2pcp_files.rpm";
    else if (import_ganglia2pcp[$NF]) f="import_ganglia2pcp_files.rpm";
%endif
    else if (import_collectl2pcp[$NF]) f="import_collectl2pcp_files.rpm";
    else if (zeroconf_files[$NF]) f="zeroconf.rpm";
    else f="base_files.rpm"
}
$1 == "d" {
	    if (match ($5, "'$PCP_RUN_DIR'")) {
		printf ("%%%%ghost ") >> f;
	    }
	    printf ("%%%%dir %%%%attr(%s,%s,%s) %s\n", $2, $3, $4, $5) >> f
	  }
$1 == "f" && $6 ~ "etc/pcp.conf" { printf ("%%%%config ") >> f; }
$1 == "f" && $6 ~ "etc/pcp.env"  { printf ("%%%%config ") >> f; }
$1 == "f" && $6 ~ "etc/pcp.sh"   { printf ("%%%%config ") >> f; }
$1 == "f" && $6 ~ "pmdapostgresql.conf"   { printf ("%%%%config(noreplace) ") >> f; }
$1 == "f" {
	    for (i=0; i < nconf; i++) {
		if ($6 ~ conf[i]) {
		    if ($6 ~ "pmmgr") {
			printf ("%%%%config(noreplace,missingok) ") >> f;
		    } else {
			printf ("%%%%config(noreplace) ") >> f;
		    }
		    break;
		}
	    }
	    if (match ($6, "'$PCP_MAN_DIR'") || match ($6, "'$PCP_DOC_DIR'")) {
		printf ("%%%%doc ") >> f;
	    }
	    printf ("%%%%attr(%s,%s,%s) %s\n", $2, $3, $4, $6) >> f
	  }
$1 == "l" { print $3 >> f }'

%pre testsuite
test -d @pcp_var_dir@/testsuite || mkdir -p -m 755 @pcp_var_dir@/testsuite
getent group pcpqa >/dev/null || groupadd -r pcpqa
getent passwd pcpqa >/dev/null || \
  useradd -c "PCP Quality Assurance" -g pcpqa -d @pcp_var_dir@/testsuite -M -r -s /bin/bash pcpqa 2>/dev/null
chown -R pcpqa:pcpqa @pcp_var_dir@/testsuite 2>/dev/null
exit 0

%post testsuite
chown -R pcpqa:pcpqa @pcp_var_dir@/testsuite 2>/dev/null
# inherited from %post for pcp-collector
%if "@enable_systemd@" == "true"
    systemctl restart pmcd >/dev/null 2>&1
    systemctl restart pmlogger >/dev/null 2>&1
    systemctl enable pmcd >/dev/null 2>&1
    systemctl enable pmlogger >/dev/null 2>&1
%else
    /sbin/chkconfig --add pmcd >/dev/null 2>&1
    /sbin/chkconfig --add pmlogger >/dev/null 2>&1
    /sbin/service pmcd condrestart
    /sbin/service pmlogger condrestart
%endif

%pre
getent group pcp >/dev/null || groupadd -r pcp
getent passwd pcp >/dev/null || \
    useradd -c "Performance Co-Pilot" -g pcp -d @pcp_var_dir@ -M -r -s /sbin/nologin pcp
exit 0

%if "@enable_manager@" == "true"
%preun manager
if [ "$1" -eq 0 ]
then
    %if "@enable_systemd@" == "true"
	systemctl --no-reload disable pmmgr.service >/dev/null 2>&1
	systemctl stop pmmgr.service >/dev/null 2>&1
    %else
	/sbin/service pmmgr stop >/dev/null 2>&1
	/sbin/chkconfig --del pmmgr >/dev/null 2>&1
    %endif
fi

%post manager
chown -R pcp:pcp "$PCP_LOG_DIR/pmmgr" 2>/dev/null
%if "@enable_systemd@" == "true"
    systemctl condrestart pmmgr.service >/dev/null 2>&1
%else
    /sbin/chkconfig --add pmmgr >/dev/null 2>&1
    /sbin/service pmmgr condrestart
%endif
%endif

%post zeroconf
PCP_PMDAS_DIR=@pcp_pmdas_dir@
PCP_SYSCONFIG_DIR=@pcp_sysconfig_dir@
PCP_PMCDCONF_PATH=@pcp_pmcdconf_path@
# auto-install important PMDAs for RH Support (if not present already)
for PMDA in dm nfsclient ; do
    if ! grep -q "$PMDA/pmda$PMDA" "$PCP_PMCDCONF_PATH"
    then
	touch "$PCP_PMDAS_DIR/$PMDA/.NeedInstall"
    fi
done
# increase default pmlogger recording frequency
sed -i 's/^\#\ PMLOGGER_INTERVAL.*/PMLOGGER_INTERVAL=10/g' "$PCP_SYSCONFIG_DIR/pmlogger"
# auto-enable these usually optional pmie rules
pmieconf -c enable dmthin

%if "@enable_systemd@" == "true"
    systemctl restart pmcd >/dev/null 2>&1
    systemctl restart pmlogger >/dev/null 2>&1
    systemctl restart pmie >/dev/null 2>&1
    systemctl enable pmcd >/dev/null 2>&1
    systemctl enable pmlogger >/dev/null 2>&1
    systemctl enable pmie >/dev/null 2>&1
%else
    /sbin/chkconfig --add pmcd >/dev/null 2>&1
    /sbin/chkconfig --add pmlogger >/dev/null 2>&1
    /sbin/chkconfig --add pmie >/dev/null 2>&1
    /sbin/service pmcd condrestart
    /sbin/service pmlogger condrestart
    /sbin/service pmie condrestart
%endif

%if "@enable_selinux@" == "true"
%preun selinux
%{selinux_handle_policy "$1" "pcpupstream"}

%triggerin selinux -- docker-selinux
%{selinux_handle_policy "$1" "pcpupstream-docker"}

%triggerin selinux -- container-selinux
%{selinux_handle_policy "$1" "pcpupstream-container"}
%endif

%if "@pmda_rpm@" == "true"
%preun pmda-rpm
%{pmda_remove "$1" "rpm"}
%endif

%if "@pmda_systemd@" == "true"
%preun pmda-systemd
%{pmda_remove "$1" "systemd"}
%endif

%if "@pmda_infiniband@" == "true"
%preun pmda-infiniband
%{pmda_remove "$1" "infiniband"}
%endif

%if "@pmda_perfevent@" == "true"
%preun pmda-perfevent
%{pmda_remove "$1" "perfevent"}
%endif

%if "@pmda_podman@" == "true"
%preun pmda-podman
%{pmda_remove "$1" "podman"}
%endif

%if "@pmda_statsd@" == "true"
%preun pmda-statsd
%{pmda_remove "$1" "statsd"}
%endif

%if "@pmda_json@" == "true"
%preun pmda-json
%{pmda_remove "$1" "json"}
%endif

%if "@pmda_libvirt@" == "true"
%preun pmda-libvirt
%{pmda_remove "$1" "libvirt"}
%endif

%if "@pmda_lio@" == "true"
%preun pmda-lio
%{pmda_remove "$1" "lio"}
%endif

%if "@pmda_openmetrics@" == "true"
%preun pmda-openmetrics
%{pmda_remove "$1" "openmetrics"}
%endif

%if "@pmda_nginx@" == "true"
%preun pmda-nginx
%{pmda_remove "$1" "nginx"}
%endif

%if "@pmda_oracle@" == "true"
%preun pmda-oracle
%{pmda_remove "$1" "oracle"}
%endif

%if "@pmda_postgresql@" == "true"
%preun pmda-postgresql
%{pmda_remove "$1" "postgresql"}
%endif

%if "@pmda_postfix@" == "true"
%preun pmda-postfix
%{pmda_remove "$1" "postfix"}
%endif

%if "@pmda_elasticsearch@" == "true"
%preun pmda-elasticsearch
%{pmda_remove "$1" "elasticsearch"}
%endif

%if "@pmda_snmp@" == "true"
%preun pmda-snmp
%{pmda_remove "$1" "snmp"}
%endif

%if "@pmda_mysql@" == "true"
%preun pmda-mysql
%{pmda_remove "$1" "mysql"}
%endif

%if "@pmda_activemq@" == "true"
%preun pmda-activemq
%{pmda_remove "$1" "activemq"}
%endif

%if "@pmda_bind2@" == "true"
%preun pmda-bind2
%{pmda_remove "$1" "bind2"}
%endif

%if "@pmda_nutcracker@" == "true"
%preun pmda-nutcracker
%{pmda_remove "$1" "nutcracker"}
%endif

%if "@have_perl@" == "true"
%preun pmda-redis
%{pmda_remove "$1" "redis"}

%preun pmda-bonding
%{pmda_remove "$1" "bonding"}

%preun pmda-dbping
%{pmda_remove "$1" "dbping"}

%preun pmda-ds389
%{pmda_remove "$1" "ds389"}

%preun pmda-ds389log
%{pmda_remove "$1" "ds389log"}

%preun pmda-gpfs
%{pmda_remove "$1" "gpfs"}

%preun pmda-gpsd
%{pmda_remove "$1" "gpsd"}

%preun pmda-docker
%{pmda_remove "$1" "docker"}

%preun pmda-lustre
%{pmda_remove "$1" "lustre"}

%preun pmda-memcache
%{pmda_remove "$1" "memcache"}

%preun pmda-named
%{pmda_remove "$1" "named"}

%preun pmda-netfilter
%{pmda_remove "$1" "netfilter"}

%preun pmda-news
%{pmda_remove "$1" "news"}

%preun pmda-pdns
%{pmda_remove "$1" "pdns"}

%preun pmda-rsyslog
%{pmda_remove "$1" "rsyslog"}

%preun pmda-samba
%{pmda_remove "$1" "samba"}

%preun pmda-vmware
%{pmda_remove "$1" "vmware"}

%preun pmda-zimbra
%{pmda_remove "$1" "zimbra"}
%endif

%preun pmda-lustrecomm
%{pmda_remove "$1" "lustrecomm"}

%preun pmda-dm
%{pmda_remove "$1" "dm"}

%if "@pmda_bcc@" == "true"
%preun pmda-bcc
%{pmda_remove "$1" "bcc"}
%endif

%if "@pmda_bpftrace@" == "true"
%preun pmda-bpftrace
%{pmda_remove "$1" "bpftrace"}
%endif

%if "@have_python@" == "true"
%preun pmda-gluster
%{pmda_remove "$1" "gluster"}

%preun pmda-zswap
%{pmda_remove "$1" "zswap"}

%preun pmda-unbound
%{pmda_remove "$1" "unbound"}

%preun pmda-mic
%{pmda_remove "$1" "mic"}

%preun pmda-haproxy
%{pmda_remove "$1" "haproxy"}

%preun pmda-nfsclient
%{pmda_remove "$1" "nfsclient"}

%preun pmda-lmsensors
%{pmda_remove "$1" "lmsensors"}

%preun pmda-mssql
%{pmda_remove "$1" "mssql"}

%preun pmda-netcheck
%{pmda_remove "$1" "netcheck"}
%endif

%preun pmda-apache
%{pmda_remove "$1" "apache"}

%preun pmda-bash
%{pmda_remove "$1" "bash"}

%preun pmda-cifs
%{pmda_remove "$1" "cifs"}

%preun pmda-cisco
%{pmda_remove "$1" "cisco"}

%preun pmda-gfs2
%{pmda_remove "$1" "gfs2"}

%preun pmda-logger
%{pmda_remove "$1" "logger"}

%preun pmda-mailq
%{pmda_remove "$1" "mailq"}

%preun pmda-mounts
%{pmda_remove "$1" "mounts"}

%preun pmda-nvidia-gpu
%{pmda_remove "$1" "nvidia"}

%preun pmda-roomtemp
%{pmda_remove "$1" "roomtemp"}

%preun pmda-sendmail
%{pmda_remove "$1" "sendmail"}

%preun pmda-shping
%{pmda_remove "$1" "shping"}

%preun pmda-smart
%{pmda_remove "$1" "smart"}

%preun pmda-summary
%{pmda_remove "$1" "summary"}

%preun pmda-trace
%{pmda_remove "$1" "trace"}

%preun pmda-weblog
%{pmda_remove "$1" "weblog"}

%if "@enable_systemd@" == "true"
%preun zeroconf
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

%preun
if [ "$1" -eq 0 ]
then
    # stop daemons before erasing the package
    %if "@enable_systemd@" == "true"
        %systemd_preun pmlogger.service
	%systemd_preun pmie.service
	%systemd_preun pmproxy.service
	%systemd_preun pmcd.service

	systemctl stop pmlogger.service >/dev/null 2>&1
	systemctl stop pmie.service >/dev/null 2>&1
	systemctl stop pmproxy.service >/dev/null 2>&1
	systemctl stop pmcd.service >/dev/null 2>&1
    %else
	/sbin/service pmlogger stop >/dev/null 2>&1
	/sbin/service pmie stop >/dev/null 2>&1
	/sbin/service pmproxy stop >/dev/null 2>&1
	/sbin/service pmcd stop >/dev/null 2>&1

	/sbin/chkconfig --del pcp >/dev/null 2>&1
	/sbin/chkconfig --del pmcd >/dev/null 2>&1
	/sbin/chkconfig --del pmlogger >/dev/null 2>&1
	/sbin/chkconfig --del pmie >/dev/null 2>&1
	/sbin/chkconfig --del pmproxy >/dev/null 2>&1
    %endif
    # cleanup namespace state/flag, may still exist
    PCP_PMNS_DIR=@pcp_var_dir@/pmns
    rm -f "$PCP_PMNS_DIR/.NeedRebuild" >/dev/null 2>&1
fi

%post
PCP_PMNS_DIR=@pcp_var_dir@/pmns
PCP_LOG_DIR=@pcp_log_dir@
PCP_SA_DIR=@pcp_sa_dir@

chown -R pcp:pcp "$PCP_LOG_DIR/pmcd" 2>/dev/null
chown -R pcp:pcp "$PCP_LOG_DIR/pmlogger" 2>/dev/null
chown -R pcp:pcp "$PCP_SA_DIR" 2>/dev/null
chown -R pcp:pcp "$PCP_LOG_DIR/pmie" 2>/dev/null
chown -R pcp:pcp "$PCP_LOG_DIR/pmproxy" 2>/dev/null
touch "$PCP_PMNS_DIR/.NeedRebuild"
chmod 644 "$PCP_PMNS_DIR/.NeedRebuild"

%if "@enable_systemd@" == "true"
    %systemd_postun_with_restart pmcd.service
    %systemd_post pmcd.service
    %systemd_postun_with_restart pmlogger.service
    %systemd_post pmlogger.service
    %systemd_postun_with_restart pmie.service
    %systemd_post pmie.service
    systemctl condrestart pmproxy.service >/dev/null 2>&1
%else
    /sbin/chkconfig --add pmcd >/dev/null 2>&1
    /sbin/service pmcd condrestart
    /sbin/chkconfig --add pmlogger >/dev/null 2>&1
    /sbin/service pmlogger condrestart
    /sbin/chkconfig --add pmie >/dev/null 2>&1
    /sbin/service pmie condrestart
    /sbin/chkconfig --add pmproxy >/dev/null 2>&1
    /sbin/service pmproxy condrestart
%endif

cd "$PCP_PMNS_DIR" && ./Rebuild -s && rm -f .NeedRebuild
cd

%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig

%if "@enable_selinux@" == "true"
%post selinux
%{selinux_handle_policy "$1" "pcpupstream"}

%triggerun selinux -- docker-selinux
%{selinux_handle_policy "$1" "pcpupstream-docker"}

%triggerun selinux -- container-selinux
%{selinux_handle_policy "$1" "pcpupstream-container"}
%endif

%files -f base_files.rpm

%files conf -f cfg_files.rpm

%files libs -f libs_files.rpm

%files libs-devel -f lib_devel_files.rpm

%files devel -f dev_files.rpm

%files doc -f docs_files.rpm

%if "@enable_selinux@" == "true"
%files selinux -f selinux_files.rpm
%endif

%if "@enable_qt@" == "true"
%files gui -f gui_files.rpm
%endif

%if "@enable_manager@" == "true"
%files manager -f manager_files.rpm
%endif

%files testsuite -f testsuite_files.rpm
%defattr(-,pcpqa,pcpqa)

%if "@pmda_infiniband@" == "true"
%files pmda-infiniband -f pmda_infiniband_files.rpm
%endif

%if "@pmda_podman@" == "true"
%files pmda-podman -f pmda_podman_files.rpm
%endif

%if "@pmda_statsd@" == "true"
%files pmda-statsd -f pmda_statsd_files.rpm
%endif

%if "@pmda_perfevent@" == "true"
%files pmda-perfevent -f pmda_perfevent_files.rpm
%endif

%if "@pmda_activemq@" == "true"
%files pmda-activemq -f pmda_activemq_files.rpm
%endif

%if "@pmda_bind2@" == "true"
%files pmda-bind2 -f pmda_bind2_files.rpm
%endif

%if "@pmda_nutcracker@" == "true"
%files pmda-nutcracker -f pmda_nutcracker_files.rpm
%endif

%if "@pmda_elasticsearch@" == "true"
%files pmda-elasticsearch -f pmda_elasticsearch_files.rpm
%endif

%if "@have_perl@" == "true"
%files pmda-redis -f pmda_redis_files.rpm

%files pmda-bonding -f pmda_bonding_files.rpm

%files pmda-dbping -f pmda_dbping_files.rpm

%files pmda-ds389log -f pmda_ds389log_files.rpm

%files pmda-ds389 -f pmda_ds389_files.rpm

%files pmda-gpfs -f pmda_gpfs_files.rpm

%files pmda-gpsd -f pmda_gpsd_files.rpm

%files pmda-docker -f pmda_docker_files.rpm

%files pmda-lustre -f pmda_lustre_files.rpm

%files pmda-memcache -f pmda_memcache_files.rpm

%files pmda-named -f pmda_named_files.rpm

%files pmda-netfilter -f pmda_netfilter_files.rpm

%files pmda-news -f pmda_news_files.rpm

%files pmda-pdns -f pmda_pdns_files.rpm

%files pmda-rsyslog -f pmda_rsyslog_files.rpm

%files pmda-samba -f pmda_samba_files.rpm

%files pmda-slurm -f pmda_slurm_files.rpm

%files pmda-vmware -f pmda_vmware_files.rpm

%files pmda-zimbra -f pmda_zimbra_files.rpm
%endif

%files pmda-lustrecomm -f pmda_lustrecomm_files.rpm

%if "@pmda_mysql@" == "true"
%files pmda-mysql -f pmda_mysql_files.rpm
%endif

%if "@pmda_nginx@" == "true"
%files pmda-nginx -f pmda_nginx_files.rpm
%endif

%if "@pmda_postfix@" == "true"
%files pmda-postfix -f pmda_postfix_files.rpm
%endif

%if "@pmda_postgresql@" == "true"
%files pmda-postgresql -f pmda_postgresql_files.rpm
%endif

%if "@pmda_oracle@" == "true"
%files pmda-oracle -f pmda_oracle_files.rpm
%endif

%if "@pmda_snmp@" == "true"
%files pmda-snmp -f pmda_snmp_files.rpm
%endif

%files pmda-dm -f pmda_dm_files.rpm

%if "@pmda_bcc@" == "true"
%files pmda-bcc -f pmda_bcc_files.rpm
%endif

%if "@pmda_bpftrace@" == "true"
%files pmda-bpftrace -f pmda_bpftrace_files.rpm
%endif

%if "@have_python@" == "true"
%files pmda-gluster -f pmda_gluster_files.rpm

%files pmda-zswap -f pmda_zswap_files.rpm

%files pmda-unbound -f pmda_unbound_files.rpm

%files pmda-mic -f pmda_mic_files.rpm

%files pmda-haproxy -f pmda_haproxy_files.rpm

%files pmda-lmsensors -f pmda_lmsensors_files.rpm

%files pmda-mssql -f pmda_mssql_files.rpm

%files pmda-netcheck -f pmda_netcheck_files.rpm

%files pmda-nfsclient -f pmda_nfsclient_files.rpm

%files export-pcp2graphite -f export_pcp2graphite_files.rpm

%files export-pcp2json -f export_pcp2json_files.rpm

%files export-pcp2spark -f export_pcp2spark_files.rpm

%files export-pcp2xml -f export_pcp2xml_files.rpm

%files export-pcp2zabbix -f export_pcp2zabbix_files.rpm

%endif

%if "@pcp2elasticsearch@" == "true"
%files export-pcp2elasticsearch -f export_pcp2elasticsearch_files.rpm
%endif

%if "@pcp2influxdb@" == "true"
%files export-pcp2influxdb -f export_pcp2influxdb_files.rpm
%endif

%if "@pcp2xlsx@" == "true"
%files export-pcp2xlsx -f export_pcp2xlsx_files.rpm
%endif

%files export-zabbix-agent -f export_zabbix_agent_files.rpm

%if "@pmda_json@" == "true"
%files pmda-json -f pmda_json_files.rpm
%endif

%if "@pmda_libvirt@" == "true"
%files pmda-libvirt -f pmda_libvirt_files.rpm
%endif

%if "@pmda_lio@" == "true"
%files pmda-lio -f pmda_lio_files.rpm
%endif

%if "@pmda_openmetrics@" == "true"
%files pmda-openmetrics -f pmda_openmetrics_files.rpm
%endif

%files pmda-apache -f pmda_apache_files.rpm

%files pmda-bash -f pmda_bash_files.rpm

%files pmda-cifs -f pmda_cifs_files.rpm

%files pmda-cisco -f pmda_cisco_files.rpm

%files pmda-gfs2 -f pmda_gfs2_files.rpm

%files pmda-logger -f pmda_logger_files.rpm

%files pmda-mailq -f pmda_mailq_files.rpm

%files pmda-mounts -f pmda_mounts_files.rpm

%files pmda-nvidia-gpu -f pmda_nvidia_files.rpm

%files pmda-roomtemp -f pmda_roomtemp_files.rpm

%if "@pmda_rpm@" == "true"
%files pmda-rpm -f pmda_rpm_files.rpm
%endif

%files pmda-sendmail -f pmda_sendmail_files.rpm

%files pmda-shping -f pmda_shping_files.rpm

%files pmda-smart -f pmda_smart_files.rpm

%files pmda-summary -f pmda_summary_files.rpm

%if "@pmda_systemd@" == "true"
%files pmda-systemd -f pmda_systemd_files.rpm
%endif

%files pmda-trace -f pmda_trace_files.rpm

%files pmda-weblog -f pmda_weblog_files.rpm

%if "@have_perl@" == "true"
%files import-sar2pcp -f import_sar2pcp_files.rpm

%files import-iostat2pcp -f import_iostat2pcp_files.rpm

%files import-sheet2pcp -f import_sheet2pcp_files.rpm

%files import-mrtg2pcp -f import_mrtg2pcp_files.rpm

%files import-ganglia2pcp -f import_ganglia2pcp_files.rpm
%endif

%files import-collectl2pcp -f import_collectl2pcp_files.rpm

%if "@have_perl@" == "true"
%files -n perl-PCP-PMDA -f perl-pcp-pmda.list

%files -n perl-PCP-MMV -f perl-pcp-mmv.list

%files -n perl-PCP-LogImport -f perl-pcp-logimport.list

%files -n perl-PCP-LogSummary -f perl-pcp-logsummary.list
%endif

%if "@enable_python2@" == "true"
%files -n %{__python2}-pcp -f python-pcp.list.rpm
%endif

%if "@enable_python3@" == "true"
%files -n python3-pcp -f python3-pcp.list.rpm
%endif

%if "@have_python@" == "true"
%files system-tools -f system_tools_files.rpm
%endif

%files zeroconf -f zeroconf.rpm
