1

如果需要,我正在尝试制作从源代码安装 psycopg2 egg 和 postgres 的构建配置:

parts =
    ...
    postgre
    psycopg2
    ...

[postgre]
recipe = hexagonit.recipe.cmmi
url = ftp://ftp3.ua.postgresql.org/pub/mirrors/postgresql/source/v9.0.0/postgresql-9.0.0.tar.gz
configure-options =
    --without-readline

[psycopg2]
recipe = zc.recipe.egg:custom
egg = psycopg2
include-dirs =
    ${postgre:location}/include
library-dirs =
    ${postgre:location}/lib
rpath =
    ${postgre:location}/lib

问题是它总是从源代码构建 postgresql,即使用户已经安装了 postgresql。

我如何告诉 buildout 检查用户是否已经拥有构建 psycopg2 所需的一切?

4

1 回答 1

2

可以做到,但你必须制作自己的食谱才能进行检查。没有现有的食谱可以满足您的需求。

另一种方法是有两个构建配置。主要buildout.cfg假设 postgresql 可用并且不尝试构建它。

一秒钟withpostgres.cfg可能看起来像这样:

[buildout]
parts +=
    postgre
    psycopg2

[postgres]
... your existing one ...

[psycopg2]
... your existing one ...

需要从源代码构建它的用户可以通过调用来使用第二个配置bin/buildout -c withpostres.cfg

这能解决你的问题吗?

于 2010-10-26T18:03:52.640 回答