Building and Using ComponentPackager

To successfully build CIAO::ComponentPackager, you will need ZipArchive, a free zip compression and decompression library developed by artpol-software.(http://www.artpol-software.com/) . This file explains how to set up the building of ZipArchive under different OS platforms such that the CIAO::ComponentPackager can be compiled successfully. If this file does not solve all the problems you might encounter compiling ComponentPackager, please also check out ZipArchive Compiling and Integration  for more information. If you are still having problems, please feel free to contact me at mxiong@dre.vanderbilt.edu .

Currently, the ZipArchive version supported by ComponentPackager is 2.4.4. So unless otherwise specified, please stay with this version. The following explains how to build ZipArchive under Windows and Linux.

Table of  Contents



Windows

To obtain and build ZipArchive under windows, please do:

1. Download the ZipArchive source from here , unzip it to a local direcoty, e.g. E:\ZipArchive
2. Navigate to ZipArchive\Windows directory, copy all the files into ZipArchive\
3. Navigate to ZipArchive\stl directory, copy all the files (except zippie folder) into ZipArchive\
4. Open ZipArchive_STL.dsw, click yes to convert it to solution file.
5. Change the output file property of ZipArchive_STL.dsw to \lib\ziparchd.lib (originally it's \debug\ZipArchive_STL.lib).
6. Build the solution, and you should be able to compile the ziparchive.
7. Add a environment variable ZIPARCHIVEROOT such that it contains the root directory of ZipArchive. In this case, it would be E:\ZipArchive

Now you should be able to build CIAO:Component_Packager.


Linux

To obtain and build ZipArchive, do:
1. Obtains  the  ZipArchive
    >wget http://www.artpol-software.com/cgi-bin/download.cgi?ziparchive.zip

2. Create a  directory  for ziparchive  and decompressed the ziparchive.zip
   >mkdir ziplib
   >unzip ziparchive.zip -d ziplib

3. Copy the necessary files for linux OS
   >cd ziplib
   >cp ./Linux/* .
   >cp ./stl/* .

4. Edit the Makefile in the ./ziplib directory, do the following:
5. Build ZipArchive by typing make
6. Install the ZipArchive by typing make install

7. Set up the environment variable
    If you have installed the ziparchive into the system include and library paths, you may skip this step. Otherwise, you might want to add an environment variable ZIPARCHIVEROOT that contains the root directory of the ZipArchive. For instance, in my ./.bash_profile i have the following entry:

    ZIPARCHIVEROOT=~/ziplib
    export ZIPARCHIVEROOT

Now you should be able to successfully build the CIAO::Component_Packager.


Create Component Package using ComponentPackager

To create a package, ComponentPackager need the flattened_deploymentplan to obtain the information about component implementations. Take DAnCE/examples/Quoter for example, here's the steps to create a package:

(assuming windows platform)
1. cd descriptors
2. %CIAO_ROOT%/DAnCE/ComponentPackager/Component_Packager.exe -p flattened_deploymentplan.cdp
    (2552|3524) Initializing the Xerces runtime
    ComponentPackager: Adding description ....[Done]
    ComponentPackager: Adding descriptors\flattened_deploymentplan.cdp ....[Done]
    ComponentPackager: Adding implementations\Broker_execd.dll ....[Done]
    ComponentPackager: Adding implementations\Broker_stubd.dll ....[Done]
    ComponentPackager: Adding implementations\Broker_svntd.dll ....[Done]
    ComponentPackager: Adding implementations\Distributor_execd.dll ....[Done]
    ComponentPackager: Adding implementations\Distributor_stubd.dll ....[Done]
    ComponentPackager: Adding implementations\Distributor_svntd.dll ....[Done]
    ComponentPackager: Adding implementations\Stock_Base_stubd.dll ....[Done]
    ComponentPackager: Adding implementations\Stock_Base_svntd.dll ....[Done]
    (2552|3524)[success] The Component Package has been created!

Now you will be able to find a ComponentPackager.cpk file under ./descriptors directory.Note that you can change the output package name by using -o option, e.g.
 %CIAO_ROOT%/DAnCE/ComponentPackager/Component_Packager.exe -o Quoter.cpk -p flattened_deploymentplan.cdp


Note: To make sure the package has every implementation artifact required, including the base library, e.g.Stock_Base_stub, you might want to check your flattened_deploymentplan to make sure the base libraries are also included as artifacts in the implementation descriptions.Please check DAnCE/examples/Quoter/descriptors/flattened_deploymentplan.cdp for details.
If you also want to archive separated descriptors other than flattened_deploymentplan.cdp (.cid, .cpd, .iad etc ) into your package, you will need to create a PackageDescriptorsList XML file which specifies what files to include in your package.  There is a sample .pdl file Sample.pdl in the root directory of  ComponentPackager. Please follow the same pattern to create your own .pdl file. Along with the .pdl file is a standalone xml schema file package.xsd which you will need to validate Sample.pdl. So make sure you have this schema file along with the .pdl file you need to use. To create a package that includes separated descriptors

1. cd descriptors
2. copy %COPY_ROOT%/ComponentPackager/Sample.pdl .\
3. copy %COPY_ROOT%/ComponentPackager/Package.xsd .\
4. %CIAO_ROOT%/DAnCE/ComponentPackager/Component_Packager.exe -p flattened_deploymentplan.cdp -i Sample.pdl