N1 Grid Service Provisioning System 5.0 Plug-in Development Guide

Components

The sample plug-in contains the RPM CT.xml file in the components directory. This file defines the backing component for the rpm component type, and is not expected to be used directly as a component itself. Look at the following items in the example below:

<?xml version="1.0" encoding="UTF-8"?>
<component xmlns="http://www.sun.com/schema/SPS"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    version="5.0"
    xsi:schemaLocation="http://www.sun.com/schema/SPS
                    component.xsd"
    modifier="ABSTRACT"
    path="/com/sun/linux"
    name="RPM CT"
    description="RPM Installer"
    platform="system#Red Hat Linux - any version">

    <extends>
        <type name="system#CR Simple Base"/>
    </extends>

    <varList>
        <var name="filterName" default="rpmOnly" access="PRIVATE"/>
        <var name="filterDescription" 
            default="show RPM file types only (.rpm)" 
            access="PRIVATE"/>
        <var name="filterExtensions" default=".rpm" access="PRIVATE"/>
        <var name="rpmCmd" default="rpm"/>
        <var modifier="FINAL" name="installDeployMode" default="REPLACE"/>
        <var name="installDiffDeploy" default="TRUE"/>
        <var access="PRIVATE" name="exporterClassName" 
             default="com.sun.n1.sps.pluginimpl.system.export.FilesystemExporter"/>
        <var access="PRIVATE" name="canBeConfigTemplate" default="FALSE"/>
    </varList>

    <installList>
        <installSteps name="default">
            <deployResource/>
            <execNative userToRunAs="root">
                <exec cmd=":[rpmCmd]">
                    <arg value="-i"></arg>
                    <arg value=":[sys.rsrcInstallPath]"></arg>
                </exec>
            </execNative>
        </installSteps>
    </installList>

    <uninstallList>
        <uninstallSteps name="default">
            <execNative userToRunAs="root">
                <shell cmd="sh -c">
                     <![CDATA[:[rpmCmd] -e `:[rpmCmd] 
                        -qp :[sys.rsrcInstallPath] 
                        -qf '%{NAME}' 2> /dev/null`]]>
                </shell>
            </execNative>
            <call blockName="deleteFile">
                <argList absPath=":[sys.rsrcInstallPath]"/>
                <systemService name="system#core services"/>
            </call>
        </uninstallSteps>
    </uninstallList>

</component>