Accepting request 79984 from home:dmdiss:branches:base-sys

- Add .so version to library package name
- Simplify package file lists

OBS-URL: https://build.opensuse.org/request/show/79984
OBS-URL: https://build.opensuse.org/package/show/Base:System/pcp?expand=0&rev=8
This commit is contained in:
Cristian Rodríguez 2011-08-29 20:39:13 +00:00 committed by Git OBS Bridge
parent d9429e7ecf
commit 6fccc61e5b

238
pcp.spec
View File

@ -27,7 +27,7 @@ License: GPLv2
Url: http://oss.sgi.com/projects/pcp
Group: System/Monitoring
Source: %{name}-%{version}-%{pcp_release}.src.tar.gz
Requires: pcp-libs = %{version}
Requires: libpcp3 = %{version}
Requires: bash gawk sed grep fileutils findutils
%if "%{_vendor}" == "suse"
Requires: sysconfig cpp
@ -40,6 +40,8 @@ BuildRequires: perl(ExtUtils::MakeMaker)
Patch6: pcp-xenbuild.patch
Patch9: static_lib_perms.diff
%define _pmdasdir %{_localstatedir}/lib/pcp/pmdas
%description
Performance Co-Pilot (PCP) provides a framework and services to support
system-level performance monitoring and performance management.
@ -49,29 +51,30 @@ the interesting performance data in a system, and allows client
applications to easily retrieve and process any subset of that data.
#
# pcp-libs
# libpcp
#
%package libs
%package -n libpcp3
License: LGPLv2+
Group: System/Libraries
Summary: Performance Co-Pilot run-time libraries
Url: http://oss.sgi.com/projects/pcp/
Obsoletes: pcp < 3.0
AutoReq: no
%description libs
%description -n libpcp3
Performance Co-Pilot (PCP) run-time libraries
#
# pcp-libs-dvel
# libpcp-devel
#
%package libs-devel
%package -n libpcp-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}
Requires: libpcp3 = %{version}
%description libs-devel
%description -n libpcp-devel
Performance Co-Pilot (PCP) headers, documentation and tools for development.
#
@ -150,7 +153,7 @@ 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
Requires: libpcp3 >= %{version} perl-PCP-LogImport >= %{version} sysstat
%description import-sar2pcp
Performance Co-Pilot (PCP) front-end tools for importing sar data
@ -164,7 +167,7 @@ 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
Requires: libpcp3 >= %{version} perl-PCP-LogImport >= %{version} sysstat
%description import-iostat2pcp
Performance Co-Pilot (PCP) front-end tools for importing iostat data
@ -178,7 +181,7 @@ 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
Requires: libpcp3 >= %{version} perl-PCP-LogImport >= %{version} sysstat
%description import-sheet2pcp
Performance Co-Pilot (PCP) front-end tools for importing spreadsheet data
@ -192,7 +195,7 @@ 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}
Requires: libpcp3 >= %{version} perl-PCP-LogImport >= %{version}
%description import-mrtg2pcp
Performance Co-Pilot (PCP) front-end tools for importing MTRG data
@ -212,112 +215,35 @@ autoconf
rm -Rf $RPM_BUILD_ROOT
%build
/usr/bin/gmake default_pcp
make 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
export DIST_ROOT
make 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}`
# Fix stuff we do/don't want to ship
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.a
#
# 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
# list of PMDAs in the base pkg
ls -1 $RPM_BUILD_ROOT/%{_pmdasdir} | grep -vE 'simple|sample|trivial|txmon' |\
sed -e 's#^#'%{_pmdasdir}'\/#' >base_pmdas.list
#
# some special cases for devel
awk '{print $NF}' $DIST_MANIFEST |\
egrep 'pcp\/(examples|demos)|pmdas\/(sample|simple|trivial|txmon)' >>devel_files
# bin and man1 files except those split out into sub packages
ls -1 $RPM_BUILD_ROOT/%{_bindir} | grep -v '2pcp' |\
sed -e 's#^#'%{_bindir}'\/#' >base_binfiles.list
ls -1 $RPM_BUILD_ROOT/%{_mandir}/man1 | grep -v '2pcp' |\
sed -e 's#^#'%{_mandir}'\/man1\/#' >base_man1files.list
#
# 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 <<EOFEOF
etc/pcp.env
pmcd/pmcd.conf
pmcd/pmcd.options
pmcd/rc.local
pmie/config.default
pmie/control
pmie/crontab
pmlogger/config.default
pmlogger/control
pmlogger/crontab
pmproxy/pmproxy.options
bash_completion.d/pcp
EOFEOF
#
# Files for the pcp-import subpackages. We use these sub-packages
# to isolate the (somwhat exotic) dependencies for these tools
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
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 }'
cat base_pmdas.list base_binfiles.list base_man1files.list > base_specialfiles.list
# 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
@ -329,53 +255,129 @@ set -x
%{?restart_on_update:%{restart_on_update pcp pmproxy pmie}}
%{?insserv_cleanup:%{insserv_cleanup}}
%post libs -p /sbin/ldconfig
%post -n libpcp3 -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
%postun -n libpcp3 -p /sbin/ldconfig
%files -f base_files.rpm
%files -f base_specialfiles.list
%defattr(-,root,root)
%dir /usr/lib*/pcp
%dir /var/lib/pcp/config/pmlogconf
%dir %{_pmdasdir}
%dir %{_datadir}/pcp
%dir %{_localstatedir}/lib/pcp
%dir %{_localstatedir}/lib/pcp/config
%doc %{_datadir}/doc/packages/pcp-%{version}
%{_libexecdir}/pcp
%{_datadir}/pcp/lib
%{_localstatedir}/log/pcp
%{_localstatedir}/lib/pcp/pmns
%{_initrddir}/pcp
%{_initrddir}/pmie
%{_initrddir}/pmproxy
%{_mandir}/man4/*
%config %{_sysconfdir}/bash_completion.d/pcp
%config %{_sysconfdir}/pcp.env
%config(noreplace) %{_localstatedir}/lib/pcp/config/pmcd/pmcd.conf
%config(noreplace) %{_localstatedir}/lib/pcp/config/pmcd/pmcd.options
%config(noreplace) %{_localstatedir}/lib/pcp/config/pmcd/rc.local
%config(noreplace) %{_localstatedir}/lib/pcp/config/pmie/config.default
%config(noreplace) %{_localstatedir}/lib/pcp/config/pmie/control
%config(noreplace) %{_localstatedir}/lib/pcp/config/pmie/crontab
%config(noreplace) %{_localstatedir}/lib/pcp/config/pmlogger/config.default
%config(noreplace) %{_localstatedir}/lib/pcp/config/pmlogger/control
%config(noreplace) %{_localstatedir}/lib/pcp/config/pmlogger/crontab
%config(noreplace) %{_localstatedir}/lib/pcp/config/pmproxy/pmproxy.options
%{_localstatedir}/lib/pcp/config/*
/usr/sbin/rcpcp
/usr/sbin/rcpmie
/usr/sbin/rcpmproxy
%files libs -f libs_files.rpm
%files -n libpcp3
%defattr(-,root,root)
%dir %{_includedir}/pcp
%{_includedir}/pcp/builddefs
%{_includedir}/pcp/buildrules
%config %{_sysconfdir}/pcp.conf
%{_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_files.rpm
%files -n libpcp-devel
%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
%{_mandir}/man3/*.3.gz
%{_datadir}/pcp/demos
%{_datadir}/pcp/examples
%{_localstatedir}/lib/pcp/pmdas/simple
%{_localstatedir}/lib/pcp/pmdas/sample
%{_localstatedir}/lib/pcp/pmdas/trivial
%{_localstatedir}/lib/pcp/pmdas/txmon
%files import-sar2pcp -f import_sar2pcp_files.rpm
%files import-sar2pcp
%defattr(-,root,root)
%{_bindir}/sar2pcp
%{_mandir}/man1/sar2pcp.1.gz
%files import-iostat2pcp -f import_iostat2pcp_files.rpm
%files import-iostat2pcp
%defattr(-,root,root)
%{_bindir}/iostat2pcp
%{_mandir}/man1/iostat2pcp.1.gz
%files import-sheet2pcp -f import_sheet2pcp_files.rpm
%files import-sheet2pcp
%defattr(-,root,root)
%{_bindir}/sheet2pcp
%{_mandir}/man1/sheet2pcp.1.gz
%files import-mrtg2pcp -f import_mrtg2pcp_files.rpm
%files import-mrtg2pcp
%defattr(-,root,root)
%{_bindir}/mrtg2pcp
%{_mandir}/man1/mrtg2pcp.1.gz
%files -n perl-PCP-PMDA -f perl-pcp-pmda.list
%files -n perl-PCP-PMDA
%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
/usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/PCP/PMDA.pm
/usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/auto/PCP/PMDA/PMDA.so
/usr/share/man/man3/PCP::PMDA.3pm.gz
%files -n perl-PCP-MMV -f perl-pcp-mmv.list
%files -n perl-PCP-MMV
%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
/usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/PCP/MMV.pm
/usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/PCP/server.pl
/usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/auto/PCP/MMV/MMV.so
/usr/share/man/man3/PCP::MMV.3pm.gz
%files -n perl-PCP-LogImport -f perl-pcp-logimport.list
%files -n perl-PCP-LogImport
%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
/usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/PCP/LogImport.pm
/usr/lib/perl5/vendor_perl/*/*-linux-thread-multi/auto/PCP/LogImport/LogImport.so
/usr/share/man/man3/PCP::LogImport.3pm.gz
%files -n perl-PCP-LogSummary -f perl-pcp-logsummary.list
%files -n perl-PCP-LogSummary
%defattr(-,root,root)
%dir /usr/lib/perl5/vendor_perl/*/PCP
/usr/lib/perl5/vendor_perl/*/PCP/LogSummary.pm
/usr/lib/perl5/vendor_perl/*/PCP/exceldemo.pl
/usr/lib/perl5/vendor_perl/*/PCP/extract.pl
/usr/share/man/man3/PCP::LogSummary.3pm.gz
%changelog