root/buildout/pcl.buildout/trunk/README.txt

Revision 923, 5.1 KB (checked in by dokai, 2 years ago)

Added documentation for using the alternative buildout for Debian based
distributions.

Line 
1============================================
2Python Cartographic Library (PCL) - Buildout
3============================================
4
5This is a buildout system for the Python Cartographic Library (PCL)
6software suite. Its main purpose is to provide a dependable and
7repeatable way for developers to easily setup a development
8environment that contains all dependencies.
9
10Although geared towards developers the end result of the buildout is a
11working environment containing the PCL components which may also be
12used for non-development purposes.
13
14The buildout provides an isolated sandbox environment for using and
15developing PCL without interfering with the rest of your system.
16
17The buildout is implemented using zc.buildout_
18
19_zc.buildout: http://pypi.python.org/pypi/zc.buildout
20
21
22Quickstart
23----------
24
25The following commands will install the whole of PCL, setup a
26PostgreSQL db for testing and run the full test suite. For detailed
27instructions read below.
28
29 $ svn co http://svn.gispython.org/svn/gispy/buildout/pcl.buildout/trunk pcl.buildout
30 $ python bootstrap.py
31 $ ./bin/buildout
32 $ python init_postgresql.py
33 $ ./bin/test_core
34 $ ./bin/test_gdal
35 $ ./bin/test_georss
36 $ ./bin/test_mapserver
37
38
39Bootstrapping the buildout
40--------------------------
41
42When the buildout is checked out from the repository it needs to be
43bootstrapped before it is ready to use. Simply run::
44
45  $ python bootstrap.py
46
47in the root of the buildout to get everything ready for work. This
48will not build PCL, but will set the necessary scripts in the right
49places for doing it.
50
51After the bootstrapping you will have the buildout script in::
52
53  ./bin/buildout
54
55which is used to run the actual buildout process. For a full listing
56of available options see::
57
58  ./bin/buildout --help
59
60
61Buildout structure
62-------------------
63
64The buildout is divided into smaller parts that correspond directly to
65the components of PCL:
66
67 - PCL-Core -- the core functionality
68 - PCL-GDAL -- disk oriented data access using GDAL
69 - PCL-MapServer -- MapServer based rendering engine
70 - PCL-GeoRSS -- GeoRSS data source
71
72Each component has its own buildout configuration (.cfg) file named
73after the component. A developer wishing to work on a particular
74component of PCL can build only the necessary components and avoid the
75cost of having to build the whole of PCL.
76
77To build a specific component you can simply run::
78
79  ./bin/buildout -c [component].cfg
80
81For example, to build PCL-Core you would run::
82
83  ./bin/buildout -c pcl-core.cfg
84
85After building a single component, you will have a script to run the
86corresponding test suite::
87
88  ./bin/test
89
90You can optionally build the whole PCL suite by simply calling the
91buildout script without any parameters::
92
93  ./bin/buildout
94
95Building the whole PCL will give you invidual scripts for running the
96test suites of the components.
97
98
99Dependencies
100------------
101
102PCL has a lot of dependencies on external libraries and programs. The
103dependencies are defined in the ``dependencies.cfg`` configuration
104file which the components of the buildout depend on.
105
106You may wish to edit the dependencies configuration for two reasons:
107
108 - change the version, download url, etc of a component
109 - omit a component in favor of an already installed system component
110   (e.g. a library)
111
112Please note that if you do the latter, you may need to update the
113sections using the component to make sure that paths are set
114correctly.
115
116
117Setting up PostgreSQL
118---------------------
119
120PCL-Core contains code and tests that interacts with a PostgreSQL
121database. The buildout compiles the database server automatically, but
122test data must be populated with a manual step.
123
124In the root of the buildout directory is a python script called
125``init_postgresql.py`` that takes care of setting up a database for
126testing PCL. You can run by simply calling::
127
128  $ ./bin/python init_postgresql.py
129
130You can optionally set the port number by using the --port option. The
131default port is 5432.
132
133Note that if you are using an alternative buildout configuration, such
134as buildout-deb.cfg, you need to tell the init script about it because
135it may need to rerun the buildout in order to update the
136configuration. Use the --buildout-cfg switch for this
137
138You can run the script as many times as you want, but be aware that it
139will reset the whole database. You shouldn't use the test database to
140store any important data as it will be lost on subsequent runs of the
141script.
142
143See the OSX Notes section below if you are using Mac OSX.
144
145
146Developing PCL
147--------------
148
149All the PCL components will be installed as development eggs, so you
150can keep modifying the source on-the-fly. All editable source code is
151located under the ``src/`` directory within the buildout.
152
153There is also a Python interpreter script located in::
154
155  ./bin/python
156
157which has all the relevant components available for instant use. For
158example, if you built PCL-Core the following will work without having
159to modify any paths or whatsoever::
160
161  ./bin/python
162  >>> import cartography
163
164
165OSX Notes
166---------
167
168Running the PostgreSQL database server on Mac OS X may require
169modifying the amount of shared memory available on your system. See
170
171  http://www.postgresql.org/docs/8.2/static/kernel-resources.html#SYSVIPC
172
173for more detailed instructions.
Note: See TracBrowser for help on using the browser.