/ howto / package
How To Package Gambas
This file won't explain you how to make the packages, but the structure they must follow.

Gambas must be packaged the way described in this document, because the development environment relies on this structure when it creates a package of a gambas project.

If a distribution does not follow this requirement, then the packages generated by the development environment won't be able to be installed, and the user will be very unhappy.

Not all distributions make correct gambas binary packages at the moment. So, if you are a packager from these distributions, and if you read this text, please try to help Gambas work on your distribution.

Thanks in advance,

Benoît.

## SPECIFICATIONS FOR GAMBAS 2.0

The specifications look like the old ones, except that `lib.XXX.component` files were renamed as `XXX.component`, and that now a component can have a part written in Gambas.

Gambas binary packages must have the following names and contents:

### The runtime package

This package includes the Gambas interpreter needed to run Gambas applications.

It contains:

- The interpreter: `gbx2`.
- The symbolic link on `gbx2`: `gbr2`.
- The internal component description: `gb.component`, `gb.info` and `gb.list`.
- The readme files, `TODO` files, and so on.
- The `gb.debug` component: `gb.debug.info`, `gb.debug.list`, `gb.debug.component`, `gb.debug.so.*`, `gb.debug.la`.
- The `gb.eval` component: `gb.eval.info`, `gb.eval.list`, `gb.eval.component`, `gb.eval.so.*`, `gb.eval.la`.
- The `gb.draw` component: `gb.draw.info`, `gb.draw.list`, `gb.draw.component`, `gb.draw.so.*`, `gb.draw.la`.

| Note that `gb.la`, `gb.so`, `gb.so.0` and `gb.so.0.0.0` do not need to be distributed. They are temporary files used for generating `gb.info` and `gb.list` only.

Its name must be `gambas2-runtime`.

### The development package

This package includes all tools needed to compile Gambas projects without having to install the complete development environment.

It contains:

- The compiler: `gbc2`.
- The archiver: `gba2`.
- The informer: `gbi2`.

Its name must be `gambas2-devel`.

### The scripter package

This package includes the scripter program that allows to write script files in Gambas.

It contains:

- The scripter: `gbs2.gambas`.
- The symbolic link on it: `gbx2`.

Its name must be `gambas2-script`.

It depends on the following Gambas packages:

- `gambas2-runtime`.
- `gambas2-devel`.

This package must register the `application/x-gambasscript` mime type as specified by the `application-x-gambasscript.xml` file and the `application-x-gambasscript.png` icon.

### The component packages

Each gambas component must have its own package.

The package of a component contains:

- The shared library files: `gb.XXX.la`, `gb.XXX.so`, `gb.XXX.so.0`, `gb.XXX.so.0.0.0`.
- The component file: `gb.XXX.component`.
- The information file: `gb.XXX.info` and `gb.XXX.list`.
- Sometimes a part written in Gambas: `gb.XXX.gambas`.

...where `gb.XXX` is the name of the component

Then name of a component package MUST BE `gambas2-gb-XXX` where `gb-XXX` is the name of the component, the point being replaced by a minus sign.

For example, the `gb.qt` component package name is `gambas2-gb-qt`. It must include:

- `gb.qt.la`
- `gb.qt.so`
- `gb.qt.so.0`
- `gb.qt.so.0.0.0`
- `gb.qt.component`
- `gb.qt.gambas`
- `gb.qt.info`
- `gb.qt.list`

Some component are entirely written in Gambas, i.e. they have only a Gambas part. These components are located in the `comp` directory of the source archive.

You must follow the previous rules for these components, except that there is no shared library files inside.

| Note that `gb.debug`, `gb.eval` and `gb.draw` do not have their own package, as they are distributed with the `gambas2-runtime` package.

### The development environment package

This package includes the complete Gambas Development Environment, with the database manager, and the help files.

It contains:

- The development environment: `gambas2.gambas`.
- The symbolic link on it: `gambas2`.
- The database manager: `gambas-database-manager.gambas`.
- The examples.
- The help files.

It depends on the following Gambas packages:

- `gambas2-runtime`.
- `gambas2-devel`.
- The packages of the components needed by the IDE and the database manager.

You MAY make this package depend on all Gambas components, so that they are all installed, but this is not recommended.

Its name must be `gambas2-ide`.

| The IDE relies on the following external tools: The GNU translation tools for translating a project. The RPM tools for creatings RPM packages. The `tar` & `gzip` tools for creating `*.tar.gz` archives. So you must add the dependencies on the packages that provide these tools. The name of these packages depends on the distribution. For example, on Mandriva, they are: `gettext` `rpm-build` `gzip` `tar`

## SPECIFICATIONS FOR GAMBAS 1.0.x

Gambas binary packages must follow the following names and contents:

### The runtime package

This package includes the Gambas interpreter needed to run Gambas applications.

It contains:

- The interpreter: `gbx`.
- The informer: `gbi`.
- The internal component description: `lib.gb.component`, `gb.info` and `gb.list`.
- The readme files, `TODO` files, and so on.

Its name must be `gambas-runtime`.

This package must register the `application/x-gambas` mime type as specified by the `application-x-gambas.xml` file and the `application-x-gambas.png` icon.

### The component packages

Each component must have its own package.

The package of a component contains:

- The shared library files: `*.so`, `*.la`.
- The component file: `*.component`.
- The information file: `*.info` and `*.list`.

The name of a component package MUST BE `gambas-gb-XXX` where `gb-XXX` is the name of the component, where the point were replaced by a minus sign.

For example, the `gb.qt.ext` component package name is `gambas-gb-qt-ext`.