[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ A ] [ B ] [ C ] [ next ]


Custom Debian Distributions
Appendix B - Quick intro into building meta packages


There are several descriptions available how to build Debian packages in general. The main resource might be the repository of Debian packaging manuals (especially developers reference chapter 6, best packaging practices). There are several external packaging HOWTOs for example the one from Joe 'Zonker' Brockmeier.


B.1 Defining dependencies for meta packages

This howto describes the building of meta packages by using the cdd-dev package. It is perfectly possible to build a meta package as any other normal Debian package but this HOWTO has the only purpose to describe the profit you might gain by using these tools.

     ~> cp -a /usr/share/doc/cdd-dev/examples/tasks .
     ~> cat tasks/README
     ~> edit tasks/task1
     Description: short description
      long description as in any debian/control file
     
     Depends: dependency1, dependency2, ...

For each meta package this skeleton of a debian/control entry is needed. All necessary information is available in the directory /usr/share/doc/cdd-dev/examples/tasks.


B.2 The packaging directory

To build any Debian package you always need a directory named debian, which contains a certain set of files. The package cdd-dev provides a complete set of example files that only have to be copied and after editing some place holders are ready to use.

     ~> cp -a /usr/share/doc/cdd-dev/examples/debian .
     ~> cat debian/README
     ~> edit debian/control.stub

Now the variables in the file control.stub change the variables named _CDD_, _MAINTAINER_ etc. to match the names of the Custom Debian Distribution to be built. Please note that the file debian/control is and has to be a symbolic link to control.stub to let the cdd-dev tools work.

     ~> edit debian/rules

Also in the debian/rules the name of the Custom Debian Distribution has to be inserted where the template contains _CDD_. Depending from the way the sources.list should be scanned the options for the gen-control call can be adjusted.

You have to build the tarball using the command

     ~> make -f debian/rules get-orig-source

For your comfort you might like to create a file Makefile containing

     #!/usr/bin/make -f 
     include /usr/share/cdd-dev/Makefile

which enables you to simply use

     ~> make dist

to build the source tarball. This tarball has to be moved to a location where the meta packages will be built. Unpack the tarball there and start the build process using for instance

     ~> debuild

That's all for the very simple case when the meta packages should not contain user menus. Even if user menus are suggested they are not necessary. The following paragraphs describe how to use the cdd-dev tools to support these menus.


B.3 The common meta package

The creation of a common package is optional, but suggested, because it adds some special features like menus, user groups, and probably more in the future. It is automatically built by cdd-install-helper, which is called in debian/rules, if the common directory exists. The easiest way to create this is as follows:

     ~> cp -a /usr/share/doc/cdd-dev/examples/common .
     ~> cat common/README
     ~> edit common/conf common/control common/common.1

The variables (_CDD_) in these three files have to be adjusted to the name of the Custom Debian Distribution in question. This cdd-common cares for the initialisation of the role based menu system and might contain adjustments of the general configuration inside the cdd-common.

If the meta package cdd-common will be created according to these rules all other meta packages will depend automatically from this common package. For the friends of auto-apt, a helper /usr/bin/<meta-package-name> will be installed as well, which just prints some information about the meta package. All in all, the usage of the common package is strongly suggested to have a common registry for stuff like user roles and possibly other things that will be implementd in the future.


B.4 The meta package menus

As explained in User menu tools, Section 6.3.1 the meta packages can contain user menus. This optional feature can be implemented easily by using the template from the cdd-dev in the following way:

     ~> cp -a /usr/share/doc/cdd-dev/examples/menu .
     ~> cat menu/README
     ~> edit menu/task1
      Edit the example to legal menu entries of the
      dependencies of this meta package
     ~> cp menu/task1 menu/<meta package name>

A menu file for each task should be created containing valid menu entries for each dependant package. The easiest way to obtain those menu entries is to simply copy the original menu entry files that are contained in the packages on which the meta package will depend. The only thing that has to be changed in these menu entries is the package field, which has to be changed from <dependent package> to cdd-task. All other entries might remain unchanged. This is a good point to check whether the menu entries of the packages you depend from are formated nicely and print the necessary information (for instance make use of "hints"). Here the meta package maintainer has a good chance for quality assurance work, which is also part of the Custom Debian Distributions issue.

In principle these menu items could be created automatically either at meta package build time or even better in the postinst script of the meta package because it is granted that the needed menu files are installed on the system, which is not really necessary on the meta package build machine. This might be implemented in later versions of cdd-dev. Currently the policy is that we like to have a little bit of control about the menu entries for the quality assurance issue mentioned above. Last, but not least, there are packages that do not provide a menu entry. If this is the case because the package maintainer just forgot it a bug report should be filed. On the other hand, there are packages with programs that provide a command line interface that does not allow a reasonable menu entry. A solution for this case is provided in the next paragraph.


B.5 Menu for any dependency

The idea of the meta package menu is to provide the user with easily viewable traces of any installed package that helps solving everyday tasks. So if there are packages that do not contain a menu, a screen with relevant documentation should be provided in a viewer by the creator of the meta package. Such documentation can be created using the following templates:

     ~> cp -a /usr/share/doc/cdd-dev/examples/docs .
     ~> cat docs/README
     ~> edit docs/task1/dep1
      Provide information about a package <dep1> that is
      a dependency of the meta package <task1>, but does not
      contain a useful menu entry.
     ~> cp docs/task1/dep1 docs/task1/<dependent pkg>
     ~> cp -a docs/task1 docs/<meta package name>

This ensures that our users become aware of all interesting packages on their system. The documentation files should contain hints to man pages to read, URLs that should be visited to learn more about the package or some short introduction how to get started.


[ previous ] [ Contents ] [ 1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 7 ] [ 8 ] [ 9 ] [ A ] [ B ] [ C ] [ next ]


Custom Debian Distributions

4 July 2008

Andreas Tille tille@debian.org