用于Trac的subversion 1.6.x(1.7.x)python 2.6+绑定

时间:2013-02-25 15:55:08

标签: python svn swig trac

我有Trac 0.12rc1(由某人定制)​​它需要python subversion绑定才能与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

SWIG:

  • 2.0.9
  • 1.3.29

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

2 个答案:

答案 0 :(得分:0)

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

从网站复制粘贴:

  • 安装RPMForge repo 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
...
  • www.wandisco.com获取1.6.6 Subversion安装脚本,并按照说明进行安装。

  • 安装MySQL。 yum install mysql mysql-devel

  • 安装Python 2.5,Trac并重建mod_python accordig到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 subversion绑定

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运行。

答案 1 :(得分:0)

我已与Trac-users maillist联系,他们提供了一个解决方案。它是rpm构建的spec文件的补丁。补丁应用到包装后一切都很顺利。

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