# Packaging &LIBGDA;

&LIBGDA; is made of several components and it installs a lot of files. This section gives hints as to how &LIBGDA; can be packaged, clearly separating the components so that packagers have a good overview, and can create the packages with a good understanding.

## Overview of the components

&LIBGDA;'s components are:

- the runtime files (shared libraries and configuration files)

- the GObject introspection files (to be used by the GObject introspection framework)

- the tools, which require the runtime component

- the database providers which are the "drivers" to each database type, which also require the runtime component

- the development files (the includes to compile C programs)

- the documentation files

- the localization files

## Runtime component

This component is the base component for Libgda, required by any application which uses &LIBGDA;, it contains the following files (located under the installation directory):

    .
    |-- bin
    |   |-- gda_trml2html
    |   |   |-- __init__.py
    |   |   |-- trml2html.py
    |   |   `-- utils.py
    |   `-- gda_trml2pdf
    |       |-- __init__.py
    |       |-- color.py
    |       |-- trml2pdf.py
    |       `-- utils.py
    |-- etc
    |   `-- libgda-6.0
    |       |-- config
    |       `-- sales_test.db
    |-- lib
    |   |-- libgda-6.0.so -> libgda-6.0.so.4.1.0
    |   |-- libgda-6.0.so.4 -> libgda-6.0.so.4.1.0
    |   |-- libgda-6.0.so.4.1.0
    |   |-- libgda-report-6.0.so -> libgda-report-6.0.so.4.1.0
    |   |-- libgda-report-6.0.so.4 -> libgda-report-6.0.so.4.1.0
    |   |-- libgda-report-6.0.so.4.1.0
    |   |-- libgda-xslt-6.0.so -> libgda-xslt-6.0.so.4.1.0
    |   |-- libgda-xslt-6.0.so.4 -> libgda-xslt-6.0.so.4.1.0
    |   |-- libgda-xslt-6.0.so.4.1.0
    `-- share
        `-- libgda-6.0
            |-- dtd
            |   |-- libgda-array.dtd
            |   |-- libgda-paramlist.dtd
            |   `-- libgda-server-operation.dtd
            |-- import_encodings.xml
            `-- information_schema.xml

This component should be made dependent on the core libraries &LIBGDA; depends on such as GLib, LibXML and LibXSLT. Also, if &LIBGDA; was compiled using a system installed SQLite, then a dependency also needs to be added to SQLite (otherwise &LIBGDA; uses its own embedded version of SQLite, and no dependency needs to be defined on SQLite).

Note that the file in the `bin` directory are used by the report library and have to be shipped with it.

## GObject introspection

If GObject introspection has been compiled, &LIBGDA;'s introspection files are:

    |-- share
    |   `-- gir-1.0
    |       `-- Gda-6.0.gir
    `-- lib
        `-- girepository-1.0
            `-- Gda-6.0.typelib

## Tools

&LIBGDA;'s offers several tools, the most useful being an SQL console which allows one to issue SQL statement from the command line. This component has the following files:

### Diagnostic tools

The diagnostic tools are useful to test connections. This component has the following files:

    .
    `-- bin
        |-- gda-list-config -> gda-list-config-6.0
        |-- gda-list-config-6.0
        |-- gda-list-jdbc-providers-6.0
        |-- gda-list-server-op -> gda-list-server-op-6.0
        |-- gda-list-server-op-6.0
        `-- gda-test-connection-6.0

This component should be made dependent on the runtime component.

### SQL console

    .
    |-- bin
    |   `-- gda-sql-6.0
     `-- share
        |-- gnome
        |   `-- help
        |       `-- gda-sql
        |           |-- C
        |           `[···]
        |-- libgda-6.0
        |   `-- web
        |       |-- cnc.js
        |       |-- gda-print.css
        |       |-- gda.css
        |       |-- irb.css
        |       |-- irb.js
        |       |-- jquery.js
        |       |-- md5.js
        |       |-- mouseapp_2.js
        |       `-- mouseirb_2.js
        `-- man
            `-- man1
                |-- gda-sql-6.0.1
                `-- gda-sql.1 -> gda-sql-6.0.1

This component should be made dependent on the runtime component.

## Database providers

Each database provider is composed of a shared library (loaded at runtime) and some configuration files, which are prefixed with the provider name. Also note that each provider comes with a PKG-CONFIG .pc file which allows one to check if a provider is installed (it does not, like most of the .pc files, define any CFLAGS or LIBS), and it's wise to include them in each provider's component.

### 'Generic' provider

Most of the providers are 'generic' as they have the same files structure, here for example the PostgreSQL provider's file are:

    .
    |-- lib
    |   |-- libgda-6.0
    |   |   `-- providers
    |   |       `-- libgda-postgres.so
    |   `-- pkgconfig
    |       `-- libgda-postgres-6.0.pc
     `-- share
        `-- libgda-6.0
            |-- postgres_specs_add_column.xml
            |-- postgres_specs_create_db.xml
            |-- postgres_specs_create_index.xml
            |-- postgres_specs_create_table.xml
            |-- postgres_specs_create_view.xml
            |-- postgres_specs_drop_column.xml
            |-- postgres_specs_drop_db.xml
            |-- postgres_specs_drop_index.xml
            |-- postgres_specs_drop_table.xml
            |-- postgres_specs_drop_view.xml
            |-- postgres_specs_dsn.xml
            `-- postgres_specs_rename_table.xml

This kind of component should be made dependent on the database's library which is used, such as LibPQ for PostgreSQL, and also on &LIBGDA;'s runtime component.

### The SQLite provider

The SQLite provider uses the same files layout as the 'generic' provider, but there is no need to add a dependency on SQLite itself.

### The JDBC provider

The JDBC provider allows one to access database through its JDBC driver, using the Java Native Interface (JNI), and a Java virtual machine runtime. The files to include in this component are:

    .
    |-- lib
    |   |-- libgda-6.0
    |   |   `-- providers
    |   |       |-- gdaprovider-6.0.jar
    |   |       `-- libgda-jdbc.so
    |   `-- pkgconfig
    |       `-- libgda-jdbc-6.0.pc
     `-- share
        `-- libgda-6.0
            |-- jdbc_specs_create_table.xml
            `-- jdbc_specs_dsn.xml

This component should be made dependent on the Java virtual machine.

## Development files

The development files are the include files needed to compile C programs, the PKG-CONFIG .pc files and the static libraries.

    |-- include
    |   `-- libgda-6.0
    |     [... except the libgdaui/ directory ...]
    `-- lib
        |-- libgda-6.0
        |-- libgda-6.0.a
        |-- libgda-6.0.la
        |-- libgda-report-6.0.a
        |-- libgda-report-6.0.la
        |-- libgda-xslt-6.0.a
        |-- libgda-xslt-6.0.la
        `-- pkgconfig
            |-- libgda-6.0.pc
            |-- libgda-report-6.0.pc
            `-- libgda-xslt-6.0.pc

## Documentation

The documentation is located in the `share/gtk-doc/html` directory.

## Localization

The translation files are located in the `share/locale` directory.