[buildout]
extends =
  ../../../stack/slapos.cfg
  ../../../component/git/buildout.cfg
  ../../../component/pillow/buildout.cfg
  ../../../component/postgresql/buildout.cfg
  ../../../component/gmp/buildout.cfg
  ../../../component/imagemagick/buildout.cfg
  ../../../component/poppler/buildout.cfg
  ../../../component/redis/buildout.cfg
  ../../../component/unoconv/buildout.cfg
  ../../../component/nginx/buildout.cfg
  ../../../component/dcron/buildout.cfg

  ../../../component/cups/buildout.cfg
  ../../../component/dbus/buildout.cfg
  ../../../component/gtk-2/buildout.cfg
  ../../../component/glib/buildout.cfg
  ../../../component/fontconfig/buildout.cfg
  ../../../component/libreoffice-bin/buildout.cfg


parts =
    slapos-cookbook

    weasyprint-repository
    flask-alembic-repository
    flask-security-repository
    progressbar-repository
    abilian-core-repository
    slapos-cookbook-repository

    weasyprint-repository-check
    flask-alembic-repository-check
    flask-security-repository-check
    progressbar-repository-check
    abilian-core-repository-check
    slapos-cookbook-repository-check

    dcron
    postgresql91
    freetype
    cairo
    glib
    pillow-python
    psycopg2
    gmp
    eggs
    imagemagick
    poppler
    cups
    dbus-glib
    libreoffice-bin
    redis
    unoconv-repository

    extranet-repository
    extranet-repository-check
    Extranet_SPR

    nginx
    instance
    instance-postgres
    instance-redis
    config-staging-py-template
    config-production-py-template
    abilian-config


find-links +=
    ${:_profile_base_location_}/local-eggs


develop =
    ${:parts-directory}/weasyprint-repository
    ${:parts-directory}/flask-alembic-repository
    ${:parts-directory}/flask-security-repository
    ${:parts-directory}/progressbar-repository
    ${:parts-directory}/abilian-core-repository
    ${:parts-directory}/slapos-cookbook-repository
    ${extranet-repository:target-directory}/${extranet-repository:part-name}


[git-repository]
recipe = slapos.recipe.build:gitclone
git-executable = ${git:location}/bin/git

[git-repository-check]
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
command = grep parts ${buildout:develop-eggs-directory}/${:egg-link}



[extranet-repository]
recipe = plone.recipe.command
stop-on-error = true
update-command = ${:command}
source-directory = /opt/slapgrid/src/systematic/${:part-name}
part-name = extranet_spr
target-directory = ${buildout:parts-directory}/
command =
    rsync -a ${:source-directory} ${:target-directory} --delete-after --delete-excluded --chmod=o-rwx

[extranet-repository-check]
< = git-repository-check
egg-link = Extranet-SPR.egg-link


[weasyprint-repository]
< = git-repository
repository = https://github.com/mmariani/WeasyPrint.git
branch = dlopen-v0.21

[weasyprint-repository-check]
< = git-repository-check
egg-link = WeasyPrint.egg-link

[flask-alembic-repository]
< = git-repository
repository = https://github.com/tobiasandtobias/flask-alembic.git
branch = master

[flask-alembic-repository-check]
< = git-repository-check
egg-link = Flask-Alembic.egg-link

[flask-security-repository]
< = git-repository
repository = https://github.com/abilian/flask-security.git
branch = master

[flask-security-repository-check]
< = git-repository-check
egg-link = Flask-Security.egg-link

[progressbar-repository]
< = git-repository
repository = https://github.com/mmariani/python-progressbar
branch = master

[progressbar-repository-check]
< = git-repository-check
egg-link = progressbar.egg-link

[abilian-core-repository]
< = git-repository
repository = https://github.com/mmariani/abilian-core.git
branch = 0.1-maintenance-nxd

[abilian-core-repository-check]
< = git-repository-check
egg-link = Abilian-Core.egg-link

[slapos-cookbook-repository]
< = git-repository
repository = http://git.erp5.org/repos/slapos.git
branch = systematic

[slapos-cookbook-repository-check]
< = git-repository-check
egg-link = slapos.cookbook.egg-link


[eggs]
recipe = zc.recipe.egg
eggs =
  ${lxml-python:egg}
  ${psycopg2:egg}
  ${pillow-python:egg}
  slapos.cookbook
  collective.recipe.template


[Extranet_SPR]
# explicitly include the egg in order to
# generate the console entry points
recipe = zc.recipe.egg:scripts
eggs = Extranet_SPR


[redis]
# make test fails under debian/ovh (Opening port 21354: bind: Address already in use)
make-targets = 
  install



#----------------
#-- Postgres driver for Python recipes.

[psycopg2-env]
PATH = ${postgresql91:location}/bin:%(PATH)s


[psycopg2]
recipe = zc.recipe.egg:custom
egg = psycopg2
define = PSYCOPG_EXTENSIONS,PSYCOPG_DISPLAY_SIZE,PSYCOPG_NEW_BOOLEAN,HAVE_PQFREEMEM,HAVE_PQPROTOCOL3
environment = psycopg2-env
include-dirs =
    ${postgresql91:location}/include
library-dirs =
    ${postgresql91:location}/lib
rpath = 
    ${postgresql91:location}/lib


[perl]
# We need to build Perl with -fPIC,
# in order to compile the Perl driver for Postgres.
configure-command =
  sh Configure -des \
    -Dprefix=${buildout:parts-directory}/${:_buildout_section_name_} \
    -Dsiteprefix=${:siteprefix} \
    -Accflags='-fPIC' \
    -Dcflags=-I${gdbm:location}/include \
    -Dldflags="-L${gdbm:location}/lib -Wl,-rpath=${gdbm:location}/lib" \
    -Ui_db \
    -Dnoextensions=ODBM_File \
    -Dusethreads


#----------------
#-- Instance-level buildout profiles.

[instance]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/instance.cfg
md5sum = a865bcd6f894f28c69edf58d4df143ca
mode = 0644

[instance-postgres]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-postgres.cfg.in
output = ${buildout:directory}/instance-postgres.cfg
md5sum = 118f5eacb47909aa4fefbd3391cb2077
mode = 0644

[instance-redis]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-redis.cfg.in
output = ${buildout:directory}/instance-redis.cfg
md5sum = a322af67bcfd73f1782494c147499071
mode = 0644

[instance-extranet]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-extranet.cfg.in
output = ${buildout:directory}/instance-extranet.cfg
md5sum = d39a2a7348866130ef4c63857e0f2945
mode = 0644

[instance-environment]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-environment.cfg.in
output = ${buildout:directory}/instance-environment.cfg
md5sum = 747242345673e3b241b50bab5609294b
mode = 0644



[abilian-config]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/abilian-config.py
md5sum = e30bc5063632a1882ad8686147d2b0df
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = abilian-config.py
download-only = true
mode = 0755


[config-staging-py-template]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/${:filename}
md5sum = e19779158ddec562003f96bda1c39be1
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = staging.py.in
download-only = true
mode = 0644


[config-production-py-template]
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/template/${:filename}
md5sum = 3fe482f39895fe1beb6a4dbf0abb6ad4
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = production.py.in
download-only = true
mode = 0644


[versions]
### Abilian
Flask = 0.9
Flask-Assets = 0.8
Flask-Babel = 0.8
Babel = 0.9.6
Flask-DebugToolbar = 0.8.0
Flask-Mail = 0.8.2
Flask-SQLAlchemy = 0.16
Flask-Script = 0.5.3

Flask-Testing = 0.4
Flask-Uploads = 0.1.3
Flask-WTF = 0.8.3
Flask-Markdown = 0.3

phonenumbers = 5.4b1
whoosh = 2.4.1
markdown = 2.3.1
feedparser = 5.1.3
requests = 1.2.0
iso8601 = 0.1.4
passlib = 1.6.1
py-bcrypt = 0.3
python-magic = 0.4.6
twill = 0.9.1
validate_email = 1.2
pydns = 2.3.6
docflow = 0.3.1

# Language detection. Langig seems better that guess-language.
langid = 1.1.4dev
#guess-language-spirit==0.5a4
#pyenchant==1.6.5

wtforms = 1.0.4
wtforms-alchemy = 0.7.15
WTForms-Components = 0.7.0

#psycopg2 = 2.4.6
SQLAlchemy = 0.8.6
# actually >=0.8,<0.9  but only buildout 2 can do that
redis = 2.7.2
alembic = 0.6.0

# SQLAlchemy-Utils: 0.8.4 introduced a broken import:
# "from sqlalchemy.orm.util import AliasedInsp "
# https://github.com/kvesteri/sqlalchemy-utils/commit/f786ca040cb8a12b270d8e6ae45f102713a54572
SQLAlchemy-Utils = 0.16.9

# flower: celery web ui
flower = 0.4.3
 
# More version freezing
html5lib = 0.999
bleach = 1.4
 
# webassets wants this version of dateutil
python-dateutil = 1.5
 
#: DEVELOPMENT
cov-core = 1.7
coverage = 3.6
coveralls = 0.2
fabric = 1.6.0
fabtools = 0.13.0
pytest-cov = 1.6
pytest = 2.4.2
Flask-LinkTester = 0.2.5

#: PRODUCTION
#newrelic==1.10.2.38
raven = 3.3.3
blinker = 1.2
xlrd = 0.9.2
gunicorn = 0.17.2

# pip > 1.4: does not install 'pre' release. Need to mark them
pytz = 2013b
closure = 20121212
progressbar = 2.3

celery = 3.0.21

Flask-Security = 1.6.5abilian0