File sblim-gather.spec of Package sblim-gather

#
# spec file for package sblim-gather
#
# Copyright (c) 2013 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/
#

%if 0%{?suse_version} > 1140 || 0%{?fedora_version} > 14
%define has_systemd 1
%else
%define has_systemd 0
%endif

Name:           sblim-gather
BuildRequires:  gcc-c++
BuildRequires:  libvirt-devel > 0.7
BuildRequires:  openssl-devel
BuildRequires:  pam-devel
BuildRequires:  sblim-cmpi-base-devel
BuildRequires:  sblim-indication_helper-devel
BuildRequires:  sblim-testsuite
%if 0%{?rhel_version} == 0 && 0%{?centos_version} == 0
BuildRequires:  openslp-devel
%endif
BuildRequires:  glib2-devel
%if 0%{?suse_version}
BuildRequires:  libtool
BuildRequires:  pkg-config
%else
BuildRequires:  pkgconfig
%endif
Url:            http://sblim.wiki.sourceforge.net/
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Summary:        SBLIM Performance Data Gatherer and Provider
License:        IPL-1.0
Group:          System/Management
Version:        2.2.9
Release:        0
Source0:        http://prdownloads.sourceforge.net/sblim/sblim-gather-%{version}.tar.bz2
Patch1:         sblim-gather-2.1.8_pointers.patch
Patch3:         sblim-gather-2.2.2-redefinition.patch
Patch4:         sblim-gather-2.2.3-initstyle.patch
# PATCH-FIX-UPSTREAM sblim-gather-%{version}-drop-libsysfs.patch [ bnc#860102 ] pwieczorkiewicz@suse.de -- Drop libsysfs requirement
Patch5:         sblim-gather-2.2.8-drop-libsysfs.patch
# PATCH-FIX-OPENSUSE /var/run not allowed
Patch6:         0001-var-run-var-lib.patch
# PATCH-FIX-UPSTREAM 
Patch7:         0002-Fixed-2744-create-run-directory-if-it-does-not-exist.patch
# PATCH-FIX-UPSTREAM 
Patch8:         0003-Fixed-2749-buffer-size-exceeded-on-file-read-in-metr.patch
# PATCH-FIX-OPENSUSE
Patch9:         0004-include-string.h-and-sys-uio.h.patch
# PATCH-FIX-OPENSUSE
Patch10:        0001-single-definition-of-globals.patch
Provides:       sblim-gather-pluginz = %{version}
Requires(pre):  cim-server
#!BuildIgnore: tog-pegasus
%if 0%{?has_systemd}
BuildRequires:  systemd
%{?systemd_requires}
%endif

%description
The purpose of this package is to implement the DMTF CIM Metrics Model
for Linux, making it available via a CIMOM supporting/supported by the
CMPI provider interface.

While the Gatherer and it's plugins can be used standalone, the
greatest benefit comes from using it in conjuction with a CIM Object
Manager (CIMOM) like Pegasus (The Open Group). Basically it allows to
remoteley obtain performance information about a Linux system. For more
information about CIM and the CIM Metrics Model you are referred to the
Distributed Management Task Force (DMTF) at http://www.dmtf.org.

This package is containing the agents and control programs which can be
deployed stand-alone.

%package provider
Summary:        SBLIM Gatherer Provider
Group:          System/Management
Requires:       %{name} = %{version}
Requires:       cim-server
Requires:       sblim-cmpi-base
Provides:       sblim-gather-pluginz-provider = %{version}

%description provider
This package is containing the CIM Providers for the SBLIM Gatherer.

%package devel
Summary:        SBLIM Gatherer Development Support
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
This package is needed to develop new plugins for the gatherer.

%package test
Summary:        SBLIM Gatherer Testcase Files
Group:          System/Management
Requires:       %{name} = %{version}
Requires:       %{name}-provider = %{version}
Requires:       sblim-testsuite

%description test
SBLIM Gatherer Testcase Files for the SBLIM Testsuite

%prep
%setup -n %{name}-%{version}
%patch -P1
%patch -P3 -p1
%patch -P4 -p1
%patch -P5 -p1
%if 0%{?suse_version} > 1310
%patch -P6 -p1
%endif
%patch -P7 -p1
%patch -P8 -p1
%patch -P9 -p1
%patch -P10 -p1

%build
autoreconf -fi
export CFLAGS="%{optflags} -fno-strict-aliasing"
%configure --enable-z
%{__make}

%install
%if 0%{?suse_version}
%makeinstall docdir=%{_docdir}/%{name}
%else
make install DESTDIR=%{buildroot} docdir=%{_docdir}/%{name}-%{version}
%endif
find %{buildroot} -type f -name \*.la -print0 -delete

%if 0%{?has_systemd}
ln -sf %{_sbindir}/service $RPM_BUILD_ROOT%{_sbindir}/rcgatherd
rm -rf %{buildroot}%{_sysconfdir}/init.d
%endif

%clean
%{__rm} -rf %{buildroot}

%define MOF Linux_IPProtocolEndpointMetric,Linux_LocalFileSystemMetric,Linux_Metric,Linux_NetworkPortMetric,Linux_OperatingSystemMetric,Linux_ProcessorMetric,Linux_UnixProcessMetric,Linux_XenMetric,Linux_zCECMetric,Linux_zCHMetric,Linux_zECKDMetric,Linux_zLPARMetric
%define REGISTRATION %{_datadir}/%{name}/{%{MOF}}.registration
%define SCHEMA %{_datadir}/%{name}/{%{MOF}}.mof

%post provider
# compile MOF
%{_datadir}/%{name}/provider-register.sh \
        -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true

%preun provider
if [ "$1" = "0" ]; then
	%{_datadir}/%{name}/provider-register.sh \
        	-r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true
fi

%postun provider -p /sbin/ldconfig

%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/gatherd.conf
%config(noreplace) %{_sysconfdir}/reposd.conf
%if 0%{?has_systemd}
# not yet %{_unitdir}/*.service
%{_sbindir}/rcgatherd
%else
%{_sysconfdir}/init.d/gatherer
%endif
%if 0%{?suse_version} > 1310
%ghost %{_localstatedir}/lib/gather
%else
%ghost %{_localstatedir}/run/gather
%endif
%{_bindir}/*
%{_sbindir}/*
%if 0%{?suse_version}
%doc %{_docdir}/%{name}
%else
%doc %{_docdir}/%{name}-%{version}
%endif
%dir %{_libdir}/gather
%dir %{_libdir}/gather/mplug
%dir %{_libdir}/gather/rplug
%{_libdir}/gather/mplug/*.so
%{_libdir}/gather/rplug/*.so
%{_libdir}/*.so.*

%files provider
%defattr(-,root,root,-)
%{_libdir}/cmpi/*.so
%dir %{_libdir}/gather/cplug
%{_libdir}/gather/cplug/*.so
%{_datadir}/%{name}

%files devel
%defattr(-,root,root,-)
%{_includedir}/gather
%{_libdir}/libgather.so
%{_libdir}/libmcserv.so
%{_libdir}/librcserv.so
%{_libdir}/librepos.so
%{_libdir}/librgather.so
%{_libdir}/librrepos.so
%{_libdir}/libhypfs.so
%{_libdir}/liblparutil.so
%{_libdir}/libsysfswrapper.so
%{_libdir}/libchannelutil.so
%{_libdir}/libgatherutil.so
%{_libdir}/libOSBase_MetricUtil.so

%files test
%defattr(-,root,root,-)
%{_datadir}/sblim-testsuite/*

%changelog
openSUSE Build Service is sponsored by