From: Jason L. <JL...@me...> - 2003-11-12 16:45:16
|
There's been a surprising amount of traffic on Config4GNU mailing list lately... it's reminded me that I'm not the only one that's been thinking about configuration issues. Anyways, it occurred to me that it might be helpful to have a HOWTO-style document for getting started with Config4GNU. What follows is my attempt at this. Most of this I wrote from memory so be prepared for inaccuracies. ~Jason -- Checking the code out of CVS * Follow the instructions on Sourceforge * Basically, 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 I 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 Run * 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 I've 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, I have a prototype client written that uses the CORBA interface to access the configuration data, but I haven't uploaded it to CVS yet. |