The configuration file generation framework is a build system for configurations files. It is based on make and offers a variety of rules as well as helper scripts. A Debian package for cfgf is available in the apt repository on this server.

By itself, cfgf does not provide any configuration file template, but it has been designed as a pluggable system. Third-party modules can enhance its functionnality and provide such templates, either by dropping files in its installation directories directly (naming conventions are defined in order to avoid conflicts), or by using a separate directory to be inserted by the administrator into cfgf's VPATH.


Filesystem usage

cfgf uses GNU make's VPATH feature to superimpose multiple directories below the working directory. On an FHS-abiding system these would be:

Those directories contain the following files as well as their sources:

make targets

Configuration file symlinks installation

Stamp files

File generation rules

m4 macros


List loops

Associative lists

Key-value associations can be encoded as lists of lists, where the leading element of each sub-list acts as the key, and the trailing ones as the value. Non-listed keys conceptually have an empty value associated to them.

Helper scripts


Usage: cg_find options [--] findargs

Runs find in each directory from the union used by cfgf, and combines the result. The precedence between the directories is preserved. The following output formatting options are available:

Note that -l and -f will still print . for the working directory.

The findargs are passed to find untouched, and as such can comprise anything it understands, including a leading list of subdirectories to search. However, the found files should still be printed by find in the usual, default -print format, or cg_find won't be able to decipher its output.


Useful from m4 templates, this helper script converts its standard input to an m4 list. Its optional depth argument is an integer. The following conversions are made: