Permalink
Browse files

add postgresql server

  • Loading branch information...
1 parent 1e2ded6 commit d0025b98c0b0dfc5c30621f88073e289668624bc @pjstevns committed Jul 21, 2010
Showing with 30 additions and 0 deletions.
  1. +30 −0 buildout.cfg
View
@@ -6,6 +6,8 @@ parts =
supervisor
tryton
tryton-config
+ postgresql
+ postgresqlinit
py
versions = versions
@@ -106,6 +108,34 @@ cmds =
test -e bin/tryton-dev.py || wget -O bin/tryton-dev.py http://hg.tryton.org/hgwebdir.cgi/tryton-dev/raw-file/tip/tryton-dev.py
test -e src/hgforest || bin/python bin/tryton-dev.py src
bin/python bin/tryton-dev.py -u src
+
+[postgresql]
+recipe = zc.recipe.cmmi
+url = ftp://ftp.postgresql.org/pub/source/v8.4.2/postgresql-8.4.2.tar.bz2
+md5sum = d738227e2f1f742d2f2d4ab56496c5c6
+extra_options =
+ --with-pgport=${tryton-config:db_port}
+
+[postgresqlinit]
+recipe = iw.recipe.cmd
+on_install = true
+on_update = false
+datadir = ${buildout:directory}/var/postgresql
+cmds =
+ test -e ${buildout:directory}/bin/psql || \
+ ln -s ${postgresql:location}/bin/psql ${buildout:directory}/bin/psql
+ test -e ${postgresqlinit:datadir} && exit 0
+ ${postgresql:location}/bin/initdb --encoding=unicode ${postgresqlinit:datadir}
+ ${postgresql:location}/bin/postgres --single -D ${postgresqlinit:datadir} \
+ template1 << EOF
+ CREATE USER ${tryton-config:db_user} WITH PASSWORD '${tryton-config:db_password}' CREATEDB ;
+ EOF
+ echo 'host all ${tryton-config:db_user} 0.0.0.0/0 md5' \
+ >> ${postgresqlinit:datadir}/pg_hba.conf
+ echo "listen_addresses = '*'" >> ${postgresqlinit:datadir}/postgresql.conf
+ echo "log_connections = on" >> ${postgresqlinit:datadir}/postgresql.conf
+ echo "log_statement = 'all'" >> ${postgresqlinit:datadir}/postgresql.conf
+
[py]
recipe = zc.recipe.egg
eggs = zc.recipe.egg

0 comments on commit d0025b9

Please sign in to comment.