1
Title: Use of site_config.cfg to ease distro package creation
5
The base install of GNUe expects all GNUe-related files to reside under
6
a single directory -- by default, /usr/local/gnue. You would then end
7
up with a structure like:
10
/usr/local/gnue/shared/images
15
The prefix /usr/local is of course configurable, so it could just as well
16
be /opt/gnue or /usr/gnue.
18
However, this single point of reference is not sufficient for many
19
packaging requirements. Files are expected to be in certain locations
20
based on their functionality. Take, for example, Debian. The above
21
directories would probably be more correct as:
23
/usr/local/gnue/lib --> /usr/lib/gnue
24
/usr/local/gnue/shared/images --> /usr/share/gnue/images/
25
/usr/local/gnue/etc --> /etc/gnue/
27
We have added a hook to all the tools so that they can search for key
28
files in different locations. This is accomplished by having centrally-
29
located site_config.cfg file (the actual name of this file is irrelevant.)
31
Firstly, you need to pick a file name and location that is always
32
consistent. The tools' setup programs can be passed this file name and
33
location and will embed it in their startup scripts. The file doesn't have
34
to exist at the time, but must exist prior to the user actually running the
40
/usr/lib/gnue/site/local.cfg
44
The file will look like:
45
------------------------------------------------------------------------------
46
install_prefix = /usr/local
47
common_etc = install_prefix + '/etc'
48
common_shared = install_prefix + '/shared'
49
common_images = common_shared + '/images'
50
common_appbase = install_prefix
52
# forms_etc = common_etc
53
# forms_shared = common_shared
54
# forms_images = common_images
55
# forms_appbase = common_appbase
57
# reports_etc = common_etc
58
# reports_shared = common_shared
59
# reports_images = common_images
60
# reports_appbase = common_appbase
62
# designer_etc = common_etc
63
# designer_shared = common_shared
64
# designer_images = common_images
65
------------------------------------------------------------------------------
67
The above is the default setup without any overrides. The programs work by
68
first checking <app name>_<location>, then common_<location>. For example,
69
for Forms to locate it's images, it would first look for a setting called
70
forms_images. If this didn't exist, it would check for a setting called
73
For the Debian example above, the site_config.cfg file might look like:
74
------------------------------------------------------------------------------
75
common_etc = /etc/gnue
76
common_shared = /usr/share/gnue
77
common_images = /usr/share/gnue/images
78
------------------------------------------------------------------------------
80
Once this file is decided on, all the tools' setup.py scripts should be called
81
with --cfg-file=/path/to/site.cfg