Qt Development‎ > ‎

Packaging a Lib for maemo

These are the steps I took to package communi (and libircclient-qt) for the n900. Hopefully they will help someone trying to package a qt lib for the n900 using scratchbox.

Get the Source

hg clone http://bitbucket.org/jpnurmi/libircclient-qt
hg clone http://bitbucket.org/communi/communi
(*) remove unneeded files (.hg, .hgignore, .hgtags, ...)


Log in into scratchbox and make sure you have the right target selected (FREMANTEL_ARMEL)



Create the lib

rename libircclient-qt folder to include version (e.g. libircclient-qt-0.5.0)

mv libircclient-qt libircclient-qt-0.5.0

create Makefile

cd libircclient-qt-0.5.0
qmake

(*) I actually used:
qmake -config no_icu -config no_deprecated

edit Makefile to remove any absolute paths
- replace all instances of "/targets/FREMANTLE_ARMEL" with "" (empty string)
- replace all instances of "/home/felipe/projects/libircclient-qt-0.5.0/" with "" (empty string).  The folder name will be different for you depending on your user, look for "/home/" to figure out the actual path for you

create debian folder

export DEBFULLNAME="Felipe Crochik"
dh_make -e libircclient-qt@crochik.com -createorig -c gpl -s

(*) you can remove all "example" files (debian/*.ex, debian/*.EX)

edit debian/control

should look like:
Source: libircclient-qt
Section: libs
Priority: optional
Maintainer: Felipe Crochik <communi@crochik.com>
XSBC-Original-Maintainer: J-P Nurmi <jpnurmi@gmail.com>
XSBC-Bugtracker: mailto:libircclient-qt@crochik.com
Build-Depends: debhelper (>= 5), libqt4-dev, libgconf2-dev
Standards-Version: 3.7.2

Package: libircclient-qt
Architecture: any
Depends: libqt4-gui, libqt4-network
Description: A library to access IRC
 A library to enable Qt applications to
 access and use IRC.
 .
 Further Information:
 http://bitbucket.org/jpnurmi/libircclient-qt
 Bug tracker: http://bitbucket.org/jpnurmi/libircclient-qt/issues
 IRC channel: #communi on irc.freenode.net

Package: libircclient-qt-dev
Architecture: any
Depends: libqt4-gui, libqt4-network, libircclient-qt
Description: A library to access IRC
 A library to enable Qt applications to
 access and use IRC.
 .
 Further Information:
 http://bitbucket.org/jpnurmi/libircclient-qt
 Bug tracker: http://bitbucket.org/jpnurmi/libircclient-qt/issues
 IRC channel: #communi on irc.freenode.net

(*) note that it includes definitions for two packages (libircclient-qt, libircclient-qt-dev) from the same source code
(*) libircclient-dev-qt should depend on libircclient-qt and not include the actual libs

create .install files

for each package you need to create a file with the list of files (or folders) that need to be copied for it:

debian/libircclient-qt.install:

usr/lib

debian/libircclient-qt-dev.install:

usr/share/qt4/mkspecs/features
usr/include/ircclient-qt

edit debian/rules

you may want to uncomment the following line to get a verbose output:
export DH_VERBOSE=1

under "install: build" change the make command to install all the files to a temporary folder:
# Add here commands to install the package into debian/libircclient-qt.
$(MAKE) INSTALL_ROOT=$(CURDIR)/debian/tmp install

change dh_install (remove #, add sourcedir, ...) :
dh_install --sourcedir=debian/tmp --autodest

remove "#" from dh_makeshlibs so package will include dependencies for your lib
dh_makeshlibs


Create files to upload to Maemo autobuilder

dpkg-buildpackage -rfakeroot -sa -S

(*) you can also create the package locally to make sure that it will work:

dpkg-buildpackage -rfakeroot -b

Upload files to autobuilder




Create Communi package (Application)


Before you start make sure that you have created the lib package and installed to your scratchbox

apt-get update
apt-get install libircclient-qt-dev

rename communi folder to include version (e.g. communi-2.0.0)

mv communi qt communi-2.0.0

edit .pro file to include install, the bare minimum file should include something like:

unix {
    # VARIABLES
    isEmpty(PREFIX):PREFIX = debian
    BINDIR = $$PREFIX/$${TARGET}/usr/bin
    DATADIR = $$PREFIX/$${TARGET}/usr/share
    DEFINES += DATADIR=\"$$DATADIR\" \
        PKGDATADIR=\"$$PKGDATADIR\"

    # MAKE INSTALL
    INSTALLS += target \
        desktop \
        icon64

    target.path = $$BINDIR
    desktop.path = $$DATADIR/applications/hildon
    desktop.files += fcrochik/$${TARGET}.desktop

    icon64.path = $$DATADIR/icons/hicolor/64x64/apps
    icon64.files += fcrochik/$${TARGET}.png
}

(*) note the fcrochik/$$(TARGET}.png and fcrochik/$$(TARGET}.desktop.


Create Icon for the app (64x64 pixels): fcrochik/communi.png

For communi I just copied the resources/icon-64.png. Make sure to name the file according to the package name

Create desktop file: fcrochik/communi.desktop

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=Communi
Exec=/usr/bin/communi
Icon=communi
X-Window-Icon=communi
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
Terminal=false

create Makefile

cd communi-2.0.0
qmake

edit Makefile to remove any absolute paths
- replace all instances of "/targets/FREMANTLE_ARMEL" with "" (empty string)
- replace all instances of "/home/felipe/projects/commui-2.0.0/" with "" (empty string).  The folder name will be different for you depending on your user, look for "/home/" to figure out the actual path for you

create debian folder

export DEBFULLNAME="Felipe Crochik"
dh_make -e communi@crochik.com -createorig -c gpl -s

(*) you can remove all "example" files (debian/*.ex, debian/*.EX)

edit debian/control

should look like:

Source: communi
Section: user/network
Priority: extra
Maintainer: Felipe Crochik <felipe@crochik.com>
XSBC-Bugtracker: mailto:communi@crochik.com
Build-Depends: debhelper (>= 5), libqt4-dev, libx11-dev, libgconf2-dev, libircclient-qt-dev
Standards-Version: 3.7.2
XB-Maemo-Display-Name: Communi

Package: communi
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, hildon-application-manager, libircclient-qt
Description: A simple and light-weight cross-platform IRC client.
 Communi is a simple and light-weight cross-platform Internet Relay Chat client written with Qt 4.
 Communi adapts many great ideas and features from famous
 IRC clients like Irssi, Konversation and mIRC.
 However, Communi intends to keep it very simple leaving out
 features like DCC file transfers.
 File transfers rarely work over IRC thanks to bouncers and
 firewalls, and there are better file transfer protocols
 anyway.
 Furthermore, Communi aims to maximize the the available
 screen size for the actual chat content.
 There are no fancy menu bars, tool bars, status bars or
 dock widgets eating up the available screen size, making
 Communi suitable for embedded devices even with relatively
 small screens.
 .
 Communi website: http://communi.bitbucket.org
 Bug tracker: http://communi.bitbucket.org/issues
 IRC channel: #communi on irc.freenode.net

(*) note the libircclient-qt-dev on the build-depends.

Create files to upload to Maemo autobuilder

dpkg-buildpackage -rfakeroot -sa -S

(*) you can also create the package locally to make sure that it will work:

dpkg-buildpackage -rfakeroot -b

Upload files to autobuilder




Thanks...Thanks...Thanks:

Daniel Wilms, Graham Cobb and Attila Csipa.


Comments