Title: Use of site_config.cfg to ease distro package creation
Created: 20-SEP-2002
Status: Obsolete

The base install of GNUe expects all GNUe-related files to reside under
a single directory -- by default, /usr/local/gnue.  You would then end 
up with a structure like: 

   /usr/local/gnue/lib
   /usr/local/gnue/shared/images
   /usr/local/gnue/etc

and so forth. 

The prefix /usr/local is of course configurable, so it could just as well
be /opt/gnue or /usr/gnue. 

However, this single point of reference is not sufficient for many 
packaging requirements.  Files are expected to be in certain locations 
based on their functionality. Take, for example, Debian.  The above
directories would probably be more correct as: 

   /usr/local/gnue/lib           --> /usr/lib/gnue
   /usr/local/gnue/shared/images --> /usr/share/gnue/images/
   /usr/local/gnue/etc           --> /etc/gnue/

We have added a hook to all the tools so that they can search for key
files in different locations.  This is accomplished by having centrally-
located site_config.cfg file (the actual name of this file is irrelevant.)

Firstly, you need to pick a file name and location that is always
consistent.  The tools' setup programs can be passed this file name and 
location and will embed it in their startup scripts. The file doesn't have 
to exist at the time, but must exist prior to the user actually running the
progam. 

Example locations: 

   /etc/gnue/.site.cfg
   /usr/lib/gnue/site/local.cfg
   etc...


The file will look like: 
------------------------------------------------------------------------------
install_prefix = /usr/local
common_etc = install_prefix + '/etc'
common_shared = install_prefix + '/shared'
common_images = common_shared + '/images'
common_appbase = install_prefix

# forms_etc = common_etc
# forms_shared = common_shared
# forms_images = common_images
# forms_appbase = common_appbase

# reports_etc = common_etc
# reports_shared = common_shared
# reports_images = common_images
# reports_appbase = common_appbase

# designer_etc = common_etc
# designer_shared = common_shared
# designer_images = common_images
------------------------------------------------------------------------------

The above is the default setup without any overrides. The programs work by 
first checking <app name>_<location>, then common_<location>. For example, 
for Forms to locate it's images, it would first look for a setting called
forms_images. If this didn't exist, it would check for a setting called
common_images.  

For the Debian example above, the site_config.cfg file might look like: 
------------------------------------------------------------------------------
common_etc = /etc/gnue
common_shared = /usr/share/gnue
common_images = /usr/share/gnue/images
------------------------------------------------------------------------------

Once this file is decided on, all the tools' setup.py scripts should be called
with --cfg-file=/path/to/site.cfg

