Previous Topic: Define Dependencies for the PIF Product MERCHANTNext Topic: Add a Procedure to the PIF Product MERCHANT


Specify Files for the PIF Product MERCHANT

All files that make up the final PIF product are defined in component sections in the prototype file. For the PIF product MERCHANT, add the following section to the prototype file MERCHANT.Any.@prm:

@COMPONENT:
#chead: component1 ;
#dir: bin , root , sys , drwxrwxrwx ;
#file: bin/merchant.jar , /myhomepath/src/merchant.jar, root , sys , -r—r—r-- , 1 ;
#file: bin/run_merchant.sh , /myhomepath/scripts/run_merchant.sh, root , sys , -r-xr-xr-x , 1 ;
#slink: /usr/bin/run_merchant.sh , bin/run_merchant.sh ;
@ENDCOMP:

The product information section defines the following product properties:

#chead: component1 ;

Defines the unique name of a component of the PIF product MERCHANT, in this case, component1.

#dir: bin , root , sys , drwxrwxrwx ;

Adds the bin directory to the PIF product MERCHANT. The user root is the owner of this directory, which is assigned to the group sys. Permissions are “read-write-execute” (rwx) for everybody.

#file: bin/merchant.jar , /myhomepath/src/merchant.jar , root , sys , -r---r---r--- , 1 ;
#file: bin/run_merchant.sh , /myhomepath/scripts/run_merchant.sh , root , sys , -r-xr-xr-x , 1 ;

Defines the product files of the PIF product MERCHANT. The first property value is the target name of the file. Directory structures have to be added to the target name, too. In this case, each file will be installed in the bin directory. The next property specifies the source file name. This is the path, where the files are located when the PIF product is built. The target’s owner, group, and access permissions follow it. The last property value (1) specifies the file type standard file.

Note: If the target file names are entered without a leading slash, the files are installed relative to the base directory of the product; otherwise, the files are installed using the absolute path name.

#slink: /usr/bin/run_merchant.sh , bin/run_merchant.sh ;

Creates a symbolic link in the /usr/bin directory. The second parameter is the path name of the source file.

Specifying files for the PIF product can be automated using the pifproto command from the command line. Additionally to creating the prototype file and the product information section, the pifproto command adds the paths and properties of all files stored in the product directory to the prototype file.

To specify files through the command line

  1. Create a new folder structure (for example, /tmp/merchant and /tmp/merchant/bin).
  2. Copy the files to be added into the /tmp/merchant/bin folder.
  3. Execute the pifproto command as follows:
    pifproto -n MERCHANT -v 2.1.0.0 -a Any -d /tmp/merchant -b /home/merchant
    

    The prototype file MERCHANT.Any.@prm is located in the current working directory.

To specify files through the Packager GUI

  1. Run the smgui command to launch the Packager GUI.
  2. Choose File, New from the menu bar..

    The New product dialog appears.

  3. Enter the following values:

    Product name: MERCHANT

    Product version: 2.1.0.0

    Product platform: Any

    Template: standard.Any.@enu

  4. Click New.

    The product MERCHANT is displayed and highlighted in the project pane. In the GUI work area, the current product properties are shown. The installation directory is preset with the value /opt/merchant. A standard component with the name component1 and a pre-install component are automatically created and displayed on the Components tab in the subproject pane.

  5. Select the product MERCHANT in the project pane
  6. Choose File, Save from the menu bar.

    The current prototype file is saved.