File sblim-cmpi-dhcp.spec of Package sblim-cmpi-dhcp
#
# spec file for package sblim-cmpi-dhcp
#
# Copyright (c) 2015 SUSE LINUX 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/
#
Name: sblim-cmpi-dhcp
Version: 1.0
Release: 0
Summary: SBLIM CMPI dhcp Instrumentation
License: EPL-1.0
Group: System/Management
Url: http://sblim.sourceforge.net/wbemsmt.html
Source: http://prdownloads.sourceforge.net/sblim/%{name}-%{version}.tar.bz2
Patch1: %{name}-%{version}-interopnamespace.patch
Patch2: %{name}-%{version}-automake.patch
Patch3: %{name}-fix-build-gcc-werror.patch
Patch4: sblim-cmpi-dhcp-1.0.patch
Patch5: 0001-fix-api-prefix-setting.patch
BuildRequires: bison
BuildRequires: dos2unix
BuildRequires: flex
BuildRequires: libtool
BuildRequires: sblim-cmpi-base-devel
BuildRequires: sblim-cmpi-devel
BuildRequires: sblim-testsuite
BuildRequires: sblim-tools-libra-devel
Requires: cim-server
Requires: sblim-cmpi-base >= 1.2.3
# FIXME: use proper Requires(pre/post/preun/...)
#PreReq: sblim-sfcb
Requires(post): sblim-sfcb
Requires(preun): sblim-sfcb
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#!BuildIgnore: tog-pegasus
%description
Standards Based Linux dhcp Instrumentation Providers
%prep
%setup -q
%patch -P1
%patch -P2
%patch -P3 -p1
%patch -P4 -p1
%patch -P5 -p1
%build
find . -name 'Makefile.am' -exec sed -i 's|#.-Werror.*|-Wall|' \{\} \;
autoreconf -fi
CFLAGS="-I/usr/include/sblim" %configure --disable-static
make %{?_smp_mflags}
dos2unix COPYING
%install
%if 0%{?suse_version}
make DESTDIR=%{buildroot} install %{?_smp_mflags} docdir=%{_docdir}/%{name}
%else
make install DESTDIR=%{buildroot} docdir=%{_docdir}/%{name}-%{version}
%endif
rm %buildroot%_libdir/cmpi/*.la
rm %buildroot%_libdir/*.la
# XXX -devel package needed?
rm %{buildroot}%{_libdir}/libRaToolsDhcp.so
install -d %{buildroot}%{_sysconfdir}/UniqueKey
%find_lang %{name}
%define REGISTRATIONS Linux_DHCPGlobal,Linux_DHCPGlobalForService,Linux_DHCPGroup,Linux_DHCPGroupsForEntity,Linux_DHCPHost,Linux_DHCPHostsForEntity,Linux_DHCPOptions,Linux_DHCPOptionsForEntity,Linux_DHCPParams,Linux_DHCPParamsForEntity,Linux_DHCPPool,Linux_DHCPPoolsForEntity,Linux_DHCPRegisteredProfile,Linux_DHCPService,Linux_DHCPServiceConfiguration,Linux_DHCPServiceConfigurationForService,Linux_DHCPSharednet,Linux_DHCPSharednetsForEntity,Linux_DHCPSubnet,Linux_DHCPSubnetsForEntity
%define SCHEMES %{REGISTRATIONS},Linux_DHCPElementConformsToProfile,Linux_DHCPEntity
%define INTEROP_REGISTRATIONS Linux_DHCPRegisteredProfile,Linux_DHCPElementConformsToProfile
%define INTEROP_SCHEMES %{INTEROP_REGISTRATIONS},Linux_DHCPService
%post
/sbin/ldconfig
# compile MOF
d=%{_datadir}/%{name}
$d/provider-register.sh -t sfcb -r $d/{%{REGISTRATIONS}}.registration -m $d/{%{SCHEMES}}.mof
$d/provider-register.sh -t sfcb -n "root/interop" -r $d/{%{INTEROP_REGISTRATIONS}}.registration -m $d/{%{INTEROP_SCHEMES}}.mof
###############################################################################
%preun
d=%{_datadir}/%{name}
$d/provider-register.sh -t sfcb -r $d/{%{REGISTRATIONS}}.registration -m $d/{%{SCHEMES}}.mof
$d/provider-register.sh -t sfcb -n "root/interop" -r $d/{%{INTEROP_REGISTRATIONS}}.registration -m $d/{%{INTEROP_SCHEMES}}.mof
###############################################################################
%postun -p /sbin/ldconfig
%files -f %{name}.lang
%defattr(-,root,root)
%doc COPYING AUTHORS README test/README.test
%config %{_sysconfdir}/smt_dhcp_ra_support.conf
%dir %{_sysconfdir}/UniqueKey
%{_libdir}/cmpi/*.so
%{_libdir}/*.so*
%{_datadir}/sblim-testsuite/*
%{_datadir}/%{name}/
%{_mandir}/man5/smt_dhcp_ra_support.conf*
%changelog