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

#
# spec file for package sblim-cmpi-authorization
#
# 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-authorization
Version:        0.1.0
Release:        0
Summary:        SBLIM sample CMPI authorization provider
License:        EPL-1.0
Group:          System/Management
Url:            https://sourceforge.net/projects/sblim/
Source:         %{name}-%{version}.tar.gz
Patch1:         0001-return-value-from-yyerror.patch
Patch2:         0002-Add-cmpiutil.h-for-declarations.patch
Patch3:         0003-Provide-proper-function-declarations.patch
BuildRequires:  bison
BuildRequires:  dos2unix
BuildRequires:  flex
BuildRequires:  libtool
BuildRequires:  sblim-cmpi-base-devel
BuildRequires:  sblim-cmpi-devel
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
This SBLIM provider package contains a sample CMPI provider that
performs simple authorization checks by looking up authorization
information saved in a file. This information contains the name of a
user and a classname, and then a list of class operations and a flag
indicating whether the user is permitted to perform that operation on
that class.

%prep
%setup -q
%patch -P1 -p1
%patch -P2 -p1
%patch -P3 -p1

%build
find . -name 'Makefile.am' -exec sed -i 's|#.-Werror.*|-Wall|' \{\} \;
autoreconf -fi
%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 -f %buildroot%_libdir/cmpi/*.la
rm -f %buildroot%_libdir/*.la
# packaged as %%license
rm -f %buildroot%_docdir/%{name}/COPYING

%define REGISTRATIONS CWS_Authorization
%define SCHEMES %{REGISTRATIONS}

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

%preun
d=%{_datadir}/%{name}
$d/provider-register.sh -t sfcb -r $d/%{REGISTRATIONS}.registration -m $d/%{SCHEMES}.mof
###############################################################################

%postun -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc AUTHORS README README.*
%license COPYING
%{_docdir}/%{name}/*.sample
%{_libdir}/cmpi/*
%dir %{_datadir}/%{name}
%{_datadir}/%{name}/*

%changelog
openSUSE Build Service is sponsored by