Themes for Harmattan – Part 3: Using C-OBS and submitting to store

In last postings I’ve been telling how to create custom theme for Harmattan, and how to change between installed themes with ThemeChanger tool (http://leimu.drupalgardens.com/content/themechanger by Leimu). Also how to create valid debian packaging for the theme and preparing the package to be built in OBS. This is the last part of the themes trilogy and will give a quick guide for using Community OBS (https://build.pub.meego.com/), or OBS in general.

To get started with Community OBS, you need to contact either X-Fade or lbt #meego@freenode on IRC. Kindly tell them about your project and ask for either of them to enable your C-OBS account. You have to have existing meego.com account to have your C-OBS account enabled, the same credentials will then work in C-OBS.

There are two ways to use C-OBS, the web interface and OSC tool (http://en.opensuse.org/openSUSE:OSC). There are plenty of tutorials on how to use OBS with OSC, like this here: http://wiki.meego.com/Getting_started_with_OBS. Also I’ve found this cheat sheet very usable: http://en.opensuse.org/images/d/df/Obs-cheat-sheet.pdf when dealing with OSC. Instead of OSC, this tutorial is focusing on how to use OBS from the web interface.

When you login first time to https://build.pub.meego.com/ you’ll see five large icons showing up your quick options. Because we want to create a project to build the custom theme, we select the fourth icon New Project. This project is going to be one of your subprojects of your Home Project. Now you have to give a name to your subproject and a little description of what it’s about. In my case I created project called “themes”. The next hierarchy level under subproject is Package. You can add multiple packages under one subproject, like I’ve done with both of my themes. When you have your new project ready, you can start adding Repositories to build your project on. This time we are adding only Harmattan repositories. It is usually wise to create separate subprojects for different target repositories, especially if their packaging differs from each other, like in case Harmattan vs MeeGo. If I would build these same themes for MeeGo also, I would create another subdirectory for them. This reminds me of something, if I’ve known this from the beginning, I would have named my theme subproject as themes-harmattan, so I could name the other one themes-meego.

Let us have some target repositories. To add one, select Repositories tab from your new subproject view. Select Add Repository in the repositories view. There are two ways to add a repository, either with simple interface or with advanced interface. Only some repositories are available through the simple interface, Harmattan is not one of them. To add Harmattan, you need to select  pick one via advanced interface. Start typing “harmattan” to the project search field, and it will complete with you some options. Select MeeGo:1.2:Harmattan from them. Leave Repository field intact. In the New name field you can give a new shorter name to the repository for your own convenience like simply “harmattan”. From architectures, tick armv7el only, and then press Add repository.

Now you’re ready to upload your package. Go to Packages tab in your subproject view and select Create new package. You have to give a name and description to your package. When you’re done, you can start uploading files. For that, in your newly created package’s main view, select Sources tab. In the last part of the tutorial we test built the package. Now you will need part of the side products of that build. If you don’t have them anymore, you can rebuild the package to regain the needed files for OBS. Only two files you need for building for Harmattan are the source tarball (file with .tar.gz suffix) and .dsc file. They should be found from the one directory up from your build directory. You can now use local file upload feature of the sources view to upload those two files to the OBS. Once you’ve done with the upload, OBS automatically triggers a build when it notices that those files needed for build are both present. To check the build progress, you can return to main view of your package selecting Overview tab. Build status box on the right should show build status for your target repository. If the status is not “building” you may need to click the reload status icon. If you can’t see your repository in build status box some extra work is needed, this has happened to me a couple of times. It means that the selected architecture was not successfully applied to your repository. To fix this, go to Repositories tab. There you see your repository and a note which says that these repositories are inherited from your subproject. Now select the link to your subproject, in my case: home:matrixx:themes. There you see your configured repository again. Select Edit repository from architectures, re-tick armv7el and click the Update button. If everything did go well, you should now see your package under Packages tab building nicely against Harmattan target. If build fails, go back to last tutorial  and check everything is in place. The usual suspect when something fails has been in my experiments, the build dependencies. OBS is much more pickier with those than scratchbox, so you might have a perfectly building package in scratchbox, but not in OBS. When package has “succeeded” build status, you’re ready to add some extra stuff for the app store submission.

The extra stuff needed for the app store submission are described here: http://wiki.meego.com/MeeGo_Apps/Packaging. Shortly, you’ll need at least one screenshot and icon. Screenshot name should end screenshot.png and the icon needs to be named icon.png. Harmattan category section we already covered in the last post. In addition, your package needs to have a proper description. The submit process is highly automated, so it’s important to have that info, and also screenshot and icon names correct to pass the automated tests. The extra files are added same way than the package files themselves, through upload system in Sources tab.

The actual submission is done according to this guide: http://wiki.meego.com/MeeGo_Apps/Submit. Briefly: Go to your package’s main view and click Submit package. You are now asked to fill in the repository where you are submitting, type in: MeeGo:1.2:Harmattan:Apps:Testing. Do not tick the empty check box. After you have submitted your package, you are forwarded to request follow-up page. There you can happily wait a while when refreshing the page and wait the your request changes state from New to Accepted. There should be some email notifying you in certain states of the test run, but I’ve so far received none, so I don’t expect you also getting any. If you are using IRC, you can follow your request on #meego-boss @ freenode, where bot is spamming with all the things happening on C-OBS at anytime. If the request fails, the request page or the bot will tell you what went wrong (missing metadata, name, description…). Everything can be fixed and resubmitted with the same steps. Once the request is Accepted, your package will show up in http://apps.formeego.org/staging/basecategories/n9/pr1.0/harmattan/ in the same category you selected for your package. This is a staging are for all the applications which were accepted to Harmattan testing repositories. They have to go through the Community QA review process, where they need to get 6 positive reviews to be promoted to http://apps.formeego.org/basecategories/n9/pr1.0/harmattan/ .

From http://apps.formeego.org/basecategories/n9/pr1.0/harmattan/ you can also download the Community Apps client if you dont have it already. It lets you browse and download apps in http://apps.formeego.org. While waiting for your app to be promoted, you can do others a favor and rate/review the other goodies waiting in the testing area. You can browse and install also the apps in the testing area with the Apps client by installing appstestingenablerharmattan package on your device. After installing the Community Apps client, it should be possible to install the package via apt-get. Now you can give those goodies a shot and review them with a same go.

I hope this whole shananigan did make any sense, and I will see also other themes in the store soon. There’s already a request from @knobtviker to create a Tron theme, just for lulz 😀

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..

HowTo: Custom theme for Harmattan, from scratch to Community App store

There is something I want to share with you. I’ve been lately tinkering on customizing Harmattan to look like it’s _my_ phone. There was a time when Widgetsgallery demo app was included in the Harmattan image, and it had a feature which allowed changing between installed themes. Now the app is gone from the image, but the source is still available in gitorious. I decided to bring the most useful feature back and assembled a dedicated theme changer application, taking advantage of the LGPL source of Widgetsgallery. The ThemeChanger app ( http://leimu.drupalgardens.com/content/themechanger by Leimu ) is currently downloadable from Community OBS. Here’s quick instructions how to do it most conveniently from your device:

Add a file named themechanger.list to /etc/apt/sources.list.d/ and write this line to the file:

deb http://repo.pub.meego.com//home:/matrixx:/themechanger/MeeGo_1.2_Harmattan_Maemo.org_MeeGo_1.2_Harmattan_standard/ ./

Now you can apt-get update & apt-get install themechanger.

If you would like to test the ThemeChanger app out, you’ll need at least one custom theme installed to your device. You can download the ones I did by adding this repository to your device:

Add a file named themes.list to /etc/apt/sources.list.d/ and write this line to the file:

deb http://repo.pub.meego.com//home:/matrixx:/themes/MeeGo_1.2_Harmattan_Maemo.org_MeeGo_1.2_Harmattan_standard/ ./

Now you can apt-get update & apt-get install either funkyocean or purplehaze packages.

Here’s how they look like:

Image

and

Image

To create your own icon set, it’s easiest to see what one of those have been eaten. All the installed files are found under /usr/share/themes/funkyocean/ or /usr/share/themes/purplehaze/.

Basically the minimal you have to have is the index.theme file and the wanted amount of icons. My icon set includes icons for the basic pre-installed applications excluding games. In your icon set it’s possible to have more or less icons, depending of your choice. Complete instructions on creating a theme and how to use the ThemeChanger tool is located here: http://leimu.drupalgardens.com/content/themechanger

When you have all the icons (sized 80×80 pixels) ready for your theme, it’s time to create packaging for the set. Easiest way to create a debian package which does not build anything, just installs the icon set files, is to use cdbs tool which is installable in scratchbox. When your package is complete, you can create a project in Community OBS. I’ll continue with detailed instructions on packaging and with instructions for using C-OBS for n00bs like me in the next posting.