Configuration 4 GNU (CFG)


Download Config4GNU (old)

A snapshot release, version 0.1.8, of the Config4GNU package was made in April 2003. It is available as a source tarball here. Please read the README and INSTALL documents included in the tarball for further instructions.

CFG has the following dependencies:

  • Xerces-C++ (>=2.1)
  • glib-2.0 or higher (REQUIRED)
  • libsigc++-1.2 or higher (REQUIRED)
  • Perl header files (to compile Perl extensions, REQUIRED)
  • gtkmm-2.0 or higher (to compile GTK client, STRONGLY RECOMMENDED)
  • libglademm-2.0 or higher (to compile GTK client, STRONGLY RECOMMENDED)
  • PHP header files (to compile PHP extension, OPTIONAL)

If you just want to see what it looks like, visit our screenshots section for some nice shots of CFG in action.

For developers, you should also try checking out our latest code from CVS. (SWIG 1.3 or higher is required to compile our source if you checkout our code from CVS). To checkout our code, follow the standard CVS checkout instructions for sourceforge. Basically, setup your CVSROOT and then run cvs -z3 co -P config4gnu.

The directory structure

  • data/ - contains XML-based class definition files, etc.
  • src/parsers/ - XML-based parsers (read/write configuration files)
  • src/libconfig4gnu/ - C++ library, reads XML definition files, handles in-memory XML tree of configuration
  • src/wrappers/ - contains Perl and PHP wrappers for the libconfig4gnu library... parsers use the Perl wrappers
  • src/clients/gtkmm/ - C++ front-end, uses Gtk-- toolkit
  • util/ - other stuff... ask Justin for details. I know one think in here is XSLT files that convert config definition files provided by Apache project to Config4GNU's format
  • test/ - build-tests, regression-tests... makes sure parsers don't mangle the configuration file when reading/writing

Something Jason recently added...

  • src/providers/ - these are Perl-based config file readers/writers that DO NOT link to the libconfig4GNU libraries. The idea is to separate the Config4GNU parsers from the XML/Xerces dependency. If you can't get the XML-based stuff to work, you may want to check this stuff out. (See further below.)

Building

  • There is info in README or INSTALL, I can't remember which. Basically you have to get the Xerces-C++ library installed and know where it is in case the configure script cannot find it.
  • You'll also need Gtkmm if you want to use the client (recommended).
  • ./configure && make && make install

Running

  • You'll want a Samba configuration file at /etc/samba/smb.conf for the following to be useful...
  • gtkmm-cfg - In the left pane, there is a node tree. This node tree is loaded based on the config4gnu.xml file installed under ${prefix}/etc. As you expand certain nodes by double-clicking them, a parser is run behind the scenes and the tree is filled with nodes generated from one or more configuration files. If you double-click a node the right pane shows "forms" that are associated with that node type. One of the forms that should always be present is the "Properties" form. On this form, you can double-click a property to view it's description, as well as any user-added comments. You can also add and remove properties (try right-clicking). Finally, if you make changes and want to save, right-click a node in the left-pane and choose Save. This invokes the parser again to take the XML and write it to the configuration file.

The stuff in src/providers/

  • These are a set of parsers that Jason has been experimenting with that do not use the libconfig4gnu library. They do not need anything other than Perl to run. Unfortunately, there is no corresponding client program. The best you can do is try running the test-samba.pl program in this directory. The test-samba.pl program loads the Samba provider, reads in the configuration file, and then displays the generated configuration tree.
  • Also in this directory are Perl modules that provide a CORBA-interface to the configuration data. There is a README file in there that describes what you need to get the CORBA interface to work. Also, Jason have a prototype client written that uses the CORBA interface to access the configuration data, but we haven't uploaded it to CVS yet.

SourceForge Logo