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

#
# spec file for package sblim-cmpi-samba (Version 0.5.6)
#
# Copyright (c) 2009 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/
#

# norootforbuild


Name:           sblim-cmpi-samba
BuildRequires:  gcc-c++
BuildRequires:  sblim-cmpi-base-devel
BuildRequires:  sblim-cmpi-c++-devel
BuildRequires:  sblim-cmpi-devel
BuildRequires:  sblim-indication_helper-devel
BuildRequires:  sblim-sfcb
BuildRequires:  sblim-testsuite
BuildRequires:  sblim-tools-libra-devel
BuildRequires:  dos2unix
Version:        0.5.6
Release:        1
Group:          System/Management
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       sblim-cmpi-base, cim-server
Requires:       samba >= 3.0.10
Requires(pre):  /usr/bin/loadmof.sh, /usr/bin/rmmof.sh
#!BuildIgnore: tog-pegasus
URL:            http://www.sblim.org
License:        CPL-1.0
Source:         https://sourceforge.net/projects/sblim/files/sblim-wbemsmt/0.5.6/sblim-cmpi-samba-0.5.6.tar.bz2
Patch:          autoconfiscate.patch
Patch1:         include-stdlib-stdio.patch
Patch2:         Makefile-dist.patch
Patch3:         smt_smb_array-compile.patch
Patch4:         fix-void-return.patch
Summary:        Samba CIM provider

%description
The cmpi-samba package provides access to the samba configuration data 
via CIMOM technology/infrastructure.
It contains the Samba CIM Model, CMPI Provider with the Samba task specific 
Resource Access.
A web based client application is available on SourceForge. Please refer to
http://sblim.wiki.sourceforge.net to get more information the WBEM-SMT Client 
Application.

%Package devel
License:        CPL-1.0
Summary: Samba CIM provider - Header Development Files
Group:   Development/Libraries/C and C++
Requires: %{name} = %{version}-%{release}

%Description devel
The package contains header files and
link libraries for dependent provider packages

%package test
License:        CPL-1.0
Summary:        Samba CIM provider - Testcase Files
Group:          System/Management
Requires:       %{name} = %{version}-%{release}

%description test
Samba CIM Provider Testcase Files for the SBLIM Testsuite


%prep
%setup -n %{name}-%{version}
%patch
%patch1
%patch2
%patch3
%patch4 -p1

%build
sh ./autoconfiscate.sh
%configure --disable-static
%{__make}
dos2unix resource-access/scripts/smt_smb_ra_test.py

%install
%if 0%{?suse_version}
%makeinstall docdir=%{_docdir}/%{name}
%else
make install DESTDIR=%{buildroot} docdir=%{_docdir}/%{name}-%{version}
%endif
rm %buildroot%_libdir/cmpi/*.la
rm %buildroot%_libdir/*.la

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

%pre
# If upgrading/not new install/not removing, deregister old version
if [ $1 -gt 1 ]; then
  if [ -x /usr/sbin/sfcbd -a -x %{_datadir}/%{name}/provider-register.sh ]; then
    %{_datadir}/%{name}/provider-register.sh -t sfcb -d -r %{_datadir}/%{name}/*.registration -m %{_datadir}/%{name}/*.mof
  fi
fi

%post
# compile MOF
/sbin/ldconfig
if [ -x /usr/sbin/sfcbd ]; then
  %{_datadir}/%{name}/provider-register.sh -t sfcb -r %{_datadir}/%{name}/*.registration -m %{_datadir}/%{name}/*.mof
fi
/usr/bin/loadmof.sh -n root/cimv2 %{_datadir}/%{name}/Linux_samba.mof ||:

%preun
if [ "$1" = "0" ]; then
  if [ -x /usr/sbin/sfcbd -a -x %{_datadir}/%{name}/provider-register.sh ]; then
    %{_datadir}/%{name}/provider-register.sh -t sfcb -d -r %{_datadir}/%{name}/*.registration -m %{_datadir}/%{name}/*.mof
  fi
  /usr/bin/rmmof.sh -n root/cimv2 %{_datadir}/%{name}/Linux_samba.mof ||:
fi

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root) 
%{_libdir}/cmpi/*.so
%{_libdir}/*.so.*
%{_mandir}/man5/*
%if 0%{?suse_version}
%doc %{_docdir}/%{name}
%else
%doc %{_docdir}/%{name}-%{version}
%endif
%dir %{_datadir}/%{name}/
%{_datadir}/%{name}/
%config /etc/smt_smb_ra_support.conf
%config /etc/smt_smb_ra_synonyms.conf

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

%files devel
%defattr(-,root,root)
%dir %{_includedir}/sblim
%{_includedir}/sblim/smt_smb*.h
%defattr(-,root,root,0755)
%{_libdir}/libIBM_SmbProviderTooling.so
%{_libdir}/libLinux_SmbGeneralProviderBasic.so
%{_libdir}/libRaToolsSmb.so

%changelog