<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://maemo.octonezd.me/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=87.158.23.94</id>
	<title>Maemo Wiki Mirror - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://maemo.octonezd.me/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=87.158.23.94"/>
	<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php/Special:Contributions/87.158.23.94"/>
	<updated>2026-04-22T10:38:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Packaging_a_Qt_application&amp;diff=31585</id>
		<title>Packaging a Qt application</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=Packaging_a_Qt_application&amp;diff=31585"/>
		<updated>2008-10-29T10:54:26Z</updated>

		<summary type="html">&lt;p&gt;87.158.23.94: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Packaging a Qt Application =&lt;br /&gt;
== Looking for a debian package of your Application ==&lt;br /&gt;
If you want to port  a popular Qt application probably it is already packaged for debian.&lt;br /&gt;
You can try to get the package source in a couple of different ways:&lt;br /&gt;
* Adding a debian src repository in your /etc/apt/source.list file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$echo “deb http://ftp.it.debian.org/debian/ unstable main contrib non-free” &amp;gt;&amp;gt; /etc/apt/source.list&lt;br /&gt;
$apt-get update&lt;br /&gt;
$apt-cache search app_name&lt;br /&gt;
$apt-get source app_name&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Checking http://packages.debian.org, downloading the following files and running &#039;&#039;dpkg-source -x app_name.dsc&#039;&#039; to decompress the upstream source and to apply the changes available in the diff.gz file.&lt;br /&gt;
** upstream source file (.tar.gz)&lt;br /&gt;
** package changes     (.diff.gz)&lt;br /&gt;
** meta-data information file (.dsc)&lt;br /&gt;
&lt;br /&gt;
== Creating a Debian package for a new Qt Application ==&lt;br /&gt;
If your application has been already packaged, you can jump this section.&lt;br /&gt;
If your application is quite younger and you need to package it by yourself,&lt;br /&gt;
in order to creating a new package, you need to:&lt;br /&gt;
* Rename the upstream source directory in Package-Version (eg: myapp-0.1)&lt;br /&gt;
* Create “src” directory in Package-Version/&lt;br /&gt;
* Copy all the files in the src/&lt;br /&gt;
* Rename src/appname.pro in src/src.pro&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$mv myapp myapp-0.1&lt;br /&gt;
$cd myapp-0.1&lt;br /&gt;
$mkdir src&lt;br /&gt;
$cp * src&lt;br /&gt;
$mv src/appname.pro src/src.pro&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Create a myapp-0.1/myapp.pro file like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
QMAKEVERSION = $$[QMAKE_VERSION]&lt;br /&gt;
ISQT4 = $$find(QMAKEVERSION, ^[2-9])&lt;br /&gt;
isEmpty( ISQT4 ) {&lt;br /&gt;
error(&amp;quot;Use the qmake include with Qt4.4 or greater, on Debian that is qmake-qt4&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
TEMPLATE = subdirs&lt;br /&gt;
SUBDIRS  = src&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Run dh_make to debianize the source archive, it creates:&lt;br /&gt;
**An archive with the unchanged upstream source (orig.tar.gz)&lt;br /&gt;
**Some basic files in the debian directory&lt;br /&gt;
**Some example files (*.EX *.ex)&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dh_make --createorig --single -e maintainer@email.org -c gpl&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Having a look inside the debian/ dir ==&lt;br /&gt;
At this point the directory my-app contains&lt;br /&gt;
* the source directory ( src/ )&lt;br /&gt;
* the debian directory (debian/)&lt;br /&gt;
&lt;br /&gt;
Inside the debian dir we have the files need for the creation of the debian package&lt;br /&gt;
* Changelog  - Application&#039;s change log&lt;br /&gt;
* Compat  - Debian helper compatibly version&lt;br /&gt;
* Control - Describes the packages to be made &lt;br /&gt;
* Copyright - Copyright text&lt;br /&gt;
* Rules - A makefile containing the rules to build all kinds of packages &lt;br /&gt;
&lt;br /&gt;
== Maemo Packaging Policy ==&lt;br /&gt;
Maemo packages follow the Debian Policy, but there are some items where Maemo:&lt;br /&gt;
* Is more strict (it is an embedded distribution)&lt;br /&gt;
* Is more relaxed&lt;br /&gt;
**Only a target device (Nokia Internet Tablet)&lt;br /&gt;
**Only a specified UI (Hildon)&lt;br /&gt;
**Only one user.&lt;br /&gt;
*Differs from Debian because Maemo has different:&lt;br /&gt;
**Objectives&lt;br /&gt;
**Maintainers&lt;br /&gt;
**Infrastructure&lt;br /&gt;
&lt;br /&gt;
== Editing the rules file ==&lt;br /&gt;
The rules file generated by dh_make will be modified in order to look like this one.&lt;br /&gt;
We are using qmake, so we haven&#039;t a configure file to run. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/usr/bin/make -f&lt;br /&gt;
APPNAME := my_app_name&lt;br /&gt;
builddir:&lt;br /&gt;
        mkdir -p builddir&lt;br /&gt;
&lt;br /&gt;
builddir/Makefile: builddir&lt;br /&gt;
        cd builddir &amp;amp;&amp;amp; qmake-qt4 PREFIX=/usr ../$(APPNAME).pro&lt;br /&gt;
&lt;br /&gt;
build: build-stamp&lt;br /&gt;
&lt;br /&gt;
build-stamp: builddir/Makefile&lt;br /&gt;
        dh_testdir&lt;br /&gt;
        # Add here commands to compile the package.&lt;br /&gt;
        cd builddir &amp;amp;&amp;amp; $(MAKE)&lt;br /&gt;
        touch $@&lt;br /&gt;
&lt;br /&gt;
clean:&lt;br /&gt;
        dh_testdir&lt;br /&gt;
        dh_testroot&lt;br /&gt;
        rm -f build-stamp&lt;br /&gt;
        # Add here commands to clean up after the build process.&lt;br /&gt;
        rm -rf builddir&lt;br /&gt;
        dh_clean&lt;br /&gt;
install: build&lt;br /&gt;
        dh_testdir&lt;br /&gt;
        dh_testroot&lt;br /&gt;
        dh_clean -k&lt;br /&gt;
        dh_installdirs&lt;br /&gt;
&lt;br /&gt;
        # Add here commands to install the package into debian/your_appname&lt;br /&gt;
        cd builddir &amp;amp;&amp;amp; $(MAKE) INSTALL_ROOT=$(CURDIR)/debian/$(APPNAME) install&lt;br /&gt;
# Build architecture-independent files here.&lt;br /&gt;
binary-indep: build install&lt;br /&gt;
# We have nothing to do by default.&lt;br /&gt;
&lt;br /&gt;
# Build architecture-dependent files here.&lt;br /&gt;
binary-arch: build install&lt;br /&gt;
        dh_testdir&lt;br /&gt;
        dh_testroot&lt;br /&gt;
        dh_installdocs&lt;br /&gt;
        dh_installexamples&lt;br /&gt;
        dh_installman&lt;br /&gt;
        dh_link&lt;br /&gt;
        dh_strip&lt;br /&gt;
        dh_compress&lt;br /&gt;
        dh_fixperms&lt;br /&gt;
        dh_installdeb&lt;br /&gt;
        dh_shlibdeps&lt;br /&gt;
        dh_gencontrol&lt;br /&gt;
        dh_md5sums&lt;br /&gt;
        dh_builddeb&lt;br /&gt;
&lt;br /&gt;
binary: binary-indep binary-arch&lt;br /&gt;
.PHONY: build clean binary-indep binary-arch binary install configure&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Editing the Control file ==&lt;br /&gt;
Basically it specifies for each package (source or binary) a name, some dependencies, a description etc...&lt;br /&gt;
For a Maemo package these fields are very important:&lt;br /&gt;
* Section: Only the packages in the user segment are showed by App Installer.&lt;br /&gt;
* Maintainer: This field MUST be changed if the upstream package is modified&lt;br /&gt;
* XB-Maemo-Icon26: It contains the PNG icon encoded in base64 visible in the Application Installer&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Source: my-application&lt;br /&gt;
Section: user/valid_subsection&lt;br /&gt;
Priority: optional &lt;br /&gt;
Maintainer: name surname &amp;lt;xxxxxxx.xxxxxx@maemo.org&amp;gt;&lt;br /&gt;
XSBC-Original-Maintainer: name surname &amp;lt;yyyyy.yyyyy@debian.org&amp;gt;&lt;br /&gt;
Build-Depends: debhelper (&amp;gt;= 5), libqt4-dev, OTHERS_BUILD DEPENDECIES &lt;br /&gt;
Standards-Version: 3.7.3&lt;br /&gt;
&lt;br /&gt;
Package: my-application &lt;br /&gt;
Architecture: any&lt;br /&gt;
Depends: ${shlibs:Depends}, ${misc:Depends}&lt;br /&gt;
Description: A simple test application&lt;br /&gt;
 A very simple application with a short description.&lt;br /&gt;
 Which spans multiple lines actually. &lt;br /&gt;
XB-Maemo-Icon-26:&lt;br /&gt;
 iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAYAAACpSkzOAAAABmJLR0QA/wD/AP+g&lt;br /&gt;
 vaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1gURDQoYya0JlwAAAU9J &lt;br /&gt;
 REFUSMftlL1KA0EUhb/NZl/ggnHQxsJUxt5CUucVJCCkDfgyKdIGG5/A0s5HEBtJ&lt;br /&gt;
 EdDAQGBgmw0YJmMzgXXYza5CtNkDW9zZw5z7c+ZCgwb/Ai3i9sVl/Bq8RIs4LRK1 &lt;br /&gt;
 gJDsKvJyNXmJMuYTsMoY1zpgozaABdYArQNPZQ1kfyGU7SpqVwxzAMwABWhgpIwp&lt;br /&gt;
 4vWBB+AUWAI3ypjnfEXtPU4bLKx9vErTeCeiRSYF+fTn1j5dp2myE9EiU+DSi3wX &lt;br /&gt;
 ymeqRQAmZ3EcA5E/fgO6BULT8zhOcrwXoJdrXRa2Lgps2y2odAUcBUIXQdz78YyC&lt;br /&gt;
 SldAp8b7+bXrIv91qjZBietqCc2DjbAt4b2WxJkyZljVujlwp0U0cPxuLcAIuC+4 &lt;br /&gt;
 dKxFlsDJarvdAGP/b6hFnDImYs+uG3hbO2AB3Jbsur63tQM+fFx3bzZocEB8AdV2&lt;br /&gt;
 gJBZgKTwAAAAAElFTkSuQmCC &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Valid subsections are:&lt;br /&gt;
* accessories&lt;br /&gt;
* communication&lt;br /&gt;
* games&lt;br /&gt;
* multimedia&lt;br /&gt;
* office&lt;br /&gt;
* other&lt;br /&gt;
* programming&lt;br /&gt;
* support&lt;br /&gt;
* themes&lt;br /&gt;
* tools&lt;br /&gt;
&lt;br /&gt;
== Editing the Changelog file ==&lt;br /&gt;
It is the log of the changes for a specified application version. It&#039;s important file because it sets the binary/binaries and the source packages version and revision.&lt;br /&gt;
If an upstream package is re-packaged or modified for maemo, the Maemo revision string should be appended to the upstream revision.&lt;br /&gt;
So if in Debian the package name was something like &amp;quot;Myapp-0.4-2&amp;quot; in maemo this package will be called &amp;quot;Myapp-0.4-2maemo0&amp;quot;.&lt;br /&gt;
The number after the &amp;quot;maemo&amp;quot; string is a progressive number.&lt;br /&gt;
&lt;br /&gt;
==  Application menu icon &amp;amp; position ==&lt;br /&gt;
The Maemo application menu detects automatically an app that provides a .desktop file in /usr/share/application/hildon&lt;br /&gt;
Maemo menu structure is completely different from Debian:&lt;br /&gt;
* An unmodified Debian package installs the proper .desktop in /usr/share/applications&lt;br /&gt;
* Applications that use the debian menu are displayed in the extra menu&lt;br /&gt;
&lt;br /&gt;
In order to show our application in the correct Maemo menu:&lt;br /&gt;
* debian/myapp.install moves the .desktop file and icons in the right directory &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
src/*.desktop usr/share/applications/hildon&lt;br /&gt;
src/*.png usr/share/icons/hicolor/26x26/apps&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* debian/postinst should call  maemo-select-menu-location utility to permit the user to choose the menu location. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
maemo-select-menu-location myapp.desktop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Checking Maemo Packages ==&lt;br /&gt;
Lintian dissects Debian packages and reports bugs and policy violations. &lt;br /&gt;
It contains automated checks for many aspects of Debian policy as well as some checks for common errors.&lt;br /&gt;
Unfortunately it doesn&#039;t check conformance to the additional Maemo policy.&lt;br /&gt;
&lt;br /&gt;
Currently Maemo doesn&#039;t provide any tools to check its policy.&lt;br /&gt;
&lt;br /&gt;
== Building the binary and the source package ==&lt;br /&gt;
To build only binary package/s&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$dpkg-buildpackage -rfakeroot -b&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
we can install these binary package with dpkg:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$dpkg -i myapp.deb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To build the source package and to sign it with your gpg key (ABCDEF12) &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dpkg-buildpackage -rfakeroot -sa -S -kABCDEF12&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
At this point, if you have tested your package and it works fine you can [http://wiki.maemo.org/Uploading_to_Extras upload it in extras/extras-devel].&lt;br /&gt;
&lt;br /&gt;
= Example =&lt;br /&gt;
You can download the source package of qt-maemo-example from the extra-devel repository just running&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;apt-get source qt-maemo-example&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This command will download the:&lt;br /&gt;
&lt;br /&gt;
- unmodified source (.orig.tar.gz)&lt;br /&gt;
&lt;br /&gt;
- debian dsc file (.dsc)&lt;br /&gt;
&lt;br /&gt;
- diff file (.diff)&lt;br /&gt;
&lt;br /&gt;
and after it will launch automatically dpkg -x file.dsc in order to uncompress the orig.tar.gz and apply the changes.&lt;br /&gt;
&lt;br /&gt;
= Useful Links =&lt;br /&gt;
[http://qt4.garage.maemo.org Qt4Maemo at garage]&lt;br /&gt;
&lt;br /&gt;
[http://doc.trolltech.com/4.4/index.html Official Qt 4.4 Documentation] &lt;br /&gt;
&lt;br /&gt;
[http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-0.9.4.html Desktop entry spec 0.9.4]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Qt]]&lt;/div&gt;</summary>
		<author><name>87.158.23.94</name></author>
	</entry>
</feed>