[maemo-developers] Help needed: packaging/distributing very small C app

From: Bruno Araujo bruno.araujo at openbossa.org
Date: Mon Apr 19 22:48:13 EEST 2010
On Mon, Apr 19, 2010 at 2:41 PM, Thomas Waelti <twaelti at gmail.com> wrote:
> I'm looking for "advanced" packaging information for a very small C application.
> While I've learned to build a .deb for a python app using py2deb, I now face another task of packaging where the effort to package could very quickly become exponentially greater than the effort needed to "write" the application itself. Here's the story:
> I needed a way to start the playback of a certain playlist in mafw/gstrenderer. Unfortunately, the python-mafw doesn't support this. I also stalled on using ctypes or going through d-bus.
> However, I found the source code for "mafw-renderer-example"*, a CLI app that includes the desired functionality.
> (* http://wiki.maemo.org/Documentation/Maemo_5_Developer_Guide/Using_Multimedia_Components/Media_Application_Framework_(MAFW)#Renderer_example )
> I then took that code and made some slight modifications to suit my needs (shuffle the playlist before starting playback, exit the app after starting playback). After building my first C app (hooray!), I now have an ARMEL binary named mafw-play-list that does what I want.
> Now I face the daunting task to distribute that code/binary, as I will need it in another app of mine (and because I believe others might like it, too).
> I'ts just one source file (400 lines, 10kB) and it takes two lines to compile. How should I distribute this?
> (I've already built a binary-only package using py2deb and uploaded it to extras-devel - but I believe this is not the right way to do it).
> Can someone explain what to do correctly?
> Or could someone even lend me a hand in packaging this?
> Thanks!
> -Tom
> BTW: strangely, the in-built media player is not aware of any alternatively started playlists in it's renderer. Exists there anything to signal something about a running playlist to the Media player?
> _______________________________________________
> maemo-developers mailing list
> maemo-developers at maemo.org
> https://lists.maemo.org/mailman/listinfo/maemo-developers

I'm not a packaging specialist, but I'll try to help :)

Here is a bare-bones and direct way to do it, inside Scratchbox and
using CDBS [1] and GPL2 license:

0. create environment variables for your name and email (they will be
useful later for automatic filling of some fields):

export DEBEMAIL="<your email>"
export DEBFULLNAME="<your name>"

1. Create a directory in the form <packagename>-<version> (e.g.
mypackage-1.0.0) and put your source files there;

2. Enter the directory and run:
$ dh_make -b -c gpl
and hit enter;
-> Obviously, if your package has a different license, you just have
to pass a different string to -c parameter of dh_make; run dh_make
--help to see available licenses and all other options - or you can
just edit debian/copyright directly afterwards;

3. Inside the created ./debian directory, remove all *.ex files
(they're all examples);

4. Edit debian/control and fill necessary fields and descriptions;
-> Build-Depends: dependencies for building your package
-> Depends: dependencies for installing your package

5. Edit debian/changelog and fill necessary fields;

6. As your have only one source file and assuming you use GNU make, it
may be not necessary to edit debian/rules, it should just work. If it
does not, however, go to [1] to see detailed instructions for CDBS.

7. Now run dpkg-buildpackage and see what happens:
$ dpkg-buildpackage -D -rfakeroot

8. With luck, your package should be built now, and ready to upload to

As I said, I'm no specialist, but I have dealt with Debian packaging
for some time. My instructions may not be exactly accurate (please
correct me as you see fit), but they at least should help you to get
started. Also, the package can be further tuned, so this can be an
excellent opportunity to learn the ways of the Maemo Debian Packaging

Well, that's it. Hope it helps!

[1] http://cdbs-doc.duckcorp.org/en/cdbs-doc.xhtml


Bruno Araújo, MSc
openBossa Labs - Instituto Nokia de Tecnologia
Manaus, Brazil

"Any sufficiently advanced technology is indistinguishable from
magic." - Arthur C. Clarke
More information about the maemo-developers mailing list