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)" optify="(0|1)">
    <icon>file or URL</icon>
    <version>…</version>
    <description>
        short description\nlong description
    </description>
    <description file="filename"/>
    <section>section name</section>
    <library>library package name</library>
    <libdev>library development package name</libdev>
    <maintainer>Some Name <email@address></maintainer>
    <upgrade-description>
        short description for upgrade\nlong description for upgrade
    </upgrade-description>
    <upgrade-description file="filename"/>
    <display-name>Application name</display-name>
    <bugtracker>URL</bugtracker>
    …
</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. It can either be specified as text in the value of the tag or a filename can be specified as an attribute.

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.

The icon can either be used to specify a file in the package source directory (note the file must be available before the package is built) or a URL and it defaults to icon/package. If a URL is specified it is copied to the icon/package file. If the icon file exists, it is resized (using the convert program) to 26x26 and is specified as the Application Manager icon for the package (using the XB-Maemo-Icon-26 field in the control file). Note: this requires that the uuencode program is installed -- this can be found in the sharutils package in the Maemo SDK.

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).

The upgrade-description tag is used to specify different description text to be displayed by the Application Manager when the package is being upgraded (the normal description text is used for the first installation of a package). The value should be specified in the same way as for the description tag. This corresponds to the XB-Maemo-Upgrade-Description control file field.

The display-name tag is used to specify the name the Application Manager should display to the user instead of the package name. This corresponds to the XB-Maemo-Display-Name control file field.

The bugtracker tag is used to specify the URL of where bugs may be logged. This currently corresponds to the Xsbc-Bugtracker control file field.

The optify attribute tells MUD to add the maemo-optify script to debian/rules and to add maemo-optify as a build dependency. This is a process used in Maemo Fremantle to move large files to the /opt partition to save space on the user's root partition.

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