# # spec file for package pcp # # Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed # upon. The license for this file, and modifications and additions to the # file, is the same license as for the pristine package itself (unless the # license for the pristine package is not an Open Source License, in which # case the license is the MIT License). An "Open Source License" is a # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild Name: pcp Version: 3.5.8 %define pcp_release 1 Release: %{pcp_release} Summary: System-level performance monitoring and performance management License: GPLv2 URL: http://oss.sgi.com/projects/pcp Group: System/Monitoring Source: %{name}-%{version}-%{pcp_release}.src.tar.gz Distribution: suse Requires: pcp-libs = %{version} Requires: bash gawk sed grep fileutils findutils %if "%{_vendor}" == "suse" Requires: sysconfig cpp %else Requires: initscripts %endif BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-build BuildRequires: procps autoconf bison flex ncurses-devel readline-devel BuildRequires: perl(ExtUtils::MakeMaker) Patch6: pcp-xenbuild.patch Patch9: static_lib_perms.diff %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-libs # %package libs License: LGPLv2+ Group: System/Libraries Summary: Performance Co-Pilot run-time libraries URL: http://oss.sgi.com/projects/pcp/ Obsoletes: pcp < 3.0 %description libs Performance Co-Pilot (PCP) run-time libraries # # pcp-libs-dvel # %package libs-devel License: GPLv2 Group: Development/Libraries/Other Summary: Performance Co-Pilot (PCP) development headers and documentation URL: http://oss.sgi.com/projects/pcp/ Requires: pcp-libs = %{version} %description libs-devel Performance Co-Pilot (PCP) headers, documentation and tools for development. # # perl-PCP-PMDA. This is the PCP agent perl binding. # %package -n perl-PCP-PMDA License: GPLv2 Group: System/Monitoring Summary: Performance Co-Pilot (PCP) Perl bindings and documentation URL: http://oss.sgi.com/projects/pcp/ Requires: pcp >= %{version} perl-base %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: System/Monitoring Summary: Performance Co-Pilot (PCP) Perl bindings for PCP Memory Mapped Values URL: http://oss.sgi.com/projects/pcp/ Requires: pcp >= %{version} perl-base %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: System/Monitoring Summary: Performance Co-Pilot Perl bindings for importing external data URL: http://oss.sgi.com/projects/pcp/ Requires: pcp >= %{version} perl-base %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: System/Monitoring Summary: Performance Co-Pilot Perl bindings for processing pmlogsummary output URL: http://oss.sgi.com/projects/pcp/ Requires: pcp >= %{version} perl-base %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: System/Monitoring Summary: Performance Co-Pilot tools for importing sar data into PCP archive logs URL: http://oss.sgi.com/projects/pcp/ Requires: pcp-libs >= %{version} perl-PCP-LogImport >= %{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: System/Monitoring Summary: Performance Co-Pilot tools for importing iostat data into PCP archive logs URL: http://oss.sgi.com/projects/pcp/ Requires: pcp-libs >= %{version} perl-PCP-LogImport >= %{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: System/Monitoring Summary: Performance Co-Pilot tools for importing spreadsheet data into PCP archive logs URL: http://oss.sgi.com/projects/pcp/ Requires: pcp-libs >= %{version} perl-PCP-LogImport >= %{version} sysstat %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: System/Monitoring Summary: Performance Co-Pilot tools for importing MTRG data into PCP archive logs URL: http://oss.sgi.com/projects/pcp/ Requires: pcp-libs >= %{version} perl-PCP-LogImport >= %{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. %prep %setup -q %patch6 %patch9 autoconf ./configure --bindir=%{_bindir} \ --libdir=%{_libdir} \ --libexecdir=%{_libexecdir} && touch config.done %clean [ ! -z "$DIST_ROOT" ] && rm -rf $DIST_ROOT rm -Rf $RPM_BUILD_ROOT %build /usr/bin/gmake default_pcp %install BACKDIR=`pwd`; DIST_ROOT=$RPM_BUILD_ROOT DIST_MANIFEST=`pwd`/install.manifest export DIST_ROOT DIST_MANIFEST rm -f $DIST_MANIFEST /usr/bin/gmake install_pcp set +x PCP_CONF=$BACKDIR/src/include/pcp.conf export PCP_CONF . $BACKDIR/src/include/pcp.env LIBFILELIST=`ls -1 $BACKDIR/debian/*.{install,dirs} | fgrep -v -- -dev. | fgrep -v -- -import` DEVFILELIST=`ls -1 $BACKDIR/debian/*-dev.{install,dirs}` # # Package split: pcp, pcp-libs, pcp-libs-devel, pcp-import-* # -libs gets first pick, then libs-devel, then pcp-import-* # The base package catches-all remaining. # sed -e 's/^/\//' $LIBFILELIST >libs_files sed -e 's/^/\//' $DEVFILELIST >devel_files %ifarch ia64 x86_64 ppc64 sed -i -e 's/usr\/lib\//usr\/lib64\//' libs_files sed -i -e 's/usr\/lib\//usr\/lib64\//' devel_files %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 is \%config, but not noreplace # and is treated specially below. cat >conf_files <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 rm -f devel_files.rpm libs_files.rpm base_files.rpm import_*_files.rpm sort -u $DIST_MANIFEST | $PCP_AWK_PROG ' BEGIN { while( getline < "libs_files") lib[$0]=1; while( getline < "devel_files") dev[$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 < "conf_files") conf[nconf++]=$0; } { if (lib[$NF]) f="libs_files.rpm"; else if (dev[$NF]) f="devel_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 f="base_files.rpm" } $1 == "d" { printf ("%%%%dir %%%%attr(%s,root,root) %s\n", $2, $5) >> f } $1 == "f" && $6 ~ "etc/pcp.conf" { 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,root,root) %s\n", $2, $6) >> f } $1 == "l" { print "%attr(0777,root,root)", $3 >> f }' # add /etc/init.d/X symlinks at /usr/sbin/rcX %__install -d -m 0755 ${RPM_BUILD_ROOT}/%{_sbindir} for script in pcp pmie pmproxy; do ln -s "%{_sysconfdir}/init.d/${script}" "${RPM_BUILD_ROOT}/%{_sbindir}/rc${script}" echo "%{_sbindir}/rc${script}" >> base_files.rpm done set -x %post /sbin/ldconfig %preun %{?stop_on_removal:%{stop_on_removal pcp pmproxy pmie}} %postun /sbin/ldconfig %{?restart_on_update:%{restart_on_update pcp pmproxy pmie}} %{?insserv_cleanup:%{insserv_cleanup}} %post libs -p /sbin/ldconfig %postun libs -p /sbin/ldconfig %files -f base_files.rpm %defattr(-,root,root) %dir /usr/lib*/pcp %dir /var/lib/pcp/config/pmlogconf %files libs -f libs_files.rpm %defattr(-,root,root) %files libs-devel -f devel_files.rpm %defattr(-,root,root) %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 -n perl-PCP-PMDA -f perl-pcp-pmda.list %defattr(-,root,root) %dir /usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/PCP %dir /usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/auto/PCP %dir /usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/auto/PCP/PMDA %files -n perl-PCP-MMV -f perl-pcp-mmv.list %defattr(-,root,root) %dir /usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/PCP %dir /usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/auto/PCP %dir /usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/auto/PCP/MMV %files -n perl-PCP-LogImport -f perl-pcp-logimport.list %defattr(-,root,root) %dir /usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/PCP %dir /usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/auto/PCP %dir /usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/auto/PCP/LogImport %files -n perl-PCP-LogSummary -f perl-pcp-logsummary.list %defattr(-,root,root) %dir /usr/lib/perl5/vendor_perl/*/PCP %changelog