Commits

Christophe Combelles committed 4dc5aab

Support for OpenERP 6.1 with Anybox buildout recipe

Comments (0)

Files changed (6)

 sudo aptitude install subversion mercurial build-essential python-virtualenv \
   python-dev libldap2-dev libsasl2-dev libssl-dev libpq-dev postgresql \
   libxml2-dev libxslt1-dev apache2 libapache2-mod-php5 libapache2-mod-python \
-  mysql-server php5 php5-mysql php5-gd wv poppler-utils zlib1g-dev curl
+  mysql-server php5 php5-mysql php5-gd wv poppler-utils zlib1g-dev curl libjpeg8-dev
 
 Then you can install the development trunk of Showroom with::
 

etc/apache2/apache2.conf

     MaxRequestsPerChild   0
 </IfModule>
 
-User ${USER}
-Group ${USER}
+# doesn't work through supervisor:
+#User ${USER}
+#Group ${USER}
+
 #AccessFileName .htaccess
 DefaultType text/plain
 HostnameLookups Off

scripts/demo_OpenERP 6.0.sh

+#!/usr/bin/env bash
+# PARAMS:name, version=6.0.4
+
+function first_install {
+# create a virtualenv
+virtualenv --no-site-packages --distribute sandbox
+
+# install the required packages
+# egenix distribution setup is just a pain
+sandbox/bin/easy_install http://downloads.egenix.com/python/egenix-mx-base-3.1.2.tar.gz
+sandbox/bin/pip install http://download.gna.org/pychart/PyChart-1.39.tar.gz
+sandbox/bin/pip install psycopg2==2.2.2 reportlab==2.4 pydot==1.0.2 lxml==2.2.8 pytz==2010k PIL==1.1.7 PyYAML==3.09 cherrypy==3.1.2 python-dateutil==1.5
+
+# download and install the server
+wget http://openerp.com/download/stable/source/openerp-server-$version.tar.gz
+tar xzf openerp-server-$version.tar.gz
+cd openerp-server-$version
+../sandbox/bin/python setup.py install
+cd ..
+
+# download and install the web interface
+wget http://openerp.com/download/stable/source/openerp-web-$version.tar.gz
+tar xzf openerp-web-$version.tar.gz
+cd openerp-web-$version
+../sandbox/bin/python setup.py install
+cd ..
+
+# needed to be able to clone the virtualenv
+virtualenv --no-site-packages --distribute sandbox
+
+# copy and change the default config
+NETRPC=$(($PORT+1000))
+cp ./sandbox/lib/python2.*/site-packages/openerp_web-*.egg/doc/openerp-web.cfg .
+sed -i "s/^server.socket_port =.*/server.socket_port = $PORT/" openerp-web.cfg
+sed -i "s/^openerp.server.port = '8070'/openerp.server.port = '$NETRPC'/" openerp-web.cfg
+
+# initialise and create the database
+/usr/lib/postgresql/9.1/bin/initdb postgresql
+echo "data_directory = './postgresql'" >> postgresql/postgresql.conf
+echo "hba_file = './postgresql/pg_hba.conf'" >> postgresql/postgresql.conf
+echo "ident_file = './postgresql/pg_ident.conf'" >> postgresql/postgresql.conf
+echo "unix_socket_directory='.'" >> postgresql/postgresql.conf
+echo "port = $((PORT+2000))" >> postgresql/postgresql.conf
+
+# prepare the server config file
+cat > ./openerp-server.conf << EOF
+[options]
+netrpc = True
+netrpc_interface = localhost
+netrpc_port = $NETRPC
+xmlrpcs = False
+xmlrpc = False
+db_host = localhost
+db_port = $((PORT+2000))
+EOF
+
+# create the startup script
+cat > start.sh << EOF
+#!/bin/bash
+trap "pkill -1 -P \$\$" EXIT
+/usr/lib/postgresql/9.1/bin/postgres -D ./postgresql &
+postgres_pid=\$!
+./sandbox/bin/openerp-server -c $PWD/openerp-server.conf &
+openerp_pid=\$!
+./sandbox/bin/openerp-web -c openerp-web.cfg &
+web_pid=\$!
+trap "kill \$web_pid; kill \$openerp_pid; kill \$postgres_pid" EXIT
+cat
+EOF
+
+# create a popup for installation instruction
+cat > popup.html << EOF
+<p>To start using OpenERP, you must create a database. Do the following:</p>
+<ol>
+    <li>Click on "Databases"</li>
+    <li>Click on "Create"</li>
+    <li>Fill in the form:
+        <ul>
+            <li>Super admin password: admin</li>
+            <li>New database name: <your_database_name></li>
+            <li>Load Demonstration data: check if you need demo data</li>
+            <li>Default Language: choose your language</li>
+            <li>Administrator password: <choose a password for the "admin" account></li>
+            <li>Confirm password: <repeat the same password></li>
+        </ul>
+    <li>Click on OK, and wait a few seconds</li>
+    <li>Start configuring your new database</li>
+</ol>
+EOF
+}
+
+function reconfigure_clone {
+cd openerp-server-$version
+../sandbox/bin/python setup.py install
+cd ../openerp-web-$version
+../sandbox/bin/python setup.py install
+cd ..
+NETRPC=$(($PORT+1000))
+sed -i "s/^port.*/port = $((PORT+2000))/" postgresql/postgresql.conf
+sed -i "s/^netrpc_port.*/netrpc_port = $NETRPC/" openerp-server.conf
+sed -i "s/^db_port.*/db_port = $((PORT+2000))/" openerp-server.conf
+sed -i "s/^server.socket_port =.*/server.socket_port = $PORT/" openerp-web.cfg
+sed -i "s/^openerp.server.port = .*/openerp.server.port = '$NETRPC'/" openerp-web.cfg
+sed -i "s%.*openerp-server.conf.*%./sandbox/bin/openerp-server -c \"$PWD/openerp-server.conf\" \&%" start.sh
+}

scripts/demo_OpenERP 6.1.sh

+#!/usr/bin/env bash
+# PARAMS:name, version=20121025-233243, admin_password=admin
+
+function first_install {
+# create a virtualenv
+virtualenv --no-site-packages --distribute sandbox
+
+# create a buildout
+cat >> buildout.cfg << EOF
+[buildout]
+parts = openerp
+versions = versions
+find-links = http://download.gna.org/pychart/
+
+[openerp]
+recipe = anybox.recipe.openerp:server
+version = nightly 6.1 $version
+options.db_host = localhost
+options.db_port = $((PORT+1000))
+options.admin_passwd = $admin_password
+options.xmlrpc_port = $PORT
+
+[versions]
+MarkupSafe = 0.15
+Pillow = 1.7.7
+PyXML = 0.8.4
+babel = 0.9.6
+feedparser = 5.1.1
+gdata = 2.0.16
+lxml = 2.3.3
+mako = 0.6.2
+psycopg2 = 2.4.4
+pychart = 1.39
+pydot = 1.0.28
+pyparsing = 1.5.6
+python-dateutil = 1.5
+python-ldap = 2.4.9
+python-openid = 2.2.5
+pytz = 2012b
+pywebdav = 0.9.4.1
+pyyaml = 3.10
+reportlab = 2.5
+simplejson = 2.4.0
+vatnumber = 1.0
+vobject = 0.8.1c
+werkzeug = 0.8.3
+xlwt = 0.7.3
+zc.buildout = 1.5.2
+zc.recipe.egg = 1.3.2
+zsi = 2.0-rc3
+EOF
+
+# get the boostrap script
+wget https://raw.github.com/buildout/buildout/master/bootstrap/bootstrap.py
+
+# bootstrap and buildout
+./sandbox/bin/python bootstrap.py
+./bin/buildout
+
+# needed to be able to clone the virtualenv
+virtualenv --no-site-packages --distribute sandbox
+
+# initialise and create the database
+/usr/lib/postgresql/9.1/bin/initdb postgresql
+echo "data_directory = './postgresql'" >> postgresql/postgresql.conf
+echo "hba_file = './postgresql/pg_hba.conf'" >> postgresql/postgresql.conf
+echo "ident_file = './postgresql/pg_ident.conf'" >> postgresql/postgresql.conf
+echo "unix_socket_directory='.'" >> postgresql/postgresql.conf
+echo "port = $((PORT+1000))" >> postgresql/postgresql.conf
+
+# create the startup script
+cat > start.sh << EOF
+#!/bin/bash
+trap "pkill -1 -P \$\$" EXIT
+/usr/lib/postgresql/9.1/bin/postgres -D ./postgresql &
+postgres_pid=\$!
+./bin/start_openerp &
+openerp_pid=\$!
+trap "kill \$openerp_pid; kill \$postgres_pid" EXIT
+cat
+EOF
+
+# create a popup for installation instruction
+#cat > popup.html << EOF
+#<p>To start using OpenERP, you must create a database. Do the following:</p>
+#<ol>
+#    <li>Click on "Manage Databases"</li>
+#    <li>Click on "Create"</li>
+#    <li>Fill in the form:
+#        <ul>
+#            <li>Super admin password: <your admin password></li>
+#            <li>New database name: <your_database_name></li>
+#            <li>Load Demonstration data: check if you need demo data</li>
+#            <li>Default Language: choose your language</li>
+#            <li>Administrator password: <choose a password for the "admin" account></li>
+#            <li>Confirm password: <repeat the same password></li>
+#        </ul>
+#    <li>Click on OK, and wait a few seconds</li>
+#    <li>Start configuring your new database</li>
+#</ol>
+#EOF
+
+}
+
+function reconfigure_clone {
+sed -i "s/^port.*/port = $((PORT+1000))/" postgresql/postgresql.conf
+sed -i "s/^options.db_port.*/options.db_port = $((PORT+1000))/" buildout.cfg
+sed -i "s/^options.admin_passwd.*/options.admin_passwd = $admin_password/" buildout.cfg
+sed -i "s/^options.xmlrpc_port.*/options.xmlrpc_port = $PORT/" buildout.cfg
+./sandbox/bin/python bootstrap.py
+./bin/buildout -o
+}

scripts/demo_OpenERP 6.sh

-#!/usr/bin/env bash
-# PARAMS:name, version=6.0.4
-
-function first_install {
-# create a virtualenv
-virtualenv --no-site-packages --distribute sandbox
-
-# install the required packages
-# egenix distribution setup is just a pain
-sandbox/bin/easy_install http://downloads.egenix.com/python/egenix-mx-base-3.1.2.tar.gz
-sandbox/bin/pip install http://download.gna.org/pychart/PyChart-1.39.tar.gz
-sandbox/bin/pip install psycopg2==2.2.2 reportlab==2.4 pydot==1.0.2 lxml==2.2.8 pytz==2010k PIL==1.1.7 PyYAML==3.09 cherrypy==3.1.2 python-dateutil==1.5
-
-# download and install the server
-wget http://openerp.com/download/stable/source/openerp-server-$version.tar.gz
-tar xzf openerp-server-$version.tar.gz
-cd openerp-server-$version
-../sandbox/bin/python setup.py install
-cd ..
-
-# download and install the web interface
-wget http://openerp.com/download/stable/source/openerp-web-$version.tar.gz
-tar xzf openerp-web-$version.tar.gz
-cd openerp-web-$version
-../sandbox/bin/python setup.py install
-cd ..
-
-# needed to be able to clone the virtualenv
-virtualenv --no-site-packages --distribute sandbox
-
-# copy and change the default config
-NETRPC=$(($PORT+1000))
-cp ./sandbox/lib/python2.*/site-packages/openerp_web-*.egg/doc/openerp-web.cfg .
-sed -i "s/^server.socket_port =.*/server.socket_port = $PORT/" openerp-web.cfg
-sed -i "s/^openerp.server.port = '8070'/openerp.server.port = '$NETRPC'/" openerp-web.cfg
-
-# initialise and create the database
-/usr/lib/postgresql/9.1/bin/initdb postgresql
-echo "data_directory = './postgresql'" >> postgresql/postgresql.conf
-echo "hba_file = './postgresql/pg_hba.conf'" >> postgresql/postgresql.conf
-echo "ident_file = './postgresql/pg_ident.conf'" >> postgresql/postgresql.conf
-echo "unix_socket_directory='.'" >> postgresql/postgresql.conf
-echo "port = $((PORT+2000))" >> postgresql/postgresql.conf
-
-# prepare the server config file
-cat > ./openerp-server.conf << EOF
-[options]
-netrpc = True
-netrpc_interface = localhost
-netrpc_port = $NETRPC
-xmlrpcs = False
-xmlrpc = False
-db_host = localhost
-db_port = $((PORT+2000))
-EOF
-
-# create the startup script
-cat > start.sh << EOF
-#!/bin/bash
-trap "pkill -1 -P \$\$" EXIT
-/usr/lib/postgresql/9.1/bin/postgres -D ./postgresql &
-postgres_pid=\$!
-./sandbox/bin/openerp-server -c $PWD/openerp-server.conf &
-openerp_pid=\$!
-./sandbox/bin/openerp-web -c openerp-web.cfg &
-web_pid=\$!
-trap "kill \$web_pid; kill \$openerp_pid; kill \$postgres_pid" EXIT
-cat
-EOF
-
-# create a popup for installation instruction
-cat > popup.html << EOF
-<p>To start using OpenERP, you must create a database. Do the following:</p>
-<ol>
-    <li>Click on "Databases"</li>
-    <li>Click on "Create"</li>
-    <li>Fill in the form:
-        <ul>
-            <li>Super admin password: admin</li>
-            <li>New database name: <your_database_name></li>
-            <li>Load Demonstration data: check if you need demo data</li>
-            <li>Default Language: choose your language</li>
-            <li>Administrator password: <choose a password for the "admin" account></li>
-            <li>Confirm password: <repeat the same password></li>
-        </ul>
-    <li>Click on OK, and wait a few seconds</li>
-    <li>Start configuring your new database</li>
-</ol>
-EOF
-}
-
-function reconfigure_clone {
-cd openerp-server-$version
-../sandbox/bin/python setup.py install
-cd ../openerp-web-$version
-../sandbox/bin/python setup.py install
-cd ..
-NETRPC=$(($PORT+1000))
-sed -i "s/^port.*/port = $((PORT+2000))/" postgresql/postgresql.conf
-sed -i "s/^netrpc_port.*/netrpc_port = $NETRPC/" openerp-server.conf
-sed -i "s/^db_port.*/db_port = $((PORT+2000))/" openerp-server.conf
-sed -i "s/^server.socket_port =.*/server.socket_port = $PORT/" openerp-web.cfg
-sed -i "s/^openerp.server.port = .*/openerp.server.port = '$NETRPC'/" openerp-web.cfg
-sed -i "s%.*openerp-server.conf.*%./sandbox/bin/openerp-server -c \"$PWD/openerp-server.conf\" \&%" start.sh
-}

showroom/utils.py

     # check whether we already have a template available
     template_name = app_type + '_' + '_' + b64encode(
       ','.join(['%s=%s' % (n.strip(), '\n'.join([i.strip() for i in str(v).split('\n')]))
-                for (n, v) in sorted(params.items()) if n not in ('name','login','user','password')]))
+                for (n, v) in sorted(params.items())
+                if n not in ('name','login','user','password','admin_passwd')]))
     template_path = join(PATHS['templates'], template_name)
 
     if os.path.exists(template_path):