Packaging and Publishing MeeGo/Harmattan Applications for Mer/Nemo via OBS

MeeGo/Harmattan uses Debian-based packaging whereas Mer/Nemo uses RPM-based packaging. Additionally, there are also some differences with respect to using the OBS for publishing packages. This might lead to some confusion when one tries to package and publish packages for Mer/Nemo.

In this post I will explain the steps I did for packaging and publishing my MeeGo/Harmattan applications to Mer/Nemo the first time. I assume you are already using the MeeGo OBS for publishing your packages. Furthermore, the “Spectacle” utilities are required on your local computer.

Set up the OBS:

At first a new repository for building against Mer/Nemo needs to be added to the home project in the OBS. To do this login to the OBS and go to your home project. To add the new, required repository select the “Repositories” tab. In the “Repositories” tab choose “Add repositories”. At the time of writing the repository we need was not directly available in the presented selection of repositories so you need to use the link “pick one via advanced interface” in order to use a more advanced selection method. In the “Advanced Search for Build Targets” enter “CE” in the “Project” search field. You should be presented with a number of different possibilities in a drop down list. We are going to use the last one “CE:MW:MTF”. As far as I understand this is the correct project to build applications using the MeeGo Touch Framework against. Please correct me if I am mistaken. With respect to the other fields we are for now sticking to the defaults of “Repository” set to “CE_MW_Shared_armv7hl” and “New Name” being “CE_MW_MTF_CE_MW_Shared_armv7hl”. Finally, you need to choose the architecture for which you want to build. I selected “armv8el” here.

Now you should have the new repository required for building and packaging for Mer/Nemo ready. You can verify this by going back to the “Overview” tab. There you should see the new repository being added. You will probably notice that all your packages are “excluded” for now. This is because the files required for building with the new repository had not yet been uploaded. We will do this soon.

Prepare the required files:

I assume that we are going to package and publish an application that had so far only be packaged for MeeGo/Harmattan via the Debian-based system. I will use my application MeePasswords as example. You can find the current source code including the files I use for packaging at gitorious: https://gitorious.org/meepasswords

The files used for packaging as RPM for Mer/Nemo are located at: https://gitorious.org/meepasswords/meepasswords/trees/master/qtc_packaging/rpm_nemo Note that there are three files *.changes, *.spec, and *.yaml. The first of these three, *.changes, is simply the changelog in yet another, slightly different format and is, as far as I know, optional. The other two, *.spec and *.yaml, are in any case required for building and packing for Mer/Nemo.

The most important file here is the *.yaml file. For more information about this file see, e.g.: http://wiki.meego.com/Packaging/Deb_conversion_example or http://wiki.merproject.org/wiki/Spectacle For a start it is sufficient if you copy the existing *.yaml file and simply adjust it to your needs.

Note: when you use the *.yaml file from my MeePasswords example please make sure to delete the line containing “- qca2” in the “PkgConfigBR” section and the line containing “- libqca2-plugin-ossl” in the “Requires” section! This is needed as I am using, as the time of writing, a little “hackish” way for adding the qca2 dependency.

Please also note that when defining dependencies the naming of dependencies has changed as well. For more information on this and on how-to identify dependencies please see my other post. Furhermore, you can find a list of available values for the “Group” entry in “/usr/share/spectacle/GROUPS”.

Once you are finished with changing the *.yaml file you can create the *.spec file using the “specify” utility that is part of Spectacle. Simple run “specify” and pass it the name to your *.yaml file, e.g., as follows “specify meepasswords.yaml”. There you might be asked whether you “… Need to create Makefile from default template …”. You can simply anser “No” here. You should now have the corresponding *.spec file.

If needed it is now possible to make some changes to the *.spec file. For details about this see the links related to Spectacle above. In practice, I found that I didn’t need to do any changes there.

Please note that I used “%{name}_%{version}.tar.gz” as source file name. Note the underscore there. I do this because this way I can reuse the source archive that is created for Debian-based packaging also for the RPM-based packaging.

Upload everything:

So, the final steps now are to upload the source archive and the three newly created files to the OBS as usual. If you didn’t change anything in your source code you can simply skip adding the source archive and use the one you already had uploaded to the OBS before. Once you have uploaded everything the OBS should start building for the new repository.

Please note that your new package might not work out of the box. In this case the OBS log file and status messages provide valuable information on how to fix your package.

Install the results:

Last but not least, you usually want to install what you just created. This can be simply done by adding your new repository to your Mer/Nemo installation using zypper. To get the URL of your repository simply go to the “Repositories” tab of the package and click the link for the Mer/Nemo repository. We used the default name of “CE_MW_MTF_CE_MW_Shared_armv7hl”. On the following page, click the “Go to download repository.” link. You will be taken to the download repository. Note that there is a file called “home:your_name.repo”. You can simply add your new repository by providing the URL of that file to zypper. In my case I used the following command to add the new repository:

[root@localhost ~]# zypper ar http://repo.pub.meego.com/home:/wonko/CE_MW_MTF_CE_MW_Shared_armv7hl/home:wonko.repo

Note that you only need to add your repository once. All other packages you create for Mer/Nemo the way as described above will also be put there. You just need to update or refresh your local repositories using “zypper ref” in order to get the latest state of your download repository. Also note that, for now, your repository is not signed and you need to confirm that you want to use an unsigned repository at the command line when refreshing.

Advertisements
This entry was posted in Misc., Snippets and tagged , , , , . Bookmark the permalink.

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