Developing and integrating a new package

The command automagix can be used to create a new package, to integrate it in the list of existing package and to update its configuration files. The constructed package will follow automatically the structure described here.

1.Creating the framework of a package

When you plan to develop a package (say foox) that fit the structure requirements defined here, the following tasks, prior to the execution of automagix:

  1. Create a directory foox with the same name as the package, and in this directory, a subdirectory specif:

    mkdir mypkg
    mkdir mypkg/specif

  2. To specify the behavior of the configuration tool, we have to edit or create the file foox/file/foox.amx as follows:

    // Name and version
    foox: Package := package ("foox", "0.1");
    
    // Package is enable by default?
    foox.default := true; 
    
    // Dependencies to other packages of the projet
    foox.dependencies := [ "package1",... ];
    
    // Dependencies to external libraries
    foox.external := [ "library1",... ];
    
    // Documentation to be build?
    foox.documentation := true;
    
    // Extra files to be distributed
    foox.extra := [ "file1",... ];
    
    // Configuration and building files handled
    foox.automatic := [ 
      "configure.ac",      
      "Makefile.am",        
      "build/Makefile.am",
      "doc/Makefile.am",
      "script/foox-config.in" 
    ];
    
    // Main setup command
    create_package (foox);

    The names in the list automatic are all optional.

    If automatic contains configuration.ac, this file will be generated. In this case,

    • a macros directory with the rquired macro definition files (.m4) will be created.
    • for each library of the external list and each package name of the dependencies list, the autoconf macro AC_WITH_NAME and AC_LIB_NAME will be included.

    If needed, customization can be done in automagix/mmx/package_configure.mmx, that can include a file automagix/data/foox.configure.ac on demand.

    If automatic contains build/Makefile.am, the files in the directory src, include/foox, glue, test, ... needed to build the different libraries, the tests, ... will be automatically listed in this file.

  3. Run the command automagix in the directory foox. To have this command in your path, first type

    cd /path/to/mmx; source set-devel-path

    To run automagix, the interpreter command mmx-light should be available (configure –enable-mmxlight).

    cd /path/to/foox; automagix

    Note that automagix accepts the following options:

    • –quiet for running in quiet mode;
    • –dry-run that does not actually change any files but just prints what would happen.

    Running automagix inside a package directory does the only updates concerning that package and the top level.

    If the directory axel exists in the package, the option –enable-axel will be added to the configure.ac files, with the corresponding macros to test and generate axel plugins.

  4. If automatic contains configure.ac, to generate the configuration files used by the autotools suite, you can now type in foox:

    autoreconf -vfi

    The configuration and building commands are now available:

    ./configure ...
    make
    make check ...

Golden rule: never modify the automagix scripts by your own without the help of an administrator of the projet, since this might have disastreous effects on the building of other packages.

2.Working with a collection of packages

To work with a collection of packages at the same time, you can have them in a joint directory,

cp -r pk1 pk2 .. mydir

and run in mydir:

automagix

This will search all the mmx packages visible in this directory (that is those directories pkg which contain specif/pkg.amx) and produce global configuration and building files.

The dependencies between the packages (using .dependecies in the files specif/pkg.amx) will be taken into account, to sort them.

To (re)generate the configuration files of these packages, one needs to do the following:

make reconfiguration

To configure and build the different packages, one uses the usual command:

make

The packages will be processed in the order they have been listed by automagix, starting with the more autonomous packages. For a detail description of the different available options, see here.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License. If you don't have this file, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.