Editing Documentation/Maemo 5 Developer Guide/Packaging, Deploying and Distributing

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 136: Line 136:
== Package Building ==
== Package Building ==
-
 
This section explains how to build software packages that the end user can install onto the Internet Tablet using the Application Manager tool in the device.
This section explains how to build software packages that the end user can install onto the Internet Tablet using the Application Manager tool in the device.
===Prerequisites ===
===Prerequisites ===
 +
This section assumes familiarity with the process of creating a .deb package. For more information on the basics of Debian packaging, see section [[#Creating_Debian_Packages|Creating Debian Packages]].
-
This section assumes familiarity with the process of creating a .deb package. For more information on the basics of Debian packaging, see section [[#Creating Debian Packages|Creating Debian Packages]].
+
Use the "hello-world-app" example package to get started. To install it with apt-get, use the following command:
-
 
+
-
Use the "hello-world-app" example package to get started. To install it with <code>apt-get</code>, use the following command:
+
  apt-get source hello-world-app
  apt-get source hello-world-app
===Application Manager ===
===Application Manager ===
-
 
The Application Manager (AM) is an end user friendly graphical front-end to the standard Debian package management infrastructure. When using the Application Manager, apt-get tools are not mandatory for the end user.
The Application Manager (AM) is an end user friendly graphical front-end to the standard Debian package management infrastructure. When using the Application Manager, apt-get tools are not mandatory for the end user.
-
The Application Manager uses the same backend tools as Synaptic, Aptitude, or <code>apt-get</code> (namely <code>libapt-pkg</code>) in the standard way, without imposing any constraints; for example, packages are installed as root, and can touch the whole system.
+
The Application Manager uses the same backend tools as Synaptic, Aptitude, or apt-get (namely libapt-pkg) in the standard way, without imposing any constraints; for example, packages are installed as root, and can touch the whole system.
The usual way to distribute a package is to put it into a repository and make it accessible to apt.
The usual way to distribute a package is to put it into a repository and make it accessible to apt.
-
Either Application Manager or the apt-get tool can be used freely. Changes made to the system via <code>apt-get</code> or dpkg are picked up by the Application Manager, and vice versa.
+
Either Application Manager or the apt-get tool can be used freely. Changes made to the system via apt-get or dpkg are picked up by the Application Manager, and vice versa.
=== Packaging ===
=== Packaging ===
-
 
Packages made for the Application Manager should follow a few extra rules, if they want to integrate nicely to the device. These rules are related to:
Packages made for the Application Manager should follow a few extra rules, if they want to integrate nicely to the device. These rules are related to:
Line 172: Line 168:
=== Text Formatting ===
=== Text Formatting ===
-
 
All strings coming from the control information of a package are interpreted in UTF-8 when they are shown in the User Interface. If a string is not valid UTF-8, all bytes above 127 are replaced with '?' before display. If your control file is not UTF-8, you will fail a quality assurance test.
All strings coming from the control information of a package are interpreted in UTF-8 when they are shown in the User Interface. If a string is not valid UTF-8, all bytes above 127 are replaced with '?' before display. If your control file is not UTF-8, you will fail a quality assurance test.
===Dependencies ===
===Dependencies ===
-
 
This field should now contain all the dependencies for package, such as <code>${shlibs:Depends}</code>.
This field should now contain all the dependencies for package, such as <code>${shlibs:Depends}</code>.
===Sections ===
===Sections ===
-
 
The Application Manager (AM) only displays packages in certain sections to the user in order to hide the hundreds of system packages making up the operating system. The AM is not designed to allow the user to manage the entire system at this point, only a set of third-party applications.
The Application Manager (AM) only displays packages in certain sections to the user in order to hide the hundreds of system packages making up the operating system. The AM is not designed to allow the user to manage the entire system at this point, only a set of third-party applications.
-
The AM only shows packages in the "user" section. The <code>Section:</code> field in the control file should be in the following format:
+
The AM only shows packages in the "user" section. The "Section:" field in the control file should be in the following format:
-
  Section: user/<SUBSECTION>
+
  Section: user/&lt;SUBSECTION&gt;
where SUBSECTION is one of the sections below:
where SUBSECTION is one of the sections below:
Line 245: Line 238:
|}
|}
-
Thus, if the package is wanted in the Office subsection, the field:
+
 
-
Section: user/office
+
Thus, if the package is wanted in the Office subsection, the field Section: user/office should be included in the control information.
-
should be included in the control information.
+
===Icons ===
===Icons ===
 +
The Application Manager may display an icon next to a package name. Icons are included in the control information of a package as a base64 encoded field named "Maemo-Icon-26".
-
The Application Manager may display an icon next to a package name. Icons are included in the control information of a package as a base64 encoded field named <code>Maemo-Icon-26</code>.
+
The image format of the icon can be anything understood by GdkPixbufLoader, but most commonly the PNG format is used.
-
 
+
-
The image format of the icon can be anything understood by <code>GdkPixbufLoader</code>, but most commonly the PNG format is used.
+
The image should be 48x48 pixels with a transparent background.
The image should be 48x48 pixels with a transparent background.
Line 262: Line 253:
===Installation and Removal Policy ===
===Installation and Removal Policy ===
-
 
The Application Manager has its own rules for automatically installing and removing packages, in addition to the ones specified by the user. These rules are tuned to eliminate most surprises for simple package management operations, but this makes them less useable for complicated things like "apt-get dist-upgrade". Take these rules into account when designing the package conflicts.
The Application Manager has its own rules for automatically installing and removing packages, in addition to the ones specified by the user. These rules are tuned to eliminate most surprises for simple package management operations, but this makes them less useable for complicated things like "apt-get dist-upgrade". Take these rules into account when designing the package conflicts.
Line 274: Line 264:
=== Feedback from Maintainer Scripts ===
=== Feedback from Maintainer Scripts ===
-
 
+
When the Application Manager runs the maintainer scripts, they have no controlling terminal; their standard input is connected to /dev/null. The DISPLAY variable is set correctly.
-
When the Application Manager runs the maintainer scripts, they have no controlling terminal; their standard input is connected to <code>/dev/null</code>. The <code>DISPLAY</code> variable is set correctly.
+
The Application Manager collects a transcript of the installation/uninstallation process, including the output of maintainer scripts. This output is hidden in the application log which users are not meant to view and understand.
The Application Manager collects a transcript of the installation/uninstallation process, including the output of maintainer scripts. This output is hidden in the application log which users are not meant to view and understand.
Line 282: Line 271:
=== Removing or Upgrading Running Applications ===
=== Removing or Upgrading Running Applications ===
-
 
The Application Manager can run a script provided by the package, before removing or upgrading it. That script can tell the Application Manager to cancel the operation.
The Application Manager can run a script provided by the package, before removing or upgrading it. That script can tell the Application Manager to cancel the operation.
-
This feature is often used to display a warning if the user tries to remove or upgrade an application that is currently running. To perform this test, use the <code>maemo-application-running</code> utility.
+
This feature is often used to display a warning if the user tries to remove or upgrade an application that is currently running. To perform this test, use the 'maemo-application-running' utility.
-
When uninstalling or upgrading a package named <code>PACKAGE</code>, the Application Manager runs the program named <code>/var/lib/hildon-application-manager/info/PACKAGE.checkrm</code>, if it exists. If this program exists with code 111, the operation is canceled. In all other cases, including when the program terminates with a signal, the operation is carried out.
+
When uninstalling or upgrading a package named PACKAGE, the Application Manager runs the program named /var/lib/hildon-application-manager/info/PACKAGE.checkrm, if it exists. If this program exists with code 111, the operation is canceled. In all other cases, including when the program terminates with a signal, the operation is carried out.
Two arguments are available for the *.checkrm program. To remove the package, use the following:
Two arguments are available for the *.checkrm program. To remove the package, use the following:
Line 293: Line 281:
  foobarexampleonly.checkrm remove
  foobarexampleonly.checkrm remove
-
To upgrade, use the following, replacing <code>VERSION</code> with the version information:
+
To upgrade, use the following, replacing VERSION with the version information:
  foobarexampleonly.checkrm upgrade VERSION
  foobarexampleonly.checkrm upgrade VERSION
Line 301: Line 289:
====maemo-application-running====
====maemo-application-running====
-
maemo-application-running -x executable-file
+
  maemo-application-running -x executable-file
-
maemo-application-running -d app.desktop
+
  maemo-application-running -d app.desktop
-
This utility is provided by the package <code>hildon-application-manager-dbg</code>. It checks whether the application specified on the command line is currently running. If the application is running, it exits with code 0. If it is not running, it exits with code 1. If an error occurs, it exits with code 2.
+
This utility is provided by the package hildon-application-manager-dbg. It checks whether the application specified on the command line is currently running. If the application is running, it exits with code 0. If it is not running, it exits with code 1. If an error occurs, it exits with code 2.
-
When using the -x option, the utility checks whether any process is currently executing that file, by looking into <code>/proc/PID/exe</code>.
+
When using the -x option, the utility checks whether any process is currently executing that file, by looking into /proc/PID/exe.
-
When using the -d option, the utility uses the given .desktop file to find the service name of the application und queries D-Bus whether the service is currently registered. If the .desktop file contains no service name, the utility uses the executable file like with the -x option.
+
When using the -d option, the utility uses the given .desktop file to find the service name of the application und queries D-BUS whether the service is currently registered. If the .desktop file contains no service name, the utility uses the executable file like with the -x option.
====maemo-confirm-text====
====maemo-confirm-text====
-
maemo-confirm-text [title] FILE
+
  maemo-confirm-text [title] FILE
This utility is provided by the package hildon-application-manager. It displays the contents of FILE in a dialog with "Ok" and "Cancel" buttons. The default title of the dialog is "License agreement".
This utility is provided by the package hildon-application-manager. It displays the contents of FILE in a dialog with "Ok" and "Cancel" buttons. The default title of the dialog is "License agreement".
Line 318: Line 306:
If the user clicks "OK", the utility exits with code 0; if the user clicks "Cancel", it exits with code 1; and if an error occurs, it exits with code 2.
If the user clicks "OK", the utility exits with code 0; if the user clicks "Cancel", it exits with code 1; and if an error occurs, it exits with code 2.
-
If a license agreement is not shown in the <code>postinst</code> script, ensure that even if the user does not agree to the licence terms, the <code>postinst</code> script does not fail. Instead, configure the application to ask the user to agree to the license agreement again at application startup and refuse to run if the user does not agree.
+
If a license agreement is not shown in the postinst script, ensure that even if the user does not agree to the licence terms, the postinst script does not fail. Instead, configure the application to ask the user to agree to the license agreement again at application startup and refuse to run if the user does not agree.
 +
 
=== Controlling Installation ===
=== Controlling Installation ===
-
Application Installer (old name for Application Manager) had a beta stage Single Click Install feature. Application Manager is backwards compatible with it and the old .install files still work, but some new features are available.
+
Application Installer (old name for Application Manager)had a beta stage Single Click Install feature. Application Manager is backwards compatible with it and the old .install files still work, but some new features are available.
-
The Application Manager offers three kinds of functionality with .install files: adding catalogues, installing packages from remote catalogues and installing packages from a memory card. The .install file follows the <code>GKeyFile</code> format as described in the [http://library.gnome.org/devel/glib/unstable/glib-Key-value-file-parser.html#glib-Key-value-file-parser.description GKeyFile reference documentation]. A <code>GKeyFile</code> consists of a number of groups, and each group contains key/value pairs. Each of the previously mentioned three functionalities is initiated by a specifically named group in the .install file.
+
The Application Manager offers three kinds of functionality with .install files: adding catalogues, installing packages from remote catalogues and installing packages from a memory card. The .install file follows the GKeyFile format as described by GLib. A GKeyFile consists of a number of groups, and each group contains key/value pairs. Each of the previously mentioned three functionalities is initiated by a specifically named group in the .install file.
==== Adding Catalogues ====
==== Adding Catalogues ====
-
 
Adding catalogues is performed with the "catalogues" group. This group has one similarly named mandatory key, "catalogues". The "catalogues" key is a list of strings referring to the catalogue groups that describe the catalogues to be added. Each catalogue is considered in turn, and the user is asked whether to add it or not. If it is to be added, and if a matching catalogue is already configured in the Application Manager, the matching catalogue is removed first. If the user declines to add the catalogue, the next catalogue is considered. After asking confirmation for each catalogue, the device asks the user whether to "Refresh the list of applications". Here is an example:
Adding catalogues is performed with the "catalogues" group. This group has one similarly named mandatory key, "catalogues". The "catalogues" key is a list of strings referring to the catalogue groups that describe the catalogues to be added. Each catalogue is considered in turn, and the user is asked whether to add it or not. If it is to be added, and if a matching catalogue is already configured in the Application Manager, the matching catalogue is removed first. If the user declines to add the catalogue, the next catalogue is considered. After asking confirmation for each catalogue, the device asks the user whether to "Refresh the list of applications". Here is an example:
-
<pre>
+
[catalogues]
-
[catalogues]
+
catalogues = extras; sdk
-
catalogues = extras; sdk
+
-
 
+
[extras]
-
[extras]
+
name = maemo Extras catalogue
-
name = maemo Extras catalogue
+
uri = http://repository.maemo.org/extras
-
uri = http://repository.maemo.org/extras
+
components = free non-free
-
components = free non-free
+
-
 
+
[sdk]
-
[sdk]
+
name = maemo SDK catalogue
-
name = maemo SDK catalogue
+
uri = http://repository.maemo.org/
-
uri = http://repository.maemo.org/
+
components = free non-free
-
components = free non-free
+
-
</pre>
+
A Group describing a catalogue can contain the following keys:
A Group describing a catalogue can contain the following keys:
-
* <code>name</code>: The display name of the catalogue as displayed to the user in the "Tool > Application catalogues" dialog. Follow the <code>GKeyFile</code> conventions to localize this key. If this key is omitted, the catalogue contains an empty name.
+
* name: The display name of the catalogue as displayed to the user in the "Tool &gt; Application catalogues" dialog. Follow the GKeyFile conventions to localize this key. If this key is omitted, the catalogue contains an empty name.
-
* <code>uri</code>: The URI part of the deb line that is added to sources.list for this catalogue. This key is required for all catalogues except those used with the "card_catalogues" key.
+
* uri: The URI part of the deb line that is added to sources.list for this catalogue. This key is required for all catalogues except those used with the "card_catalogues" key.
-
* <code>file_uri</code>: When using file_uri instead of uri, the URI part of the deb line uses the "file://" method and the file_uri gives the actual pathname, relative to the location of the .install file. This key is required for all catalogues that are used with the "card_catalogues" key.
+
* file_uri: When using file_uri instead of uri, the URI part of the deb line uses the "file://" method and the file_uri gives the actual pathname, relative to the location of the .install file. This key is required for all catalogues that are used with the "card_catalogues" key.
-
* <code>dist</code>: The distribution of the deb line to be added to sources.list for this catalogue. If it is omitted, the catalogue defaults to the distribution corresponding to the IT OS release on the device. The Application Manager remembers to select the distribution automatically. For example, if a backup is made, containing a catalogue with automatic distribution selection, and restored on a different IT OS release, the distribution for the new version is used automatically.
+
* dist: The distribution of the deb line to be added to sources.list for this catalogue. If it is omitted, the catalogue defaults to the distribution corresponding to the IT OS release on the device. The Application Manager remembers to select the distribution automatically. For example, if a backup is made, containing a catalogue with automatic distribution selection, and restored on a different IT OS release, the distribution for the new version is used automatically.
-
* <code>components</code>: The components part of the deb line to be added to sources.list for this catalogue. If it is omitted, the components part has no content.
+
* components: The components part of the deb line to be added to sources.list for this catalogue. If it is omitted, the components part has no content.
-
* <code>filter_dist</code>: Ignored if the distribution corresponding to the IT OS release on the device does not match.
+
* filter_dist: Ignored if the distribution corresponding to the IT OS release on the device does not match.
-
When catalogues are compared, they are considered equal if their <code>uri</code>, <code>dist</code> and <code>components</code> fields are equal.
+
When catalogues are compared, they are considered equal if their uri, dist and components fields are equal.
==== Installing Packages ====
==== Installing Packages ====
 +
In order to install packages with an .install file, the file must contain an "install" group. The group has one mandatory key, "package", and one optional key, "catalogues". The "catalogues" key is handled as follows: each catalogue is considered in turn. The user is asked for confirmation if a catalogue that is not already configured is encountered. Alternatively, if a catalogue is already present but disabled, the user is asked to confirm enabling the catalogue. If the user does not confirm, the processing of the .install file stops and any changes made in the configured catalogues are reverted. After the list of catalogues has been processed, the list of applications is refreshed automatically, and the package is offered to the user for installing. Here is an example:
-
In order to install packages with an .install file, the file must contain an "install" group. The group has one mandatory key, <code>package</code>, and one optional key, <code>catalogues</code>. The <code>catalogues</code> key is handled as follows: each catalogue is considered in turn. The user is asked for confirmation if a catalogue that is not already configured is encountered. Alternatively, if a catalogue is already present but disabled, the user is asked to confirm enabling the catalogue. If the user does not confirm, the processing of the .install file stops and any changes made in the configured catalogues are reverted. After the list of catalogues has been processed, the list of applications is refreshed automatically, and the package is offered to the user for installing. Here is an example:
+
[install]
 +
catalogues = foobar
 +
package = maemofoo
 +
 +
[foobar]
 +
name = Foobar Catalogue
 +
name[en_GB] = Foobar Catalogue
 +
name[de_DE] = Foobar Katalog
 +
uri = http://foobar.com/repository
 +
components = main
-
<pre>
 
-
[install]
 
-
catalogues = foobar
 
-
package = maemofoo
 
-
 
-
[foobar]
 
-
name = Foobar Catalogue
 
-
name[en_GB] = Foobar Catalogue
 
-
name[de_DE] = Foobar Katalog
 
-
uri = http://foobar.com/repository
 
-
components = main
 
-
</pre>
 
==== Installing Packages from Memory Card ====
==== Installing Packages from Memory Card ====
 +
Installing packages from a memory card is governed by the "card_install" group. It has two mandatory keys, "packages" and "card_catalogues", and one optional key, "permanent_catalogues". The "packages" key lists the names of packages that can be installed from the memory card, using the "card_catalogues". The package is installed in a temporary environment where the usual catalogues are not available. Only the catalogues listed by the "card_catalogues" key are configured. All of these catalogues must use "file_uri" instead of "uri".
-
Installing packages from a memory card is governed by the <code>card_install</code> group. It has two mandatory keys, <code>packages</code> and <code>card_catalogues</code>, and one optional key, <code>permanent_catalogues</code>. The <code>packages</code> key lists the names of packages that can be installed from the memory card, using the <code>card_catalogues</code>. The package is installed in a temporary environment where the usual catalogues are not available. Only the catalogues listed by the <code>card_catalogues</code> key are configured. All of these catalogues must use <code>file_uri</code> instead of <code>uri</code>.
+
The user gets to select the packages from a list, after which the installation proceeds one package after another. In case the installation of a package fails, an error note is displayed, and the processing stops. After the installation is complete, the optional group "permanent_catalogues" is processed ???similarly to adding a catalogue as described above.
-
The user gets to select the packages from a list, after which the installation proceeds one package after another. In case the installation of a package fails, an error note is displayed, and the processing stops. After the installation is complete, the optional group <code>permanent_catalogues</code> is processed ???similarly to adding a catalogue as described above.
+
Whenever a memory card is inserted that contains a file called .auto.install, that file is processed by the Application Manager. Usually, the .auto.install file contains a "card_install" group, of course. For example:
-
 
+
-
Whenever a memory card is inserted that contains a file called .auto.install, that file is processed by the Application Manager. Usually, the .auto.install file contains a <code>card_install</code> group, of course. For example:
+
  $ mkdir .repo
  $ mkdir .repo
  $ cp somewhere/*.deb .repo/
  $ cp somewhere/*.deb .repo/
-
  $ (cd .repo && apt-ftparchive packages . >Packages)
+
  $ (cd .repo &amp;&amp; apt-ftparchive packages . &gt;Packages)
A matching .install file could look like the following:
A matching .install file could look like the following:
-
<pre>
+
[card_install]
-
[card_install]
+
card_catalogues = repo
-
card_catalogues = repo
+
packages = app-1; app-2
-
packages = app-1; app-2
+
-
 
+
[repo]
-
[repo]
+
file_uri = .repo
-
file_uri = .repo
+
dist = ./
-
dist = ./
+
-
</pre>
+
The .repo and the .install files typically go to the root of the memory card. To make the memory card auto-installing, make a copy of the .install file and name it .auto.install.
The .repo and the .install files typically go to the root of the memory card. To make the memory card auto-installing, make a copy of the .install file and name it .auto.install.
=== Signing Package ===
=== Signing Package ===
-
 
In order to sign packages, use debsign tool inside Scratchbox. For more information on using debsign, see the [http://www.penguin-soft.com/penguin/man/1/debsign.html debsign manual page].
In order to sign packages, use debsign tool inside Scratchbox. For more information on using debsign, see the [http://www.penguin-soft.com/penguin/man/1/debsign.html debsign manual page].

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page: