1

我有 Trac 0.12rc1(由某人定制)​​它需要 python 颠覆绑定才能与 svn repos 一起使用。但是我所有编译库的尝试都以:

make 中的最后一个命令:

/bin/sh /usr/local/src/subversion-1.6.20/libtool --tag=CC --silent --mode=compile gcc -pthread -fPIC -g -O2   -pthread -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE  -I/usr/local
/src/subversion-1.6.20/subversion -I/usr/local/src/subversion-1.6.20/subversion/include
-I/usr/local/src/subversion-1.6.20/subversion/bindings/swig -I/usr/local/src/subversion-1.6.20/subversion/bindings/swig/include 
-I/usr/local/src/subversion-1.6.20/subversion/bindings/swig/proxy 
-I/usr/local/src/subversion-1.6.20/subversion/bindings/swig/proxy 
-I/usr/include/apr-1  -I/usr/include/apr-1  -I/usr/include/python2.6 
-I/usr/local/src/subversion-1.6.20/subversion/bindings/swig/python/libsvn_swig_py
-prefer-pic -c -o subversion/bindings/swig/python/svn_client.lo subversion/bindings
/swig/python/svn_client.c

它的输出的最后一部分(所有时间看起来都一样):

subversion/bindings/swig/python/svn_client.c:23637: error: expected ‘)’ before ‘*’ token
subversion/bindings/swig/python/svn_client.c: In function ‘init_client’:
subversion/bindings/swig/python/svn_client.c:23690: error: ‘PyObject’ undeclared (first use in this function)
subversion/bindings/swig/python/svn_client.c:23690: error: ‘m’ undeclared (first use in this function)
subversion/bindings/swig/python/svn_client.c:23690: error: ‘d’ undeclared (first use in this function)
subversion/bindings/swig/python/svn_client.c:23693: error: ‘SwigMethods’ undeclared (first use in this function)

我尝试了什么:Python:

  • 2.4(工作,但我们的 Trac 不能正常工作)
  • 2.6 “make swig-py”失败
  • 2.7 “make swig-py”失败

颠覆:

  • 1.6.17
  • 1.6.20
  • 1.7.8

痛饮:

  • 2.0.9
  • 1.3.29

有没有人成功为 python2.6+ 构建颠覆绑定?有可能吗?是否可以为 RHEL\OEL\CentOS 5.x 找到任何预构建的二进制文件?

4

2 回答 2

0

我已联系 Trac-users 邮件列表,他们提供了解决方案。它是用于 rpm 构建的规范文件的补丁。将补丁应用到包后,一切正常。

https://groups.google.com/d/topic/trac-users/BVVnh9I17Po/discussion

于 2013-03-11T14:46:42.400 回答
0

使用这个:http ://egao1980.blogspot.com/2011/03/installing-trac-and-subversion-with.html

下面从网站复制粘贴:

  • 安装 RPMForge 存储库rpm -ihv http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

  • 很高兴拥有 yum install bash-completion

  • [base][updates]repos中的黑名单颠覆

vim /etc/yum.repos.d/CentOS-Base.repo

[base]
exclude=subversion
exclude=subversion-devel
...
[updates]
exclude=subversion
exclude=subversion-devel
...
  • 从中获取 1.6.6 Subversion 安装脚本www.wandisco.com并按照说明进行安装。

  • 安装 MySQL。 yum install mysql mysql-devel

  • 安装 Python 2.5、Trac 并重建 mod_pythonaccordig 到Installing-python-25-on-centos-5 和Installing-trac-on-centos-5。

  • 构建 Subversion 绑定:

获取 Sqlite:

wget http://www.sqlite.org/sqlite-autoconf-3070500.tar.gz
tar xzvf sqlite-autoconf-3070500.tar.gz && cd sqlite-autoconf-3070500 && make && make install

获取并构建 SWIG

wget http://downloads.sourceforge.net/project/swig/swig/swig-2.0.2/swig-2.0.2.tar.gz
tar xzvf swig-2.0.2.tar.gz && ./configure --with-python=/usr/bin/python25 --prefix=/usr && make && make install

构建 Python 2.5 颠覆绑定

wget http://subversion.tigris.org/downloads/subversion-1.6.16.tar.bz2
tar xjvf subversion-1.6.16.tar.bz2 && cd subversion-1.6.16
./configure PYTHON=/usr/bin/python25 --with-sqlite=/usr/local && make && make swig-py && make install-swig-py
echo /usr/local/lib/svn-python > /usr/lib/python2.5/site-packages/svn.pth

此时,您应该将 Subversion 1.6.6、Trac 0.12、MySQLDb 1.2.2 和 mod_python 配置为与 Python 2.5 一起运行。

于 2013-02-25T17:08:12.887 回答