Preface
This document is part of the Campcaster
project, Copyright © 2004 Media
Development Loan Fund, under the GNU GPL.
- Author: $Author$
- Version: $Revision$
- Location: $URL$
Scope
This document describes how to set up the Campcaster development
environment.
Introduction
Campcaster uses a well-defined development environment.
Most of the Campcaster-specific files are included in the version
control system, but some preparation and setup has to be made on system
used to develop Campcaster as well.
There is a simplified and Ubuntu-centric version of this document in the
Campcaster Trac wiki.
Steps
The following steps needed to be taken for setting up the Campcaster
development environment.
- install development tools
- set up additional system resources
- check out the sources
- configure the environment
- set up tools used by Campcaster
- personalize your development environment
Install development tools
Install all the tools needed for the development of Campcaster. Please
see the development tools document
for a list of tools needed.
Set up additional system resources
The Campcaster development environment uses some system resources,
that are not reasonable to include in the environment itself.
Test database
One such
resource is an ODBC datasource to a test database. This
database has to be accessible for executing the test suites and
applications within the Campcaster development environment.
First, Campcaster expects a PostgreSQL
database, and an ODBC
Data Source accessible to it through unixODBC.
Please refer to the documentation of these tools to set them up.
The test environment assumes that it can connect to the PostgreSQL
database as localhost via a TCP/IP connection, as the user test.
In newer versions of PostgreSQL (≥ 8), TCP/IP connections from localhost
are enabled by default. If you are using an older version, do the following:
Web server
Second, Campcaster expects:
- Apache httpd server
running on the development computer
- PHP interpreter
- PHP apache module
- PHP iconv extension (--with-iconv)
- DOMXML PHP extension - an
XMLv2 module for PHP
- PostgreSQL support in PHP
- PEAR
Apache group membership
The setup script assumes that the current user is a member of the Apache group.
Add the user who will be using the development environment to this group;
it's usually called apache
; on debian-based systems, it is
called www-data
.
Apache configuration
The storage server uses some directives which are not enabled by default.
To enable them, find the configuration file for the userdir module of
apache, and change the AllowOverride
directive in the
<Directory /home/*/public_html>
section to All
.
Check out the sources
The Campcaster development directory tree can be accessed anonymously via
Subversion, at
svn+ssh://code.campware.org/home/svn/repo/campcaster/trunk/campcaster
.
The following Subversion command
would check out the development tree:
svn checkout svn+ssh://code.campware.org/home/svn/repo/campcaster/trunk/campcaster
This will check out and create the Campcaster development directory
structure.
Configure the environment
First, you need to create the database and ODBC data source used by
Campcaster. This is done most easily by running the script
campcaster/bin/user_setup_db.sh
.
Run the scripts as root, and provide your user name with the
--user
option:
cd campcaster
sudo ./bin/user_setup_db.sh --user=<ls_developer_user>
The script will set up the following resources:
- a PostgreSQL user named
test
with the password
test
(if it does not exist)
- a PostgreSQL database named
Campcaster-<ls_developer_user>
- an ODBC data source of the same name, with user name
and password
test
Next (and last), you compile the code and set up the configuration files.
Both are done by the script
cd campcaster
./bin/setupDevelopmentEnvironment.sh --apache-group=<apache_group>
This script will set up the libraries used by Campcaster (by compiling
and installing them under campcaster/usr), and set up the development
environment for all Campcaster modules.
It will also create your personalized configuration files under
~/.campcaster
, make certain directories writable for Apache
(this is where we need the current user to be a member of the
apache
group), define a user-specific port for the scheduler
daemon, and create a symlink in ~/public_html/
to the PHP
entry points.
After running the above script, the campcaster development environment
for the current user will be unique on the system, and will not
conflict with resources used by other developers. For example, the
Campcaster HTML user interface for the user will be reachable at:
http://localhost/~<ls_developer_user>/campcaster/htmlUI/var
Single-user setup
It is also possible to set up a shared configuration, instead of the
per-user setup described in the previous section.
To do this, use the script test_setup_db.sh
instead of
user_setup_db.sh
. You will also need to manually execute
the commands in setupDevelopmentEnvironment
up to, and not
including, the call to user_setup.sh
; and manually execute
the "Setup storage server" and "Setup directory permissions" portions
of the user_setup.sh
script. Finally, create a symlink
campcaster
in the root data directory of the Apache server
which points to campcaster/src/modules/
.
The address of the HTML interface will now be
http://localhost/campcaster/htmlUI/var
After this, the development environment should work, using the default
configuration files. NOTE: this single-user method has not been used by any
developers for quite some time, so these instructions may be
out of date or incomplete.
Ready to roll
With the above steps completed, the Campcaster modules and products
are ready to be compiled and developed further. Have fun!