diff options
Diffstat (limited to 'build/rpm')
-rw-r--r-- | build/rpm/GNUmakefile | 83 | ||||
-rw-r--r-- | build/rpm/fedora.spec | 1163 | ||||
-rwxr-xr-x | build/rpm/filter-requires | 75 | ||||
-rwxr-xr-x | build/rpm/get_rpm_version | 66 | ||||
-rw-r--r-- | build/rpm/macros.template | 23 | ||||
-rw-r--r-- | build/rpm/pcp-logsummary-perl.desc | 6 | ||||
-rw-r--r-- | build/rpm/pcp-mmv-perl.desc | 6 | ||||
-rw-r--r-- | build/rpm/pcp-pmda-perl.desc | 5 | ||||
-rw-r--r-- | build/rpm/pcp.spec.in | 881 |
9 files changed, 2308 insertions, 0 deletions
diff --git a/build/rpm/GNUmakefile b/build/rpm/GNUmakefile new file mode 100644 index 0000000..e2a6b59 --- /dev/null +++ b/build/rpm/GNUmakefile @@ -0,0 +1,83 @@ +# +# Copyright (c) 2012-2013 Red Hat. +# Copyright (c) 2000,2004 Silicon Graphics, Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# + +TOPDIR = ../.. +include $(TOPDIR)/src/include/builddefs +-include ../GNUlocaldefs +-include ./GNUlocaldefs + +SPEC = pcp.spec +LDIRT += *-[0-9]*.*.rpm $(SPEC) rpmmacros + +PERLFILES = pcp-pmda-perl.desc pcp-logsummary-perl.desc pcp-mmv-perl.desc +RPM_VERSION=$(shell ./get_rpm_version) + +default install install_pcp default_pcp : + +# Blow the spec away after rpm has finished its work - it IS +# going to make sure it'll be rebuild next time we come here +# We used to override --target=FOO, but it's better to let the +# local build distro defaults do their jobs. +pack_pcp : rpmmacros $(SPEC) + DEFS=`grep '^--define' rpmmacros`; \ + eval $(RPMPROG) -ba $$DEFS \ + --clean $(SPEC) + rm -f $(SPEC) $(TOPDIR)/install.manifest $(TOPDIR)/files.rpm \ + rpmmacros + +rpmmacros : macros.template + @TREEROOT=`cd ${TOPDIR}; pwd`; \ + for d in RPM SRPM; do \ + eval D=\$$$${d}DIR; \ + if [ -z "$$D" -o ! -d "$$D" ] ; then \ + eval $${d}DIR=$$TREEROOT/build/rpm; \ + fi; \ + done; \ + sed -e "s|%topdir%|$${TREEROOT}|g" \ + -e "s|@rpmsdir@|$${RPMDIR}|g" \ + -e "s|@srpmsdir@|$${SRPMDIR}|"g \ + -e '/^%/s/[ \t]*$$/'\''/' \ + -e '/^%/s/^%/--define '\''/' <$< >$@ + +pcp.spec: pcp.spec.in + @echo Generating $@ from $?; \ + sed -e's|@package_sgirelease@|$(SGIRELEASENUMBER)|g' \ + -e's|@sgi_chroot_build@|$(SGI_CHROOT_BUILD)|g' \ + -e's|@sgi_issp_build@|$(SGI_ISSP_BUILD)|g' \ + -e's|@package_name@|$(PACKAGE_NAME)|g' \ + -e's|@package_version@|$(PACKAGE_VERSION)|g' \ + -e's|@package_release@|$(PACKAGE_BUILD)|g' \ + -e's|@package_configure@|$(PACKAGE_CONFIGURE)|g' \ + -e's|@package_distribution@|$(PACKAGE_DISTRIBUTION)|g' \ + -e's|@have_libmicrohttpd@|$(HAVE_LIBMICROHTTPD)|g' \ + -e's|@have_rpmlib@|$(HAVE_RPMLIB)|g' \ + -e's|@pmda_infiniband@|$(PMDA_INFINIBAND)|g' \ + -e's|@enable_systemd@|$(ENABLE_SYSTEMD)|g' \ + -e's|@enable_papi@|$(ENABLE_PAPI)|g' \ + -e's|@enable_secure@|$(ENABLE_SECURE)|g' \ + -e's|@enable_probes@|$(ENABLE_PROBES)|g' \ + -e's|@enable_avahi@|$(ENABLE_AVAHI)|g' \ + -e's|@enable_qt@|$(ENABLE_QT)|g' \ + -e"s|@build_root@|$${DIST_ROOT}|g" \ + -e's|@pcp_sysconf_dir@|$(PCP_SYSCONF_DIR)|g' \ + -e's|@pcp_log_dir@|$(PCP_LOG_DIR)|g' \ + -e's|@pcp_var_dir@|$(PCP_VAR_DIR)|g' \ + -e's|@pcp_etc_dir@|$(PCP_ETC_DIR)|g' \ + -e's|@BUILD_PMMGR@|$(BUILD_PMMGR)|g' \ + -e's|@rpm_version@|$(RPM_VERSION)|g' \ + -e's|@make@|$(PCP_MAKE_PROG)|g' <$? >$@ + +include $(BUILDRULES) + diff --git a/build/rpm/fedora.spec b/build/rpm/fedora.spec new file mode 100644 index 0000000..618837f --- /dev/null +++ b/build/rpm/fedora.spec @@ -0,0 +1,1163 @@ +Summary: System-level performance monitoring and performance management +Name: pcp +Version: 3.9.10 +%define buildversion 1 + +Release: %{buildversion}%{?dist} +License: GPLv2+ and LGPLv2.1+ +URL: http://www.performancecopilot.org +Group: Applications/System +Source0: pcp-%{version}.src.tar.gz + +%define disable_papi 0 +%define disable_microhttpd 0 +%if 0%{?rhel} == 0 || 0%{?rhel} > 5 +%define disable_qt 0 +%else +%define disable_qt 1 +%endif + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: procps autoconf bison flex +BuildRequires: nss-devel +BuildRequires: rpm-devel +BuildRequires: avahi-devel +BuildRequires: python-devel +BuildRequires: ncurses-devel +BuildRequires: readline-devel +BuildRequires: cyrus-sasl-devel +%if !%{disable_papi} +BuildRequires: papi-devel +%endif +%if !%{disable_microhttpd} +BuildRequires: libmicrohttpd-devel +%endif +%if 0%{?rhel} == 0 || 0%{?rhel} > 5 +BuildRequires: systemtap-sdt-devel +%else +%ifnarch ppc ppc64 +BuildRequires: systemtap-sdt-devel +%endif +%endif +BuildRequires: perl(ExtUtils::MakeMaker) +BuildRequires: initscripts man +%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 +BuildRequires: systemd-devel +%endif +%if !%{disable_qt} +BuildRequires: desktop-file-utils +BuildRequires: qt4-devel >= 4.4 +%endif + +Requires: bash gawk sed grep fileutils findutils initscripts perl +Requires: python +%if 0%{?rhel} <= 5 +Requires: python-ctypes +%endif + +Requires: pcp-libs = %{version}-%{release} +Requires: python-pcp = %{version}-%{release} +Requires: perl-PCP-PMDA = %{version}-%{release} +Obsoletes: pcp-gui-debuginfo +Obsoletes: pcp-pmda-nvidia + +%global tapsetdir %{_datadir}/systemtap/tapset + +%define _confdir %{_sysconfdir}/pcp +%define _initddir %{_sysconfdir}/rc.d/init.d +%define _logsdir %{_localstatedir}/log/pcp +%define _pmnsdir %{_localstatedir}/lib/pcp/pmns +%define _tempsdir %{_localstatedir}/lib/pcp/tmp +%define _pmdasdir %{_localstatedir}/lib/pcp/pmdas +%define _testsdir %{_localstatedir}/lib/pcp/testsuite +%define _pixmapdir %{_datadir}/pcp-gui/pixmaps +%define _booksdir %{_datadir}/doc/pcp-doc + +%if 0%{?fedora} >= 20 +%define _with_doc --with-docdir=%{_docdir}/%{name} +%endif +%if 0%{?fedora} >= 19 || 0%{?rhel} >= 7 +%define _with_initd --with-rcdir=%{_initddir} +%define disable_systemd 0 +%else +%define disable_systemd 1 +%endif + +# we never want Infiniband on s390 platforms +%ifarch s390 s390x +%define disable_infiniband 1 +%else + +# we never want Infiniband on RHEL5 or earlier +%if 0%{?rhel} != 0 && 0%{?rhel} < 6 +%define disable_infiniband 1 +%else +%define disable_infiniband 0 +%endif + +%endif + +%if %{disable_infiniband} +%define _with_ib --with-infiniband=no +%endif + +%if !%{disable_papi} +%define _with_papi --with-papi=yes +%endif + +%if %{disable_qt} +%define _with_ib --with-qt=no +%endif + +%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+ +Group: Development/Libraries +Summary: Performance Co-Pilot run-time configuration +URL: http://www.performancecopilot.org + +# 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+ +Group: Development/Libraries +Summary: Performance Co-Pilot run-time libraries +URL: http://www.performancecopilot.org + +Requires: pcp-conf = %{version}-%{release} + +%description libs +Performance Co-Pilot (PCP) run-time libraries + +# +# pcp-libs-devel +# +%package libs-devel +License: GPLv2+ and LGPLv2.1+ +Group: Development/Libraries +Summary: Performance Co-Pilot (PCP) development headers and documentation +URL: http://www.performancecopilot.org +Requires: pcp-libs = %{version}-%{release} + +%description libs-devel +Performance Co-Pilot (PCP) headers, documentation and tools for development. + +# +# pcp-testsuite +# +%package testsuite +License: GPLv2+ +Group: Development/Libraries +Summary: Performance Co-Pilot (PCP) test suite +URL: http://www.performancecopilot.org +Requires: pcp = %{version}-%{release} +Requires: pcp-libs = %{version}-%{release} +Requires: pcp-libs-devel = %{version}-%{release} +Obsoletes: pcp-gui-testsuite + +%description testsuite +Quality assurance test suite for Performance Co-Pilot (PCP). + +# +# pcp-manager +# +%package manager +License: GPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot (PCP) manager daemon +URL: http://www.performancecopilot.org + +Requires: pcp = %{version}-%{release} +Requires: pcp-libs = %{version}-%{release} + +%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 (which are particularly complex in the case of pmlogger). +The base PCP package provides comparable functionality through cron +scripts which predate this daemon but do still provide effective and +efficient log management services. +The pcp-manager package aims to aggressively enable new PCP features +and as a result may not be suited to all production environments. + +%if !%{disable_microhttpd} +# +# pcp-webapi +# +%package webapi +License: GPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot (PCP) web API service +URL: http://www.performancecopilot.org + +Requires: pcp = %{version}-%{release} +Requires: pcp-libs = %{version}-%{release} + +%description webapi +Provides a daemon (pmwebd) that binds a large subset of the Performance +Co-Pilot (PCP) client API (PMAPI) to RESTful web applications using the +HTTP (PMWEBAPI) protocol. +%endif + +# +# perl-PCP-PMDA. This is the PCP agent perl binding. +# +%package -n perl-PCP-PMDA +License: GPLv2+ +Group: Development/Libraries +Summary: Performance Co-Pilot (PCP) Perl bindings and documentation +URL: http://www.performancecopilot.org +Requires: pcp-libs = %{version}-%{release} + +%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+ +Group: Development/Libraries +Summary: Performance Co-Pilot (PCP) Perl bindings for PCP Memory Mapped Values +URL: http://www.performancecopilot.org +Requires: pcp-libs = %{version}-%{release} + +%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+ +Group: Development/Libraries +Summary: Performance Co-Pilot (PCP) Perl bindings for importing external data into PCP archives +URL: http://www.performancecopilot.org +Requires: pcp-libs = %{version}-%{release} + +%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+ +Group: Development/Libraries +Summary: Performance Co-Pilot (PCP) Perl bindings for post-processing output of pmlogsummary +URL: http://www.performancecopilot.org +Requires: pcp-libs = %{version}-%{release} + +%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+ +Group: Applications/System +Summary: Performance Co-Pilot tools for importing sar data into PCP archive logs +URL: http://www.performancecopilot.org +Requires: pcp-libs = %{version}-%{release} +Requires: perl-PCP-LogImport = %{version}-%{release} +Requires: sysstat + +%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+ +Group: Applications/System +Summary: Performance Co-Pilot tools for importing iostat data into PCP archive logs +URL: http://www.performancecopilot.org +Requires: pcp-libs = %{version}-%{release} +Requires: perl-PCP-LogImport = %{version}-%{release} +Requires: sysstat + +%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-mrtg2pcp +# +%package import-mrtg2pcp +License: LGPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot tools for importing MTRG data into PCP archive logs +URL: http://www.performancecopilot.org +Requires: pcp-libs = %{version}-%{release} +Requires: perl-PCP-LogImport = %{version}-%{release} + +%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-collectl2pcp +# +%package import-collectl2pcp +License: LGPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot tools for importing collectl log files into PCP archive logs +URL: http://www.performancecopilot.org +Requires: pcp-libs = %{version}-%{release} + +%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. + +%if !%{disable_papi} +# +# pcp-pmda-papi +# +%package pmda-papi +License: GPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot (PCP) metrics for Performance API and hardware counters +URL: http://www.performancecopilot.org +Requires: pcp-libs = %{version}-%{release} +Requires: papi-devel +BuildRequires: papi-devel + +%description pmda-papi +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting hardware counters statistics through PAPI (Performance API). +%endif + +%if !%{disable_infiniband} +# +# pcp-pmda-infiniband +# +%package pmda-infiniband +License: GPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot (PCP) metrics for Infiniband HCAs and switches +URL: http://www.performancecopilot.org +Requires: pcp-libs = %{version}-%{release} +Requires: libibmad >= 1.3.7 libibumad >= 1.3.7 +BuildRequires: libibmad-devel >= 1.3.7 libibumad-devel >= 1.3.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. +%endif + +# +# python-pcp. This is the PCP library bindings for python. +# +%package -n python-pcp +License: GPLv2+ +Group: Development/Libraries +Summary: Performance Co-Pilot (PCP) Python bindings and documentation +URL: http://www.performancecopilot.org +Requires: pcp-libs = %{version}-%{release} + +%description -n python-pcp +The python PCP module contains the language bindings for +building Performance Metric API (PMAPI) tools using Python. + +%if !%{disable_qt} +# +# pcp-gui package for Qt tools +# +%package -n pcp-gui +License: GPLv2+ and LGPLv2+ and LGPLv2+ with exceptions +Group: Applications/System +Summary: Visualization tools for the Performance Co-Pilot toolkit +URL: http://www.performancecopilot.org +Requires: pcp-libs = %{version}-%{release} + +%description -n pcp-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 -n pcp-doc +Group: Documentation +%if 0%{?rhel} == 0 || 0%{?rhel} > 5 +BuildArch: noarch +%endif +Summary: Documentation and tutorial for the Performance Co-Pilot +URL: http://www.performancecopilot.org + +%description -n pcp-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. + +%prep +%setup -q + +%clean +rm -Rf $RPM_BUILD_ROOT + +%build +%configure %{?_with_initd} %{?_with_doc} %{?_with_ib} %{?_with_papi} %{?_with_qt} +make default_pcp + +%install +rm -Rf $RPM_BUILD_ROOT +export NO_CHOWN=true DIST_ROOT=$RPM_BUILD_ROOT +make install_pcp +PCP_GUI='pmchart|pmconfirm|pmdumptext|pmmessage|pmquery|pmsnap|pmtime' + +# Fix stuff we do/don't want to ship +rm -f $RPM_BUILD_ROOT/%{_libdir}/*.a + +# remove sheet2pcp until BZ 830923 and BZ 754678 are resolved. +rm -f $RPM_BUILD_ROOT/%{_bindir}/sheet2pcp $RPM_BUILD_ROOT/%{_mandir}/man1/sheet2pcp.1.gz + +# remove configsz.h as this is not multilib friendly. +rm -f $RPM_BUILD_ROOT/%{_includedir}/pcp/configsz.h + +%if %{disable_microhttpd} +rm -f $RPM_BUILD_ROOT/%{_mandir}/man1/pmwebd.* +rm -f $RPM_BUILD_ROOT/%{_mandir}/man3/PMWEBAPI.* +rm -fr $RPM_BUILD_ROOT/%{_confdir}/pmwebd +rm -fr $RPM_BUILD_ROOT/%{_initddir}/pmwebd +rm -f $RPM_BUILD_ROOT/%{_libexecdir}/pcp/bin/pmwebd +%endif + +%if %{disable_infiniband} +# remove pmdainfiniband on platforms lacking IB devel packages. +rm -f $RPM_BUILD_ROOT/%{_pmdasdir}/ib +rm -f $RPM_BUILD_ROOT/%{_mandir}/man1/pmdaib.1.gz +rm -fr $RPM_BUILD_ROOT/%{_pmdasdir}/infiniband +%endif + +%if %{disable_qt} +rm -fr $RPM_BUILD_ROOT/%{_pixmapdir} +rm -f `find $RPM_BUILD_ROOT/%{_mandir}/man1 | egrep "$PCP_GUI"` +%else +rm -rf $RPM_BUILD_ROOT/usr/share/doc/pcp-gui +desktop-file-validate $RPM_BUILD_ROOT/%{_datadir}/applications/pmchart.desktop +%endif + +%if %{disable_systemd} +# default chkconfig off for Fedora and RHEL +for f in $RPM_BUILD_ROOT/%{_initddir}/{pcp,pmcd,pmlogger,pmie,pmwebd,pmmgr,pmproxy}; do + test -f "$f" || continue + sed -i -e '/^# chkconfig/s/:.*$/: - 95 05/' -e '/^# Default-Start:/s/:.*$/:/' $f +done +%endif + +# list of PMDAs in the base pkg +ls -1 $RPM_BUILD_ROOT/%{_pmdasdir} |\ + egrep -v 'simple|sample|trivial|txmon' |\ + egrep -v '^ib$|infiniband' |\ + egrep -v 'papi' |\ + sed -e 's#^#'%{_pmdasdir}'\/#' >base_pmdas.list + +# all base pcp package files except those split out into sub packages +ls -1 $RPM_BUILD_ROOT/%{_bindir} |\ + sed -e 's#^#'%{_bindir}'\/#' >base_bin.list +ls -1 $RPM_BUILD_ROOT/%{_libexecdir}/pcp/bin |\ + sed -e 's#^#'%{_libexecdir}/pcp/bin'\/#' >base_exec.list +ls -1 $RPM_BUILD_ROOT/%{_mandir}/man1 |\ + sed -e 's#^#'%{_mandir}'\/man1\/#' >base_man.list +ls -1 $RPM_BUILD_ROOT/%{_booksdir} |\ + sed -e 's#^#'%{_booksdir}'\/#' > pcp-doc.list +ls -1 $RPM_BUILD_ROOT/%{_datadir}/pcp/demos/tutorials |\ + sed -e 's#^#'%{_datadir}/pcp/demos/tutorials'\/#' >>pcp-doc.list +%if !%{disable_qt} +ls -1 $RPM_BUILD_ROOT/%{_pixmapdir} |\ + sed -e 's#^#'%{_pixmapdir}'\/#' > pcp-gui.list +cat base_bin.list base_exec.list base_man.list |\ + egrep "$PCP_GUI" >> pcp-gui.list +%endif +cat base_pmdas.list base_bin.list base_exec.list base_man.list |\ + egrep -v 'pmdaib|pmmgr|pmweb|2pcp' |\ + egrep -v "$PCP_GUI|pixmaps|pcp-doc|tutorials" |\ + egrep -v %{_confdir} | egrep -v %{_logsdir} > base.list + +# all devel pcp package files except those split out into sub packages +ls -1 $RPM_BUILD_ROOT/%{_mandir}/man3 |\ +sed -e 's#^#'%{_mandir}'\/man3\/#' | egrep -v '3pm|PMWEBAPI' >devel.list +ls -1 $RPM_BUILD_ROOT/%{_datadir}/pcp/demos |\ +sed -e 's#^#'%{_datadir}'\/pcp\/demos\/#' | egrep -v tutorials >> devel.list + +%pre testsuite +test -d %{_testsdir} || mkdir -p -m 755 %{_testsdir} +getent group pcpqa >/dev/null || groupadd -r pcpqa +getent passwd pcpqa >/dev/null || \ + useradd -c "PCP Quality Assurance" -g pcpqa -d %{_testsdir} -M -r -s /bin/bash pcpqa 2>/dev/null +chown -R pcpqa:pcpqa %{_testsdir} 2>/dev/null +exit 0 + +%post testsuite +chown -R pcpqa:pcpqa %{_testsdir} 2>/dev/null +exit 0 + +%pre +getent group pcp >/dev/null || groupadd -r pcp +getent passwd pcp >/dev/null || \ + useradd -c "Performance Co-Pilot" -g pcp -d %{_localstatedir}/lib/pcp -M -r -s /sbin/nologin pcp +PCP_SYSCONF_DIR=%{_confdir} +PCP_LOG_DIR=%{_logsdir} +PCP_ETC_DIR=%{_sysconfdir} +# rename crontab files to align with current Fedora packaging guidelines +for crontab in pmlogger pmie +do + test -f "$PCP_ETC_DIR/cron.d/$crontab" || continue + mv -f "$PCP_ETC_DIR/cron.d/$crontab" "$PCP_ETC_DIR/cron.d/pcp-$crontab" +done +# produce a script to run post-install to move configs to their new homes +save_configs_script() +{ + _new="$1" + shift + for _dir + do + [ "$_dir" = "$_new" ] && continue + if [ -d "$_dir" ] + then + ( cd "$_dir" ; find . -type f -print ) | sed -e 's/^\.\///' \ + | while read _file + do + _want=true + if [ -f "$_new/$_file" ] + then + # file exists in both directories, pick the more + # recently modified one + _try=`find "$_dir/$_file" -newer "$_new/$_file" -print` + [ -n "$_try" ] || _want=false + fi + $_want && echo cp -p "$_dir/$_file" "$_new/$_file" + done + fi + done +} +# migrate and clean configs if we have had a previous in-use installation +[ -d "$PCP_LOG_DIR" ] || exit 0 # no configuration file upgrades required +rm -f "$PCP_LOG_DIR/configs.sh" +for daemon in pmcd pmie pmlogger pmproxy +do + save_configs_script >> "$PCP_LOG_DIR/configs.sh" "$PCP_SYSCONF_DIR/$daemon" \ + /var/lib/pcp/config/$daemon /etc/$daemon /etc/pcp/$daemon /etc/sysconfig/$daemon +done +exit 0 + +%if !%{disable_microhttpd} +%preun webapi +if [ "$1" -eq 0 ] +then +%if !%{disable_systemd} + systemctl --no-reload disable pmwebd.service >/dev/null 2>&1 + systemctl stop pmwebd.service >/dev/null 2>&1 +%else + /sbin/service pmwebd stop >/dev/null 2>&1 + /sbin/chkconfig --del pmwebd >/dev/null 2>&1 +%endif +fi +%endif + +%preun manager +if [ "$1" -eq 0 ] +then +%if !%{disable_systemd} + 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 + +%preun +if [ "$1" -eq 0 ] +then + # stop daemons before erasing the package + %if !%{disable_systemd} + systemctl --no-reload disable pmlogger.service >/dev/null 2>&1 + systemctl --no-reload disable pmie.service >/dev/null 2>&1 + systemctl --no-reload disable pmproxy.service >/dev/null 2>&1 + systemctl --no-reload disable pmcd.service >/dev/null 2>&1 + + 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=%{_pmnsdir} + rm -f "$PCP_PMNS_DIR/.NeedRebuild" >/dev/null 2>&1 +fi + +%if !%{disable_microhttpd} +%post webapi +chown -R pcp:pcp %{_logsdir}/pmwebd 2>/dev/null +%if !%{disable_systemd} + systemctl condrestart pmwebd.service >/dev/null 2>&1 +%else + /sbin/chkconfig --add pmwebd >/dev/null 2>&1 + /sbin/service pmwebd condrestart +%endif +%endif + +%post manager +chown -R pcp:pcp %{_logsdir}/pmmgr 2>/dev/null +%if !%{disable_systemd} + systemctl condrestart pmmgr.service >/dev/null 2>&1 +%else + /sbin/chkconfig --add pmmgr >/dev/null 2>&1 + /sbin/service pmmgr condrestart +%endif + +%post +PCP_LOG_DIR=%{_logsdir} +PCP_PMNS_DIR=%{_pmnsdir} +# restore saved configs, if any +test -s "$PCP_LOG_DIR/configs.sh" && source "$PCP_LOG_DIR/configs.sh" +rm -f $PCP_LOG_DIR/configs.sh + +# migrate old to new temp dir locations (within the same filesystem) +migrate_tempdirs() +{ + _sub="$1" + _new_tmp_dir=%{_tempsdir} + _old_tmp_dir=%{_localstatedir}/tmp + + for d in "$_old_tmp_dir/$_sub" ; do + test -d "$d" -a -k "$d" || continue + cd "$d" || continue + for f in * ; do + [ "$f" != "*" ] || continue + source="$d/$f" + target="$_new_tmp_dir/$_sub/$f" + [ "$source" != "$target" ] || continue + [ -f "$target" ] || mv -fu "$source" "$target" + done + cd && rmdir "$d" 2>/dev/null + done +} +for daemon in mmv pmdabash pmie pmlogger +do + migrate_tempdirs $daemon +done +chown -R pcp:pcp %{_logsdir}/pmcd 2>/dev/null +chown -R pcp:pcp %{_logsdir}/pmlogger 2>/dev/null +chown -R pcp:pcp %{_logsdir}/pmie 2>/dev/null +chown -R pcp:pcp %{_logsdir}/pmproxy 2>/dev/null +touch "$PCP_PMNS_DIR/.NeedRebuild" +chmod 644 "$PCP_PMNS_DIR/.NeedRebuild" +%if !%{disable_systemd} + systemctl condrestart pmcd.service >/dev/null 2>&1 + systemctl condrestart pmlogger.service >/dev/null 2>&1 + systemctl condrestart pmie.service >/dev/null 2>&1 + 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 + +%post libs -p /sbin/ldconfig +%postun libs -p /sbin/ldconfig + +%files -f base.list +# +# Note: there are some headers (e.g. domain.h) and in a few cases some +# C source files that rpmlint complains about. These are not devel files, +# but rather they are (slightly obscure) PMDA config files. +# +%defattr(-,root,root) +%doc CHANGELOG COPYING INSTALL README VERSION.pcp pcp.lsm + +%dir %{_confdir} +%dir %{_pmdasdir} +%dir %{_datadir}/pcp +%dir %{_localstatedir}/lib/pcp +%dir %{_localstatedir}/lib/pcp/config +%dir %attr(0775,pcp,pcp) %{_localstatedir}/lib/pcp/config/pmda +%dir %attr(0775,pcp,pcp) %{_tempsdir} +%dir %attr(0775,pcp,pcp) %{_tempsdir}/pmie +%dir %attr(0775,pcp,pcp) %{_tempsdir}/pmlogger +%dir %attr(0775,pcp,pcp) %{_logsdir} + +%{_datadir}/pcp/lib +%attr(0775,pcp,pcp) %{_logsdir}/pmcd +%attr(0775,pcp,pcp) %{_logsdir}/pmlogger +%attr(0775,pcp,pcp) %{_logsdir}/pmie +%attr(0775,pcp,pcp) %{_logsdir}/pmproxy +%{_localstatedir}/lib/pcp/pmns +%if %{disable_systemd} +%{_initddir}/pcp +%{_initddir}/pmcd +%{_initddir}/pmlogger +%{_initddir}/pmie +%{_initddir}/pmproxy +%endif +%{_mandir}/man5/* +%config(noreplace) %{_sysconfdir}/sasl2/pmcd.conf +%config(noreplace) %{_sysconfdir}/cron.d/pcp-pmlogger +%config(noreplace) %{_sysconfdir}/cron.d/pcp-pmie +%config %{_sysconfdir}/bash_completion.d/pcp +%config %{_sysconfdir}/pcp.env +%config %{_sysconfdir}/pcp.sh +%dir %{_confdir}/pmcd +%config(noreplace) %{_confdir}/pmcd/pmcd.conf +%config(noreplace) %{_confdir}/pmcd/pmcd.options +%config(noreplace) %{_confdir}/pmcd/rc.local +%dir %{_confdir}/pmproxy +%config(noreplace) %{_confdir}/pmproxy/pmproxy.options +%dir %attr(0775,pcp,pcp) %{_confdir}/pmie +%attr(0664,pcp,pcp) %config(noreplace) %{_confdir}/pmie/control +%dir %attr(0775,pcp,pcp) %{_confdir}/pmlogger +%attr(0664,pcp,pcp) %config(noreplace) %{_confdir}/pmlogger/control +%{_localstatedir}/lib/pcp/config/* + +%if 0%{?rhel} == 0 || 0%{?rhel} > 5 +%{tapsetdir}/pmcd.stp +%else # rhel5 +%ifarch ppc ppc64 +# no systemtap-sdt-devel +%else # ! ppc +%{tapsetdir}/pmcd.stp +%endif # ppc +%endif + +%files conf +%defattr(-,root,root) + +%dir %{_includedir}/pcp +%{_includedir}/pcp/builddefs +%{_includedir}/pcp/buildrules +%config %{_sysconfdir}/pcp.conf + +%files libs +%defattr(-,root,root) + +%{_libdir}/libpcp.so.3 +%{_libdir}/libpcp_gui.so.2 +%{_libdir}/libpcp_mmv.so.1 +%{_libdir}/libpcp_pmda.so.3 +%{_libdir}/libpcp_trace.so.2 +%{_libdir}/libpcp_import.so.1 + +%files libs-devel -f devel.list +%defattr(-,root,root) + +%{_libdir}/libpcp.so +%{_libdir}/libpcp.so.2 +%{_libdir}/libpcp_gui.so +%{_libdir}/libpcp_gui.so.1 +%{_libdir}/libpcp_mmv.so +%{_libdir}/libpcp_pmda.so +%{_libdir}/libpcp_pmda.so.2 +%{_libdir}/libpcp_trace.so +%{_libdir}/libpcp_import.so +%{_includedir}/pcp/*.h +%{_datadir}/pcp/examples + +# PMDAs that ship src and are not for production use +# straight out-of-the-box, for devel or QA use only. +%{_pmdasdir}/simple +%{_pmdasdir}/sample +%{_pmdasdir}/trivial +%{_pmdasdir}/txmon + +%files testsuite +%defattr(-,pcpqa,pcpqa) +%{_testsdir} + +%if !%{disable_microhttpd} +%files webapi +%defattr(-,root,root) +%if %{disable_systemd} +%{_initddir}/pmwebd +%endif +%{_libexecdir}/pcp/bin/pmwebd +%attr(0775,pcp,pcp) %{_logsdir}/pmwebd +%{_confdir}/pmwebd +%config(noreplace) %{_confdir}/pmwebd/pmwebd.options +%{_mandir}/man1/pmwebd.1.gz +%{_mandir}/man3/PMWEBAPI.3.gz +%endif + +%files manager +%defattr(-,root,root) +%if %{disable_systemd} +%{_initddir}/pmmgr +%endif +%{_libexecdir}/pcp/bin/pmmgr +%attr(0775,pcp,pcp) %{_logsdir}/pmmgr +%{_confdir}/pmmgr +%config(noreplace) %{_confdir}/pmmgr/pmmgr.options +%{_mandir}/man1/pmmgr.1.gz + +%files import-sar2pcp +%defattr(-,root,root) +%{_bindir}/sar2pcp +%{_mandir}/man1/sar2pcp.1.gz + +%files import-iostat2pcp +%defattr(-,root,root) +%{_bindir}/iostat2pcp +%{_mandir}/man1/iostat2pcp.1.gz + +%files import-mrtg2pcp +%defattr(-,root,root) +%{_bindir}/mrtg2pcp +%{_mandir}/man1/mrtg2pcp.1.gz + +%files import-collectl2pcp +%defattr(-,root,root) +%{_bindir}/collectl2pcp +%{_mandir}/man1/collectl2pcp.1.gz + +%if !%{disable_papi} +%files pmda-papi +%defattr(-,root,root) +%{_pmdasdir}/papi +%{_mandir}/man1/pmdapapi.1.gz +%endif + +%if !%{disable_infiniband} +%files pmda-infiniband +%defattr(-,root,root) +%{_pmdasdir}/ib +%{_pmdasdir}/infiniband +%{_mandir}/man1/pmdaib.1.gz +%endif + +%files -n perl-PCP-PMDA -f perl-pcp-pmda.list +%defattr(-,root,root) + +%files -n perl-PCP-MMV -f perl-pcp-mmv.list +%defattr(-,root,root) + +%files -n perl-PCP-LogImport -f perl-pcp-logimport.list +%defattr(-,root,root) + +%files -n perl-PCP-LogSummary -f perl-pcp-logsummary.list +%defattr(-,root,root) + +%files -n python-pcp -f python-pcp.list.rpm +%defattr(-,root,root) + +%if !%{disable_qt} +%files -n pcp-gui -f pcp-gui.list +%defattr(-,root,root,-) + +%{_sysconfdir}/pcp/pmsnap +%config(noreplace) %{_sysconfdir}/pcp/pmsnap +%{_localstatedir}/lib/pcp/config/pmsnap +%dir %{_localstatedir}/lib/pcp/config/pmsnap +%{_localstatedir}/lib/pcp/config/pmchart +%dir %{_localstatedir}/lib/pcp/config/pmchart +%{_localstatedir}/lib/pcp/config/pmafm/pcp-gui +%{_datadir}/applications/pmchart.desktop +%endif + +%files -n pcp-doc -f pcp-doc.list +%defattr(-,root,root,-) + +%changelog +* Fri Sep 05 2014 Nathan Scott <nathans@redhat.com> - 3.9.10-1 +- Convert PCP init scripts to systemd services (BZ 996438) +- Fix pmlogsummary -S/-T time window reporting (BZ 1132476) +- Resolve pmdumptext segfault with invalid host (BZ 1131779) +- Fix signedness in some service discovery codes (BZ 1136166) +- New conditionally-built pcp-pmda-papi sub-package. +- Update to latest PCP sources. + +* Wed Aug 13 2014 Nathan Scott <nathans@redhat.com> - 3.9.9-1 +- Update to latest PCP sources. + +* Wed Jul 16 2014 Mark Goodwin <mgoodwin@redhat.com> - 3.9.7-1 +- Update to latest PCP sources. + +* Wed Jun 18 2014 Dave Brolley <brolley@redhat.com> - 3.9.5-1 +- Daemon signal handlers no longer use unsafe APIs (BZ 847343) +- Handle /var/run setups on a temporary filesystem (BZ 656659) +- Resolve pmlogcheck sigsegv for some archives (BZ 1077432) +- Ensure pcp-gui-{testsuite,debuginfo} packages get replaced. +- Revive support for EPEL5 builds, post pcp-gui merge. +- Update to latest PCP sources. + +* Fri Jun 06 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.9.4-1.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu May 15 2014 Nathan Scott <nathans@redhat.com> - 3.9.4-1 +- Merged pcp-gui and pcp-doc packages into core PCP. +- Allow for conditional libmicrohttpd builds in spec file. +- Adopt slow-start capability in systemd PMDA (BZ 1073658) +- Resolve pmcollectl network/disk mis-reporting (BZ 1097095) +- Update to latest PCP sources. + +* Tue Apr 15 2014 Dave Brolley <brolley@redhat.com> - 3.9.2-1 +- Improve pmdarpm(1) concurrency complications (BZ 1044297) +- Fix pmconfig(1) shell output string quoting (BZ 1085401) +- Update to latest PCP sources. + +* Wed Mar 19 2014 Nathan Scott <nathans@redhat.com> - 3.9.1-1 +- Update to latest PCP sources. + +* Thu Feb 20 2014 Nathan Scott <nathans@redhat.com> - 3.9.0-2 +- Workaround further PowerPC/tapset-related build fallout. + +* Wed Feb 19 2014 Nathan Scott <nathans@redhat.com> - 3.9.0-1 +- Create new sub-packages for pcp-webapi and pcp-manager +- Split configuration from pcp-libs into pcp-conf (multilib) +- Fix pmdagluster to handle more volumes, fileops (BZ 1066544) +- Update to latest PCP sources. + +* Wed Jan 29 2014 Nathan Scott <nathans@redhat.com> - 3.8.12-1 +- Resolves SNMP procfs file ICMP line parse issue (BZ 1055818) +- Update to latest PCP sources. + +* Wed Jan 15 2014 Nathan Scott <nathans@redhat.com> - 3.8.10-1 +- Update to latest PCP sources. + +* Thu Dec 12 2013 Nathan Scott <nathans@redhat.com> - 3.8.9-1 +- Reduce set of exported symbols from DSO PMDAs (BZ 1025694) +- Symbol-versioning for PCP shared libraries (BZ 1037771) +- Fix pmcd/Avahi interaction with multiple ports (BZ 1035513) +- Update to latest PCP sources. + +* Sun Nov 03 2013 Nathan Scott <nathans@redhat.com> - 3.8.8-1 +- Update to latest PCP sources (simple build fixes only). + +* Fri Nov 01 2013 Nathan Scott <nathans@redhat.com> - 3.8.6-1 +- Update to latest PCP sources. +- Rework pmpost test which confused virus checkers (BZ 1024850) +- Tackle pmatop reporting issues via alternate metrics (BZ 998735) + +* Fri Oct 18 2013 Nathan Scott <nathans@redhat.com> - 3.8.5-1 +- Update to latest PCP sources. +- Disable pcp-pmda-infiniband sub-package on RHEL5 (BZ 1016368) + +* Mon Sep 16 2013 Nathan Scott <nathans@redhat.com> - 3.8.4-2 +- Disable the pcp-pmda-infiniband sub-package on s390 platforms. + +* Sun Sep 15 2013 Nathan Scott <nathans@redhat.com> - 3.8.4-1 +- Very minor release containing mostly QA related changes. +- Enables many more metrics to be logged for Linux hosts. + +* Wed Sep 11 2013 Stan Cox <scox@redhat.com> - 3.8.3-2 +- Disable pmcd.stp on el5 ppc. + +* Mon Sep 09 2013 Nathan Scott <nathans@redhat.com> - 3.8.3-1 +- Default to Unix domain socket (authenticated) local connections. +- Introduces new pcp-pmda-infiniband sub-package. +- Disable systemtap-sdt-devel usage on ppc. + +* Sat Aug 03 2013 Petr Pisar <ppisar@redhat.com> - 3.8.2-1.1 +- Perl 5.18 rebuild + +* Wed Jul 31 2013 Nathan Scott <nathans@redhat.com> - 3.8.2-1 +- Update to latest PCP sources. +- Integrate gluster related stats with PCP (BZ 969348) +- Fix for iostat2pcp not parsing iostat output (BZ 981545) +- Start pmlogger with usable config by default (BZ 953759) +- Fix pmatop failing to start, gives stacktrace (BZ 963085) + +* Wed Jun 19 2013 Nathan Scott <nathans@redhat.com> - 3.8.1-1 +- Update to latest PCP sources. +- Fix log import silently dropping >1024 metrics (BZ 968210) +- Move some commonly used tools on the usual PATH (BZ 967709) +- Improve pmatop handling of missing proc metrics (BZ 963085) +- Stop out-of-order records corrupting import logs (BZ 958745) + +* Tue May 14 2013 Nathan Scott <nathans@redhat.com> - 3.8.0-1 +- Update to latest PCP sources. +- Validate metric names passed into pmiAddMetric (BZ 958019) +- Install log directories with correct ownership (BZ 960858) + +* Fri Apr 19 2013 Nathan Scott <nathans@redhat.com> - 3.7.2-1 +- Update to latest PCP sources. +- Ensure root namespace exists at the end of install (BZ 952977) + +* Wed Mar 20 2013 Nathan Scott <nathans@redhat.com> - 3.7.1-1 +- Update to latest PCP sources. +- Migrate all tempfiles correctly to the new tempdir hierarchy. + +* Sun Mar 10 2013 Nathan Scott <nathans@redhat.com> - 3.7.0-1 +- Update to latest PCP sources. +- Migrate all configuration files below the /etc/pcp hierarchy. + +* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 3.6.10-2.1 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Wed Nov 28 2012 Nathan Scott <nathans@redhat.com> - 3.6.10-2 +- Ensure tmpfile directories created in %%files section. +- Resolve tmpfile create/teardown race conditions. + +* Mon Nov 19 2012 Nathan Scott <nathans@redhat.com> - 3.6.10-1 +- Update to latest PCP sources. +- Resolve tmpfile security flaws: CVE-2012-5530 +- Introduces new "pcp" user account for all daemons to use. + +* Fri Oct 12 2012 Nathan Scott <nathans@redhat.com> - 3.6.9-1 +- Update to latest PCP sources. +- Fix pmcd sigsegv in NUMA/CPU indom setup (BZ 858384) +- Fix sar2pcp uninitialised perl variable warning (BZ 859117) +- Fix pcp.py and pmcollectl with older python versions (BZ 852234) + +* Fri Sep 14 2012 Nathan Scott <nathans@redhat.com> - 3.6.8-1 +- Update to latest PCP sources. + +* Wed Sep 05 2012 Nathan Scott <nathans@redhat.com> - 3.6.6-1.1 +- Move configure step from prep to build section of spec (BZ 854128) + +* Tue Aug 28 2012 Mark Goodwin <mgoodwin@redhat.com> - 3.6.6-1 +- Update to latest PCP sources, see installed CHANGELOG for details. +- Introduces new python-pcp and pcp-testsuite sub-packages. + +* Thu Aug 16 2012 Mark Goodwin <mgoodwin@redhat.com> - 3.6.5-1 +- Update to latest PCP sources, see installed CHANGELOG for details. +- Fix security flaws: CVE-2012-3418 CVE-2012-3419 CVE-2012-3420 and CVE-2012-3421 (BZ 848629) + +* Thu Jul 19 2012 Mark Goodwin <mgoodwin@redhat.com> +- pmcd and pmlogger services are not supposed to be enabled by default (BZ 840763) - 3.6.3-1.3 + +* Thu Jun 21 2012 Mark Goodwin <mgoodwin@redhat.com> +- remove pcp-import-sheet2pcp subpackage due to missing deps (BZ 830923) - 3.6.3-1.2 + +* Fri May 18 2012 Dan Hork <dan[at]danny.cz> - 3.6.3-1.1 +- fix build on s390x + +* Mon Apr 30 2012 Mark Goodwin - 3.6.3-1 +- Update to latest PCP sources + +* Thu Apr 26 2012 Mark Goodwin - 3.6.2-1 +- Update to latest PCP sources + +* Thu Apr 12 2012 Mark Goodwin - 3.6.1-1 +- Update to latest PCP sources + +* Thu Mar 22 2012 Mark Goodwin - 3.6.0-1 +- use %%configure macro for correct libdir logic +- update to latest PCP sources + +* Thu Dec 15 2011 Mark Goodwin - 3.5.11-2 +- patched configure.in for libdir=/usr/lib64 on ppc64 + +* Thu Dec 01 2011 Mark Goodwin - 3.5.11-1 +- Update to latest PCP sources. + +* Fri Nov 04 2011 Mark Goodwin - 3.5.10-1 +- Update to latest PCP sources. + +* Mon Oct 24 2011 Mark Goodwin - 3.5.9-1 +- Update to latest PCP sources. + +* Mon Aug 08 2011 Mark Goodwin - 3.5.8-1 +- Update to latest PCP sources. + +* Fri Aug 05 2011 Mark Goodwin - 3.5.7-1 +- Update to latest PCP sources. + +* Fri Jul 22 2011 Mark Goodwin - 3.5.6-1 +- Update to latest PCP sources. + +* Tue Jul 19 2011 Mark Goodwin - 3.5.5-1 +- Update to latest PCP sources. + +* Thu Feb 03 2011 Mark Goodwin - 3.5.0-1 +- Update to latest PCP sources. + +* Thu Sep 30 2010 Mark Goodwin - 3.4.0-1 +- Update to latest PCP sources. + +* Fri Jul 16 2010 Mark Goodwin - 3.3.3-1 +- Update to latest PCP sources. + +* Sat Jul 10 2010 Mark Goodwin - 3.3.2-1 +- Update to latest PCP sources. + +* Tue Jun 29 2010 Mark Goodwin - 3.3.1-1 +- Update to latest PCP sources. + +* Fri Jun 25 2010 Mark Goodwin - 3.3.0-1 +- Update to latest PCP sources. + +* Thu Mar 18 2010 Mark Goodwin - 3.1.2-1 +- Update to latest PCP sources. + +* Wed Jan 27 2010 Mark Goodwin - 3.1.0-1 +- BuildRequires: initscripts for %%{_vendor} == redhat. + +* Thu Dec 10 2009 Mark Goodwin - 3.0.3-1 +- BuildRequires: initscripts for FC12. + +* Wed Dec 02 2009 Mark Goodwin - 3.0.2-1 +- Added sysfs.kernel metrics, rebased to minor community release. + +* Mon Oct 19 2009 Martin Hicks <mort@sgi.com> - 3.0.1-2 +- Remove IB dependencies. The Infiniband PMDA is being moved to + a stand-alone package. +- Move cluster PMDA to a stand-alone package. + +* Fri Oct 09 2009 Mark Goodwin <mgoodwin@redhat.com> - 3.0.0-9 +- This is the initial import for Fedora +- See 3.0.0 details in CHANGELOG diff --git a/build/rpm/filter-requires b/build/rpm/filter-requires new file mode 100755 index 0000000..379415d --- /dev/null +++ b/build/rpm/filter-requires @@ -0,0 +1,75 @@ +#!/bin/sh +# +# Filter to exclude some Requires targets from those automatically +# generated by rpmbuild's helper script find-requires +# +# Specifically intended for Perl modules that PCP uses, but which +# may not be packaged in some distributions. +# + +_usage() +{ + echo >&2 "Usage: $0 [option] path-to-real-find-requires [arg]" + echo >&2 "Options:" + echo >&2 " -f fedora_version" + echo >&2 " -r redhat_version" + echo >&2 " -v vendor (\"redhat\" or \"suse\" or ...)" +} + +#debug# echo >&2 "$0 called as: $0 $*" + +FEDORA=0 +REDHAT=0 +VENDOR=unknown +while getopts "f:r:v:?" c +do + case $c + in + f) + FEDORA="$OPTARG" + ;; + r) + REDHAT="$OPTARG" + ;; + v) + VENDOR="$OPTARG" + ;; + esac +done +shift `expr $OPTIND - 1` + +if [ $# -lt 1 ] +then + _usage + exit 1 +fi + +if [ ! -f "$1" ] +then + echo "$0: Error: rpm script $1 not found" + exit 1 +fi + +# Filtering depends on distro vendor and possibly version +# +# Lines from find-requires look like this ... +# /bin/sh +# libc.so.6()(64bit) +# libc.so.6(GLIBC_2.2.5)(64bit) +# perl(Spreadsheet::Read) +# perl(strict) +# +case "$VENDOR" +in + redhat) + # See RedHat BZ 830923 and BZ 754678 for Spreadsheet::Read + # issues. + # Does not seem to matter what version of RH or Fedora. + $* \ + | sed \ + -e '/^perl(Spreadsheet::Read)$/d' + ;; + *) + $* + ;; +esac diff --git a/build/rpm/get_rpm_version b/build/rpm/get_rpm_version new file mode 100755 index 0000000..5dca540 --- /dev/null +++ b/build/rpm/get_rpm_version @@ -0,0 +1,66 @@ +#!/bin/sh +# +# Convert an rpm(1) --version string into an 7 or more digit number that +# can be used in %if comparisons in a specfile. +# +# The first part of the rpm verson has no leading zero, parts after that +# (up to 3 more) are fixed width 2 digits with leading zero if needed. +# +# rpm --version produces text like +# RPM version 4.4.2.3 +# and this is mapped to 4040203 and .0 is implied for any missing parts +# of the version string, so 4.7 becomes 4070000 for example. +# +# Copyright (c) 2014 Ken McDonell. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# + +tmp=/var/tmp/$$ +sts=0 +trap "rm -f $tmp.*; exit \$sts" 0 1 2 3 15 + +# try to get required command pathnames from ../../src/include/builddefs +# +if [ -f ../../src/include/builddefs ] +then + rpm=`sed <../../src/include/builddefs -n -e '/^RPM[ ]*=/s/^RPM[ ]*=[ ]*//p'` + awk=`sed <../../src/include/builddefs -n -e '/^AWK[ ]*=/s/^AWK[ ]*=[ ]*//p'` +fi + +# otherwise use vanilla defaults +# +[ -z "$rpm" ] && rpm=rpm +[ -z "$awk" ] && awk=awk + +if `which $rpm >/dev/null 2>&1` +then + : +else + echo "$0: Arrgh ... $rpm not found, why am I being run?" + sts=1 + exit +fi + +#debug# echo "rpm=$rpm" +#debug# echo "awk=$awk" + +cat <<'End-of-File' >$tmp.awk +{ for (i = NF+1; i <= 4; i++) $i = 0 + printf "%d%02d%02d%02d\n",$1,$2,$3,$4 +} +End-of-File + +# translate rpm --version output +# +$rpm --version \ +| sed -e 's/.* \([0-9]\)/\1/' \ +| eval $awk -F. -f $tmp.awk diff --git a/build/rpm/macros.template b/build/rpm/macros.template new file mode 100644 index 0000000..6e36d88 --- /dev/null +++ b/build/rpm/macros.template @@ -0,0 +1,23 @@ +# +# rpmrc.template +# + +# topdir == $(WORKAREA) +%_topdir %topdir% + +# Following directories are specific to the topdir +# This is where build is done. In our case it's the same as $WORKAREA +%_builddir %{_topdir} + +# This is where foo.1.99.tar.gz is living in the real world. +# Be careful not to run full rpm build as it will override the sources +%_sourcedir %{_topdir}/../build/tar + +# This is where binary RPM and source RPM would end up +%_rpmdir @rpmsdir@ +%_srcrpmdir @srpmsdir@ +%_specdir %{_topdir}/build/rpm + +# Leave RPM files in the same directory - we're not building for +# multiple architectures +%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm diff --git a/build/rpm/pcp-logsummary-perl.desc b/build/rpm/pcp-logsummary-perl.desc new file mode 100644 index 0000000..cbbad53 --- /dev/null +++ b/build/rpm/pcp-logsummary-perl.desc @@ -0,0 +1,6 @@ +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). diff --git a/build/rpm/pcp-mmv-perl.desc b/build/rpm/pcp-mmv-perl.desc new file mode 100644 index 0000000..8991e01 --- /dev/null +++ b/build/rpm/pcp-mmv-perl.desc @@ -0,0 +1,6 @@ +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. diff --git a/build/rpm/pcp-pmda-perl.desc b/build/rpm/pcp-pmda-perl.desc new file mode 100644 index 0000000..15d43f9 --- /dev/null +++ b/build/rpm/pcp-pmda-perl.desc @@ -0,0 +1,5 @@ +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. diff --git a/build/rpm/pcp.spec.in b/build/rpm/pcp.spec.in new file mode 100644 index 0000000..ca4f77a --- /dev/null +++ b/build/rpm/pcp.spec.in @@ -0,0 +1,881 @@ +Summary: System-level performance monitoring and performance management +Name: @package_name@ +Version: @package_version@ +Release: @package_release@@package_sgirelease@ +License: GPLv2+ and LGPLv2.1+ +URL: http://www.performancecopilot.org +Group: Applications/System +Source: @package_name@-@package_version@.src.tar.gz +BuildRoot: @build_root@ +Distribution: @package_distribution@ +BuildRequires: procps bison flex +BuildRequires: python-devel +BuildRequires: ncurses-devel +BuildRequires: readline-devel +BuildRequires: perl(ExtUtils::MakeMaker) +%if "@enable_avahi@" == "true" +BuildRequires: avahi-devel +%endif +%if "@enable_secure@" == "true" +BuildRequires: nss-devel +BuildRequires: cyrus-sasl-devel +%endif +%if "@enable_probes@" == "true" +BuildRequires: systemtap-sdt-devel +%endif +%if @have_libmicrohttpd@ == 1 +BuildRequires: libmicrohttpd-devel +%endif +%if @have_rpmlib@ == 1 +BuildRequires: rpm-devel +%endif +%if "@enable_qt@" == "true" +%if "%{_vendor}" == "suse" +BuildRequires: qt-devel >= 4.4 +%else +BuildRequires: qt4-devel >= 4.4 +%endif +%endif +%if "%{_vendor}" == "redhat" +BuildRequires: initscripts man /bin/hostname +%endif +%if 0%{?fedora} >= 18 || 0%{?rhel} >= 7 +BuildRequires: systemd-devel +%endif + +%if "@enable_papi@" == "enable_papi" +BuildRequires: papi-devel +%endif + +Conflicts: pcp-pro < 2.2 + +# Utilities used indirectly e.g. by scripts we install +Requires: bash gawk sed grep fileutils findutils perl +Requires: python +%if "%{_vendor}" == "redhat" && 0%{?rhel} <= 5 +Requires: python-ctypes +%endif +%if "%{_vendor}" == "suse" +Requires: sysconfig +%define _rcdir /etc/init.d +%else +Requires: initscripts +%define _rcdir /etc/rc.d/init.d +%endif +%if "@enable_systemd@" == "true" +%define _configure_rcdir %{nil} +%else +%define _configure_rcdir --with-rcdir=%{_rcdir} +%endif +%define _tmpdir %{_localstatedir}/lib/pcp/tmp + +# 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} + +Requires: pcp-libs = @package_version@ +Requires: python-pcp = @package_version@ +Requires: perl-PCP-PMDA = @package_version@ +Obsoletes: pcp-gui-debuginfo +Obsoletes: pcp-pmda-nvidia + +%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.1+ +Group: Development/Libraries +Summary: Performance Co-Pilot run-time configuration +URL: http://www.performancecopilot.org + +# 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.1+ +Group: Development/Libraries +Summary: Performance Co-Pilot run-time libraries +URL: http://www.performancecopilot.org + +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.1+ +Group: Development/Libraries +Summary: Performance Co-Pilot (PCP) development headers and documentation +URL: http://www.performancecopilot.org + +Requires: pcp-libs = @package_version@ + +%description libs-devel +Performance Co-Pilot (PCP) headers, documentation and tools for development. + +# +# pcp-testsuite +# +%package testsuite +License: GPLv2+ +Group: Development/Libraries +Summary: Performance Co-Pilot (PCP) test suite +URL: http://www.performancecopilot.org + +Requires: pcp = @package_version@ +Requires: pcp-libs = @package_version@ +Requires: pcp-libs-devel = @package_version@ +# Suggests: valgrind, nmap +Obsoletes: pcp-gui-testsuite + +%description testsuite +Quality assurance test suite for Performance Co-Pilot (PCP). + +%if "@BUILD_PMMGR@" == "yes" +# +# pcp-manager +# +%package manager +License: GPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot (PCP) manager daemon +URL: http://www.performancecopilot.org + +Requires: pcp = @package_version@ +Requires: 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 (which are particularly complex in the case of pmlogger). +The base PCP package provides comparable functionality through cron +scripts which predate this daemon but do still provide effective and +efficient log management services. +The pcp-manager package aims to aggressively enable new PCP features +and as a result may not be suited to all production environments. +%endif + +%if @have_libmicrohttpd@ == 1 +# +# pcp-webapi +# +%package webapi +License: GPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot (PCP) web API service +URL: http://www.performancecopilot.org + +Requires: pcp = @package_version@ +Requires: pcp-libs = @package_version@ + +%description webapi +Provides a daemon (pmwebd) that binds a large subset of the Performance +Co-Pilot (PCP) client API (PMAPI) to RESTful web applications using the +HTTP (PMWEBAPI) protocol. +%endif + +# +# perl-PCP-PMDA. This is the PCP agent perl binding. +# +%package -n perl-PCP-PMDA +License: GPLv2+ +Group: Development/Languages +Summary: Performance Co-Pilot (PCP) Perl bindings and documentation +URL: http://www.performancecopilot.org +Requires: pcp-libs = @package_version@ + +%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+ +Group: Development/Libraries +Summary: Performance Co-Pilot (PCP) Perl bindings for PCP Memory Mapped Values +URL: http://www.performancecopilot.org +Requires: pcp >= @package_version@ + +%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+ +Group: Development/Libraries +Summary: Performance Co-Pilot (PCP) Perl bindings for importing external data into PCP archives +URL: http://www.performancecopilot.org +Requires: pcp >= @package_version@ + +%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+ +Group: Development/Languages +Summary: Performance Co-Pilot (PCP) Perl bindings for post-processing output of pmlogsummary +URL: http://www.performancecopilot.org +Requires: pcp >= @package_version@ + +%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+ +Group: Applications/System +Summary: Performance Co-Pilot tools for importing sar data into PCP archive logs +URL: http://www.performancecopilot.org +Requires: pcp-libs >= @package_version@ perl-PCP-LogImport >= @package_version@ sysstat + +%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+ +Group: Applications/System +Summary: Performance Co-Pilot tools for importing iostat data into PCP archive logs +URL: http://www.performancecopilot.org +Requires: pcp-libs >= @package_version@ perl-PCP-LogImport >= @package_version@ sysstat + +%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+ +Group: Applications/System +Summary: Performance Co-Pilot tools for importing spreadsheet data into PCP archive logs +URL: http://www.performancecopilot.org +Requires: pcp-libs >= @package_version@ perl-PCP-LogImport >= @package_version@ + +%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+ +Group: Applications/System +Summary: Performance Co-Pilot tools for importing MTRG data into PCP archive logs +URL: http://www.performancecopilot.org +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-collectl2pcp +# +%package import-collectl2pcp +License: LGPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot tools for importing collectl log files into PCP archive logs +URL: http://www.performancecopilot.org +Requires: pcp-libs >= %{version}-%{release} + +%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. + +# +# python-pcp. This is the PCP library bindings for python. +# +%package -n python-pcp +License: GPLv2+ +Group: Development/Libraries +Summary: Performance Co-Pilot (PCP) Python bindings and documentation +URL: http://www.performancecopilot.org +Requires: pcp-libs = @package_version@ + +%description -n python-pcp +The python PCP module contains the language bindings for +building Performance Metric API (PMAPI) tools using Python. + +%if "@enable_qt@" == "true" +# +# pcp-gui package for Qt tools +# +%package -n pcp-gui +License: GPLv2+ and LGPLv2+ and LGPLv2+ with exceptions +Group: Applications/System +Summary: Visualization tools for the Performance Co-Pilot toolkit +URL: http://www.performancecopilot.org +Requires: pcp-libs = %{version}-%{release} + +%description -n pcp-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 -n pcp-doc +Group: Documentation +# 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: http://www.performancecopilot.org + +%description -n pcp-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-pmda-papi +# +%if "@enable_papi@" == "enable_papi" +%package pmda-papi +License: GPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot (PCP) metrics for Performance API and hardware counters +URL: http://www.performancecopilot.org +Requires: pcp-libs = %{version}-%{release} +Requires: papi-devel +BuildRequires: papi-devel + +%description pmda-papi +This package contains the PCP Performance Metrics Domain Agent (PMDA) for +collecting hardware counters statistics through PAPI (Perforamance API). +%endif + +%if "@pmda_infiniband@" == "infiniband" +# +# pcp-pmda-infiniband +# +%package pmda-infiniband +License: GPLv2+ +Group: Applications/System +Summary: Performance Co-Pilot (PCP) metrics for Infiniband HCAs and switches +URL: http://www.performancecopilot.org +Requires: pcp-libs = @package_version@ +Requires: libibmad >= 1.1.7 libibumad >= 1.1.7 +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. +%endif + +%prep +%setup -q + +%clean +[ ! -z "$DIST_ROOT" ] && rm -rf $DIST_ROOT +rm -Rf $RPM_BUILD_ROOT + +%build +%configure @package_configure@ %{_configure_rcdir} +@make@ default_pcp + +%install +rm -Rf $RPM_BUILD_ROOT +NO_CHOWN=true +BACKDIR=`pwd`; +DIST_ROOT=$RPM_BUILD_ROOT +DIST_MANIFEST=`pwd`/install.manifest +export NO_CHOWN DIST_ROOT DIST_MANIFEST +rm -f $DIST_MANIFEST +@make@ install_pcp + +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,-webapi,-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 >devel_files +%ifarch x86_64 ppc64 s390x +sed -i -e 's/usr\/lib\//usr\/lib64\//' libs_files +sed -i -e 's/usr\/lib\//usr\/lib64\//' 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\//' devel_files +%endif +%endif + +# +# some special cases for devel +awk '{print $NF}' $DIST_MANIFEST |\ +egrep 'pcp\/(examples|demos)|pmdas\/(sample|simple|trivial|txmon)' >>devel_files + +# +# Patterns for files to be marked %config(noreplace). +# Note: /etc/pcp.{conf,env,sh} are %config but not noreplace. +# and is treated specially below. +cat >conf_files <<EOF +etc/cron.d/pcp-pmie +etc/cron.d/pcp-pmlogger +pmcd/pmcd.conf +pmcd/pmcd.options +pmcd/rc.local +pmie/control +pmie/stomp +pmlogger/control +pmproxy/pmproxy.options +bash_completion.d/pcp +EOF +%if "@BUILD_PMMGR@" == "yes" +cat >>conf_files <<MGREOF +etc/pcp/pmmgr +MGREOF +%endif +%if @have_libmicrohttpd@ == 1 +cat >>conf_files <<WEBEOF +pmwebd/pmwebd.options +WEBEOF +%endif +%if "@enable_qt@" == "true" +cat >>conf_files <<GUIEOF +pmsnap/control +pmsnap/crontab +GUIEOF +%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. +awk '{print $NF}' $DIST_MANIFEST | egrep 'pcp-doc' >docs_files +awk '{print $NF}' $DIST_MANIFEST | egrep 'tutorials' >>docs_files +%if "@enable_qt@" == "true" +PCP_GUI='pmchart|pmconfirm|pmdumptext|pmmessage|pmquery|pmsnap|pmtime' +awk '{print $NF}' $DIST_MANIFEST | egrep "$PCP_GUI|pixmaps" > gui_files +%endif +%if @have_libmicrohttpd@ == 1 +awk '{print $NF}' $DIST_MANIFEST | egrep 'pmweb|PMWEBAPI' >webapi_files +%endif +%if "@BUILD_PMMGR@" == "yes" +awk '{print $NF}' $DIST_MANIFEST | egrep 'pmmgr' >manager_files +%endif +awk '{print $NF}' $DIST_MANIFEST | egrep 'testsuite' >testsuite_files +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 'collectl2pcp' >import_collectl2pcp_files +%if "@pmda_infiniband@" == "infiniband" +awk '{print $NF}' $DIST_MANIFEST | egrep 'infiniband|pmdaib|pmdas/ib' >pmda_infiniband_files +%endif +%if "@enable_papi@" == "enable_papi" +awk '{print $NF}' $DIST_MANIFEST | egrep 'papi' >pmda_papi_files +%endif +touch gui_files webapi_files manager_files pmda_infiniband_files pmda_papi_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 < "devel_files") dev[$0]=1; + while( getline < "webapi_files") webapi[$0]=1; + while( getline < "manager_files") manager[$0]=1; + while( getline < "testsuite_files") testsuite[$0]=1; + while( getline < "pmda_infiniband_files") pmda_infiniband[$0]=1; + while( getline < "pmda_papi_files") pmda_papi[$0]=1; + 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_collectl2pcp_files") import_collectl2pcp[$0]=1; + while( getline < "import_collectl2pcp_files") import_collectl2pcp[$0]=1; + while( getline < "conf_files") conf[nconf++]=$0; +} +{ + if (cfg[$NF]) f="cfg_files.rpm"; + else if (gui[$NF]) f="gui_files.rpm"; + else if (doc[$NF]) f="docs_files.rpm"; + else if (lib[$NF]) f="libs_files.rpm"; + else if (dev[$NF]) f="devel_files.rpm"; + else if (webapi[$NF]) f="webapi_files.rpm"; + else if (manager[$NF]) f="manager_files.rpm"; + else if (testsuite[$NF]) f="testsuite_files.rpm"; + else if (pmda_infiniband[$NF]) f="pmda_infiniband_files.rpm"; + else if (pmda_papi[$NF]) f="pmda_papi_files.rpm"; + 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_collectl2pcp[$NF]) f="import_collectl2pcp_files.rpm"; + else f="base_files.rpm" +} +$1 == "d" { 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" { + for (i=0; i < nconf; i++) { + if ($6 ~ conf[i]) { + 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 "%attr(0777,root,root)", $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 + +%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 +# new directories; they should match /etc/pcp.conf settings after install +PCP_SYSCONF_DIR=@pcp_sysconf_dir@ +PCP_LOG_DIR=@pcp_log_dir@ +PCP_ETC_DIR=@pcp_etc_dir@ +# rename crontab files to align with current Fedora packaging guidelines +for crontab in pmlogger pmie +do + test -f "$PCP_ETC_DIR/cron.d/$crontab" || continue + mv -f "$PCP_ETC_DIR/cron.d/$crontab" "$PCP_ETC_DIR/cron.d/pcp-$crontab" +done +# produce a script to run post-install to move configs to their new homes +save_configs_script() +{ + _new="$1" + shift + for _dir + do + [ "$_dir" = "$_new" ] && continue + if [ -d "$_dir" ] + then + ( cd "$_dir" ; find . -type f -print ) | sed -e 's/^\.\///' \ + | while read _file + do + _want=true + if [ -f "$_new/$_file" ] + then + # file exists in both directories, pick the more + # recently modified one + _try=`find "$_dir/$_file" -newer "$_new/$_file" -print` + [ -n "$_try" ] || _want=false + fi + $_want && echo cp -p "$_dir/$_file" "$_new/$_file" + done + fi + done +} +# migrate and clean configs if we have had a previous in-use installation +[ -d "$PCP_LOG_DIR" ] || exit 0 # no configuration file upgrades required +rm -f "$PCP_LOG_DIR/configs.sh" +for daemon in pmcd pmie pmlogger pmproxy +do + save_configs_script >> "$PCP_LOG_DIR/configs.sh" "$PCP_SYSCONF_DIR/$daemon" \ + /var/lib/pcp/config/$daemon /etc/$daemon /etc/pcp/$daemon /etc/sysconfig/$daemon +done +exit 0 + +%if @have_libmicrohttpd@ == 1 +%preun webapi +if [ "$1" -eq 0 ] +then + %if "@enable_systemd@" == "true" + systemctl --no-reload disable pmwebd.service >/dev/null 2>&1 + systemctl stop pmwebd.service >/dev/null 2>&1 + %else + /sbin/service pmwebd stop >/dev/null 2>&1 + /sbin/chkconfig --del pmwebd >/dev/null 2>&1 + %endif +fi + +%post webapi +chown -R pcp:pcp "$PCP_LOG_DIR/pmwebd" 2>/dev/null +%if "@enable_systemd@" == "true" + systemctl condrestart pmwebd.service >/dev/null 2>&1 +%else + /sbin/chkconfig --add pmwebd >/dev/null 2>&1 && \ + /sbin/service pmwebd condrestart +%endif +%endif + +%if "@BUILD_PMMGR@" == "yes" +%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 + +%preun +if [ "$1" -eq 0 ] +then + # stop daemons before erasing the package + %if "@enable_systemd@" == "true" + systemctl --no-reload disable pmlogger.service >/dev/null 2>&1 + systemctl --no-reload disable pmie.service >/dev/null 2>&1 + systemctl --no-reload disable pmproxy.service >/dev/null 2>&1 + systemctl --no-reload disable pmcd.service >/dev/null 2>&1 + + 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@ +# restore saved configs, if any +test -s "$PCP_LOG_DIR/configs.sh" && source "$PCP_LOG_DIR/configs.sh" +rm -f $PCP_LOG_DIR/configs.sh + +# migrate old to new temp dir locations within the same filesystem) +migrate_tempdirs() +{ + _sub="$1" + _new_tmp_dir=%{_tmpdir} + _old_tmp_dir=%{_localstatedir}/tmp + + for d in "$_old_tmp_dir/$_sub" ; do + test -d "$d" -a -k "$d" || continue + cd "$d" || continue + for f in * ; do + [ "$f" != "*" ] || continue + source="$d/$f" + target="$_new_tmp_dir/$_sub/$f" + [ "$source" != "$target" ] || continue + [ -f "$target" ] || mv -fu "$source" "$target" + done + cd && rmdir "$d" 2>/dev/null + done +} +for daemon in mmv pmdabash pmie pmlogger +do + migrate_tempdirs $daemon +done +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_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" + systemctl condrestart pmcd.service >/dev/null 2>&1 + systemctl condrestart pmlogger.service >/dev/null 2>&1 + systemctl condrestart pmie.service >/dev/null 2>&1 + 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 + +%post libs -p /sbin/ldconfig +%postun libs -p /sbin/ldconfig + +%files -f base_files.rpm +%defattr(-,root,root) + +%files conf -f cfg_files.rpm +%defattr(-,root,root) + +%files libs -f libs_files.rpm +%defattr(-,root,root) + +%files libs-devel -f devel_files.rpm +%defattr(-,root,root) + +%files doc -f docs_files.rpm +%defattr(-,root,root) + +%if "@enable_qt@" == "true" +%files gui -f gui_files.rpm +%defattr(-,root,root) +%endif + +%if @have_libmicrohttpd@ == 1 +%files webapi -f webapi_files.rpm +%defattr(-,root,root) +%endif + +%if "@BUILD_PMMGR@" == "yes" +%files manager -f manager_files.rpm +%defattr(-,root,root) +%endif + +%files testsuite -f testsuite_files.rpm +%defattr(-,pcpqa,pcpqa) + +%if "@enable_papi@" == "enable_papi" +%files pmda-papi -f pmda_papi_files.rpm +%defattr(-,root,root) +%endif + +%if "@pmda_infiniband@" == "infiniband" +%files pmda-infiniband -f pmda_infiniband_files.rpm +%defattr(-,root,root) +%endif + +%files import-sar2pcp -f import_sar2pcp_files.rpm +%defattr(-,root,root) + +%files import-iostat2pcp -f import_iostat2pcp_files.rpm +%defattr(-,root,root) + +%files import-sheet2pcp -f import_sheet2pcp_files.rpm +%defattr(-,root,root) + +%files import-mrtg2pcp -f import_mrtg2pcp_files.rpm +%defattr(-,root,root) + +%files import-collectl2pcp -f import_collectl2pcp_files.rpm +%defattr(-,root,root) + +%files -n perl-PCP-PMDA -f perl-pcp-pmda.list +%defattr(-,root,root) + +%files -n perl-PCP-MMV -f perl-pcp-mmv.list +%defattr(-,root,root) + +%files -n perl-PCP-LogImport -f perl-pcp-logimport.list +%defattr(-,root,root) + +%files -n perl-PCP-LogSummary -f perl-pcp-logsummary.list +%defattr(-,root,root) + +%files -n python-pcp -f python-pcp.list.rpm +%defattr(-,root,root) + |