FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 10-06-2008, 04:03 AM
Michael Best
 
Default python-sybase on Centos 5 x86_64

Installed the freetds rpms from centos-extras, also tried the ones in
rpmforge

http://mirror.centos.org/centos/5/extras/x86_64/RPMS/freetds-0.64-11.el5.centos.x86_64.rpm
http://mirror.centos.org/centos/5/extras/x86_64/RPMS/freetds-devel-0.64-11.el5.centos.x86_64.rpm

Compiled python-sybase-0.39 by hand, and also via rpm.

http://www.redhat.com/archives/fedora-package-review/2008-August/msg01790.html

This spec file modified to compile on x86_64:
http://gohanman.com/rpm/Fedora9/freetds-devel/freetds-devel.spec

--- python-sybase.spec 2008-10-05 21:53:49.000000000 -0600
+++ python-sybase.spec.new 2008-10-05 21:53:36.000000000 -0600
@@ -27,6 +27,6 @@
%install
rm -rf $RPM_BUILD_ROOT
-PYVERSION=`python --version 2>&1 | sed -e "s/.*
([0-9]*.[0-9]*).[0-9]*/1/g"`

-export PYTHONPATH="$RPM_BUILD_ROOT/usr/lib/python$PYVERSION/site-packages"
+PYVERSION=`python -V 2>&1 | sed -e "s/.* ([0-9]*.[0-9]*).[0-9]*/1/g"`
+export
PYTHONPATH="$RPM_BUILD_ROOT/usr/lib64/python$PYVERSION/site-packages"

mkdir -p $PYTHONPATH
export SYBASE="/usr"

Both the source version and the rpm are built basically the same way,
and the final result after installation is something like:


# python
Python 2.4.3 (#1, Mar 14 2007, 19:01:42)
[GCC 4.1.1 20070105 (Red Hat 4.1.1-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Sybase
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "build/bdist.linux-x86_64/egg/Sybase.py", line 11, in ?
File "build/bdist.linux-x86_64/egg/sybasect.py", line 7, in ?
File "build/bdist.linux-x86_64/egg/sybasect.py", line 6, in __bootstrap__
ImportError:
/home/mbest/.python-eggs/python_sybase-0.39-py2.4-linux-x86_64.egg-tmp/sybasect.so:
undefined symbol: blk_alloc


As per this thread:
http://mlblog.osdir.com/python.sybase/2004-03/

Something may be going wrong in linking, as the sybasect.so doesn't seem
to be linked to the sybase libraries.


$ ldd
~/.python-eggs/python_sybase-0.39-py2.4-linux-x86_64.egg-tmp/sybasect.so

libpthread.so.0 => /lib64/libpthread.so.0 (0x00002aaaaacdf000)
libc.so.6 => /lib64/libc.so.6 (0x00002aaaaaef9000)
/lib64/ld-linux-x86-64.so.2 (0x0000555555554000)

Suggestions, comments, fixes, would all be useful.

-Mike
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 10-16-2008, 03:46 AM
Michael Best
 
Default python-sybase on Centos 5 x86_64

Solution turned out to involve building with at least -lct although the
src.rpm from


http://sisyphus.ru/srpm/Sisyphus/python-module-sybase/get

uses:
SYBASE=/usr python setup.py build_ext -D WANT_THREADS -D HAVE_FREETDS -U
WANT_BULKCOPY -lct



Diff to this python-sybase.spec included.
http://gohanman.com/rpm/Fedora9/SRPMS/python-sybase.spec

--- python-sybase.spec 2008-10-05 21:53:49.000000000 -0600
+++ python-sybase.spec.new 2008-10-15 21:42:44.000000000 -0600
@@ -22,11 +22,11 @@
%build
export SYBASE="/usr"
-python setup.py build_ext -D HAVE_FREETDS
+python setup.py build_ext -D HAVE_FREETDS -lct


%install
rm -rf $RPM_BUILD_ROOT
-PYVERSION=`python --version 2>&1 | sed -e "s/.*
([0-9]*.[0-9]*).[0-9]*/1/g"`

-export PYTHONPATH="$RPM_BUILD_ROOT/usr/lib/python$PYVERSION/site-packages"
+PYVERSION=`python -V 2>&1 | sed -e "s/.* ([0-9]*.[0-9]*).[0-9]*/1/g"`
+export
PYTHONPATH="$RPM_BUILD_ROOT/usr/lib64/python$PYVERSION/site-packages"

mkdir -p $PYTHONPATH
export SYBASE="/usr"
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 08:21 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org