~ubuntu-branches/ubuntu/hardy/gnue-common/hardy

« back to all changes in this revision

Viewing changes to doc/technotes/00007.txt

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Mitchell
  • Date: 2005-03-09 11:06:31 UTC
  • Revision ID: james.westby@ubuntu.com-20050309110631-8gvvn39q7tjz1kj6
Tags: upstream-0.5.14
ImportĀ upstreamĀ versionĀ 0.5.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Title: Use of site_config.cfg to ease distro package creation
 
2
Created: 20-SEP-2002
 
3
Status: Obsolete
 
4
 
 
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: 
 
8
 
 
9
   /usr/local/gnue/lib
 
10
   /usr/local/gnue/shared/images
 
11
   /usr/local/gnue/etc
 
12
 
 
13
and so forth. 
 
14
 
 
15
The prefix /usr/local is of course configurable, so it could just as well
 
16
be /opt/gnue or /usr/gnue. 
 
17
 
 
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: 
 
22
 
 
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/
 
26
 
 
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.)
 
30
 
 
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
 
35
progam. 
 
36
 
 
37
Example locations: 
 
38
 
 
39
   /etc/gnue/.site.cfg
 
40
   /usr/lib/gnue/site/local.cfg
 
41
   etc...
 
42
 
 
43
 
 
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
 
51
 
 
52
# forms_etc = common_etc
 
53
# forms_shared = common_shared
 
54
# forms_images = common_images
 
55
# forms_appbase = common_appbase
 
56
 
 
57
# reports_etc = common_etc
 
58
# reports_shared = common_shared
 
59
# reports_images = common_images
 
60
# reports_appbase = common_appbase
 
61
 
 
62
# designer_etc = common_etc
 
63
# designer_shared = common_shared
 
64
# designer_images = common_images
 
65
------------------------------------------------------------------------------
 
66
 
 
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
 
71
common_images.  
 
72
 
 
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
------------------------------------------------------------------------------
 
79
 
 
80
Once this file is decided on, all the tools' setup.py scripts should be called
 
81
with --cfg-file=/path/to/site.cfg
 
82