Packaging eBox
Directory layout
Packaging files for eBox are stored in the packaging/ tree in the base of the eBox SVN repository.
There you can find a debian/ directory which contains directories for the different distributions which use the Debian packaging system. Inside these directories you'll find a trunk/ directory containing the latest packaging version, plus a tags/ directory with the packaging files for already released distributions. The trunk/ directory contains the debian directories for each module and are named after the modules.
In the scripts/ directory there are a few scripts that turn releasing and packaging eBox for supported distributions into an easy task.
Packaging steps
For official packages to be done, the eBox code needs to have been tagged. Tags follow the following format: X.Y-series/X.Y.Z. The eBox version 1.3.0 will be tagged as 1.3-series/1.3.0.
Once the tag exists, the next step is to update the current packaging files if required. This might be due to a new major ebox version which implies changes in control files, new patches required or old patches no longer needed or other different reasons.
The patches are stored inside the patches/ directory inside the debian directories and applied using simple-patchsys.mk. If one of the modules has no patches you'll have to add this directory and add a include for simple-patchsys.mk in the debian/rules file when you are adding the first patch. As far as it's reasonable is considered a better policy to try to make the eBox code work with as many distributions as possible instead of using patches. An example of this is the new detection for the GConf version to know whether DBus needs to be initialized or not.
As it's not easy to maintain these patches up-to-date, there are eBox branches to make this easier. They are named <distribution>-patches, and they hold the required changes to make eBox work on a given distribution. Ideally these branches should always be a branch from the latest release or trunk and contain only the changes required to make eBox work in that distribution. When new releases appear the recommended procedure is to just delete the branch, re-branch from the appropriate source and reapply the diffs from the last package to keep the branch clean and with a "1 patch-1 commit" policy.
Once the source is tagged and the packaging changes are done, we can proceed to package eBox. There is one script that takes care of almost everything: generate-ebox-packages.
This script is invoked like this:
# generate-ebox-packages <tag> <dist>
p.e.,
# generate-ebox-packages 1.3.0 jaunty
The script will perform the following steps:
- Create a temporary directory to hold all the files required in the process
- Checkout the eBox tag specified
- Generate the source distribution using make dist
- Change the source tarballs name to the appropriate ones for Debian packages
- Build each one of the packages, either:
- Using an already existing checkout of the packaging/ directory, pointed to by the environment variable EBOX_PACKAGING
- Exporting the packaging into the temporary directory if no EBOX_PACKAGING environment variable exists If available, the script will use the packaging for the version provided (from the appropriate tag), otherwise it will use the packaging in trunk/
Each of these steps is performed by a different script which is invoked from the main script. The most important one is the latter, build-ebox-packages. If there are problems building some packages, the only actions needed are fixing the packaging and then running again build-ebox-packages. build-ebox-packages takes as first parameter the distribution it needs to build the packages to and then interprets any further parameter as names of packages to build, building all of them if no names are provided at all.
By default the script uses the -S option to just build source packages, but that can be changed with the option "-dopts", if this option is provided the options specified will be passed to dpkg-buildpackage instead of "-S", an example invocation could be:
build-ebox-packages -dopts "" jaunty libebox ebox
to rebuild the libebox and ebox packages for jaunty distribution not passing "-S" to dpkg-buildpackage
Temporary packages
Even if the debian/ directory will no longer be present in the source code of eBox, it's still possible to make quick&dirty packages using the ebox-package script. The new version of ebox-package will try to look recursively for the packaging/ directory in the parent directory and will use the appropriate packaging once found.
If you have one directory holding trunk/ and a few branches, just checking out packaging/ in that very same directory will suffice. By default it will use the packaging for 'hardy' but that can be changed by providing the distribution named in the command line such as:
ebox-package ebox jaunty
