mud-builder

Documentation

Package format

The package file describes where to get the application's source and how to package it for Maemo. It is a simple XML file in in the packages directory.

The name of the file should correspond to the Debian guidelines: all lower case, with dashes, underscores, dots and numbers also permissible. The smallest possible file is:

<package>
    <fetch type="debian"/>
</package>

This will download the source of the Debian package named the same as the MUD package from the default (currently "etch") and build it, without overriding any of the defaults. Obviously, however, this is not suitable for all packages and so more flexibility is possible.

The complete file is divided into three sections, only one of which is required, and has the following outline:

<package>
    <fetch type="…">
        …
    </fetch>
    <build>
      <result>single</result>
      <copyright>gpl</copyright>
      <include>examples,man</include>
      …
    </build>
    <deb>
        <icon>http://www.example.com/logo.png</icon>
        …
    </deb>
</package>

As can be seen, the three sections are:

fetch
This section selects one of several plugins which instructs mud-builder how to download the package. Plugin-specific options, such as the location of the source, are specified here. This element is mandatory.
build
Information on how to build the package; including its licence, whether single, multiple or library packages should be produced, whether any of the documentation stripped out by default should be included, configure flags and so on.

deb
Information on the output package; such as description, icon, maintainer and son on. Many settings in this section will be automatically determined if possible.

Fetch section

<fetch type="plugin">
    …
</fetch>

The content of this tag is entirely dependent on the plugin chosen:

debian
The source and its build-dependencies are fetched from the Debian distribution. There are literally thousands of packages in Debian, containing all the necessary metadata for a Maemo-compatible package. As Maemo is different to Debian, however, these builds can often become overcomplex, and it may be worth considering using the upstream source directly.
tarball
A URL, or filesystem path, is given to a compressed archive (.tar.gz, .tgz, .tar.bz2 and .zip are supported file extensions). This is downloaded and unpacked in the build directory.
command
A command is given which is executed using /bin/sh. This command should unpack the source in an appropriate subdirectory. This will be most used for CVS or Subversion exports.

Debian

The Debian fetcher is designed to fetch the source of one of the thousands of packages packaged and supported by the Debian distribution. It supports the following child elements of the fetch node:

TBC...

Tarball

TBC...

Command

The command fetcher is very basic: it relies on a given command - or sequence of commands - to provide the source in the appropriate build directory. It supports the following child element of the fetch node only:

Build section

<build>
    <result>(single|multiple|library)</result>
    <copyright>(gpl|lgpl|artistic|bsd)</copyright>
    <include>(changelogs|docs|examples|info|man)*</include>
    <configure-append>…</configure-append>
    <env>
        <SOMEOPT>true</SOMEOPT>
        <PATH>/usr/sbin:$PATH</PATH>
    </env>
</build>

Out of all of the sections, this is the "most" optional: for many packages all of the information here will be determined automatically, from the package licence, to whether a single, multiple or library-style packages should be produced. However, if the auto-detection fails, or there is a need to override the defaults, that power is available.

TBC...

Deb section

<deb prefix-section="(0|1)">
    <icon>URL</icon>
    <version>…</version>
    <description>
        short description\nlong description
    </description>
    <section>section name</section>
    <library>library package name</library>
    <libdev>library development package name</libdev>
    <maintainer>Some Name <email@address></maintainer>
    …
</deb>

Most of the child elements of the deb node correspond to fields within the debian/control, allowing you to change their value without patching the file.

The capitalised tag name is used as the field name, and the value is used as the content. Multi-line entries can be entered, such as the description, by entering \n within the text.

The description should contain two parts: the synopsis at around 60 characters, and the extended description over several lines following it. The section will be automatically prefixed with user/, if not already by mud-builder unless the prefix-section attribute is set to 0, or a section is specified explicitly. Packages which end-users can install directly (rather than libraries) are prefixed like this, according to the Maemo packaging guide. In addition, certain sections are recommended, if possible:

Other sections should have the second word capitalised, such as user/Fonts A selection of third-party sections is available in the Maemo.org wiki.

There are two tags designed for use when creating library packages: library and libdev. These can be used to specify the package names used for the library package itself and the development package. library is the name to be used for the library package: it defaults to the name of the package file but is useful when the name has to be modified in some way (for example to append the major id number). libdev is similarly used to rename the development package: it defaults to the name of the package file followed by -dev.

The maintainer tag should be used to specify the name and email address of the maintainer of the maemo package (which is not likely to be the maintainer of the upstream package).

[XHTML 1.0 Valid] © Andrew Flegg 2007. Released under the Artistic Licence.