summaryrefslogtreecommitdiffstats
path: root/openlmi-providers.spec
diff options
context:
space:
mode:
Diffstat (limited to 'openlmi-providers.spec')
-rw-r--r--openlmi-providers.spec82
1 files changed, 80 insertions, 2 deletions
diff --git a/openlmi-providers.spec b/openlmi-providers.spec
index 6e6d8b7..2d181bf 100644
--- a/openlmi-providers.spec
+++ b/openlmi-providers.spec
@@ -1,6 +1,6 @@
Name: openlmi-providers
Version: 0.0.25
-Release: 5%{?dist}
+Release: 6%{?dist}
Summary: Set of basic CIM providers
License: LGPLv2+
@@ -177,6 +177,21 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description -n openlmi-indicationmanager-libs-devel
%{summary}.
+%package -n openlmi-pcp
+Summary: pywbem providers for accessing PCP metrics
+Requires: %{name} = %{version}-%{release}
+BuildArch: noarch
+Requires: python-setuptools
+Requires: cmpi-bindings-pywbem
+Requires: python-pcp
+
+%description -n openlmi-pcp
+openlmi-pcp exposes metrics from a local PMCD (Performance Co-Pilot server)
+to the CIMOM. They appear as potentially hundreds of MOF classes, e.g.
+class "PCP_Metric_kernel__pernode__cpu__use", with instances for each PCP
+metric instance, e.g. "node0". PCP metric values and metadata are transcribed
+into strings on demand.
+
%prep
%setup -q
@@ -186,7 +201,7 @@ pushd %{_target_platform}
%{cmake} ..
popd
-make %{?_smp_mflags} -C %{_target_platform}
+make -k %{?_smp_mflags} -C %{_target_platform}
pushd src/python
%{__python} setup.py build
@@ -195,6 +210,9 @@ popd # src/python
pushd src/software
%{__python} setup.py build
popd # src/software
+pushd src/pcp
+%{__python} setup.py build
+popd
%install
make install/fast DESTDIR=$RPM_BUILD_ROOT -C %{_target_platform}
@@ -217,6 +235,21 @@ install -m 755 pycmpiLMI_Software-cimprovagt $RPM_BUILD_ROOT/%{_libexecdir}/pega
popd # src/software
cp mof/LMI_Software.reg $RPM_BUILD_ROOT/%{_datadir}/%{name}/
+# pcp
+pushd src/pcp
+%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+popd
+cp -p src/pcp/openlmi-pcp-generate $RPM_BUILD_ROOT/%{_bindir}/openlmi-pcp-generate
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily
+cp -p src/pcp/openlmi-pcp.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily/openlmi-pcp
+sed -i -e 's,^_LOCALSTATEDIR=.*,_LOCALSTATEDIR="%{_localstatedir}",' \
+ -e 's,^_DATADIR=.*,_DATADIR="%{_datadir}",' \
+ -e 's,^NAME=.*,NAME="%{name}",' \
+ -e 's,^PYTHON2_SITELIB=.*,PYTHON2_SITELIB="%{python2_sitelib}",' \
+ $RPM_BUILD_ROOT/%{_bindir}/openlmi-pcp-generate \
+ $RPM_BUILD_ROOT/%{_sysconfdir}/cron.daily/openlmi-pcp
+mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/%{name}
+
%files
%doc README COPYING
@@ -290,6 +323,19 @@ cp mof/LMI_Software.reg $RPM_BUILD_ROOT/%{_datadir}/%{name}/
%{_datadir}/%{name}/70_LMI_SoftwareIndicationFilters.mof
%{_datadir}/%{name}/LMI_Software.reg
+%files -n openlmi-pcp
+%doc README COPYING
+%{_datadir}/%{name}/60_LMI_PCP.mof
+%dir %{python_sitelib}/lmi/pcp
+%{python_sitelib}/lmi/pcp/*
+%{python_sitelib}/lmi_pcp-*
+%attr(755, root, root) %{_bindir}/openlmi-pcp-generate
+%attr(755, root, root) %{_sysconfdir}/cron.daily/openlmi-pcp
+%dir %{_localstatedir}/lib/%{name}
+%ghost %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.mof
+%ghost %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.reg
+%ghost %{_localstatedir}/lib/%{name}/stamp
+
%files -n openlmi-logicalfile
%doc README COPYING
%{_libdir}/cmpi/libcmpiLMI_LogicalFile.so
@@ -435,6 +481,7 @@ if [ "$1" -gt 1 ]; then
> /dev/null 2>&1 || :;
fi
+
%pre -n openlmi-hardware
if [ "$1" -gt 1 ]; then
%{_bindir}/openlmi-mof-register unregister \
@@ -443,6 +490,15 @@ if [ "$1" -gt 1 ]; then
> /dev/null 2>&1 || :;
fi
+%pre -n openlmi-pcp
+if [ "$1" -gt 1 ]; then
+ %{_bindir}/openlmi-mof-register unregister \
+ %{_datadir}/%{name}/60_LMI_PCP.mof \
+ %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.mof \
+ %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.reg \
+ > /dev/null 2>&1 || :;
+fi
+
%post -n openlmi-fan
# Register Schema and Provider
if [ "$1" -ge 1 ]; then
@@ -518,6 +574,15 @@ if [ "$1" -gt 1 ]; then
> /dev/null 2>&1 || :;
fi
+%post -n openlmi-pcp
+if [ "$1" -gt 1 ]; then
+ %{_bindir}/openlmi-mof-register register \
+ %{_datadir}/%{name}/60_LMI_PCP.mof \
+ %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.mof \
+ %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.reg \
+ > /dev/null 2>&1 || :;
+fi
+
%preun -n openlmi-fan
# Deregister only if not upgrading
if [ "$1" -eq 0 ]; then
@@ -585,6 +650,7 @@ if [ "$1" -gt 1 ]; then
> /dev/null 2>&1 || :;
fi
+
%preun -n openlmi-hardware
if [ "$1" -gt 1 ]; then
%{_bindir}/openlmi-mof-register unregister \
@@ -593,7 +659,19 @@ if [ "$1" -gt 1 ]; then
> /dev/null 2>&1 || :;
fi
+%preun -n openlmi-pcp
+if [ "$1" -gt 1 ]; then
+ %{_bindir}/openlmi-mof-register unregister \
+ %{_datadir}/%{name}/60_LMI_PCP.mof \
+ %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.mof \
+ %{_localstatedir}/lib/%{name}/60_LMI_PCP_PMNS.reg \
+ > /dev/null 2>&1 || :;
+fi
+
%changelog
+* Mon Jul 08 2013 Frank Ch. Eigler <fche@redhat.com> 0.0.25-6
+- Added PCP provider in optional openlmi-pcp subrpm.
+
* Mon Jul 15 2013 Jan Synáček <jsynacek@redhat.com> - 0.0.25-5
- Added libselinux-devel to BuildRequires.