JUN
29
2009

Packaging KDE applications for multiple distributions in the openSUSE build service

If you look at for example kde-apps.org or kde-look.org, there are numbers of various KDE applications, utilities, styles, decorations and what not. Various contributors post there their work for others to try and use. This is the place where new software or other contributions often look for their first users.

However, if you look closer, you may notice one problem - most of them are only provided as the source tarball, with no, few or old binary packages. Sadly, here the old jokes about how difficult it is to install software on Linux are still valid - it is not difficult to find applications with comments along the lines of "I tried to compile it, it said <whatever error>, what do I need to do, help". The difference between providing or not providing a simple way to install your newest creation can be the difference between users using it or not.

This may not seem to be that simple to solve though. There are probably only very few people who have all the major KDE distributions installed, let alone actually know how to create packages for all of them and have the time to do that. There are other community members who sometimes provide binary packages, but those only do it for a selected range, and they have to update them as new versions are released. More lucky contributions get picked up and packaged by distributions, but that can be difficult for new ones, since simply they are new and not many users know about them. So it looks like the usual kde-apps/kde-look/whatever contributor needs to depend also on luck to actually even reach the potential users.

Well, for those who still don't know it, let me introduce you: KDE contributors, meet the openSUSE build service; openSUSE build service, this big bunch of people are KDE contributors.

The openSUSE build service is a tool that is used to build the openSUSE distribution, but it can be also used to build additional software for openSUSE (such as the additional KDE repositories that provide various KDE versions). And, what many people might not know, it can be also used to build software for other distributions.

In fact, I've been looking into the possibilities recently, and, in the process of it, I have packaged a bunch of random kde-apps/kde-look stuff in my home repository. And, right now, I have packages for various openSUSE versions and SLED 11, Fedora 10, Fedora 11, Mandriva 2009, Mandriva 2009.1 Spring, Kubuntu 8.10 and Kubuntu 9.04. There are some more distributions supported, for example Debian, but those do not yet have a stable release containing KDE4, so tough luck there.

And I tried to cover various possibilities of what gets posted on kde-apps/kde-look:

  • I was probably the first one to package the KWin Aurorae SVG decoration engine by Martin Graesslin soon after he had announced it there, as soon as the necessary KDE4.3 beta2 release entered the KDE4:UNSTABLE repository. I also packaged the Nitrogen KWin decoration, just to have a decoration that builds on more distributions.
  • I packaged a set of the Glassified KDM, Plasma and splashscreen themes. The themes were actually just tarballs containing the files (and that actually gave me a hard time when trying to package that for Ubuntu) that need to be uncompressed into the right place, but still, there is the convenience of just installing a package and be done with it.
  • I miss the ability switch using keyboard shortcuts between taskbar entries like it was possible with Kicker. There was feature freeze, so instead of providing a patch for Plasma I went for a temporary solution and wrote a simple KDED module hacks that does it. And from the moment I uploaded it to kde-apps as TaskbarSwitch there were also binaries.
  • I packaged KShutdown, Ksshaskpass and Kvkbd as examples of various applications. Together with Ksshaskpass I also created a local modification of the openSSH package and sent a request to its maintainer to include a change that enables openSSH to use Ksshaskpass. Kvkbd needed a patch fixing it to work with the XDM/KDM setup on openSUSE.

And the best part about it is that it was actually quite simple and easy. I just took a template for .rpm and .deb packaging, filled it in, tweaked a bit if needed and submitted to the buildservice. Then checked the results after a while, fixed problems and now it is all in home:llunak:kde, ready to be used. Anybody who can code a small KDE application shouldn't have a problem to do the same and then say that the package is in the repository home:<whoever> and that the installation instructions are at http://en.opensuse.org/KDE/Build_Service.

Of course, it was simple and easy for the Lubos Lunak who wanted to package those things, as that was the point. The other Lubos Lunak, the one trying to ensure it was that way, had it a bit harder. The openSUSE Wiki has a lot of information, but it was necessary to read it and try it out. Some work was needed for building from one .spec file for all RPM distributions (really just one .spec, the only package that needed conditionals was Ksshaskpass, and only because I knew the special handling needed to fit with openSUSE's openSSH). It is of course possible to build for each distribution using their .spec syntax, but I wanted the possibility of having just one syntax that would be mapped automatically as necessary using macros and package renames. Some work was (and still is) needed to help making .deb packaging as shared with .rpm packaging as possible (I think I can forget generating it automatically from the .spec, but for example Debian/Kubuntu build system accepts only .tar.gz tarballs, so there is a build service patch from me pending to make the possible conversion automatic).

That work is going to be only mine, though, the plan is still to make it easy for you. Well, ok, I wouldn't mind if at least somebody added better details to the distribution-specific pages linked from the main page, because I e.g. haven't managed to find out how to easily add a new custom repository on other distributions. So if you are waiting now for a howto, this will need to wait for a while, until it is prepared and cleaned up. You can however try to bribe me at Akademy into demoing it personally :).