Meego Wiki
Views

SDK/Tutorials/Packaging

From MeeGo wiki
< SDK | Tutorials
Revision as of 04:06, 12 January 2011 by Johnchen (Talk | contribs)
Jump to: navigation, search

Contents

Introduction

This page will create a MeeGo rpm package from an existing qt project - an OpenGL application called "textures" in qt examples. The original project is just a qt example project and has no icon and can not be launched from MeeGo UI. We will make it more like a stand alone application which can be launched from MeeGo applications panel and create a rpm package which can be installed on MeeGo device.

Preparation

Assuming that we have MeeGo Linux SDK or MeeGo Windows SDK installed. The textures is one example of Qt demo and included in qt-examples package. The project is at $sysroot/usr/lib/qt4/example/opengl/textures, where $sysroot is located in /usr/lib/madde/linux-${arch}/sysroots

  • Copy it to a separate folder $workspace as a stand-alone project.
cp -a $sysroot/usr/lib/qt4/examples/opengl/textures $workspace/textures-0.0.1
cd $workspace/textures-0.0.1
  • Add an icon for the application. We reuse an image inside the project as the application icon.
cp images/side6.png textures.png
  • Add a desktop file so we can find the application from MeeGo applications panel.
vi textures.desktop

with following contents:

[Desktop Entry]
Name=QtDemoTextures
Comment=Qt Demo Textures
Exec=textures
Categories=Development;
Icon=textures
Type=Application
Terminal=false
StartupNotify=true
  • Edit textures.pro to remove some defines for Qt Example and add icon, desktop installation.
vi textures.pro

The contents will be:

HEADERS       = glwidget.h \
                window.h
SOURCES       = glwidget.cpp \
                main.cpp \
                window.cpp
RESOURCES     = textures.qrc
QT           += opengl

# install
target.path = /usr/bin
icon.files = textures.png
icon.path = /usr/share/icons
desktop.files = textures.desktop
desktop.path = /usr/share/applications

INSTALLS += target icon desktop


Create rpm package with meego-sdk-qtcreator

  • Start meego-sdk-qtcrator (Or meego-sdk-qt-creator)
  • Go to File->Open file or project

Browse to $workspace/textures-0.0.1 and choose textures.pro, choose any MeeGo target you installed when prompted.

  • Go to Build->Build project "textures" (or "Deploy Project" in QtCreator 2.1.0)

The project will be built and there will be errors in the "Compile Output" window if you haven't had a runtime running. You can see there's log "Started uploading file <path to rpm>". That means the RPM have been created successfully. You can look for the RPM there.

Verify the rpm package

You can have the following ways to verify if your RPM is OK:


Then you can find QtDemoTextures in applications Zone under Programming.

Personal tools