From Fedora Project Wiki
(fixups per toshio's comments)
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
These are guidelines for packaging CMPI plugins, used by the tog-pegasus or sblim-sfcb CIMOMs.  Such plugins are called "CIM providers", and each uses the CMPI interface to the CIMOM.
In Fedora 12  and above These are guidelines for packaging CMPI plugins, used by the tog-pegasus or sblim-sfcb CIMOMs.  Such plugins are called "CIM providers", and each uses the CMPI interface to the CIMOM.


 
<ol>
# Make sure each provider Requires: tog-pegasus (or sblim-sfcb). Each provider should "Require" either cim server for now. This is going to change in future, to Requires: cim-server
<li>Make sure each provider <code>Requires: cim server</code>. This is a virtual provide that each CIMOM has. 
* sblim-sfcb has this already, need to add it to tog-pegasus
{{admon/warning||sblim-sfcb has this already, need to add it to tog-pegasus}}</li>
 
<li>
# All plugins are shared libraries, ending in .so.  These are to be installed in the %{_libdir}/cmpi/ directory.
All plugins are shared libraries, ending in .so.  These are to be installed in the %{_libdir}/cmpi/ directory.
# Each provider should register in %postin and unregister in %preun to the cim server.
</li><li>
Some of the providers may have hard-coded shared object names, which are dlopen()ed at runtime.  rpmlint will throw warnings to move *.so files to a -devel package, but this would be incorrect for these packages.  Such warnings may be ignored.
</li><li>
All the .registration and .mof files go to %{_datadir}/%{name}
</li><li>
Each provider should register in %postin and unregister in %preun to the cim server.
<pre>
<pre>
%pre
%pre
Line 38: Line 43:
         > /dev/null 2>&1 || :;
         > /dev/null 2>&1 || :;
fi
fi
%postun -p /sbin/ldconfig
</pre>
</pre>
 
</li></ol>
# Some of the providers may have hard-coded shared object names, which are dlopen()ed at runtime.  rpmlint will throw warnings to move *.so files to a -devel package, but this would be incorrect for these packages.  Such warnings may be ignored.
{{admon/warning||as these aren't standard shared libraries or in a libdir path, do we need to run ldconfig?}}
# All the registration and mof files go to %{_datadir}/%{name}
{{admon/warning||can we avoid hard-coding the '-t pegasus' bit, to handle other CIMOMs?}}

Latest revision as of 14:46, 8 February 2010

In Fedora 12 and above These are guidelines for packaging CMPI plugins, used by the tog-pegasus or sblim-sfcb CIMOMs. Such plugins are called "CIM providers", and each uses the CMPI interface to the CIMOM.

  1. Make sure each provider Requires: cim server. This is a virtual provide that each CIMOM has.
    Warning.png
    sblim-sfcb has this already, need to add it to tog-pegasus
  2. All plugins are shared libraries, ending in .so. These are to be installed in the %{_libdir}/cmpi/ directory.
  3. Some of the providers may have hard-coded shared object names, which are dlopen()ed at runtime. rpmlint will throw warnings to move *.so files to a -devel package, but this would be incorrect for these packages. Such warnings may be ignored.
  4. All the .registration and .mof files go to %{_datadir}/%{name}
  5. Each provider should register in %postin and unregister in %preun to the cim server.
    %pre
    if [ "$1" -gt 1 ]; then
    # If upgrading, deregister old version
        %{_datadir}/%{name}/provider-register.sh \
            -d -t pegasus \
            -m %{_datadir}/%{name}/Linux_Network.mof \
            -r %{_datadir}/%{name}/Linux_Network.registration \
            > /dev/null 2>&1 || :;
    fi
    
    %post
    /sbin/ldconfig
    if [ "$1" -ge 1 ]; then
    # Register Schema and Provider
        %{_datadir}/%{name}/provider-register.sh \
            -t pegasus \
            -m %{_datadir}/%{name}/Linux_Network.mof \
            -r %{_datadir}/%{name}/Linux_Network.registration \
            > /dev/null 2>&1 || :;
    fi
    
    %preun
    if [ "$1" -eq 0 ]; then
    # Deregister only if not upgrading
        %{_datadir}/%{name}/provider-register.sh \
            -d -t pegasus \
            -m %{_datadir}/%{name}/Linux_Network.mof \
            -r %{_datadir}/%{name}/Linux_Network.registration \
            > /dev/null 2>&1 || :;
    fi
    
    %postun -p /sbin/ldconfig
    
Warning.png
as these aren't standard shared libraries or in a libdir path, do we need to run ldconfig?
Warning.png
can we avoid hard-coding the '-t pegasus' bit, to handle other CIMOMs?