Mapping existing packaging solutions to proposed Fractal packaging scheme

  1. Introduction

    This document shows how the Fractal packaging scheme can be used to present the features of two of the existing packaging systems: OSGi bundles and RPM packages.

  2. OSGi bundles

    1. General information:

      Bundles are JAR files that contain resources in a form of class files as well as other data such as HTML files, icons and so on. Each bundle contains a manifest file providing information about the bundle. The manifest file has a defined set of headers processed and used by the OSGi framework.

    2. Metadata:

      Metadata is stored in META-INF/MANIFEST.MF file inside the bundle's JAR.

      Following information can be provided in the manifest:

      Header

      Sample

      Description

      Bundle-Activator

      com.acme.fw.activator

      The name of the class that is used to start and stop the bundle.

      Bundle-Category

      osgi, test, nursery

      A comma separated list of category names.

      Bundle-Classpath

      /jar/http.jar

      A comma serparated list of JAR file path names (inside the bundle) that should be searched for classes and resources. The period ('.') specifies the bundle itself.

      Bundle-ContactAddress

      2400 Oswego Road
      Austin, TX

      Contact address if it is necessary to contact the vendor.

      Bundle-Copyright

      OSGi © 2002

      Copyright specification for this bundle.

      Bundle-Description

      Network firewall

      A short description of this bundle.

      Bundle-DocURL

      http://www.acme.com/firewall/doc

      A URL to documentation about this bundle.

      Bundle-Name

      Firewall

      Name for this bundle. this should be a short name and should contain no spaces.

      Bundle-NativeCode

      /lib/http.dll;
      osname = QNX;
      osversion = 3.1

      A specification of native code contained in this bundle's JAR file.

      Bundle-RequiredExecutionEnvironment

      CDC-1.0/Foundation-1.0

      Comma separated list of execution environments that must be present on the ServicePlatform.

      Bundle-UpdateLocation

      http://www.acme.com/firewall/bundle.jar

      If the bundle is updated, this location should be used (if present) to retrieve the updated jar file.

      Bundle-Vendor

      OSGi

      A text description of this bundle.

      Bundle-Version

      1.1

      The version of this bundle.

      DynamicImport-Package

      com.acme.plugin.*

      Comma separated list of package names that should be dynamically imported when needed.

      Export-Package

      org.osgi.util.tracker

      Comma separeted list of package names (with optional version specification) that can be exported.

      Import-Package

      org.osgi.util.tracker; specification-version=1.4

      Comma separated list of package names (with optional version specification) that must be imported.

    3. Mapping to Fractal packaging system:

      The "tags" that describe physical dependencies between OSGi bundles are:

      • Import-Package
      • Export-Package
      • DynamicImport-Package

      Rest of the information provided in OSGi bundles' manifest is supplemantary and can be expressed through specific Fractal ADL modules.

      The proposition on mapping bundle dependencies to the Fractal ADL is as follows:

       

      Client

      Server

      Bundle manifest

      Import-Package: helloworld.server; specification-version=2.0
      Export-Package: helloworld.client; specification-version=1.0

      Export-Package: helloworld.server; specification-version=2.0

      ADL

      <definition name="Client"/>
        <interface name="helloworld.server" role="client" version="2.0"/>
        <interface name="helloworld.client" role="server" version="1.0"/>
      </definition>

      <definition name="Server"/>
        <interface name="helloworld.server" role="server" version="2.0"/>
      </definition>

      The DynamicImport-Package dependency can be mapped using the client collection interface.

      The Bundle-ClassPath should only be of importance to the OSGi framework as it tells the Framework where to look for classes inside the current bundle and therefore does not describe external (inter-bundle) dependencies.

  3. RPM packages

    1. General information:
    2. RPM packages are files with ".rpm" extension that provide a convenient way of distributing linux software. Each RPM file provides metadata used by the package manager.

    3. Metadata:

      The RPM package's metadata is stored in several files in the INFO directory inside the RPM package.

      Those files and their content are as follows:

      File

      Sample content

      Description

      BUILDHOST

      dhcp-110-143.idi.ntnu.no

      Host on which this RPM package has been built.

      BUILDTIME

      Tue Apr 27 17:07:29 2004

      Time when this RPM package has been built.

      CHANGELOG

      (none)

      List of changes applied to this RPM package.

      COPYRIGHT

      GPL

      Copyright specification for this RPM package.

      DESCRIPTION

      Xmms is a multimedia player for the X Window System with an interface similar to Winamp's. Xmms supports playlists and streaming content and has a configurable interface.

      A short description of this RPM package.

      DISTRIBUTION

       

       

      GROUP

      Applications/Multimedia

      A software group to which this RPM package belongs.

      LICENSE

       

       

      NAME-VERSION-RELEASE

      xmms-1.2.10-1

      Information on this RPM package's name, version and release.

      OBSOLETES

       

       

      OS

      linux

      Operating system to which this RPM package is dedicated.

      PACKAGER

      Haavard Kvaalen

      Name of the person who created this RPM package.

      PROVIDES

      libOSS.so
      libbscope.so
      libcdaudio.so
      libdisk_writer.so
      libecho.so
      libir.so
      libjoy.so
      libmpg123.so
      libsanalyzer.so
      libsong_change.so
      libstereo.so
      libtonegen.so
      libvoice.so
      libwav.so
      libxmms.so
      libxmms.so.1
      xmms

      List of resources (capabilities) provided by this RPM package.

      REQUIRENAME

      /sbin/ldconfig
      /sbin/ldconfig
      gtk+ >= 1:1.2.2
      libICE.so.6
      libSM.so.6
      libX11.so.6
      libXtext.so.6
      libXi.so.6
      libc.so.6
      libc.so.6(GLIBC_2.0)
      libc.so.6(GLIBC_2.1)
      libc.so.6(GLIBC_2.1.3)
      libc.so.6(GLIBC_2.3)
      libdl.so.2
      libdl.so.2(GLIBC_2.0)
      libdl.so.2(GLIBC_2.1)
      libgdk-1.2.so.0
      libglib-1.2.so.0
      libgmodule-1.2.so.0
      libgthread-1.2.so.0
      libgtk-1.2.so.0
      libm.so.6
      libm.so.6(GLIBC_2.0)
      libpthread.so.0
      libpthread.so.0(GLIBC_2.0)
      libpthread.so.0(GLIBC_2.1)
      libpthread.so.0(GLIBC_2.3.2)
      libxmms.so.1
      libz.so.1
      rpmlib(CompressedFileNames) <= 3.0.4-1
      rpmlib(PayloadFilesHavePrefix) <= 4.0-1

      List of resources (capabilities) required by this RPM package (with optional version specification).

      RPMVERSION

      4.2

       

      SIZE

      5470337 bytes

      Size of this RPM package.

      SOURCERPM

      xmms-1.2.10-10.src.rpm

      RPM package containing source files for this RPM package.

      SUMMARY

      A multimedia player for X which resembles Winamp.

      Summarized information on this RPM package.

      URL

      http://www.xmms.org/

      URL address for obtaining this RPM package.

      VENDOR

      XMMS Development Team

      Author of this RPM package.

      The files that describe dependencies between RPM packages are:

      • REQUIRENAME
      • PROVIDES

    4. Mapping to Fractal packaging system:

      The contents of the REQUIRENAME and PROVIDES files can be represented as client (required) and server (provided) interfaces in the ADL file in a manner similar to the one in the case of OSGi bundles. In case of OSGi bundles we can specify only the exact version that we want to import. In case of RPM packages, the imported version can be less than, less than or equal, equal, greater or equal, greater than the specified version. This has to be represented by the Fractal ADL interface tag.

       

      Client (version 1.0-1)

      Server (version 5.0-2)

      RPM metadata

      PROVIDES:
       client.so
      REQUIRES:
       server.so >= 4.3-1

      PROVIDES:
       server.so

      ADL

      <definition name="Client" version="1.0-1"/>
        <interface name="server.so" role="client" version=">=4.3-1"/>
        <interface name="client.so" role="server" version="1.0-1"/>
      </definition>

      <definition name="Server" version="5.0-2"/>
        <interface name="server.so" role="server" version="5.0-2"/>
      </definition>

      The version of every resource (capability) provided by the RPM package (declared in the PROVIDES file) is the same as this RPM package's NAME-VERSION-RELEASE metadata.

  4. Conclusion

    Looking at the above two examples, we can draw a conclusion that most packaging systems should be possible to map on the proposed Fractal packaging scheme since the dependencies between packages can usually be expressed in a form of Fractal client/server interfaces and other information can be provided by Fractal ADL modules.