Blame SPECS/pcp.spec

e7bec3
Summary: System-level performance monitoring and performance management
e7bec3
Name: pcp
95ec45
Version: 3.8.10
95ec45
%define buildversion 8
e7bec3
e7bec3
Release: %{buildversion}%{?dist}
e7bec3
License: GPLv2+ and LGPLv2.1+
e7bec3
URL: http://oss.sgi.com/projects/pcp
e7bec3
Group: Applications/System
e7bec3
Source0: pcp-%{version}.src.tar.gz
e7bec3
95ec45
# man pages for all of the PMDAs missing out (BZ 1053094)
95ec45
Patch1: bz1053094.patch
95ec45
# pmdalinux failure on unexpected ICMP types (BZ 1055826)
95ec45
Patch2: bz1055826.patch
95ec45
# ensure PMNS stdpmid files are installed (BZ 1059004)
95ec45
Patch3: bz1059004.patch
95ec45
# pmdammv induced pmcd segv during tests (BZ 1061330)
95ec45
Patch4: bz1061330.patch
95ec45
# python-pcp time API wrapper implementation (BZ 1062467)
95ec45
Patch5: bz1062467.patch
95ec45
# missing qualified output for newly added tests (BZ 1064311)
95ec45
Patch6: bz1064311.patch
95ec45
# PMDA install now works without a running pmcd (BZ 1062443)
95ec45
Patch7: bz1062443.patch
95ec45
# pmdalinux memory corruption issue on s390x (BZ 1064254)
95ec45
Patch8: bz1064254.patch
95ec45
# handful of QE-found test-induced failure fixes (BZ 987086)
95ec45
Patch9: bz987086.patch
95ec45
# multilib packaging support for libs and devel (BZ 1059642)
95ec45
Patch10: bz1059642.patch
95ec45
# update pmmgr to pcp 3.9.0+ level
95ec45
Patch11: bz1067547.patch
e7bec3
e7bec3
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
e7bec3
BuildRequires: procps autoconf bison flex
e7bec3
BuildRequires: nss-devel
95ec45
BuildRequires: rpm-devel
95ec45
BuildRequires: avahi-devel
e7bec3
BuildRequires: python-devel
e7bec3
BuildRequires: ncurses-devel
e7bec3
BuildRequires: readline-devel
e7bec3
BuildRequires: cyrus-sasl-devel
e7bec3
BuildRequires: libmicrohttpd-devel
e7bec3
%ifnarch ppc ppc64
e7bec3
BuildRequires: systemtap-sdt-devel
e7bec3
%endif
e7bec3
BuildRequires: perl(ExtUtils::MakeMaker)
e7bec3
BuildRequires: initscripts man
e7bec3
%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
e7bec3
BuildRequires: systemd-devel
e7bec3
%endif
e7bec3
 
e7bec3
Requires: bash gawk sed grep fileutils findutils initscripts perl
e7bec3
Requires: python
e7bec3
%if 0%{?rhel} <= 5
e7bec3
Requires: python-ctypes
e7bec3
%endif
e7bec3
e7bec3
Requires: pcp-libs = %{version}-%{release}
e7bec3
Requires: python-pcp = %{version}-%{release}
e7bec3
Requires: perl-PCP-PMDA = %{version}-%{release}
e7bec3
e7bec3
%global tapsetdir      %{_datadir}/systemtap/tapset
e7bec3
e7bec3
%define _confdir  %{_sysconfdir}/pcp
e7bec3
%define _initddir %{_sysconfdir}/rc.d/init.d
e7bec3
%define _logsdir  %{_localstatedir}/log/pcp
e7bec3
%define _pmnsdir  %{_localstatedir}/lib/pcp/pmns
e7bec3
%define _tempsdir %{_localstatedir}/lib/pcp/tmp
e7bec3
%define _pmdasdir %{_localstatedir}/lib/pcp/pmdas
e7bec3
%define _testsdir %{_localstatedir}/lib/pcp/testsuite
e7bec3
e7bec3
%if 0%{?fedora} >= 20
e7bec3
%define _with_doc --with-docdir=%{_docdir}/%{name}
e7bec3
%endif
e7bec3
e7bec3
# we never want Infiniband on s390 platforms
e7bec3
%ifarch s390 s390x
e7bec3
%define disable_infiniband 1
e7bec3
%else
e7bec3
e7bec3
# we never want Infiniband on RHEL5 or earlier
e7bec3
%if 0%{?rhel} != 0 && 0%{?rhel} < 6
e7bec3
%define disable_infiniband 1
e7bec3
%else
e7bec3
%define disable_infiniband 0
e7bec3
%endif
e7bec3
e7bec3
%endif
e7bec3
e7bec3
%if %{disable_infiniband}
e7bec3
%define _with_ib --with-infiniband=no
e7bec3
%endif
e7bec3
e7bec3
%description
e7bec3
Performance Co-Pilot (PCP) provides a framework and services to support
e7bec3
system-level performance monitoring and performance management. 
e7bec3
e7bec3
The PCP open source release provides a unifying abstraction for all of
e7bec3
the interesting performance data in a system, and allows client
e7bec3
applications to easily retrieve and process any subset of that data. 
e7bec3
e7bec3
#
95ec45
# pcp-conf
95ec45
#
95ec45
%package conf
95ec45
License: LGPLv2+
95ec45
Group: Development/Libraries
95ec45
Summary: Performance Co-Pilot run-time configuration
95ec45
URL: http://oss.sgi.com/projects/pcp/
95ec45
95ec45
# http://fedoraproject.org/wiki/Packaging:Conflicts "Splitting Packages"
95ec45
Conflicts: pcp-libs < 3.8.10-7
95ec45
95ec45
%description conf
95ec45
Performance Co-Pilot (PCP) run-time configuration
95ec45
95ec45
#
e7bec3
# pcp-libs
e7bec3
#
e7bec3
%package libs
e7bec3
License: LGPLv2+
e7bec3
Group: Development/Libraries
e7bec3
Summary: Performance Co-Pilot run-time libraries
e7bec3
URL: http://oss.sgi.com/projects/pcp/
e7bec3
95ec45
Requires: pcp-conf = %{version}-%{release}
95ec45
e7bec3
%description libs
e7bec3
Performance Co-Pilot (PCP) run-time libraries
e7bec3
e7bec3
#
e7bec3
# pcp-libs-devel
e7bec3
#
e7bec3
%package libs-devel
e7bec3
License: GPLv2+ and LGPLv2.1+
e7bec3
Group: Development/Libraries
e7bec3
Summary: Performance Co-Pilot (PCP) development headers and documentation
e7bec3
URL: http://oss.sgi.com/projects/pcp/
e7bec3
Requires: pcp-libs = %{version}-%{release}
e7bec3
e7bec3
%description libs-devel
e7bec3
Performance Co-Pilot (PCP) headers, documentation and tools for development.
e7bec3
e7bec3
#
e7bec3
# pcp-testsuite
e7bec3
#
e7bec3
%package testsuite
e7bec3
License: GPLv2+
e7bec3
Group: Development/Libraries
e7bec3
Summary: Performance Co-Pilot (PCP) test suite
e7bec3
URL: http://oss.sgi.com/projects/pcp/
e7bec3
Requires: pcp = %{version}-%{release}
95ec45
Requires: pcp-libs = %{version}-%{release}
e7bec3
Requires: pcp-libs-devel = %{version}-%{release}
e7bec3
e7bec3
%description testsuite
e7bec3
Quality assurance test suite for Performance Co-Pilot (PCP).
e7bec3
e7bec3
#
e7bec3
# perl-PCP-PMDA. This is the PCP agent perl binding.
e7bec3
#
e7bec3
%package -n perl-PCP-PMDA
e7bec3
License: GPLv2+
e7bec3
Group: Development/Libraries
e7bec3
Summary: Performance Co-Pilot (PCP) Perl bindings and documentation
e7bec3
URL: http://oss.sgi.com/projects/pcp/
e7bec3
Requires: pcp-libs = %{version}-%{release}
e7bec3
e7bec3
%description -n perl-PCP-PMDA
e7bec3
The PCP::PMDA Perl module contains the language bindings for
e7bec3
building Performance Metric Domain Agents (PMDAs) using Perl.
e7bec3
Each PMDA exports performance data for one specific domain, for
e7bec3
example the operating system kernel, Cisco routers, a database,
e7bec3
an application, etc.
e7bec3
e7bec3
#
e7bec3
# perl-PCP-MMV
e7bec3
#
e7bec3
%package -n perl-PCP-MMV
e7bec3
License: GPLv2+
e7bec3
Group: Development/Libraries
e7bec3
Summary: Performance Co-Pilot (PCP) Perl bindings for PCP Memory Mapped Values
e7bec3
URL: http://oss.sgi.com/projects/pcp/
e7bec3
Requires: pcp-libs = %{version}-%{release}
e7bec3
e7bec3
%description -n perl-PCP-MMV
e7bec3
The PCP::MMV module contains the Perl language bindings for
e7bec3
building scripts instrumented with the Performance Co-Pilot
e7bec3
(PCP) Memory Mapped Value (MMV) mechanism.
e7bec3
This mechanism allows arbitrary values to be exported from an
e7bec3
instrumented script into the PCP infrastructure for monitoring
e7bec3
and analysis with pmchart, pmie, pmlogger and other PCP tools.
e7bec3
e7bec3
#
e7bec3
# perl-PCP-LogImport
e7bec3
#
e7bec3
%package -n perl-PCP-LogImport
e7bec3
License: GPLv2+
e7bec3
Group: Development/Libraries
e7bec3
Summary: Performance Co-Pilot (PCP) Perl bindings for importing external data into PCP archives
e7bec3
URL: http://oss.sgi.com/projects/pcp/
e7bec3
Requires: pcp-libs = %{version}-%{release}
e7bec3
e7bec3
%description -n perl-PCP-LogImport
e7bec3
The PCP::LogImport module contains the Perl language bindings for
e7bec3
importing data in various 3rd party formats into PCP archives so
e7bec3
they can be replayed with standard PCP monitoring tools.
e7bec3
e7bec3
 #
e7bec3
# perl-PCP-LogSummary
e7bec3
#
e7bec3
%package -n perl-PCP-LogSummary
e7bec3
License: GPLv2+
e7bec3
Group: Development/Libraries
e7bec3
Summary: Performance Co-Pilot (PCP) Perl bindings for post-processing output of pmlogsummary
e7bec3
URL: http://oss.sgi.com/projects/pcp/
e7bec3
Requires: pcp-libs = %{version}-%{release}
e7bec3
e7bec3
%description -n perl-PCP-LogSummary
e7bec3
The PCP::LogSummary module provides a Perl module for using the
e7bec3
statistical summary data produced by the Performance Co-Pilot
e7bec3
pmlogsummary utility.  This utility produces various averages,
e7bec3
minima, maxima, and other calculations based on the performance
e7bec3
data stored in a PCP archive.  The Perl interface is ideal for
e7bec3
exporting this data into third-party tools (e.g. spreadsheets).
e7bec3
e7bec3
#
e7bec3
# pcp-import-sar2pcp
e7bec3
#
e7bec3
%package import-sar2pcp
e7bec3
License: LGPLv2+
e7bec3
Group: Applications/System
e7bec3
Summary: Performance Co-Pilot tools for importing sar data into PCP archive logs
e7bec3
URL: http://oss.sgi.com/projects/pcp/
e7bec3
Requires: pcp-libs = %{version}-%{release}
e7bec3
Requires: perl-PCP-LogImport = %{version}-%{release}
e7bec3
Requires: sysstat
e7bec3
e7bec3
%description import-sar2pcp
e7bec3
Performance Co-Pilot (PCP) front-end tools for importing sar data
e7bec3
into standard PCP archive logs for replay with any PCP monitoring tool.
e7bec3
e7bec3
#
e7bec3
# pcp-import-iostat2pcp
e7bec3
#
e7bec3
%package import-iostat2pcp
e7bec3
License: LGPLv2+
e7bec3
Group: Applications/System
e7bec3
Summary: Performance Co-Pilot tools for importing iostat data into PCP archive logs
e7bec3
URL: http://oss.sgi.com/projects/pcp/
e7bec3
Requires: pcp-libs = %{version}-%{release}
e7bec3
Requires: perl-PCP-LogImport = %{version}-%{release}
e7bec3
Requires: sysstat
e7bec3
e7bec3
%description import-iostat2pcp
e7bec3
Performance Co-Pilot (PCP) front-end tools for importing iostat data
e7bec3
into standard PCP archive logs for replay with any PCP monitoring tool.
e7bec3
e7bec3
#
e7bec3
# pcp-import-mrtg2pcp
e7bec3
#
e7bec3
%package import-mrtg2pcp
e7bec3
License: LGPLv2+
e7bec3
Group: Applications/System
e7bec3
Summary: Performance Co-Pilot tools for importing MTRG data into PCP archive logs
e7bec3
URL: http://oss.sgi.com/projects/pcp/
e7bec3
Requires: pcp-libs = %{version}-%{release}
e7bec3
Requires: perl-PCP-LogImport = %{version}-%{release}
e7bec3
e7bec3
%description import-mrtg2pcp
e7bec3
Performance Co-Pilot (PCP) front-end tools for importing MTRG data
e7bec3
into standard PCP archive logs for replay with any PCP monitoring tool.
e7bec3
e7bec3
#
e7bec3
# pcp-import-collectl2pcp
e7bec3
#
e7bec3
%package import-collectl2pcp
e7bec3
License: LGPLv2+
e7bec3
Group: Applications/System
e7bec3
Summary: Performance Co-Pilot tools for importing collectl log files into PCP archive logs
e7bec3
URL: http://oss.sgi.com/projects/pcp/
e7bec3
Requires: pcp-libs = %{version}-%{release}
e7bec3
e7bec3
%description import-collectl2pcp
e7bec3
Performance Co-Pilot (PCP) front-end tools for importing collectl data
e7bec3
into standard PCP archive logs for replay with any PCP monitoring tool.
e7bec3
e7bec3
%if !%{disable_infiniband}
e7bec3
#
e7bec3
# pcp-pmda-infiniband
e7bec3
#
e7bec3
%package pmda-infiniband
e7bec3
License: GPLv2+
e7bec3
Group: Applications/System
e7bec3
Summary: Performance Co-Pilot (PCP) metrics for Infiniband HCAs and switches
e7bec3
URL: http://oss.sgi.com/projects/pcp/
e7bec3
Requires: pcp-libs = %{version}-%{release}
e7bec3
Requires: libibmad >= 1.3.7 libibumad >= 1.3.7
e7bec3
BuildRequires: libibmad-devel >= 1.3.7 libibumad-devel >= 1.3.7
e7bec3
e7bec3
%description pmda-infiniband
e7bec3
This package contains the PCP Performance Metrics Domain Agent (PMDA) for
e7bec3
collecting Infiniband statistics.  By default, it monitors the local HCAs
e7bec3
but can also be configured to monitor remote GUIDs such as IB switches.
e7bec3
%endif
e7bec3
e7bec3
#
e7bec3
# python-pcp. This is the PCP library bindings for python.
e7bec3
#
e7bec3
%package -n python-pcp
e7bec3
License: GPLv2+
e7bec3
Group: Development/Libraries
e7bec3
Summary: Performance Co-Pilot (PCP) Python bindings and documentation
e7bec3
URL: http://oss.sgi.com/projects/pcp/
e7bec3
Requires: pcp-libs = %{version}-%{release}
e7bec3
e7bec3
%description -n python-pcp
e7bec3
The python PCP module contains the language bindings for
e7bec3
building Performance Metric API (PMAPI) tools using Python.
e7bec3
e7bec3
%prep
e7bec3
%setup -q
95ec45
%patch1 -p1
95ec45
%patch2 -p1
95ec45
%patch3 -p1
95ec45
%patch4 -p1
95ec45
%patch5 -p1
95ec45
%patch6 -p1
95ec45
%patch7 -p1
95ec45
%patch8 -p1
95ec45
%patch9 -p1
95ec45
%patch10 -p1
95ec45
%patch11 -p1
e7bec3
e7bec3
%clean
e7bec3
rm -Rf $RPM_BUILD_ROOT
e7bec3
e7bec3
%build
95ec45
%configure --with-rcdir=%{_initddir} %{?_with_doc} %{?_with_ib}
e7bec3
make default_pcp
e7bec3
e7bec3
%install
e7bec3
rm -Rf $RPM_BUILD_ROOT
e7bec3
export NO_CHOWN=true DIST_ROOT=$RPM_BUILD_ROOT
e7bec3
make install_pcp
e7bec3
e7bec3
# Fix stuff we do/don't want to ship
e7bec3
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.a
e7bec3
mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/run/pcp
e7bec3
e7bec3
# remove sheet2pcp until BZ 830923 and BZ 754678 are resolved.
e7bec3
rm -f $RPM_BUILD_ROOT/%{_bindir}/sheet2pcp $RPM_BUILD_ROOT/%{_mandir}/man1/sheet2pcp.1.gz
e7bec3
95ec45
# remove configsz.h as this is not multilib friendly.
95ec45
rm -f $RPM_BUILD_ROOT/%{_includedir}/pcp/configsz.h
95ec45
e7bec3
%if %{disable_infiniband}
e7bec3
# remove pmdainfiniband on platforms lacking IB devel packages.
e7bec3
rm -f $RPM_BUILD_ROOT/%{_pmdasdir}/ib $RPM_BUILD_ROOT/man1/pmdaib.1.gz
e7bec3
rm -fr $RPM_BUILD_ROOT/%{_pmdasdir}/infiniband
e7bec3
%endif
e7bec3
e7bec3
# default chkconfig off for Fedora and RHEL
95ec45
for f in $RPM_BUILD_ROOT/%{_initddir}/{pcp,pmcd,pmlogger,pmie,pmwebd,pmmgr,pmproxy}; do
e7bec3
	sed -i -e '/^# chkconfig/s/:.*$/: - 95 05/' -e '/^# Default-Start:/s/:.*$/:/' $f
e7bec3
done
e7bec3
e7bec3
# list of PMDAs in the base pkg
e7bec3
ls -1 $RPM_BUILD_ROOT/%{_pmdasdir} |\
e7bec3
egrep -v 'simple|sample|trivial|txmon' |\
e7bec3
egrep -v '^ib$|infiniband' |\
e7bec3
sed -e 's#^#'%{_pmdasdir}'\/#' >base_pmdas.list
e7bec3
e7bec3
# bin and man1 files except those split out into sub packages
e7bec3
ls -1 $RPM_BUILD_ROOT/%{_bindir} | egrep -v '2pcp' |\
e7bec3
sed -e 's#^#'%{_bindir}'\/#' >base_binfiles.list
e7bec3
ls -1 $RPM_BUILD_ROOT/%{_mandir}/man1 | egrep -v '2pcp|pmdaib' |\
e7bec3
sed -e 's#^#'%{_mandir}'\/man1\/#' >base_man1files.list
e7bec3
e7bec3
cat base_pmdas.list base_binfiles.list base_man1files.list > base_specialfiles.list
e7bec3
e7bec3
%pre testsuite
95ec45
test -d %{_testsdir} || mkdir -p -m 755 %{_testsdir}
e7bec3
getent group pcpqa >/dev/null || groupadd -r pcpqa
e7bec3
getent passwd pcpqa >/dev/null || \
95ec45
  useradd -c "PCP Quality Assurance" -g pcpqa -d %{_testsdir} -M -r -s /bin/bash pcpqa 2>/dev/null
95ec45
chown -R pcpqa:pcpqa %{_testsdir} 2>/dev/null
e7bec3
exit 0
e7bec3
e7bec3
%post testsuite
e7bec3
chown -R pcpqa:pcpqa %{_testsdir} 2>/dev/null
95ec45
chmod 755 %{_testsdir} 2>/dev/null
e7bec3
exit 0
e7bec3
e7bec3
%pre
e7bec3
getent group pcp >/dev/null || groupadd -r pcp
e7bec3
getent passwd pcp >/dev/null || \
e7bec3
  useradd -c "Performance Co-Pilot" -g pcp -d %{_localstatedir}/lib/pcp -M -r -s /sbin/nologin pcp
e7bec3
PCP_SYSCONF_DIR=%{_confdir}
e7bec3
PCP_LOG_DIR=%{_logsdir}
e7bec3
PCP_ETC_DIR=%{_sysconfdir}
e7bec3
# rename crontab files to align with current Fedora packaging guidelines
e7bec3
for crontab in pmlogger pmie
e7bec3
do
e7bec3
    test -f "$PCP_ETC_DIR/cron.d/$crontab" || continue
e7bec3
    mv -f "$PCP_ETC_DIR/cron.d/$crontab" "$PCP_ETC_DIR/cron.d/pcp-$crontab"
e7bec3
done
e7bec3
# produce a script to run post-install to move configs to their new homes
e7bec3
save_configs_script()
e7bec3
{
e7bec3
    _new="$1"
e7bec3
    shift
e7bec3
    for _dir
e7bec3
    do
e7bec3
        [ "$_dir" = "$_new" ] && continue
e7bec3
        if [ -d "$_dir" ]
e7bec3
        then
e7bec3
            ( cd "$_dir" ; find . -type f -print ) | sed -e 's/^\.\///' \
e7bec3
            | while read _file
e7bec3
            do
e7bec3
                _want=true
e7bec3
                if [ -f "$_new/$_file" ]
e7bec3
                then
e7bec3
                    # file exists in both directories, pick the more
e7bec3
                    # recently modified one
e7bec3
                    _try=`find "$_dir/$_file" -newer "$_new/$_file" -print`
e7bec3
                    [ -n "$_try" ] || _want=false
e7bec3
                fi
e7bec3
                $_want && echo cp -p "$_dir/$_file" "$_new/$_file"
e7bec3
            done
e7bec3
        fi
e7bec3
    done
e7bec3
}
e7bec3
# migrate and clean configs if we have had a previous in-use installation
e7bec3
[ -d "$PCP_LOG_DIR" ] || exit 0	# no configuration file upgrades required
e7bec3
rm -f "$PCP_LOG_DIR/configs.sh"
e7bec3
for daemon in pmcd pmie pmlogger pmwebd pmproxy
e7bec3
do
e7bec3
    save_configs_script >> "$PCP_LOG_DIR/configs.sh" "$PCP_SYSCONF_DIR/$daemon" \
e7bec3
        /var/lib/pcp/config/$daemon /etc/$daemon /etc/pcp/$daemon /etc/sysconfig/$daemon
e7bec3
done
e7bec3
exit 0
e7bec3
e7bec3
%preun
e7bec3
if [ "$1" -eq 0 ]
e7bec3
then
95ec45
    # stop daemons before erasing the package
e7bec3
    /sbin/service pmlogger stop >/dev/null 2>&1
e7bec3
    /sbin/service pmie stop >/dev/null 2>&1
e7bec3
    /sbin/service pmproxy stop >/dev/null 2>&1
e7bec3
    /sbin/service pmwebd stop >/dev/null 2>&1
95ec45
    /sbin/service pmmgr stop >/dev/null 2>&1
e7bec3
    /sbin/service pmcd stop >/dev/null 2>&1
e7bec3
e7bec3
    /sbin/chkconfig --del pcp >/dev/null 2>&1
e7bec3
    /sbin/chkconfig --del pmcd >/dev/null 2>&1
e7bec3
    /sbin/chkconfig --del pmlogger >/dev/null 2>&1
e7bec3
    /sbin/chkconfig --del pmie >/dev/null 2>&1
95ec45
    /sbin/chkconfig --del pmmgr >/dev/null 2>&1
e7bec3
    /sbin/chkconfig --del pmwebd >/dev/null 2>&1
e7bec3
    /sbin/chkconfig --del pmproxy >/dev/null 2>&1
95ec45
95ec45
    # cleanup namespace state/flag, may still exist
95ec45
    PCP_PMNS_DIR=%{_pmnsdir}
95ec45
    rm -f "$PCP_PMNS_DIR/.NeedRebuild" >/dev/null 2>&1
e7bec3
fi
e7bec3
e7bec3
%post
e7bec3
PCP_LOG_DIR=%{_logsdir}
e7bec3
PCP_PMNS_DIR=%{_pmnsdir}
e7bec3
# restore saved configs, if any
e7bec3
test -s "$PCP_LOG_DIR/configs.sh" && source "$PCP_LOG_DIR/configs.sh"
e7bec3
rm -f $PCP_LOG_DIR/configs.sh
e7bec3
e7bec3
# migrate old to new temp dir locations (within the same filesystem)
e7bec3
migrate_tempdirs()
e7bec3
{
e7bec3
    _sub="$1"
e7bec3
    _new_tmp_dir=%{_tempsdir}
e7bec3
    _old_tmp_dir=%{_localstatedir}/tmp
e7bec3
e7bec3
    for d in "$_old_tmp_dir/$_sub" ; do
e7bec3
        test -d "$d" -a -k "$d" || continue
e7bec3
        cd "$d" || continue
e7bec3
        for f in * ; do
e7bec3
            [ "$f" != "*" ] || continue
e7bec3
            source="$d/$f"
e7bec3
            target="$_new_tmp_dir/$_sub/$f"
e7bec3
            [ "$source" != "$target" ] || continue
e7bec3
	    [ -f "$target" ] || mv -fu "$source" "$target"
e7bec3
        done
e7bec3
        cd && rmdir "$d" 2>/dev/null
e7bec3
    done
e7bec3
}
e7bec3
for daemon in mmv pmdabash pmie pmlogger
e7bec3
do
e7bec3
    migrate_tempdirs $daemon
e7bec3
done
e7bec3
chown -R pcp:pcp %{_logsdir}/pmcd 2>/dev/null
e7bec3
chown -R pcp:pcp %{_logsdir}/pmlogger 2>/dev/null
e7bec3
chown -R pcp:pcp %{_logsdir}/pmie 2>/dev/null
95ec45
chown -R pcp:pcp %{_logsdir}/pmmgr 2>/dev/null
e7bec3
chown -R pcp:pcp %{_logsdir}/pmwebd 2>/dev/null
e7bec3
chown -R pcp:pcp %{_logsdir}/pmproxy 2>/dev/null
95ec45
touch "$PCP_PMNS_DIR/.NeedRebuild"
95ec45
chmod 644 "$PCP_PMNS_DIR/.NeedRebuild"
e7bec3
/sbin/chkconfig --add pmcd >/dev/null 2>&1
e7bec3
/sbin/service pmcd condrestart
e7bec3
/sbin/chkconfig --add pmlogger >/dev/null 2>&1
e7bec3
/sbin/service pmlogger condrestart
e7bec3
/sbin/chkconfig --add pmie >/dev/null 2>&1
e7bec3
/sbin/service pmie condrestart
95ec45
/sbin/chkconfig --add pmmgr >/dev/null 2>&1
95ec45
/sbin/service pmmgr condrestart
e7bec3
/sbin/chkconfig --add pmwebd >/dev/null 2>&1
e7bec3
/sbin/service pmwebd condrestart
e7bec3
/sbin/chkconfig --add pmproxy >/dev/null 2>&1
e7bec3
/sbin/service pmproxy condrestart
e7bec3
e7bec3
%post libs -p /sbin/ldconfig
e7bec3
%postun libs -p /sbin/ldconfig
e7bec3
e7bec3
%files -f base_specialfiles.list
e7bec3
#
e7bec3
# Note: there are some headers (e.g. domain.h) and in a few cases some
e7bec3
# C source files that rpmlint complains about. These are not devel files,
e7bec3
# but rather they are (slightly obscure) PMDA config files.
e7bec3
#
e7bec3
%defattr(-,root,root)
e7bec3
%doc CHANGELOG COPYING INSTALL README VERSION.pcp pcp.lsm
e7bec3
e7bec3
%dir %{_pmdasdir}
e7bec3
%dir %{_datadir}/pcp
e7bec3
%dir %attr(0775,pcp,pcp) %{_localstatedir}/run/pcp
e7bec3
%dir %{_localstatedir}/lib/pcp
e7bec3
%dir %{_localstatedir}/lib/pcp/config
e7bec3
%dir %attr(0775,pcp,pcp) %{_localstatedir}/lib/pcp/config/pmda
95ec45
%dir %attr(0775,pcp,pcp) %{_tempsdir}
95ec45
%dir %attr(0775,pcp,pcp) %{_tempsdir}/pmie
95ec45
%dir %attr(0775,pcp,pcp) %{_tempsdir}/pmlogger
e7bec3
e7bec3
%{_libexecdir}/pcp
e7bec3
%{_datadir}/pcp/lib
e7bec3
%attr(0775,pcp,pcp) %{_logsdir}
e7bec3
%attr(0775,pcp,pcp) %{_logsdir}/pmcd
e7bec3
%attr(0775,pcp,pcp) %{_logsdir}/pmlogger
e7bec3
%attr(0775,pcp,pcp) %{_logsdir}/pmie
e7bec3
%attr(0775,pcp,pcp) %{_logsdir}/pmwebd
e7bec3
%attr(0775,pcp,pcp) %{_logsdir}/pmproxy
e7bec3
%{_localstatedir}/lib/pcp/pmns
e7bec3
%{_initddir}/pcp
e7bec3
%{_initddir}/pmcd
e7bec3
%{_initddir}/pmlogger
e7bec3
%{_initddir}/pmie
95ec45
%{_initddir}/pmmgr
e7bec3
%{_initddir}/pmwebd
e7bec3
%{_initddir}/pmproxy
e7bec3
%{_mandir}/man5/*
e7bec3
%config(noreplace) %{_sysconfdir}/sasl2/pmcd.conf
e7bec3
%config(noreplace) %{_sysconfdir}/cron.d/pcp-pmlogger
e7bec3
%config(noreplace) %{_sysconfdir}/cron.d/pcp-pmie
e7bec3
%config %{_sysconfdir}/bash_completion.d/pcp
e7bec3
%config %{_sysconfdir}/pcp.env
e7bec3
%{_sysconfdir}/pcp.sh
e7bec3
%{_sysconfdir}/pcp
e7bec3
%config(noreplace) %{_confdir}/pmcd/pmcd.conf
e7bec3
%config(noreplace) %{_confdir}/pmcd/pmcd.options
e7bec3
%config(noreplace) %{_confdir}/pmcd/rc.local
95ec45
%config(noreplace) %{_confdir}/pmmgr/pmmgr.options
e7bec3
%config(noreplace) %{_confdir}/pmwebd/pmwebd.options
e7bec3
%config(noreplace) %{_confdir}/pmproxy/pmproxy.options
e7bec3
%dir %attr(0775,pcp,pcp) %{_confdir}/pmie
e7bec3
%attr(0664,pcp,pcp) %config(noreplace) %{_confdir}/pmie/control
e7bec3
%dir %attr(0775,pcp,pcp) %{_confdir}/pmlogger
e7bec3
%attr(0664,pcp,pcp) %config(noreplace) %{_confdir}/pmlogger/control
e7bec3
%{_localstatedir}/lib/pcp/config/*
e7bec3
e7bec3
%if 0%{?rhel} == 0 || 0%{?rhel} > 5 
e7bec3
%{tapsetdir}/pmcd.stp
e7bec3
%else				# rhel5
e7bec3
%ifarch ppc ppc64
e7bec3
# no systemtap-sdt-devel
e7bec3
%else				# ! ppc
e7bec3
%{tapsetdir}/pmcd.stp
e7bec3
%endif				# ppc
e7bec3
%endif
e7bec3
95ec45
%files conf
e7bec3
%defattr(-,root,root)
e7bec3
e7bec3
%dir %{_includedir}/pcp
e7bec3
%{_includedir}/pcp/builddefs
e7bec3
%{_includedir}/pcp/buildrules
e7bec3
%config %{_sysconfdir}/pcp.conf
95ec45
95ec45
%files libs
95ec45
%defattr(-,root,root)
95ec45
e7bec3
%{_libdir}/libpcp.so.3
e7bec3
%{_libdir}/libpcp_gui.so.2
e7bec3
%{_libdir}/libpcp_mmv.so.1
e7bec3
%{_libdir}/libpcp_pmda.so.3
e7bec3
%{_libdir}/libpcp_trace.so.2
e7bec3
%{_libdir}/libpcp_import.so.1
e7bec3
e7bec3
%files libs-devel
e7bec3
%defattr(-,root,root)
e7bec3
e7bec3
%{_libdir}/libpcp.so
e7bec3
%{_libdir}/libpcp.so.2
e7bec3
%{_libdir}/libpcp_gui.so
e7bec3
%{_libdir}/libpcp_gui.so.1
e7bec3
%{_libdir}/libpcp_mmv.so
e7bec3
%{_libdir}/libpcp_pmda.so
e7bec3
%{_libdir}/libpcp_pmda.so.2
e7bec3
%{_libdir}/libpcp_trace.so
e7bec3
%{_libdir}/libpcp_import.so
e7bec3
%{_includedir}/pcp/*.h
e7bec3
%{_mandir}/man3/*.3.gz
e7bec3
%{_datadir}/pcp/demos
e7bec3
%{_datadir}/pcp/examples
e7bec3
e7bec3
# PMDAs that ship src and are not for production use
e7bec3
# straight out-of-the-box, for devel or QA use only.
e7bec3
%{_pmdasdir}/simple
e7bec3
%{_pmdasdir}/sample
e7bec3
%{_pmdasdir}/trivial
e7bec3
%{_pmdasdir}/txmon
e7bec3
e7bec3
%files testsuite
e7bec3
%defattr(-,pcpqa,pcpqa)
e7bec3
%{_testsdir}
e7bec3
e7bec3
%files import-sar2pcp
e7bec3
%defattr(-,root,root)
e7bec3
%{_bindir}/sar2pcp
e7bec3
%{_mandir}/man1/sar2pcp.1.gz
e7bec3
e7bec3
%files import-iostat2pcp
e7bec3
%defattr(-,root,root)
e7bec3
%{_bindir}/iostat2pcp
e7bec3
%{_mandir}/man1/iostat2pcp.1.gz
e7bec3
e7bec3
%files import-mrtg2pcp
e7bec3
%defattr(-,root,root)
e7bec3
%{_bindir}/mrtg2pcp
e7bec3
%{_mandir}/man1/mrtg2pcp.1.gz
e7bec3
e7bec3
%files import-collectl2pcp
e7bec3
%defattr(-,root,root)
e7bec3
%{_bindir}/collectl2pcp
e7bec3
%{_mandir}/man1/collectl2pcp.1.gz
e7bec3
e7bec3
%if !%{disable_infiniband}
e7bec3
%files pmda-infiniband
e7bec3
%defattr(-,root,root)
e7bec3
%{_pmdasdir}/ib
e7bec3
%{_pmdasdir}/infiniband
e7bec3
%{_mandir}/man1/pmdaib.1.gz
e7bec3
%endif
e7bec3
e7bec3
%files -n perl-PCP-PMDA -f perl-pcp-pmda.list
e7bec3
%defattr(-,root,root)
e7bec3
e7bec3
%files -n perl-PCP-MMV -f perl-pcp-mmv.list
e7bec3
%defattr(-,root,root)
e7bec3
e7bec3
%files -n perl-PCP-LogImport -f perl-pcp-logimport.list
e7bec3
%defattr(-,root,root)
e7bec3
e7bec3
%files -n perl-PCP-LogSummary -f perl-pcp-logsummary.list
e7bec3
%defattr(-,root,root)
e7bec3
e7bec3
%files -n python-pcp -f python-pcp.list.rpm
e7bec3
%defattr(-,root,root)
e7bec3
e7bec3
%changelog
95ec45
* Wed Feb 26 2014 Nathan Scott <nathans@redhat.com> - 3.8.10-8
95ec45
- Update pmmgr to pcp 3.9.0+ level (BZ 1067547)
95ec45
95ec45
* Tue Feb 25 2014 Nathan Scott <nathans@redhat.com> - 3.8.10-7
95ec45
- Fix a handful of QE-found test-induced failures (BZ 987086)
95ec45
- Multilib packaging support for libs and devel (BZ 1059642)
95ec45
95ec45
* Tue Feb 18 2014 Nathan Scott <nathans@redhat.com> - 3.8.10-6
95ec45
- Added missing qualified output for test qa/844 (BZ 1064311)
95ec45
- Fix pmdalinux memory corruption issue on s390x (BZ 1064254)
95ec45
- PMDA installation works without a running pmcd (BZ 1062443)
95ec45
- Fix some more issues in pcpqa account creation (BZ 1025688)
95ec45
95ec45
* Mon Feb 10 2014 Nathan Scott <nathans@redhat.com> - 3.8.10-5
95ec45
- Resolve pmdammv induced pmcd segv during tests (BZ 1061330)
95ec45
- Fix python-pcp time API wrapper implementation (BZ 1062467)
95ec45
95ec45
* Wed Jan 29 2014 Nathan Scott <nathans@redhat.com> - 3.8.10-4
95ec45
- Ensure the PMNS stdpmid files are installed (BZ 1059004)
95ec45
95ec45
* Fri Jan 24 2014 Daniel Mach <dmach@redhat.com> - 3.8.10-3
95ec45
- Mass rebuild 2014-01-24
95ec45
95ec45
* Wed Jan 22 2014 Nathan Scott <nathans@redhat.com> - 3.8.10-2
95ec45
- Fix pmdalinux failure on unexpected ICMP types (BZ 1055826)
95ec45
- Add man pages for all of the PMDAs missing out (BZ 1053094)
95ec45
95ec45
* Wed Jan 15 2014 Nathan Scott <nathans@redhat.com> - 3.8.10-1
95ec45
- Add symbol-versioning for PCP shared libraries (BZ 1037771)
95ec45
- Fix pmcd/Avahi interaction with multiple ports (BZ 1035513)
95ec45
- Confine set of exported symbols from DSO PMDAs (BZ 1025694)
95ec45
- Ensure pcpqa user created by pcp-testsuite rpm (BZ 1025688)
95ec45
- Remove empty pmlogger configuration directory (BZ 1025599)
95ec45
- Resolve warning messages from pcp rpm scripts (BZ 1025587)
95ec45
- Remove world-writeable private temp directory (BZ 1025583)
95ec45
- Tackle remaining failing pcp-testsuite cases (BZ 987086)
95ec45
- Update to latest PCP sources.
95ec45
95ec45
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 3.8.6-3
95ec45
- Mass rebuild 2013-12-27
95ec45
e7bec3
* Wed Nov 06 2013 Frank Ch. Eigler <fche@redhat.com> - 3.8.6-2
e7bec3
- BZ1027236: adapt to droppage of nss export ciphers
e7bec3
e7bec3
* Fri Nov 01 2013 Nathan Scott <nathans@redhat.com> - 3.8.6-1
e7bec3
- Update to latest PCP sources.
e7bec3
- Rework pmpost test which confused virus checkers (BZ 1024850)
e7bec3
- Tackle pmatop reporting issues via alternate metrics (BZ 998735)
e7bec3
e7bec3
* Fri Oct 18 2013 Nathan Scott <nathans@redhat.com> - 3.8.5-1
e7bec3
- Update to latest PCP sources.
e7bec3
- Correct pcp Infiniband package dependencies (BZ 1016368)
e7bec3
e7bec3
* Mon Sep 16 2013 Nathan Scott <nathans@redhat.com> - 3.8.4-2
e7bec3
- Disable the pcp-pmda-infiniband sub-package on s390 platforms.
e7bec3
e7bec3
* Sun Sep 15 2013 Nathan Scott <nathans@redhat.com> - 3.8.4-1
e7bec3
- Very minor release containing mostly QA related changes.
e7bec3
- Enables many more metrics to be logged for Linux hosts.
e7bec3
e7bec3
* Wed Sep 11 2013 Stan Cox <scox@redhat.com> - 3.8.3-2
e7bec3
- Disable pmcd.stp on el5 ppc.
e7bec3
e7bec3
* Mon Sep 09 2013 Nathan Scott <nathans@redhat.com> - 3.8.3-1
e7bec3
- Default to Unix domain socket (authenticated) local connections.
e7bec3
- Introduces new pcp-pmda-infiniband sub-package.
e7bec3
- Disable systemtap-sdt-devel usage on ppc.
e7bec3
e7bec3
* Sat Aug 03 2013 Petr Pisar <ppisar@redhat.com> - 3.8.2-1.1
e7bec3
- Perl 5.18 rebuild
e7bec3
e7bec3
* Wed Jul 31 2013 Nathan Scott <nathans@redhat.com> - 3.8.2-1
e7bec3
- Update to latest PCP sources.
e7bec3
- Integrate gluster related stats with PCP (BZ 969348)
e7bec3
- Fix for iostat2pcp not parsing iostat output (BZ 981545)
e7bec3
- Start pmlogger with usable config by default (BZ 953759)
e7bec3
- Fix pmatop failing to start, gives stacktrace (BZ 963085)
e7bec3
e7bec3
* Wed Jun 19 2013 Nathan Scott <nathans@redhat.com> - 3.8.1-1
e7bec3
- Update to latest PCP sources.
e7bec3
- Fix log import silently dropping >1024 metrics (BZ 968210)
e7bec3
- Move some commonly used tools on the usual PATH (BZ 967709)
e7bec3
- Improve pmatop handling of missing proc metrics (BZ 963085)
e7bec3
- Stop out-of-order records corrupting import logs (BZ 958745)
e7bec3
e7bec3
* Tue May 14 2013 Nathan Scott <nathans@redhat.com> - 3.8.0-1
e7bec3
- Update to latest PCP sources.
e7bec3
- Validate metric names passed into pmiAddMetric (BZ 958019)
e7bec3
- Install log directories with correct ownership (BZ 960858)
e7bec3
e7bec3
* Fri Apr 19 2013 Nathan Scott <nathans@redhat.com> - 3.7.2-1
e7bec3
- Update to latest PCP sources.
e7bec3
- Ensure root namespace exists at the end of install (BZ 952977)
e7bec3
e7bec3
* Wed Mar 20 2013 Nathan Scott <nathans@redhat.com> - 3.7.1-1
e7bec3
- Update to latest PCP sources.
e7bec3
- Migrate all tempfiles correctly to the new tempdir hierarchy.
e7bec3
e7bec3
* Sun Mar 10 2013 Nathan Scott <nathans@redhat.com> - 3.7.0-1
e7bec3
- Update to latest PCP sources.
e7bec3
- Migrate all configuration files below the /etc/pcp hierarchy.
e7bec3
e7bec3
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.6.10-2.1
e7bec3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
e7bec3
e7bec3
* Wed Nov 28 2012 Nathan Scott <nathans@redhat.com> - 3.6.10-2
e7bec3
- Ensure tmpfile directories created in %%files section.
e7bec3
- Resolve tmpfile create/teardown race conditions.
e7bec3
e7bec3
* Mon Nov 19 2012 Nathan Scott <nathans@redhat.com> - 3.6.10-1
e7bec3
- Update to latest PCP sources.
e7bec3
- Resolve tmpfile security flaws: CVE-2012-5530
e7bec3
- Introduces new "pcp" user account for all daemons to use.
e7bec3
e7bec3
* Fri Oct 12 2012 Nathan Scott <nathans@redhat.com> - 3.6.9-1
e7bec3
- Update to latest PCP sources.
e7bec3
- Fix pmcd sigsegv in NUMA/CPU indom setup (BZ 858384)
e7bec3
- Fix sar2pcp uninitialised perl variable warning (BZ 859117)
e7bec3
- Fix pcp.py and pmcollectl with older python versions (BZ 852234)
e7bec3
e7bec3
* Fri Sep 14 2012 Nathan Scott <nathans@redhat.com> - 3.6.8-1
e7bec3
- Update to latest PCP sources.
e7bec3
e7bec3
* Wed Sep 05 2012 Nathan Scott <nathans@redhat.com> - 3.6.6-1.1
e7bec3
- Move configure step from prep to build section of spec (BZ 854128)
e7bec3
e7bec3
* Tue Aug 28 2012 Mark Goodwin <mgoodwin@redhat.com> - 3.6.6-1
e7bec3
- Update to latest PCP sources, see installed CHANGELOG for details.
e7bec3
- Introduces new python-pcp and pcp-testsuite sub-packages.
e7bec3
e7bec3
* Thu Aug 16 2012 Mark Goodwin <mgoodwin@redhat.com> - 3.6.5-1
e7bec3
- Update to latest PCP sources, see installed CHANGELOG for details.
e7bec3
- Fix security flaws: CVE-2012-3418 CVE-2012-3419 CVE-2012-3420 and CVE-2012-3421 (BZ 848629)
e7bec3
e7bec3
* Thu Jul 19 2012 Mark Goodwin <mgoodwin@redhat.com>
e7bec3
- pmcd and pmlogger services are not supposed to be enabled by default (BZ 840763) - 3.6.3-1.3
e7bec3
e7bec3
* Thu Jun 21 2012 Mark Goodwin <mgoodwin@redhat.com>
e7bec3
- remove pcp-import-sheet2pcp subpackage due to missing deps (BZ 830923) - 3.6.3-1.2
e7bec3
e7bec3
* Fri May 18 2012 Dan Hork <dan[at]danny.cz> - 3.6.3-1.1
e7bec3
- fix build on s390x
e7bec3
e7bec3
* Mon Apr 30 2012 Mark Goodwin - 3.6.3-1
e7bec3
- Update to latest PCP sources
e7bec3
e7bec3
* Thu Apr 26 2012 Mark Goodwin - 3.6.2-1
e7bec3
- Update to latest PCP sources
e7bec3
e7bec3
* Thu Apr 12 2012 Mark Goodwin - 3.6.1-1
e7bec3
- Update to latest PCP sources
e7bec3
e7bec3
* Thu Mar 22 2012 Mark Goodwin - 3.6.0-1
e7bec3
- use %%configure macro for correct libdir logic
e7bec3
- update to latest PCP sources
e7bec3
e7bec3
* Thu Dec 15 2011 Mark Goodwin - 3.5.11-2
e7bec3
- patched configure.in for libdir=/usr/lib64 on ppc64
e7bec3
e7bec3
* Thu Dec 01 2011 Mark Goodwin - 3.5.11-1
e7bec3
- Update to latest PCP sources.
e7bec3
e7bec3
* Fri Nov 04 2011 Mark Goodwin - 3.5.10-1
e7bec3
- Update to latest PCP sources.
e7bec3
e7bec3
* Mon Oct 24 2011 Mark Goodwin - 3.5.9-1
e7bec3
- Update to latest PCP sources.
e7bec3
e7bec3
* Mon Aug 08 2011 Mark Goodwin - 3.5.8-1
e7bec3
- Update to latest PCP sources.
e7bec3
e7bec3
* Fri Aug 05 2011 Mark Goodwin - 3.5.7-1
e7bec3
- Update to latest PCP sources.
e7bec3
e7bec3
* Fri Jul 22 2011 Mark Goodwin - 3.5.6-1
e7bec3
- Update to latest PCP sources.
e7bec3
e7bec3
* Tue Jul 19 2011 Mark Goodwin - 3.5.5-1
e7bec3
- Update to latest PCP sources.
e7bec3
e7bec3
* Thu Feb 03 2011 Mark Goodwin - 3.5.0-1
e7bec3
- Update to latest PCP sources.
e7bec3
e7bec3
* Thu Sep 30 2010 Mark Goodwin - 3.4.0-1
e7bec3
- Update to latest PCP sources.
e7bec3
e7bec3
* Fri Jul 16 2010 Mark Goodwin - 3.3.3-1
e7bec3
- Update to latest PCP sources.
e7bec3
e7bec3
* Sat Jul 10 2010 Mark Goodwin - 3.3.2-1
e7bec3
- Update to latest PCP sources.
e7bec3
e7bec3
* Tue Jun 29 2010 Mark Goodwin - 3.3.1-1
e7bec3
- Update to latest PCP sources.
e7bec3
e7bec3
* Fri Jun 25 2010 Mark Goodwin - 3.3.0-1
e7bec3
- Update to latest PCP sources.
e7bec3
e7bec3
* Thu Mar 18 2010 Mark Goodwin - 3.1.2-1
e7bec3
- Update to latest PCP sources.
e7bec3
e7bec3
* Wed Jan 27 2010 Mark Goodwin - 3.1.0-1
e7bec3
- BuildRequires: initscripts for %%{_vendor} == redhat.
e7bec3
e7bec3
* Thu Dec 10 2009 Mark Goodwin - 3.0.3-1
e7bec3
- BuildRequires: initscripts for FC12.
e7bec3
e7bec3
* Wed Dec 02 2009 Mark Goodwin - 3.0.2-1
e7bec3
- Added sysfs.kernel metrics, rebased to minor community release.
e7bec3
e7bec3
* Mon Oct 19 2009 Martin Hicks <mort@sgi.com> - 3.0.1-2
e7bec3
- Remove IB dependencies.  The Infiniband PMDA is being moved to
e7bec3
  a stand-alone package.
e7bec3
- Move cluster PMDA to a stand-alone package.
e7bec3
e7bec3
* Fri Oct 09 2009 Mark Goodwin <mgoodwin@redhat.com> - 3.0.0-9
e7bec3
- This is the initial import for Fedora
e7bec3
- See 3.0.0 details in CHANGELOG