<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,63 +1,120 @@
 Installation manual for Nightingale/Freesound
 =============================================
 
-prerequisites for local debugging/development:
+This document describes the installation of Freesound in a Debian Lenny host.
+Some configuration files may reside on different places for other distributions.
+
+We choosed to deploy freesound inside a virtualenv. This is optional but makes
+easier to meet the Python requirements without creating conflicts with other
+software.
+
+Some prerequisites for local debugging/development:
 
  * python &gt;= 2.5
  * postgresql up and running
 
 
-For development you may want configure postgresql to use password authentication,
-in pg_hba.sql:
 
-    local all all trust
-    host all all 127.0.0.1/32 trust
+Optional: work in a virtualenv
+------------------------------
+
+Install host-wide:
+
+    $ sudo pip install virtualenv virtualenvwrapper
+
+Create a virtualenv and work on it.
+
+    $ mkvirtualenv freesound
+    $ easy_install pip
+
+
+Install Debian packages
+-----------------------
+
+Some Debian packages are need. Some could be installed with 'pip' in your
+virtualenv but have non-Python dependencies or are hard to compile.
+
+    $ sudo apt-get install sndfile-programs libsndfile1-dev \
+        mplayer lame memcached vorbis-tools flac \
+        python-psycopg2 ipython python-imaging python-dev \
+        python-numpy
+
+`libsndfile1-dev` is a requirement of the `scikit.audiolab` Python package.
+
+
+Install Python packages
+-----------------------
+
+Download Freesound:
 
- * [django from trunk][django-trunk]
- * [psycopg2][psycopg2]
+    $ git clone git://github.com/bram/freesound.git
 
-[django-trunk]: http://www.djangoproject.com/documentation/install/#installing-the-development-version
-[psycopg2]: http://www.initd.org/tracker/psycopg/wiki/PsycopgTwo
+Install required Python packages:
 
-(on linux distros you may find a ready made package for psycopg2)
+    $ pip install -r freesound/freesound/docs/requirements-python.txt
 
 
-Steps to install pydev and eclipse
-==================================
 
- * download the Platform Runtime Binary for eclipse. this is the most minimal
+Optional: install pydev and eclipse
+-----------------------------------
+
+This is only recommended for local development.
+
+ * Download the Platform Runtime Binary for eclipse. This is the most minimal
    configuration.
- * from within eclipse using software updates &gt; install :
- * install pydev and then configure the python interpreter
+ * From within eclipse using software updates &gt; install :
+ * Install pydev and then configure the python interpreter
    (prefs &gt; pydev &gt; interpreter )
- * install Eclipse Java Development Tools (JDT)
- * download and install http://www.eclipse.org/gef/
- * download and install Amateras Eclipse HTML Editor Plugin
- * import the freesound project (import existing poject into workspace)
+ * Install Eclipse Java Development Tools (JDT)
+ * Download and install http://www.eclipse.org/gef/
+ * Download and install Amateras Eclipse HTML Editor Plugin
+ * Import the freesound project (import existing project into workspace)
+
+
+
+Configuration
+=============
+
+
+Create a database
+-----------------
 
+(Note: replace &lt;freesound_db&gt; and &lt;freesound_db_user&gt; with the value you will
+really use).
 
-Database for freesound
-======================
+All database commands must be run by the user 'postgres', so
 
-create the freesound user
+    # sudo su postgres
 
-    % sudo -u postgres createuser -P -e freesound
+Create the freesound user.
+
+    $ createuser -SDR -P &lt;freesound_db_user&gt;
 	Enter password for new role:
 	Enter it again:
-	Shall the new role be a superuser? (y/n) n
-	Shall the new role be allowed to create databases? (y/n) n
-	Shall the new role be allowed to create more new roles? (y/n) n
 
-create a database
+Create a database.
+
+    $ createdb --owner &lt;freesound_db_user&gt; --encoding=UTF-8 &lt;freesound_db&gt;
+
+If your webserver is on another machine you must allow access to the database.
+Edit your `/etc/postgresql/8.3/main/pg_hba.conf` and add something like:
+
+    host    &lt;freesound_db&gt;  &lt;freesound_db_user&gt;  193.145.55.3/32   md5
 
-    % /usr/local/bin/createdb --owner freesound --encoding=UTF-8 freesound
+
+Create a directory for logs
+---------------------------
+
+    $ sudo mkdir /var/log/freesound
+    $ sudo chown &lt;local_user&gt;: /var/log/freesound
 
 
 Create your local settings
-==========================
+--------------------------
+
+Copy and edit as needed:
 
-Copy the local_settings.example.py file to a local_settings.py file and edit to
-suit your needs.
+    cp local_settings.example.py local_settings.py
 
 **Try it!**
 </diff>
      <filename>docs/INSTALL.markdown</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>57b54d3fe974d950232df8cc6a2bcc83e2813e16</id>
    </parent>
  </parents>
  <author>
    <name>Jordi Funollet</name>
    <email>jordi.f@ati.es</email>
  </author>
  <url>http://github.com/bram/freesound/commit/b899030d09aede1eccda4ba3df5d0627ad0a76a7</url>
  <id>b899030d09aede1eccda4ba3df5d0627ad0a76a7</id>
  <committed-date>2009-10-30T04:33:42-07:00</committed-date>
  <authored-date>2009-10-30T04:33:42-07:00</authored-date>
  <message>several steps added to INSTALL.markdown</message>
  <tree>bf515048f9aeaa89dc8141110f556e1521f90102</tree>
  <committer>
    <name>Jordi Funollet</name>
    <email>jordi.f@ati.es</email>
  </committer>
</commit>
