Creating a new package

Currently best supported are simple command line utilities without many build dependencies. For the sake of this example we'll duplicate the existing cal package, but additionally patch it to provide some Maemo-specific behaviour.. It is assumed that the previous tutorial has been folowed and that mud is installed and the alias set.

  1. Switch to the SDK_PC target.
  2. Create a file, packages/mycal.xml:
        <fetch type="debian">
  3. Extract the source to build/mycal/.build:
    mud get mycal
    .build is a symlink to whatever source directory is unpacked, in this case cal-3.5.
  4. Change to the build directory:
    cd build/mycal/.build
  5. We want to brand the calendar for Maemo, so we'll modify a source file, change source/cal.c, line 574 from:
    fputs("\t\t\t\t ", stdout);
    fputs("\t\t\t\tMaemo in ", stdout);
  6. Check your modifications build and install:
    mud compile mycal
    fakeroot dpkg -i ../../../upload/ccal*.deb
    ccal 2007
  7. If happy with your Maemo port, we now need to generate the patch for it to be submitted to the mud-builder project so that it is always applied in future. Check that the local Subversion repository contains only the changes you want:
    svn status
    Note that the source/cal.c line is prefixed with "M" for modified. This is what we want, note also the auto-changes to debian/control. We don't want to store this as it can be easily regenerated by mud-builder so revert that file and then save the patch into your local copy of mud-builder:
    svn diff debian/control
    svn revert debian/control
    mud diff mycal
    Files marked with a "?" are unknown to Subversion and are usually ignorable side effects of the build. If you add a new file, use svn add <path> to include it in the diff.
  8. Send packages/mycal.xml and packages/patch/mycal.patch to the mud-builder-users mailing list.
  9. Tidy up:
    mud clean mycal
    Because our changes were saved in packages/patch/mycal.patch, the next time that mud get mycal is run the patch will be re-applied after the source is unpacked.

There is reference documentation available on the XML-file package format.

[XHTML 1.0 Valid] © Andrew Flegg 2007. Released under the Artistic Licence.