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

#
# spec file for package sblim-cmpi-firewall (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/
#

%define cmpi_provider_dir %{_libdir}/cmpi

Summary:        SBLIM Firewall Instrumentation

Name:           sblim-cmpi-firewall
Version:        0.5.6
Release:        0.<RELEASE1>
Group:          System/Management
License:        EPL-1.0
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  bison
BuildRequires:  flex
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRequires:  sblim-cmpi-c++-devel
BuildRequires:  sblim-cmpi-devel
BuildRequires:  sblim-sfcb
BuildRequires:  sblim-testsuite
BuildRequires:  sblim-tools-libra-devel
Requires:       sblim-sfcb cim-schema bind
Source0:        http://sourceforge.net/projects/sblim/files/sblim-wbemsmt/0.5.6/sblim-cmpi-firewall-0.5.6.tar.bz2
Url:            http://sblim.wiki.sourceforge.net/
Patch0:         no_duplicate_man_install.patch
Patch1:         no_duplicate_mof_install.patch
Patch2:         configure.ac.patch
Patch3:         docdir.patch
Patch4:         initialize-cmpidata.patch
# remove unused variable
Patch5:         sblim-cmpi-firewall-0.5.6.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
#!BuildIgnore:  tog-pegasus

%description
The cmpi-firewall package provides access to the FIREWALL
configuration data via CIMOM technology/infrastructure.
It contains the FIREWALL CIM Model, CMPI Provider with the FIREWALL
task specific Resource Access.
A web based client application is available on SourceForge. Please
refer to https://sourceforge.net/project/showfiles.php?group_id=128809&package_id=214076
to get the WBEM-SMT Client Application.


%package devel
License:        Other uncritical OpenSource License
Summary:        SBLIM WBEM-SMT Firewall - Header Development Files
Group:          System/Management
Requires:       %{name} = %{version}-%{release}

%description devel
SBLIM WBEM-SMT Dns Development Package contains header files and link
libraries for dependent provider packages


%package test
License:        Other uncritical OpenSource License
Summary:        SBLIM WBEM-SMT Firewall - Testcase Files
Group:          System/Management
Requires:       %{name} = %{version}-%{release}

%description test
SBLIM WBEM-SMT Firewall Provider Testcase Files for the SBLIM Testsuite


%prep
%setup -n %{name}-%{version}
%patch0 -p0
%patch1 -p0
%patch2 -p0
%patch3 -p0
%patch4 -p1
%patch5 -p1

%build
autoreconf -f -i
%configure \
   docdir=%{_docdir}/%{name} \
   TESTSUITEDIR=%{_datadir}/sblim-testsuite \
   CIMSERVER=sfcb \
   PROVIDERDIR=%{_libdir}/cmpi
make RPM_OPT_FLAGS=$(RPM_OPT_FLAGS)

%clean
%{__rm} -rf "$RPM_BUILD_ROOT"

%install
mkdir -p $RPM_BUILD_ROOT/usr/%{_lib}/cmpi
mkdir -p $RPM_BUILD_ROOT/usr/include/cmpi
mkdir -p $RPM_BUILD_ROOT/usr/share/cmpi/mof
%if 0%{?suse_version}
make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_lib} docdir=%{_docdir}/%{name}
%else
make install DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_lib} docdir=%{_docdir}/%{name}-%{version}
%endif
rm -f $RPM_BUILD_ROOT/%{_libdir}/*a
rm -f $RPM_BUILD_ROOT/%{_libdir}/cmpi/*a
find $RPM_BUILD_ROOT
# Conditional definition of schema and registration files
%define SCHEMAS Linux_FirewallService,Linux_FirewallServiceConfiguration,Linux_FirewallServiceConfigurationForService,Linux_FirewallRegisteredProfile,Linux_FirewallElementConformsToProfile,Linux_FirewallInterface,Linux_FirewallManagedPorts,Linux_FirewallTrustedServices,Linux_FirewallManagedPortsForInterface,Linux_FirewallTrustedServicesForInterface
%define REGISTRATIONS Linux_FirewallService,Linux_FirewallServiceConfiguration,Linux_FirewallServiceConfigurationForService,Linux_FirewallInterface,Linux_FirewallTrustedServices,Linux_FirewallManagedPorts,Linux_FirewallManagedPortsForInterface,Linux_FirewallTrustedServicesForInterface
%define INTEROP_SCHEMAS Linux_FirewallService,Linux_FirewallRegisteredProfile,Linux_FirewallElementConformsToProfile
%define INTEROP_REGISTRATIONS Linux_FirewallRegisteredProfile,Linux_FirewallElementConformsToProfile
%define INTEROP_NS "root/interop"

%post
# compile MOF
/sbin/ldconfig
d=%{_datadir}/%{name}
$d/provider-register.sh -t sfcb -r $d/{%{REGISTRATIONS}}.registration -m $d/{%{SCHEMAS}}.mof
$d/provider-register.sh -t sfcb -n %{INTEROP_NS} -r $d/{%{INTEROP_REGISTRATIONS}}.registration -m $d/{%{INTEROP_SCHEMAS}}.mof

%preun
# If upgrading, deregister old version
if [ "$1" = "0" ]; then
  d=%{_datadir}/%{name}
  $d/provider-register.sh -t sfcb -d -r $d/{%{REGISTRATIONS}}.registration -m $d/{%{SCHEMAS}}.mof
  $d/provider-register.sh -t sfcb -d -n %{INTEROP_NS} -r $d/{%{INTEROP_REGISTRATIONS}}.registration -m $d/{%{INTEROP_SCHEMAS}}.mof
fi

%postun
# Run ldconfig only if not upgrading
if [ $1 -eq 0 ]
then
  /sbin/ldconfig
fi

%files
%defattr(-,root,root,0755)
%if 0%{?suse_version}
%doc %{_docdir}/%{name}
%exclude %{_docdir}/%{name}/*.test
%else
%doc %{_docdir}/%{name}-%{version}
%exclude %{_docdir}/%{name}-%{version}/*.test
%endif
%defattr(-,root,root,0644) 
%doc %{_mandir}/man5/smt_fw_ra_support.conf.5.gz
%config(noreplace) %{_sysconfdir}/smt_fw*.conf
%defattr(-,root,root,0755)
%dir %{_datadir}/%{name}
%{_datadir}/%{name}
%defattr(-,root,root,0644) 
%{_datadir}/locale/en_US/LC_MESSAGES/sblim-cmpi-firewall.*
%{_libdir}/libRaToolsFirewall.so.*
%{cmpi_provider_dir}/libcmpiLinux_Firewall*.so

%files devel
%defattr(-,root,root) 
%{_libdir}/libRaToolsFirewall.so

%files test
%defattr(-,root,root,0755)
%if 0%{?suse_version}
%doc %{_docdir}/%{name}/*.test
%else
%doc %{_docdir}/%{name}-%{version}/*.test
%endif
%{_datadir}/sblim-testsuite/test-cmpi-firewall.sh
%defattr(-,root,root,0644)
#%{_datadir}/sblim-testsuite/iptables.conf
%{_datadir}/sblim-testsuite/cim/Linux_Firewall*
%{_datadir}/sblim-testsuite/system/linux/Linux_Firewall*

%changelog
openSUSE Build Service is sponsored by