README.txt 4.39 KB
=============
ERP5 buildout
=============

Introduction
============

ERP5 Buildout is providing a way to build and manage ERP5 software components
with all needed dependencies.

ERP5 Buildout is also providing a way to manage instances of software
(whenever provided by ERP5 Buildout or externally).


Software
========

Software part shall be system independent. In perfect world it shall depend
only on:

 * C and C++ compiler
 * standard C and C++ library with development headers
 * make
 * patch
 * python (>=2.4) with development headers (to run buildout)
 * tool to download bootstrap (wget, curl or web browser)
 * subversion client (XXX: It will be removed some day)

As world is not perfect some additional build time requirements are added,
please look below for a way to acquire list of dependencies and system helpers.

Note: We are working hard on removing system depending helpers. Please try to
use ERP5 Appliance 2.8 without helpers and extend buildout profiles to depend
only on above list.

How to run
----------

Checkout: https://svn.erp5.org/repos/public/erp5/trunk/buildout/
For example:

  svn co https://svn.erp5.org/repos/public/erp5/trunk/buildout/ ~/erp5.buildout

Run make inside:

  cd ~/erp5.buildout
  mkdir -p downloads
  make

It will install required software and configure it locally, up to ERP5 site
with some Business Templates. By default it will use local python, MySQL,
Zope, etc.

Choosing and modifying proper profile allows to control how much software will
be build in place.

Minimal requirements
--------------------

To start buildout it is required to have:

 * any python with header files (file similar to
   /usr/lib*/python*/config/Makefile have to be delivered by system package)
 * svn client (to checkout buildout)

After build check
-----------------

After software is build invoke:

  make assert

To be sure that all components are available (corretly build and linked).

Distribution helpers
--------------------

In profiles directory there are profiles to help with preparation of used
distributions.

To prepare Mandriva 2010.0 please type, having root privileges:

  helpers/mandriva2010.0.sh

There are more helpers available, please refer to helpers directory.

Instances
=========

Note: Instance generation is still work in progress.

After software is generated it is time to have instances running.
The easiest way to generate instance is of course to reuse generated software.
If software is available in ~/erp5.buildout, such scenario work:

$ svn co https://svn.erp5.org/repos/public/erp5/trunk/buildout/ ~/instances
$ cd instances
$ cat > my_instances.cfg
[buildout]
extends = profiles/development.cfg

parts =
  software-links
  mysql-instance
  oood-instance
  supervisor-instance

[software_definition]
software_home = /home/MYUSER/erp5.buildout
^D
$ ~/erp5.buildout/bin/python2.4 bootstrap/bootstrap.py -c my_instances.cfg
$ ~/erp5.buildout/bin/python2.4 -S bin/buildout -c my_instances.cfg
$ var/bin/supervisord # it will start supervisor and configured software
$ $EDITOR my_instances.cfg
# add "runUnitTest" and "development-site" to parts
$ ~/erp5.buildout/bin/python2.4 -S bin/buildout -c my_instances.cfg

Fully configured development instance will be available in var/development-site.

Network based invocation
========================

Buildout profile can extend other ones from network. It is possible to play
with ERP5 buildout that way.

What to do:

$ mkdir software
$ cd software
$ echo '[buildout]' >> buildout.cfg
$ echo 'extends = https://svn.erp5.org/repos/public/erp5/trunk/buildout/buildout.cfg' >> buildout.cfg
$ wget -qO - http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py | python -S - -d
$ python -S bin/buildout

Note on -S: this switch is overridden by PYTHON_PATH environment variable. In
doubt, unset it before invoking that command.

After some time everything shall be locally available.

Disclaimer: That way is still in early stage of development.

Troubleshooting
===============

In various Linux distributions python is heavily patched and user related
environment variables are set system wide. This affects behaviour of python
and introduces various problem with running buildout.

In case of such issues consider resetting some python environment variables
before running buildout:

 * PYTHONPATH
 * PYTHONSTARTUP
 * PYTHONDONTWRITEBYTECODE

Example:

$ unset PYTHONPATH PYTHONSTARTUP PYTHONDONTWRITEBYTECODE
$ make
$ # other buildout related commands