2007-01-16 00:29:21 +01:00
|
|
|
#
|
|
|
|
# spec file for package pcp (Version 2.5.0)
|
|
|
|
#
|
2010-02-24 02:23:45 +01:00
|
|
|
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2007-01-16 00:29:21 +01:00
|
|
|
#
|
2008-08-29 03:00:23 +02:00
|
|
|
# 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.
|
|
|
|
|
2007-01-16 00:29:21 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
# norootforbuild
|
|
|
|
|
2008-08-29 03:00:23 +02:00
|
|
|
|
2007-01-16 00:29:21 +01:00
|
|
|
Name: pcp
|
2007-03-30 02:09:35 +02:00
|
|
|
BuildRequires: bison flex gcc-c++ ncurses-devel procps
|
2007-01-16 00:29:21 +01:00
|
|
|
Version: 2.5.0
|
2010-02-24 02:23:45 +01:00
|
|
|
Release: 130
|
2007-01-16 00:29:21 +01:00
|
|
|
Summary: Performance Co-Pilot (system-level performance monitoring)
|
2010-02-24 02:23:45 +01:00
|
|
|
License: GPLv2+
|
2007-12-06 01:18:47 +01:00
|
|
|
Url: http://oss.sgi.com/projects/pcp
|
2007-01-16 00:29:21 +01:00
|
|
|
Group: System/Monitoring
|
|
|
|
Source: pcp-%{version}.src.tar.gz
|
|
|
|
Patch0: pcp-%{version}-SuSE.diff
|
|
|
|
Patch1: pcp-%{version}-ndbm.diff
|
2007-07-13 18:56:33 +02:00
|
|
|
Patch2: pcp-%{version}-rpmlint.diff
|
2007-12-06 01:18:47 +01:00
|
|
|
Patch3: pcp-gcc43.patch
|
2008-08-29 03:00:23 +02:00
|
|
|
Patch4: pcp-init.patch
|
2008-10-08 12:06:24 +02:00
|
|
|
Patch5: pcp-2.5.0-buffer-overflow.diff
|
2008-11-06 18:27:12 +01:00
|
|
|
Patch6: pcp-xenbuild.patch
|
2009-02-26 18:19:17 +01:00
|
|
|
Patch7: pcp-2.5.0-GCC44.patch
|
2010-02-24 02:23:45 +01:00
|
|
|
Patch8: pcp-pic.diff
|
2007-01-16 00:29:21 +01:00
|
|
|
PreReq: %insserv_prereq %fillup_prereq permissions
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
|
|
|
|
%description
|
|
|
|
Performance Co-Pilot (PCP) is a framework and services to support
|
|
|
|
system-level performance monitoring and performance management.
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-07-13 18:56:33 +02:00
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
SGI OSS <owner-pcp@oss.sgi.com>
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Include Files and Libraries mandatory for Development
|
|
|
|
Group: Development/Libraries/C and C++
|
2010-02-24 02:23:45 +01:00
|
|
|
License: GPLv2+
|
2007-07-13 18:56:33 +02:00
|
|
|
Requires: %{name} = %{version}
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
This package contains all necessary include files and libraries needed
|
|
|
|
to develop applications that require these.
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-16 00:29:21 +01:00
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
SGI OSS <owner-pcp@oss.sgi.com>
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
%patch0 -p1
|
|
|
|
%patch1 -p1
|
2007-07-13 18:56:33 +02:00
|
|
|
%patch2 -p1
|
2007-12-06 01:18:47 +01:00
|
|
|
%patch3
|
2008-08-29 03:00:23 +02:00
|
|
|
%patch4
|
2008-10-08 12:06:24 +02:00
|
|
|
%patch5
|
2008-11-06 18:27:12 +01:00
|
|
|
%patch6
|
2009-02-26 18:19:17 +01:00
|
|
|
%patch7 -p1
|
2010-02-24 02:23:45 +01:00
|
|
|
%patch -P 8 -p1
|
2007-01-16 00:29:21 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
%{suse_update_config -f}
|
|
|
|
autoconf
|
|
|
|
YACC="yacc" ./configure \
|
|
|
|
--bindir=%{_bindir} \
|
|
|
|
--mandir=%{_mandir} \
|
|
|
|
--libdir=%{_libdir} \
|
|
|
|
--datadir=%{_datadir}/pcp \
|
|
|
|
--sysconfdir=/etc/pcp \
|
|
|
|
--sbindir=/usr/lib/pcp \
|
|
|
|
--localstatedir=/var/lib/pcp
|
2009-06-10 11:03:09 +02:00
|
|
|
export RPM_OPT_FLAGS=${RPM_OPT_FLAGS/-fomit-frame-pointer/}
|
2007-01-16 00:29:21 +01:00
|
|
|
CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" \
|
|
|
|
/usr/bin/gmake default_pcp
|
|
|
|
|
|
|
|
%install
|
|
|
|
DIST_ROOT=$RPM_BUILD_ROOT
|
|
|
|
DIST_MANIFEST=`pwd`/install.manifest
|
|
|
|
export DIST_ROOT DIST_MANIFEST
|
|
|
|
rm -f $DIST_MANIFEST
|
|
|
|
/usr/bin/gmake install_pcp
|
|
|
|
# local setting
|
|
|
|
install -d $RPM_BUILD_ROOT/usr/sbin
|
|
|
|
./install-sh -S ../../etc/init.d/pcp /usr/sbin/rcpcp
|
|
|
|
./install-sh -S ../../etc/init.d/pmie /usr/sbin/rcpmie
|
|
|
|
./install-sh -S ../../etc/init.d/pmproxy /usr/sbin/rcpmproxy
|
|
|
|
set +x
|
|
|
|
PCP_CONF=src/include/pcp.conf
|
|
|
|
export PCP_CONF
|
|
|
|
. src/include/pcp.env
|
|
|
|
sort $DIST_MANIFEST | uniq | $PCP_AWK_PROG '
|
|
|
|
$1 == "d" { printf ("%%%%dir %%%%attr(%%s,root,root) %%s\n", $2, $5); }
|
|
|
|
$1 == "f" { if ( match ($6, "'$PCP_VAR_DIR'/config") ||
|
|
|
|
match ($6, "'$PCP_SYSCONFIG_DIR'") ) {
|
|
|
|
printf ("%%%%config ");
|
|
|
|
}
|
|
|
|
if (match ($6, "'$PCP_MAN_DIR'") || match ($6, "'$PCP_DOC_DIR'")) {
|
|
|
|
printf ("%%%%doc ");
|
|
|
|
}
|
|
|
|
g = $4;
|
|
|
|
if (g == "trusted") {
|
|
|
|
printf ("%%%%verify(not mode group) ");
|
|
|
|
} else if (g == "bin") {
|
|
|
|
g = "root";
|
|
|
|
}
|
|
|
|
printf ("%%%%attr(%%s,root,%%s) %s\n", $2, g, $6); }
|
|
|
|
$1 == "l" { printf "%%%%attr(-,root,root) %%s\n", $3; }
|
2007-07-13 18:56:33 +02:00
|
|
|
' | tee files-all.rpm |
|
|
|
|
perl -e '
|
|
|
|
open(N, "> files.rpm") || die;
|
|
|
|
open(D, "> files-devel.rpm") || die;
|
|
|
|
while ( <> ) {
|
|
|
|
if ( m{(include|man3|/var/lib/pcp/(pmdas|demos))} || m{\.(c|h|so)$} ) {
|
|
|
|
print D;
|
|
|
|
} else {
|
|
|
|
print N;
|
|
|
|
}
|
|
|
|
}'
|
2007-01-16 00:29:21 +01:00
|
|
|
set -x
|
|
|
|
|
|
|
|
%clean
|
|
|
|
[ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ] || rm -rf $RPM_BUILD_ROOT
|
|
|
|
%verifyscript
|
|
|
|
%verify_permissions -e /usr/lib/pcp/pmpost
|
|
|
|
|
|
|
|
%files -f files.rpm
|
|
|
|
|
2007-07-13 18:56:33 +02:00
|
|
|
%files -f files-devel.rpm devel
|
|
|
|
|
2007-01-16 00:29:21 +01:00
|
|
|
%preun
|
|
|
|
if [ "$1" -eq 0 ]
|
|
|
|
then
|
|
|
|
#
|
|
|
|
# Stop daemons before erasing the package
|
|
|
|
#
|
|
|
|
if [ -f /etc/pcp.env ] ; then
|
|
|
|
. /etc/pcp.env
|
|
|
|
$PCP_RC_DIR/pcp stop >/dev/null 2>&1
|
|
|
|
$PCP_RC_DIR/pmie stop >/dev/null 2>&1
|
|
|
|
[ -x $PCP_RC_DIR/pmproxy ] && $PCP_RC_DIR/pmproxy stop >/dev/null 2>&1
|
|
|
|
rm -f $PCP_VAR_DIR/pmns/.NeedRebuild
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%postun
|
|
|
|
%insserv_cleanup
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%post
|
|
|
|
%run_permissions
|
|
|
|
if [ -f /etc/pcp.env ] ; then
|
|
|
|
. /etc/pcp.env
|
|
|
|
. $PCP_SHARE_DIR/lib/rc-proc.sh
|
|
|
|
touch $PCP_VAR_DIR/pmns/.NeedRebuild
|
|
|
|
chmod 644 $PCP_VAR_DIR/pmns/.NeedRebuild
|
|
|
|
if [ ! -f $PCP_VAR_DIR/pmns/root ]
|
|
|
|
then
|
|
|
|
if [ -f $PCP_VAR_DIR/pmns/root.saved ]
|
|
|
|
then
|
|
|
|
# restore the previous pmns after upgrade
|
|
|
|
mv $PCP_VAR_DIR/pmns/root.saved $PCP_VAR_DIR/pmns/root
|
|
|
|
else
|
|
|
|
# empty initial name space (prior to Rebuild)
|
|
|
|
echo "root {" >$PCP_VAR_DIR/pmns/root
|
|
|
|
echo "}" >>$PCP_VAR_DIR/pmns/root
|
|
|
|
fi
|
|
|
|
chmod 644 $PCP_VAR_DIR/pmns/root
|
|
|
|
else
|
|
|
|
# root pmns already exists, so we need to restore
|
|
|
|
# pmcd.conf and pmcd.options if they were saved.
|
|
|
|
for f in $PCP_PMCDCONF_PATH $PCP_PMCDOPTIONS_PATH
|
|
|
|
do
|
|
|
|
if [ -f $f -a -f $f.rpmsave ]
|
|
|
|
then
|
|
|
|
mv $f $f.rpmnew
|
|
|
|
mv $f.rpmsave $f
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
#
|
|
|
|
# delete *.rpmorig turds that are the same as their new version
|
|
|
|
find $PCP_VAR_DIR/config -name \*.rpmorig -print \
|
|
|
|
| while read f
|
|
|
|
do
|
|
|
|
if diff $f `basename $f .rpmorig` >/dev/null 2>&1
|
|
|
|
then
|
|
|
|
rm -f $f
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
x=$PCP_SHARE_DIR/lib/.migrate_pcp_var_dir
|
|
|
|
[ -x $x ] && $x
|
|
|
|
fi
|
|
|
|
%{fillup_and_insserv pcp}
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%triggerpostun -- pcp < 2.1.9
|
|
|
|
#
|
|
|
|
# Fix for bug where pcp-2.1.6 %postun script would chkconfig pcp off
|
|
|
|
# and remove the .NeedRebuild and .NeedUpdate files. This was done
|
|
|
|
# *after* the %post script of the new version, causing upgrade havoc.
|
|
|
|
#
|
|
|
|
if [ "$1" -gt 0 ]
|
|
|
|
then
|
|
|
|
. /etc/pcp.env
|
|
|
|
. $PCP_SHARE_DIR/lib/rc-proc.sh
|
|
|
|
touch $PCP_VAR_DIR/pmns/.NeedRebuild
|
|
|
|
chmod 644 $PCP_VAR_DIR/pmns/.NeedRebuild
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%triggerun -- pcp < 2.2.0-18
|
|
|
|
#
|
|
|
|
# first half of fix for bug #825229 where upgrade
|
|
|
|
# clobbers $PCP_VAR_DIR/pmns/root
|
|
|
|
#
|
|
|
|
if [ "$1" -gt 0 ]
|
|
|
|
then
|
|
|
|
. /etc/pcp.env
|
|
|
|
if [ -f $PCP_VAR_DIR/pmns/root ]
|
|
|
|
then
|
|
|
|
cp $PCP_VAR_DIR/pmns/root $PCP_VAR_DIR/pmns/root.saved
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
%triggerpostun -- pcp < 2.2.0-18
|
|
|
|
#
|
|
|
|
# second half of the fix for bug #825229
|
|
|
|
#
|
|
|
|
if [ "$1" -gt 0 ]
|
|
|
|
then
|
|
|
|
. /etc/pcp.env
|
|
|
|
if [ ! -f $PCP_VAR_DIR/pmns/root ]
|
|
|
|
then
|
|
|
|
if [ -f $PCP_VAR_DIR/pmns/root.saved ]
|
|
|
|
then
|
|
|
|
mv $PCP_VAR_DIR/pmns/root.saved $PCP_VAR_DIR/pmns/root
|
|
|
|
else
|
|
|
|
# empty initial name space (prior to Rebuild)
|
|
|
|
echo "root {" >$PCP_VAR_DIR/pmns/root
|
|
|
|
echo "}" >>$PCP_VAR_DIR/pmns/root
|
|
|
|
fi
|
|
|
|
chmod 644 $PCP_VAR_DIR/pmns/root
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
exit 0
|
|
|
|
|
2007-03-30 02:09:35 +02:00
|
|
|
%changelog
|