File sblim-cmpi-base.spec of Package sblim-cmpi-base

# spec file for package sblim-cmpi-base
# Copyright (c) 2012 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

Name:           sblim-cmpi-base
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRequires:  sblim-cmpi-devel
BuildRequires:  sblim-indication_helper-devel
BuildRequires:  sblim-sfcb
BuildRequires:  sblim-testsuite
Version:        1.6.1
Release:        0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       cim-server cim-schema
Source1:        sblim-cmpi-base-rpmlintrc
# PATCH-FEATURE-OPENSUSE sblim-cmpi-base-%{version}-methods-enable.patch [ bnc#470670 ] -- Enables methods by default
Patch0:         sblim-cmpi-base-%{version}-methods-enable.patch
# PATCH-FIX-UPSTREAM sblim-cmpi-base-%{version}-missing-fclose.patch [ bnc#530325 upstream#2843613 ] -- Adding missing fclose
Patch1:         sblim-cmpi-base-%{version}-missing-fclose.patch
Summary:        SBLIM Base Instrumentation
License:        EPL-1.0
Group:          System/Management

Standards Based Linux Instrumentation Base Providers

    SBLIM Project

%package devel
Summary:        SBLIM Base Instrumentation Header Development Files
Group:          Development/Libraries/C and C++
Requires:       %{name} = %{version}

%description devel
SBLIM Base Provider Development Package

    SBLIM Project

%package testsuite
Summary:        SBLIM Base Instrumentation (test suite)
Group:          System/Management
Requires:       %{name} = %{version}
Requires:       sblim-testsuite

%description testsuite
Test suite for the Standards Based Linux Instrumentation Base Providers

    SBLIM Project

%setup -T -b 0 -n %{name}-%{version}

autoreconf -fi
%configure TESTSUITEDIR=%{_datadir}/sblim-testsuite --disable-static

%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel}
%makeinstall docdir=%{_docdir}/%{name}
# don't delete .la's until we sort out if sfcb/openwbem/pegasus use ltdlopen()
# %{__rm} %{buildroot}%{_libdir}/{libcmpiOSBase_Common,libdmiinfo}.la
# remove unused libtool files
rm -f $RPM_BUILD_ROOT/%{_libdir}/*.a
rm -f $RPM_BUILD_ROOT/%{_libdir}/cmpi/*.a
rm -f $RPM_BUILD_ROOT/%{_libdir}/cmpi/*.la


# definition of schema and registration files
%define SCHEMA %{_datadir}/%{name}/Linux_Base.mof %{_datadir}/%{name}/Linux_BaseIndication.mof
%define PEGASUS_MOF  CIM_Card,CIM_UnixProcess,CIM_Processor,CIM_OperatingSystem,CIM_ComputerSystem,CIM_ComputerSystemPackage,CIM_RunningOS,CIM_OSProcess,CIM_SystemDevice,CIM_ProcessIndication,CIM_ElementStatisticalData
%define REGISTRATION %{_datadir}/%{name}/Linux_BaseIndication.registration
# If upgrading, deregister old version
if [ $1 -gt 1 ]
  %{_datadir}/%{name}/ -d \
	-r %{REGISTRATION} -m %{SCHEMA} > /dev/null ||:

# Register Schema and Provider - this is higly provider specific
# tog-pegasus needs some schemes registered first
if [ -x /usr/bin/ ]; then -n root/cimv2 /usr/share/mof/cim-current/*/{%{PEGASUS_MOF}}.mof
	rctog-pegasus try-restart
# and then following script can handle registration for various providers
%{_datadir}/%{name}/ \
	-r %{REGISTRATION} -m %{SCHEMA} > /dev/null ||:

# Deregister only if not upgrading 
if [ $1 -eq 0 ]
  %{_datadir}/%{name}/ -d \
	-r %{REGISTRATION} -m %{SCHEMA} > /dev/null ||:

%postun -p /sbin/ldconfig

%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version} || 0%{?fedora} || 0%{?rhel}
%docdir %{_datadir}/doc/%{name}-%{version}
%doc %{_datadir}/doc/%{name}-%{version}
%doc %{_docdir}/%{name}
%dir %{_libdir}/cmpi/
%dir %{_datadir}/%{name}/
#possibly needed atm, as per above comment... leaving for now

%files devel
%dir %{_includedir}/sblim

%files testsuite
%dir %{_datadir}/sblim-testsuite
%dir %{_datadir}/sblim-testsuite/cim
%dir %{_datadir}/sblim-testsuite/system
%dir %{_datadir}/sblim-testsuite/system/linux