<?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=88.115.28.145</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=88.115.28.145"/>
	<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php/Special:Contributions/88.115.28.145"/>
	<updated>2026-04-22T09:49:25Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Documentation/Maemo_5_Developer_Guide/Development_Environment/Maemo_Programming_Environments/Using_Maemo_5_specific_APIs_in_Qt_application&amp;diff=6920</id>
		<title>Documentation/Maemo 5 Developer Guide/Development Environment/Maemo Programming Environments/Using Maemo 5 specific APIs in Qt application</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=Documentation/Maemo_5_Developer_Guide/Development_Environment/Maemo_Programming_Environments/Using_Maemo_5_specific_APIs_in_Qt_application&amp;diff=6920"/>
		<updated>2010-01-17T21:56:53Z</updated>

		<summary type="html">&lt;p&gt;88.115.28.145: /* Using Zoom In and Zoom Out keys */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= How to use Maemo 5 specific APIs from Qt application =&lt;br /&gt;
&lt;br /&gt;
== Accelometer ==&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
This section explains how to use the [[Accelerometers | accelerometer]] D-Bus interface in a Maemo 5 Qt application.&lt;br /&gt;
&lt;br /&gt;
The following code examples are used in this section:&lt;br /&gt;
* [https://garage.maemo.org/svn/maemoexamples/trunk/qt-maemo-gravity-example/ qt-maemo-gravity-example]&lt;br /&gt;
&lt;br /&gt;
=== D-Bus interface ===&lt;br /&gt;
&lt;br /&gt;
It is up to each application how to organize interactions with the [http://maemo.org/api_refs/5.0/beta/mce-dev/ MCE] orientation interface. In [[Documentation/Maemo 5 Developer Guide/Porting Software/Porting Existing GTK+ Application to Maemo 5#Portrait Mode | some cases]] catching orientation signal can be enough, but if, e.g., more frequent updates are needed, you might want to use method calls, as demonstrated in our example.&lt;br /&gt;
We&#039;ve moved D-Bus related functionality and orientation based calculations to a separate library that implements `DeviceOrientationNotifier&#039; class. &lt;br /&gt;
Our notifier asks MCE about orientation parameters with a certain period, &lt;br /&gt;
 void DeviceOrientationNotifier::timerEvent(QTimerEvent *)&lt;br /&gt;
 {&lt;br /&gt;
   QDBusMessage msg = QDBusMessage::createMethodCall(MCE_SERVICE, MCE_REQUEST_PATH, MCE_REQUEST_IF, MCE_DEVICE_ORIENTATION_GET);&lt;br /&gt;
   bool sent = QDBusConnection::systemBus().callWithCallback(msg, this, SLOT(mceOrientationSlot(QString, QString, QString, int, int, int)));&lt;br /&gt;
 }&lt;br /&gt;
processes answers in `mceOrientationSlot&#039;, and emits data needed by the application with the following signal.&lt;br /&gt;
 void deviceOrientation(qreal pitch, qreal roll);&lt;br /&gt;
&lt;br /&gt;
=== Example application ===&lt;br /&gt;
&lt;br /&gt;
We&#039;ve modified [http://qt.nokia.com/doc/4.5/graphicsview-collidingmice.html one of Qt4 Examples] in order to show how device orientation can be used.&lt;br /&gt;
In our case pitch and roll are scene&#039;s characteristics, so we&#039;ve implemented a `SceneTuner&#039;, whose slot can be connected to an appropriate signal in order to setup these scene properties.&lt;br /&gt;
 DeviceOrientationNotifier notifier(100);&lt;br /&gt;
 SceneTuner tuner(&amp;amp;scene, TimerInterval);&lt;br /&gt;
 QObject::connect(&amp;amp;notifier, SIGNAL(deviceOrientation(qreal, qreal)), &amp;amp;tuner, SLOT(setProps(qreal, qreal)));&lt;br /&gt;
Based on that each mouse can take into account the gravity effect, see `Mouse::advance&#039; for details.&lt;br /&gt;
&lt;br /&gt;
== Using Zoom In and Zoom Out keys ==&lt;br /&gt;
&lt;br /&gt;
This section uses the same qt-maemo-gravity-example to explain how to use Zoom In and Out keys in a Qt application. They are used to set the application window to fullscreen and normal modes like in the GTK+ example [[Documentation/Maemo 5 Developer Guide/Porting Software/Porting Existing GTK+ Application to Maemo 5|Maemo Sliders]].&lt;br /&gt;
&lt;br /&gt;
First, the keys are released from maemo-status-volume by using &amp;lt;code&amp;gt;XChangeProperty()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
hardkeyhandler.cpp:&lt;br /&gt;
 void HardkeyHandler::grabIncreaseDecreaseKeys(QWidget* window, bool grab)&lt;br /&gt;
 {&lt;br /&gt;
     // Tell maemo-status-volume to grab/ungrab increase/decrease keys&lt;br /&gt;
     unsigned long val = (grab==true)?1:0;&lt;br /&gt;
     Atom atom;&lt;br /&gt;
     atom = XInternAtom( QX11Info::display(), &amp;quot;_HILDON_ZOOM_KEY_ATOM&amp;quot;, 0);&lt;br /&gt;
     XChangeProperty (QX11Info::display(),&lt;br /&gt;
                      window-&amp;gt;winId(),&lt;br /&gt;
                      atom,&lt;br /&gt;
                      XA_INTEGER,&lt;br /&gt;
                      32,&lt;br /&gt;
                      PropModeReplace,&lt;br /&gt;
                      (unsigned char *) &amp;amp;val,&lt;br /&gt;
                      1);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Next, a handler for keypresses is created. 73 and 74 are the keycodes for F7/F8 in the SDK and Zoom In/Out buttons in the device. Handler functions emit corresponding signals when called.&lt;br /&gt;
&lt;br /&gt;
hardkeyhandler.cpp&lt;br /&gt;
 bool HardkeyHandler::processX11Event(XEvent* event)&lt;br /&gt;
 {&lt;br /&gt;
     if ( event-&amp;gt;type == KeyPress )&lt;br /&gt;
     {&lt;br /&gt;
         if (event-&amp;gt;xkey.keycode == 73 || event-&amp;gt;xkey.keycode == QKeySequence::ZoomOut)&lt;br /&gt;
         {&lt;br /&gt;
             emit decreaseKeyPressed();&lt;br /&gt;
             return true;&lt;br /&gt;
         } &lt;br /&gt;
         else if (event-&amp;gt;xkey.keycode == 74  || event-&amp;gt;xkey.keycode ==  QKeySequence::ZoomIn)&lt;br /&gt;
         {&lt;br /&gt;
             emit increaseKeyPressed();&lt;br /&gt;
             return true;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     return false;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Signals need slots, of course. They are located to myapplication.h and myapplication.cpp files. Here changing to fullscreen and back are done by &amp;lt;code&amp;gt;showFullScreen()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;showNormal()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
myapplication.cpp&lt;br /&gt;
 void MyApplication::increaseKeyPressed()&lt;br /&gt;
 {&lt;br /&gt;
     qDebug(&amp;quot;MyApplication::increaseKeyPressed&amp;quot;);&lt;br /&gt;
     view.showFullScreen();&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void MyApplication::decreaseKeyPressed()&lt;br /&gt;
 {&lt;br /&gt;
     qDebug(&amp;quot;MyApplication::decreaseKeyPressed&amp;quot;);&lt;br /&gt;
     view.showNormal();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The new signals are connected to corresponding slots in &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
main.cpp&lt;br /&gt;
 QObject::connect(app.keyHandler(), SIGNAL(decreaseKeyPressed()), &amp;amp;app, SLOT(decreaseKeyPressed()));&lt;br /&gt;
 QObject::connect(app.keyHandler(), SIGNAL(increaseKeyPressed()), &amp;amp;app, SLOT(increaseKeyPressed()));&lt;br /&gt;
&lt;br /&gt;
Finally, gtk-x11 library and the new source and header files (hardkeyhandler.* and myapplication.*) are added to the Qt project file:&lt;br /&gt;
&lt;br /&gt;
collidingmice-gravity.pro:&lt;br /&gt;
 LIBS += -ldevornot-qt-maemo -L/usr/local/lib -lgtk-x11-2.0&lt;br /&gt;
 &lt;br /&gt;
 HEADERS += \&lt;br /&gt;
     mouse.h \&lt;br /&gt;
     hardkeyhandler.h \&lt;br /&gt;
     myapplication.h \&lt;br /&gt;
     scenetuner.h&lt;br /&gt;
 SOURCES += \&lt;br /&gt;
     main.cpp \&lt;br /&gt;
     hardkeyhandler.cpp \&lt;br /&gt;
     myapplication.cpp \&lt;br /&gt;
     mouse.cpp&lt;/div&gt;</summary>
		<author><name>88.115.28.145</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Documentation/Maemo_5_Developer_Guide/Development_Environment/Maemo_Programming_Environments/Using_Maemo_5_specific_APIs_in_Qt_application&amp;diff=6921</id>
		<title>Documentation/Maemo 5 Developer Guide/Development Environment/Maemo Programming Environments/Using Maemo 5 specific APIs in Qt application</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=Documentation/Maemo_5_Developer_Guide/Development_Environment/Maemo_Programming_Environments/Using_Maemo_5_specific_APIs_in_Qt_application&amp;diff=6921"/>
		<updated>2010-01-17T21:56:07Z</updated>

		<summary type="html">&lt;p&gt;88.115.28.145: /* Using Zoom In and Zoom Out keys */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= How to use Maemo 5 specific APIs from Qt application =&lt;br /&gt;
&lt;br /&gt;
== Accelometer ==&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
This section explains how to use the [[Accelerometers | accelerometer]] D-Bus interface in a Maemo 5 Qt application.&lt;br /&gt;
&lt;br /&gt;
The following code examples are used in this section:&lt;br /&gt;
* [https://garage.maemo.org/svn/maemoexamples/trunk/qt-maemo-gravity-example/ qt-maemo-gravity-example]&lt;br /&gt;
&lt;br /&gt;
=== D-Bus interface ===&lt;br /&gt;
&lt;br /&gt;
It is up to each application how to organize interactions with the [http://maemo.org/api_refs/5.0/beta/mce-dev/ MCE] orientation interface. In [[Documentation/Maemo 5 Developer Guide/Porting Software/Porting Existing GTK+ Application to Maemo 5#Portrait Mode | some cases]] catching orientation signal can be enough, but if, e.g., more frequent updates are needed, you might want to use method calls, as demonstrated in our example.&lt;br /&gt;
We&#039;ve moved D-Bus related functionality and orientation based calculations to a separate library that implements `DeviceOrientationNotifier&#039; class. &lt;br /&gt;
Our notifier asks MCE about orientation parameters with a certain period, &lt;br /&gt;
 void DeviceOrientationNotifier::timerEvent(QTimerEvent *)&lt;br /&gt;
 {&lt;br /&gt;
   QDBusMessage msg = QDBusMessage::createMethodCall(MCE_SERVICE, MCE_REQUEST_PATH, MCE_REQUEST_IF, MCE_DEVICE_ORIENTATION_GET);&lt;br /&gt;
   bool sent = QDBusConnection::systemBus().callWithCallback(msg, this, SLOT(mceOrientationSlot(QString, QString, QString, int, int, int)));&lt;br /&gt;
 }&lt;br /&gt;
processes answers in `mceOrientationSlot&#039;, and emits data needed by the application with the following signal.&lt;br /&gt;
 void deviceOrientation(qreal pitch, qreal roll);&lt;br /&gt;
&lt;br /&gt;
=== Example application ===&lt;br /&gt;
&lt;br /&gt;
We&#039;ve modified [http://qt.nokia.com/doc/4.5/graphicsview-collidingmice.html one of Qt4 Examples] in order to show how device orientation can be used.&lt;br /&gt;
In our case pitch and roll are scene&#039;s characteristics, so we&#039;ve implemented a `SceneTuner&#039;, whose slot can be connected to an appropriate signal in order to setup these scene properties.&lt;br /&gt;
 DeviceOrientationNotifier notifier(100);&lt;br /&gt;
 SceneTuner tuner(&amp;amp;scene, TimerInterval);&lt;br /&gt;
 QObject::connect(&amp;amp;notifier, SIGNAL(deviceOrientation(qreal, qreal)), &amp;amp;tuner, SLOT(setProps(qreal, qreal)));&lt;br /&gt;
Based on that each mouse can take into account the gravity effect, see `Mouse::advance&#039; for details.&lt;br /&gt;
&lt;br /&gt;
== Using Zoom In and Zoom Out keys ==&lt;br /&gt;
&lt;br /&gt;
This section uses the same qt-maemo-gravity-example to explain how to use Zoom In and Out keys in a Qt application. They are used to set the application window to fullscreen and normal modes like in the GTK+ example [[Documentation/Maemo 5 Developer Guide/Porting Software/Porting Existing GTK+ Application to Maemo 5|Maemo Sliders]].&lt;br /&gt;
&lt;br /&gt;
First, the keys are released from maemo-status-volume by using &amp;lt;code&amp;gt;XChangeProperty()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
hardkeyhandler.cpp:&lt;br /&gt;
 void HardkeyHandler::grabIncreaseDecreaseKeys(QWidget* window, bool grab)&lt;br /&gt;
 {&lt;br /&gt;
     // Tell maemo-status-volume to grab/ungrab increase/decrease keys&lt;br /&gt;
     unsigned long val = (grab==true)?1:0;&lt;br /&gt;
     Atom atom;&lt;br /&gt;
     atom = XInternAtom( QX11Info::display(), &amp;quot;_HILDON_ZOOM_KEY_ATOM&amp;quot;, 0);&lt;br /&gt;
     XChangeProperty (QX11Info::display(),&lt;br /&gt;
                      window-&amp;gt;winId(),&lt;br /&gt;
                      atom,&lt;br /&gt;
                      XA_INTEGER,&lt;br /&gt;
                      32,&lt;br /&gt;
                      PropModeReplace,&lt;br /&gt;
                      (unsigned char *) &amp;amp;val,&lt;br /&gt;
                      1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Next, a handler for keypresses is created. 73 and 74 are the keycodes for F7/F8 in the SDK and Zoom In/Out buttons in the device. Handler functions emit corresponding signals when called.&lt;br /&gt;
&lt;br /&gt;
hardkeyhandler.cpp&lt;br /&gt;
 bool HardkeyHandler::processX11Event(XEvent* event)&lt;br /&gt;
 {&lt;br /&gt;
     if ( event-&amp;gt;type == KeyPress )&lt;br /&gt;
     {&lt;br /&gt;
         if (event-&amp;gt;xkey.keycode == 73 || event-&amp;gt;xkey.keycode == QKeySequence::ZoomOut)&lt;br /&gt;
         {&lt;br /&gt;
             emit decreaseKeyPressed();&lt;br /&gt;
             return true;&lt;br /&gt;
         } &lt;br /&gt;
         else if (event-&amp;gt;xkey.keycode == 74  || event-&amp;gt;xkey.keycode ==  QKeySequence::ZoomIn)&lt;br /&gt;
         {&lt;br /&gt;
             emit increaseKeyPressed();&lt;br /&gt;
             return true;&lt;br /&gt;
         }&lt;br /&gt;
     }&lt;br /&gt;
 &lt;br /&gt;
     return false;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Signals need slots, of course. They are located to myapplication.h and myapplication.cpp files. Here changing to fullscreen and back are done by &amp;lt;code&amp;gt;showFullScreen()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;showNormal()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
myapplication.cpp&lt;br /&gt;
 void MyApplication::increaseKeyPressed()&lt;br /&gt;
 {&lt;br /&gt;
     qDebug(&amp;quot;MyApplication::increaseKeyPressed&amp;quot;);&lt;br /&gt;
     view.showFullScreen();&lt;br /&gt;
 &lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 void MyApplication::decreaseKeyPressed()&lt;br /&gt;
 {&lt;br /&gt;
     qDebug(&amp;quot;MyApplication::decreaseKeyPressed&amp;quot;);&lt;br /&gt;
     view.showNormal();&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The new signals are connected to corresponding slots in &amp;lt;code&amp;gt;main()&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
main.cpp&lt;br /&gt;
 QObject::connect(app.keyHandler(), SIGNAL(decreaseKeyPressed()), &amp;amp;app, SLOT(decreaseKeyPressed()));&lt;br /&gt;
 QObject::connect(app.keyHandler(), SIGNAL(increaseKeyPressed()), &amp;amp;app, SLOT(increaseKeyPressed()));&lt;br /&gt;
&lt;br /&gt;
Finally, gtk-x11 library and the new source and header files (hardkeyhandler.* and myapplication.*) are added to the Qt project file:&lt;br /&gt;
&lt;br /&gt;
collidingmice-gravity.pro:&lt;br /&gt;
 LIBS += -ldevornot-qt-maemo -L/usr/local/lib -lgtk-x11-2.0&lt;br /&gt;
 &lt;br /&gt;
 HEADERS += \&lt;br /&gt;
     mouse.h \&lt;br /&gt;
     hardkeyhandler.h \&lt;br /&gt;
     myapplication.h \&lt;br /&gt;
     scenetuner.h&lt;br /&gt;
 SOURCES += \&lt;br /&gt;
     main.cpp \&lt;br /&gt;
     hardkeyhandler.cpp \&lt;br /&gt;
     myapplication.cpp \&lt;br /&gt;
     mouse.cpp&lt;/div&gt;</summary>
		<author><name>88.115.28.145</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Packaging_a_Qt_application&amp;diff=31553</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=31553"/>
		<updated>2010-01-15T21:18:02Z</updated>

		<summary type="html">&lt;p&gt;88.115.28.145: /* Editing the Control file */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Packaging a Qt application for Maemo=&lt;br /&gt;
== Finding your package in debian ==&lt;br /&gt;
If you want to port a Qt package to Maemo, you should check and see if it is already packaged for debian and use that package if you can - this will save you time and effort. You can search in debian&#039;s [http://www.debian.org/distrib/packages Package Tracking System (PTS)] to see if it is there. There is a search system on the PTS page, under the &amp;quot;distribution&amp;quot; drop-down, select &#039;any&#039;, this will search throughout debian&#039;s repositories to find the package. Debian has more than 20,000 packages just in its stable distribution so your application is likely already packaged.&lt;br /&gt;
&lt;br /&gt;
If you find the package already exists in debian, you can get the source, including the packaging source, with apt-get. To do this, you&#039;ll have to edit your /etc/apt/sources.list, you can follow this recipe;&lt;br /&gt;
&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 &amp;quot;application name&amp;quot;&lt;br /&gt;
$ apt-get source &amp;quot;application name&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;To learn more about the /etc/apt/sources.list you can do a &#039;man sources.list&#039; if you are running debian or a debian based GNU/Linux distro.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Porting the debian package to a Maemo package  ==&lt;br /&gt;
If your application has been already packaged for debian, you can begin your maemo packaging with this section. Once you have the source of the debian package, you will need to make some modifications to that package for it to build under Maemo. For the complete Maemo Package Policy, use [http://maemo.org/forrest-images/pdf/maemo-policy.pdf this link] to a pdf.&lt;br /&gt;
&lt;br /&gt;
In order to create a new package for maemo, you&#039;ll 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;
&lt;br /&gt;
Append the following chunk to end of your src/src.pro . The chunk adds install section to your qmakefile  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  unix {&lt;br /&gt;
    #VARIABLES&lt;br /&gt;
    isEmpty(PREFIX) {&lt;br /&gt;
        PREFIX = /usr/local&lt;br /&gt;
  }&lt;br /&gt;
BINDIR = $$PREFIX/bin&lt;br /&gt;
DATADIR =$$PREFIX/share&lt;br /&gt;
&lt;br /&gt;
DEFINES += DATADIR=\&amp;quot;$$DATADIR\&amp;quot; PKGDATADIR=\&amp;quot;$$PKGDATADIR\&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#MAKE INSTALL&lt;br /&gt;
&lt;br /&gt;
INSTALLS += target desktop iconxpm icon26 icon40 icon64&lt;br /&gt;
&lt;br /&gt;
  target.path =$$BINDIR&lt;br /&gt;
&lt;br /&gt;
  desktop.path = $$DATADIR/applications/hildon&lt;br /&gt;
  desktop.files += $${TARGET}.desktop&lt;br /&gt;
&lt;br /&gt;
  iconxpm.path = $$DATADIR/pixmap&lt;br /&gt;
  iconxpm.files += ../data/maemo/$${TARGET}.xpm&lt;br /&gt;
&lt;br /&gt;
  icon26.path = $$DATADIR/icons/hicolor/26x26/apps&lt;br /&gt;
  icon26.files += ../data/26x26/$${TARGET}.png&lt;br /&gt;
&lt;br /&gt;
  icon40.path = $$DATADIR/icons/hicolor/40x40/apps&lt;br /&gt;
  icon40.files += ../data/40x40/$${TARGET}.png&lt;br /&gt;
&lt;br /&gt;
  icon64.path = $$DATADIR/icons/hicolor/64x64/apps&lt;br /&gt;
  icon64.files += ../data/64x64/$${TARGET}.png&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&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 needed 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 binary makefile containing the rules to build the package&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 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;
* [http://wiki.maemo.org/Task:Package_categories#Translations 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;
If you need to encode your icon as base64, there are [http://wiki.maemo.org/Maemo_packaging#Displaying_an_icon_in_the_Application_Manager_next_to_your_package instructions here.]&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;
&lt;br /&gt;
Package: my-application-dbg&lt;br /&gt;
Section: devel&lt;br /&gt;
Architecture: any&lt;br /&gt;
Depends: my-application (= ${binary:Version})&lt;br /&gt;
Description: Debug symbols for a simple test application&lt;br /&gt;
 Debug symbols for a very simple application, which allow&lt;br /&gt;
 tracing and debugging.&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 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;
If you cut-and-paste following file, notify that empty space beginning of lines it TAB characters, it is not multiple space characters. If you cut-and-paste &lt;br /&gt;
the following chunk, you most propably get spaces instead tabs and the file does not wok &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 --dbg-package=my-application-dbg&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 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 . If you don&#039;t have desktop file, create one in the src directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Version=0.1&lt;br /&gt;
Type=Application&lt;br /&gt;
Name=myapp&lt;br /&gt;
Exec=/usr/bin/myapp&lt;br /&gt;
Icon=myapp&lt;br /&gt;
X-HildonDesk-ShowInToolbar=true&lt;br /&gt;
X-Osso-Type=application/x-executable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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.  &#039;&#039;&#039;This works only in Diablo, it doesn&#039;t work in Fremantle.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&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 is creating [http://maemian.garage.maemo.org/ Maemian] 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 extras-devel repository just running if you have source packages enabled in your sources file;&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://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;
= Debhelper 7 =&lt;br /&gt;
Debhelper 7 is not available in fremantle.&lt;br /&gt;
Debian packages that requires level 7 needs some changes:&lt;br /&gt;
eg:&lt;br /&gt;
* debian/compat:  7 -&amp;gt; 5&lt;br /&gt;
* debian/control: Build-Depends: debhelper (&amp;gt;= 7) -&amp;gt; debhelper (&amp;gt;= 5)&lt;br /&gt;
* And maybe comment out a few dh_* calls from debian/rules, which might not exist on level 5&lt;br /&gt;
&lt;br /&gt;
Now things might get complex if the packaging already uses some new&lt;br /&gt;
features of level 7, like those CDBS-like helper rules. In such cases,&lt;br /&gt;
looking at versions prior to the compatibility level upgrade might&lt;br /&gt;
help doing the downgrade (and most Debian packages are kept in public&lt;br /&gt;
SCMs like svn.debian.org).&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Qt]]&lt;/div&gt;</summary>
		<author><name>88.115.28.145</name></author>
	</entry>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Packaging_a_Qt_application&amp;diff=31554</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=31554"/>
		<updated>2010-01-15T21:16:58Z</updated>

		<summary type="html">&lt;p&gt;88.115.28.145: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Packaging a Qt application for Maemo=&lt;br /&gt;
== Finding your package in debian ==&lt;br /&gt;
If you want to port a Qt package to Maemo, you should check and see if it is already packaged for debian and use that package if you can - this will save you time and effort. You can search in debian&#039;s [http://www.debian.org/distrib/packages Package Tracking System (PTS)] to see if it is there. There is a search system on the PTS page, under the &amp;quot;distribution&amp;quot; drop-down, select &#039;any&#039;, this will search throughout debian&#039;s repositories to find the package. Debian has more than 20,000 packages just in its stable distribution so your application is likely already packaged.&lt;br /&gt;
&lt;br /&gt;
If you find the package already exists in debian, you can get the source, including the packaging source, with apt-get. To do this, you&#039;ll have to edit your /etc/apt/sources.list, you can follow this recipe;&lt;br /&gt;
&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 &amp;quot;application name&amp;quot;&lt;br /&gt;
$ apt-get source &amp;quot;application name&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;To learn more about the /etc/apt/sources.list you can do a &#039;man sources.list&#039; if you are running debian or a debian based GNU/Linux distro.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Porting the debian package to a Maemo package  ==&lt;br /&gt;
If your application has been already packaged for debian, you can begin your maemo packaging with this section. Once you have the source of the debian package, you will need to make some modifications to that package for it to build under Maemo. For the complete Maemo Package Policy, use [http://maemo.org/forrest-images/pdf/maemo-policy.pdf this link] to a pdf.&lt;br /&gt;
&lt;br /&gt;
In order to create a new package for maemo, you&#039;ll 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;
&lt;br /&gt;
Append the following chunk to end of your src/src.pro . The chunk adds install section to your qmakefile  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  unix {&lt;br /&gt;
    #VARIABLES&lt;br /&gt;
    isEmpty(PREFIX) {&lt;br /&gt;
        PREFIX = /usr/local&lt;br /&gt;
  }&lt;br /&gt;
BINDIR = $$PREFIX/bin&lt;br /&gt;
DATADIR =$$PREFIX/share&lt;br /&gt;
&lt;br /&gt;
DEFINES += DATADIR=\&amp;quot;$$DATADIR\&amp;quot; PKGDATADIR=\&amp;quot;$$PKGDATADIR\&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#MAKE INSTALL&lt;br /&gt;
&lt;br /&gt;
INSTALLS += target desktop iconxpm icon26 icon40 icon64&lt;br /&gt;
&lt;br /&gt;
  target.path =$$BINDIR&lt;br /&gt;
&lt;br /&gt;
  desktop.path = $$DATADIR/applications/hildon&lt;br /&gt;
  desktop.files += $${TARGET}.desktop&lt;br /&gt;
&lt;br /&gt;
  iconxpm.path = $$DATADIR/pixmap&lt;br /&gt;
  iconxpm.files += ../data/maemo/$${TARGET}.xpm&lt;br /&gt;
&lt;br /&gt;
  icon26.path = $$DATADIR/icons/hicolor/26x26/apps&lt;br /&gt;
  icon26.files += ../data/26x26/$${TARGET}.png&lt;br /&gt;
&lt;br /&gt;
  icon40.path = $$DATADIR/icons/hicolor/40x40/apps&lt;br /&gt;
  icon40.files += ../data/40x40/$${TARGET}.png&lt;br /&gt;
&lt;br /&gt;
  icon64.path = $$DATADIR/icons/hicolor/64x64/apps&lt;br /&gt;
  icon64.files += ../data/64x64/$${TARGET}.png&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&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 needed 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 binary makefile containing the rules to build the package&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 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;
* [http://wiki.maemo.org/Task:Package_categories#Translations 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;
If you need to encode your icon as base64, there are [http://wiki.maemo.org/Maemo_packaging#Displaying_an_icon_in_the_Application_Manager_next_to_your_package instructions here.]&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;
&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;
&lt;br /&gt;
Package: my-application-dbg&lt;br /&gt;
Section: devel&lt;br /&gt;
Architecture: any&lt;br /&gt;
Depends: my-application (= ${binary:Version})&lt;br /&gt;
Description: Debug symbols for a simple test application&lt;br /&gt;
 Debug symbols for a very simple application, which allow&lt;br /&gt;
 tracing and debugging.&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 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;
If you cut-and-paste following file, notify that empty space beginning of lines it TAB characters, it is not multiple space characters. If you cut-and-paste &lt;br /&gt;
the following chunk, you most propably get spaces instead tabs and the file does not wok &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 --dbg-package=my-application-dbg&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 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 . If you don&#039;t have desktop file, create one in the src directory.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[Desktop Entry]&lt;br /&gt;
Encoding=UTF-8&lt;br /&gt;
Version=0.1&lt;br /&gt;
Type=Application&lt;br /&gt;
Name=myapp&lt;br /&gt;
Exec=/usr/bin/myapp&lt;br /&gt;
Icon=myapp&lt;br /&gt;
X-HildonDesk-ShowInToolbar=true&lt;br /&gt;
X-Osso-Type=application/x-executable&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&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.  &#039;&#039;&#039;This works only in Diablo, it doesn&#039;t work in Fremantle.&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&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 is creating [http://maemian.garage.maemo.org/ Maemian] 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 extras-devel repository just running if you have source packages enabled in your sources file;&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://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;
= Debhelper 7 =&lt;br /&gt;
Debhelper 7 is not available in fremantle.&lt;br /&gt;
Debian packages that requires level 7 needs some changes:&lt;br /&gt;
eg:&lt;br /&gt;
* debian/compat:  7 -&amp;gt; 5&lt;br /&gt;
* debian/control: Build-Depends: debhelper (&amp;gt;= 7) -&amp;gt; debhelper (&amp;gt;= 5)&lt;br /&gt;
* And maybe comment out a few dh_* calls from debian/rules, which might not exist on level 5&lt;br /&gt;
&lt;br /&gt;
Now things might get complex if the packaging already uses some new&lt;br /&gt;
features of level 7, like those CDBS-like helper rules. In such cases,&lt;br /&gt;
looking at versions prior to the compatibility level upgrade might&lt;br /&gt;
help doing the downgrade (and most Debian packages are kept in public&lt;br /&gt;
SCMs like svn.debian.org).&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Qt]]&lt;/div&gt;</summary>
		<author><name>88.115.28.145</name></author>
	</entry>
</feed>