Themes for Harmattan – part 2: Packaging and building

In last post I started series of HowTo create a custom theme for Harmattan, from scratch to the community app store. This is the second part where I’m going to share some tips on packaging, and going through usage of Community OBS, step by step. I just taught myself to use Community OBS for building my apps and I must say, it’s about the time, OBS is really a great tool!

Now, if you are following these postings to create a custom theme, after the last post, you should have a theme ready for packaging. If you are already familiar with Debian packaging, you don’t need any guidance, but this is for those you aren’t that familiar yet. The minimal proper debian package needs only few files to guide how the package is built. Those are called control, rules and compat. In addition you might want to have changelog, copyright and readme. For packages that don’t actually need to build anything, but only extract files from the package to their rightful locations on the device is a handy tool called CDBS (http://build-common.alioth.debian.org/) . I got this tip to use such tool from a friend of mine, Juho, and thanks to him, I have to spent only a minimal time for the packaging process. The advantage of this tool is that you don’t need custom Makefile for your project, and also only two lines in rules file instead of normally needed few to tens of debhelper macros. As con sides, you have cdbs as an extra build dependency, and also you need one extra file to tell, what to install and where to install.

All the packaging files should be placed in a directory called debian, in your project directory. Easy way to create a skeleton for the package is to take some existing package and copy files from there. Another way to create the skeleton is to use QtCreator. Start new project on Qt creator, any kind of project will do, as long as you use the name of your upcoming package as a project name. Then add Harmattan as one of the build targets. Build the skeleton project once. After that, you can delete everything else, but things inside debian folder. Now you can move your theme stuff inside that new project folder and you have a skeleton packaging files. After creating skeleton, with either of those methods, or from scratch, you can start from the easiest file, compat, and change the compatibility value to 7, if it’s not already it. The second easiest file in this case is rules, normally it isn’t, but this time you can remove all the other lines but leave these two:

#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk

For the control file, you need a little bit more work to match the info with the ones for your package; name, version, category, homepage url, maintainer etc. One thing to notice at this point is that when packaging for Community app store, apps.formeego.org, you have to follow packaging rules which are mentioned here in section 1.4: http://wiki.meego.com/MeeGo_Apps/Packaging

The last file you are going to need for packaging is the .install file. It should be named according to your package. If your package happen to be name “mytheme”, then the .install file should be mytheme.install. The example installation lines I have in one of the theme packages are following:

funkyocean.desktop /usr/share/applications/
index.theme /usr/share/themes/funkyocean/
license.html /usr/share/themes/funkyocean/
icons/* /usr/share/themes/funkyocean/meegotouch/icons/

At simplest, it tells where to install .desktop file (more of desktop file in a bit), theme index file, license and the icons themselves, wildcard can be used to indicate to install all the icons which are in the icons dir of your package. The desktop file includes info of your application. The guide to create valid desktop file you can find from: http://wiki.meego.com/Packaging/Guidelines#Desktop_files

Here’s a couple of lines I added to my theme desktop files to prevent the package icon showing up in homescreen. I’m not sure if they are both needed, and you can experiment by having only of them, but here they are anyway:

NotShowIn=X-MeeGo;
NoDisplay=true

Now you may want to add some license, I’ve used one of the Creative Commons licenses. Changelog is also good to have for your release, especially if you are updating the package, it’s nice to have a description of what has been changing between current and last version of the package. Format for changelog you can find here: http://www.debian.org/doc/debian-policy/ch-source.html#s-dpkgchangelog. Now you are ready to test-build your package for sending to OBS for final build. Apparently this came out too long to have OBS n00b guide as is, so I’m leaving it for the next post. That’s how it always is with debian, nothing comes out short, not even with great helper tools..

Advertisements

5 Responses to “Themes for Harmattan – part 2: Packaging and building”

  1. Carol Chen (@cybette) Says:

    icons/* /usr/share/applications/funkyocean/meegotouch/icons/
    should be:
    icons/* /usr/share/themes/funkyocean/meegotouch/icons/
    right?

  2. Mariano Says:

    I’m a theme developer, and i would like to know if there is an easier way to packaging themes?

    • saijakristina Says:

      I haven’t been packaging themes since I made these two mentioned in the post, so I haven’t been thinking about easier ways to do the packaging. Though if you would like, I can dig you up (on monday, will leave out of reach for the weekend in an hour) some people I know who are / have been working on themes more lately?

      • Mariano Says:

        Thank you kris, now i have an easier way packaging with a script with nokia n9 but i would like an easier method with PC


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: