How to integrate Intel AppUp™ SDK and create RPM package for MeeGo* applications

In this article I will show you how to prepare your MeeGo* app to be validated in the Intel AppUpSM Center. This article is based on the project from my another article Modern mobile applications with Qt* and QML. No changes will be made in the project source code. Thanks to Qt*, our Windows* application can be launched on MeeGo* without any changes in code. All you need is just to recompile it.

Integrating AppUp™ SDK

Launch Qt Creator* installed with MeeGo* SDK. If you don't have MeeGo* SDK installed, here is a link. On this page you can find everything you need to start developing MeeGo* apps. Open project, open project file (4Toddler.pro) and add following lines:

# Add path to Intel AppUp™ SDK headers directory INCLUDEPATH +=    "$$(IADP_SDK_DIR_MEEGO)Cpp/include" # Add required libraries LIBS +=    -lxml2 -lpthread LIBS +=    "$$(IADP_SDK_DIR_MEEGO)Cpp/lib/libadpruntime.a" \     "$$(IADP_SDK_DIR_MEEGO)Cpp/lib/libadpcore.a" \     "$$(IADP_SDK_DIR_MEEGO)Cpp/lib/libxerces-c.a" \     "$$(IADP_SDK_DIR_MEEGO)Cpp/lib/libxml-security-c.a" \     "$$(IADP_SDK_DIR_MEEGO)Cpp/lib/libcrypto.a"


Next open main.cpp file. Include header file from the Intel AppUp™ SDK:

#include "adpcppf.h"


And new function:

bool IsAuthorized() { #ifdef QT_DEBUG     // Do not check authorization for debug version     return true; #endif     bool authorized = false;     QString message;     com::intel::adp::Application *pApp = NULL;     try     {         pApp = new Application(ADP_DEBUG_APPLICATIONID);         // Authorized successfully         authorized = true;     }     catch (com::intel::adp::AdpException& e)     {         // Got some error         message = QString::fromAscii(e.message());     }     if(pApp != NULL)     {         delete pApp;     }     if(authorized == false)     {         QMessageBox msgBox(QMessageBox::Information, "4 Toddler", message, QMessageBox::Ok);         msgBox.exec();     }     return authorized; }


Call this function from your main()

if(IsAuthorized() == false) {     // Quit application     a.quit();     return 0; }

 

Creating RPM package


To install and run the application on MeeGo* we need to create an RPM package. RPM is something like an archive with binaries, icons, libraries, application info inside it. You can find a lot of info about RPM at www.rpm.org.

The Intel AppUpSM Developer Program has some requirements for RPMs described here MeeGo* Packaging and Compliance Guidelines.

First we need to create additional icons in PNG file format in sizes: 16x16, 32x32, 64x64, and 128x128.

Next we need to create a .desktop file for our application. This file contains some info for the OS about our application category, icon, binary file path. Create a new file with name 4Toddler.desktop.

[Desktop Entry] Name=4 Toddler GenericName=4 Toddler Comment=4 Toddler application Exec=/opt/com.company.4toddler/4Toddler Categories=Games Icon=4toddler Type=Application Terminal=false StartupNotify=true


Name - specific name of the application
GenericName - generic name of the application
Comment - tooltip for the entry
Exec - path to program to execute, possibly with arguments
Categories - categories in which the entry should be shown in a menu. Information about all categories can be found here
Icon - icon file name
Type - type of desktop entry. Can be Application, Link or Directory
Terminal - whether the program runs in a terminal window

Full description for all keys inside the desktop file can be found at here.

Next we need to make some changes in our project file. We should tell Qt Creator* which file should be packed to our RPM.

# Files to be packed and installed target.path = /opt/com.company.4toddler/ icon.files = Icon/4toddler.png icon.path = /usr/share/icons/ icon16.files = Icon/16/4toddler.png icon16.path = /usr/share/icons/hicolor/16x16/apps/ icon32.files = Icon/32/4toddler.png icon32.path = /usr/share/icons/hicolor/32x32/apps/ icon64.files = Icon/64/4toddler.png icon64.path = /usr/share/icons/hicolor/64x64/apps/ icon128.files = Icon/128/4toddler.png icon128.path = /usr/share/icons/hicolor/128x128/apps/ desktop.files = 4Toddler.desktop desktop.path = /usr/share/applications sounds.files = Sounds/*.wav sounds.path = /var/opt/com.company.4toddler/sounds/ ui.files = UI/*.* ui.path = /var/opt/com.company.4toddler/UI/ stars.files = UI/Stars/*.png stars.path = /var/opt/com.company.4toddler/UI/Stars/ icons.files = UI/Icons/*.png icons.path = /var/opt/com.company.4toddler/UI/Icons/ INSTALLS += target icon icon16 icon32 icon64 icon128 desktop sounds ui stars icons


Why do I choose /opt/com.company.4toddler/ for binaries and /var/opt/com.company.4toddler/sounds/ for application files? This is a requirement, described in MeeGo* Packaging and Compliance Guidelines.

Last thing, we should add spec file to our project. This file is needed to build RPM file from our project files. Add new 4Toddler.spec file:

# Define package name %define app_name com.company.4toddler Name:          4toddler Version:        1.0.1 Release:        1 License:        Intel Summary:        4 Toddler Application Url:            http://you_company_website.com Group:         Amusements/Games Requires:    libqt >= 4.7.0 %description Application description %prep %setup -q %build # Add commands here to compile the package. make %install make install INSTALL_ROOT=%{buildroot} %files %defattr(-,root,root,-) /opt/%{app_name} %{_datadir}/applications/*.desktop %{_datadir}/icons/*.png %{_datadir}/icons/hicolor/16x16/apps/*.png %{_datadir}/icons/hicolor/32x32/apps/*.png %{_datadir}/icons/hicolor/64x64/apps/*.png %{_datadir}/icons/hicolor/128x128/apps/*.png /var/opt/%{app_name}/sounds/*.wav /var/opt/%{app_name}/UI/*.* /var/opt/%{app_name}/UI/Stars/*.* /var/opt/%{app_name}/UI/Icons/*.*


Name - package name. Name of your application
Version - software version
Release - package version
Url - Url to your application web site
Group - package group
Requires - package requirements


You can read more about spec files here.

As you can see, the sec file contains several sections, marked with %. The most interesting section is the %files section. In this section you should define paths to all your installed files. If you forget to include something, this file will not be packed and installed.

Hint: To make sure all files are inside RPM package and have valid paths, I use 7-Zip. Using 7-Zip you can open and explore RPM packages.

Done! Your application is ready to be built, deployed on a device and submitted to the Intel AppUpSM Center. But don't forget to rename your package before submission to:

com.companyname.appname.rpm

Some useful links:
MeeGo* Packaging and Compliance Guidelines
Integrating the Intel AppUp™ SDK Suite in a MeeGo* app
Building a MeeGo* Application for AppUpSM using Windows* Development Environment
Installing the MeeGo* SDK for Windows*
Packaging/Guidelines - MeeGo* Wiki
Packaging/Tutorial - MeeGo* Wiki
Desktop file specifications
http://www.rpm.org/max-rpm/index.html

Have a question? Do not hesitate to ask.
Good luck!

For more complete information about compiler optimizations, see our Optimization Notice.

Comments

Dmitry Rizshkov's picture

@rzr Windows SDK required only if develop Windows apps.

rzr's picture

quotting :

http://appdeveloper.intel.com/fr-fr/node/2932

The AppUp SDK is a shared library that allows you to integrate with Intel's AppUp Store. Currently, it's only available for Windows but the Linux version is just around the corner.

-- http://rzr.online.fr/q/intel# Please support TiZen, native TiZen (qt,efl), android-x86, MeeGo, and other opensource projets...
Anavi's picture

Thanks Dmitry! It is a great article that can save a lot of time :)

's picture

I am trying to integrate the Meego SDK with my app but it is giving me Cannot find xml2.lib. What should i do?

Felipe Crochik's picture

After struggling for a while trying to figure out why just adding the INCLUDEPATH to my project (.pro) file would prevent me from rebuilding the code I found the issue.

When you install the "Intel AppUp SDK" on a Windows 64 bit system the default installation folder is "C:\Program Files (x86)\Intel\IntelAppUpSDKMeeGo\".
Later when trying to build the project you will get errors:

/bin/sh: -c: line 0: syntax error near unexpected token `('
...
make: *** [main.o] Error 2

Make sure to change the installation folder to something like "C:\Intel\IntelAppUpSDKMeeGo\" to avoid it.

rzr's picture

I should be libxml*.a or .so

but does intel appup still support meego ?

-- http://rzr.online.fr/q/intel# Please support TiZen, native TiZen (qt,efl), android-x86, MeeGo, and other opensource projets...
sagod's picture

Thanks for this article!
But I've got a question. Where I should put library file which used in my application? Not in /usr/lib/, isn't it?

's picture

I posted this somewhere else, but I am getting a bunch of LINK errors (over 100)that say that something is already defined somewhere else. Since this is my first attempt, I'm assuming this is a common newbie bug? What did this newb do wrong?

rzr's picture

just curious will this work if we copy $IADP_SDK_DIR_MEEGO to a linux box and do the same outside windows ?

--
http://rzr.online.fr/q/qt

-- http://rzr.online.fr/q/intel# Please support TiZen, native TiZen (qt,efl), android-x86, MeeGo, and other opensource projets...
's picture

I have added
INCLUDEPATH += "$$(IADP_SDK_DIR_MEEGO)Cpp\include"
LIBS += -lxml2\
-lpthread
LIBS += "$$(IADP_SDK_DIR_MEEGO)Cpp\lib\libadpruntime.a" \
"$$(IADP_SDK_DIR_MEEGO)Cpp\lib\libadpcore.a" \
"$$(IADP_SDK_DIR_MEEGO)Cpp\lib\libxerces-c.a" \
"$$(IADP_SDK_DIR_MEEGO)Cpp\lib\libxml-security-c.a" \
"$$(IADP_SDK_DIR_MEEGO)Cpp\lib\libcrypto.a"

in .pro file

and

my main.cpp

is

const ADP_APPLICATIONID ApplicationID={{0xECD102E2,0x2CCA4589,0xB1B5AE7E,0x2D806904}};

int main(int argc, char *argv[])
{

QApplication a(argc, argv);
com::intel::adp::Application *application = NULL;
try {
application = new Application(ApplicationID);
MainWindow w;
w.show();
}
catch (AdpErrorException& e) {
qDebug()<<"Caught exception in application with Exception code: "<

Pages