Editing Packaging a Qt application
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 1: | Line 1: | ||
+ | = Packaging a Qt application for Maemo= | ||
+ | |||
{{main|Packaging}} | {{main|Packaging}} | ||
Line 6: | Line 8: | ||
In order to create a new package for Maemo, from a qmake project, you will need to: | In order to create a new package for Maemo, from a qmake project, you will need to: | ||
- | * Rename the source directory to <code>Package-Version</code> (for example myapp-0.1 for an application | + | * Rename the upstream source directory to <code>Package-Version</code> (for example myapp-0.1 for an application myapp with a version of 0.1) |
- | * Create | + | * Create “src” directory in Package-Version/ |
* Copy all the files to the <code>src/</code> directory | * Copy all the files to the <code>src/</code> directory | ||
* Rename <code>src/appname.pro</code> to <code>src/src.pro</code> | * Rename <code>src/appname.pro</code> to <code>src/src.pro</code> | ||
- | |||
- | |||
<pre> | <pre> | ||
$mv myapp myapp-0.1 | $mv myapp myapp-0.1 | ||
Line 23: | Line 23: | ||
<pre> | <pre> | ||
- | unix { | + | unix { |
- | + | #VARIABLES | |
- | + | isEmpty(PREFIX) { | |
- | + | PREFIX = /usr/local | |
} | } | ||
- | + | BINDIR = $$PREFIX/bin | |
- | + | DATADIR =$$PREFIX/share | |
- | + | DEFINES += DATADIR=\"$$DATADIR\" PKGDATADIR=\"$$PKGDATADIR\" | |
- | + | #MAKE INSTALL | |
- | + | INSTALLS += target desktop iconxpm icon26 icon48 icon64 | |
target.path =$$BINDIR | target.path =$$BINDIR | ||
Line 42: | Line 42: | ||
desktop.files += $${TARGET}.desktop | desktop.files += $${TARGET}.desktop | ||
- | + | iconxpm.path = $$DATADIR/pixmap | |
- | + | iconxpm.files += ../data/maemo/$${TARGET}.xpm | |
+ | |||
+ | icon26.path = $$DATADIR/icons/hicolor/26x26/apps | ||
+ | icon26.files += ../data/26x26/$${TARGET}.png | ||
+ | |||
+ | icon48.path = $$DATADIR/icons/hicolor/48x48/apps | ||
+ | icon48.files += ../data/48x48/$${TARGET}.png | ||
icon64.path = $$DATADIR/icons/hicolor/64x64/apps | icon64.path = $$DATADIR/icons/hicolor/64x64/apps | ||
Line 70: | Line 76: | ||
dh_make --createorig --single -e maintainer@email.org -c gpl | dh_make --createorig --single -e maintainer@email.org -c gpl | ||
</pre> | </pre> | ||
+ | |||
+ | == Having a look inside the debian/ dir == | ||
+ | At this point the directory my-app contains | ||
+ | * the source directory ( src/ ) | ||
+ | * the debian directory (debian/) | ||
+ | |||
+ | Inside the debian dir we have the files needed for the creation of the debian package | ||
+ | * Changelog - Application's change log | ||
+ | * Compat - Debian helper compatibly version | ||
+ | * Control - Describes the packages to be made | ||
+ | * Copyright - Copyright text | ||
+ | * Rules - A binary makefile containing the rules to build the package | ||
+ | |||
+ | |||
== Editing the rules file == | == Editing the rules file == | ||
- | The rules file generated by | + | The rules file generated by dh_make will be modified in order to look like this one. |
+ | We are using qmake, so we haven't a configure file to run. | ||
+ | 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 | ||
+ | the following chunk, you most propably get spaces instead tabs and the file does not wok | ||
<pre> | <pre> | ||
Line 131: | Line 154: | ||
</pre> | </pre> | ||
- | == | + | == Application menu icon & position == |
- | The | + | The Maemo application menu detects automatically an app that provides a .desktop file in /usr/share/application/hildon . If you don't have desktop file, create one in the src directory. |
- | + | <pre> | |
+ | [Desktop Entry] | ||
+ | Encoding=UTF-8 | ||
+ | Version=0.1 | ||
+ | Type=Application | ||
+ | Name=myapp | ||
+ | Exec=/usr/bin/myapp | ||
+ | Icon=myapp | ||
+ | X-HildonDesk-ShowInToolbar=true | ||
+ | X-Osso-Type=application/x-executable | ||
+ | </pre> | ||
- | + | Maemo menu structure is completely different from Debian: | |
- | + | * An unmodified Debian package installs the proper .desktop in /usr/share/applications | |
+ | * Applications that use the debian menu are displayed in the extra menu | ||
- | apt-get source qt-maemo-example | + | In order to show our application in the correct Maemo menu: |
+ | * debian/myapp.install moves the .desktop file and icons in the right directory | ||
+ | <pre> | ||
+ | src/*.desktop usr/share/applications/hildon | ||
+ | src/*.png usr/share/icons/hicolor/26x26/apps | ||
+ | </pre> | ||
+ | |||
+ | * debian/postinst should call maemo-select-menu-location utility to permit the user to choose the menu location. '''This works only in Diablo, it doesn't work in Fremantle.''' | ||
+ | <pre> | ||
+ | #!/bin/sh | ||
+ | maemo-select-menu-location myapp.desktop | ||
+ | </pre> | ||
+ | |||
+ | = Example = | ||
+ | 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; | ||
+ | |||
+ | ''apt-get source qt-maemo-example'' | ||
This command will download the: | This command will download the: | ||
- | + | - unmodified source (.orig.tar.gz) | |
- | + | ||
- | + | ||
- | + | - debian dsc file (.dsc) | |
- | + | - diff file (.diff) | |
+ | |||
+ | and after it will launch automatically dpkg -x file.dsc in order to uncompress the orig.tar.gz and apply the changes. | ||
+ | |||
+ | = Useful Links = | ||
- | |||
* [[Qt-Maemo|Qt for Maemo]] | * [[Qt-Maemo|Qt for Maemo]] | ||
* [[Packaging|Packaging guide for Maemo]] | * [[Packaging|Packaging guide for Maemo]] | ||
- | * [http:// | + | * [http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html Desktop entry specification] |
+ | |||
+ | = Debhelper 7 = | ||
+ | |||
+ | A backport of Debhelper 7 for fremantle is available in extras-devel. | ||
+ | It works transparently and can coexist with debhelper 5 in the SDK. | ||
+ | It even works on autobuilder, if you specify the correct build-dependency debhelper7. | ||
+ | Read the mails about [http://www.mail-archive.com/maemo-developers@maemo.org/msg23779.html debhelper7] | ||
+ | and [http://www.mail-archive.com/maemo-developers@maemo.org/msg23749.html cdbs-dh7]. | ||
+ | |||
+ | Alternatively, you can try to use debhelper 5 in some cases: | ||
+ | |||
+ | Debian packages that requires level 7 needs some changes: | ||
+ | eg: | ||
+ | * debian/compat: 7 -> 5 | ||
+ | * debian/control: Build-Depends: debhelper (>= 7) -> debhelper (>= 5) | ||
+ | * And maybe comment out a few dh_* calls from debian/rules, which might not exist on level 5 | ||
+ | |||
+ | Now things might get complex if the packaging already uses some new | ||
+ | features of level 7, like those CDBS-like helper rules. In such cases, | ||
+ | looking at versions prior to the compatibility level upgrade might | ||
+ | help doing the downgrade (and most Debian packages are kept in public | ||
+ | SCMs like svn.debian.org). | ||
- | [[Category: | + | [[Category:Development]] |
[[Category:Qt]] | [[Category:Qt]] |
Learn more about Contributing to the wiki.