1
votes

I have Trac 0.12rc1(customized by somebody) it needs python subversion bindings to work with svn repos. But all of my attempts to compile the libraries ended with:

Last command in 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

Last part of it's output(all the time looks the same):

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)

What I tried: Python:

  • 2.4 (work, but our Trac doesn't work properly with it)
  • 2.6 "make swig-py" fails
  • 2.7 "make swig-py" fails

Subversion:

  • 1.6.17
  • 1.6.20
  • 1.7.8

SWIG:

  • 2.0.9
  • 1.3.29

Does anyone had success with building subversion bindings for python2.6+ ? Is it posible at all? Is it possible to find any pre-built binaries for RHEL\OEL\CentOS 5.x ?

2
just a guess -- Look for the python development/header files in your repository. - mgilson
Could you explain a little bit more? How it could help? - st0ne_c0ld
the last part of aa compiler error is the least useful. What's the first bit of the error? - Flexo

2 Answers

0
votes

Use this: http://egao1980.blogspot.com/2011/03/installing-trac-and-subversion-with.html

Below copy paste from site:

  • Install RPMForge repo rpm -ihv http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm

  • Good to have yum install bash-completion

  • Black list subversion in [base] and [updates] repos

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

[base]
exclude=subversion
exclude=subversion-devel
...
[updates]
exclude=subversion
exclude=subversion-devel
...
  • Get 1.6.6 Subversion install script from www.wandisco.com and follow instructions to install it.

  • Install MySQL. yum install mysql mysql-devel

  • Install Python 2.5, Trac and rebuild mod_python accordig to Installing-python-25-on-centos-5 and Installing-trac-on-centos-5.

  • Build Subversion bindings:

get 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

get and build 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

build Python 2.5 subversion bindings

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

At this point you should have Subversion 1.6.6, Trac 0.12, MySQLDb 1.2.2 and mod_python configured to run with Python 2.5.

0
votes

I've contacted to the Trac-users maillist and they provided a solution. It was a patch for spec file for rpm building. After patch was applied to the package everything went fine.

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