%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} Name: python-sybase Version: 0.39 Release: 2%{?dist} Summary: Python interface to Sybase Group: Development/Languages License: BSD URL: http://python-sybase.sourceforge.net/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz # for building the doc Source1: http://svn.python.org/projects/python/branches/release25-maint/Doc/texinputs/howto.cls Source2: http://svn.python.org/projects/python/branches/release25-maint/Doc/texinputs/pypaper.sty Source3: http://svn.python.org/projects/python/branches/release25-maint/Doc/texinputs/python.sty # bugfix from upstream svn r446 Patch1: python-sybase-0.39-bug2615821.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: python-setuptools-devel BuildRequires: freetds-devel # for building the doc BuildRequires: texlive-latex %description python-sybase is a DB-API 2.0 compliant Python interface to the Sybase Relational Database. %prep %setup -q %patch1 -p0 -b .bug2615821 rm doc/.cvsignore chmod -x doc/pstumble cp -av %{SOURCE1} %{SOURCE2} %{SOURCE3} doc/ %build export SYBASE="%{_prefix}" # the uptrame build setup fails to mention -lct on x86_64, so just use explicitly # reported upstream artefact 2812108 # https://sourceforge.net/tracker/?func=detail&aid=2812108&group_id=184050&atid=907701 CFLAGS="-DHAVE_FREETDS" LDFLAGS="-lct" %{__python} setup.py build cd doc ; makeindex sybase.tex ; pdflatex sybase %install rm -rf $RPM_BUILD_ROOT export SYBASE="%{_prefix}" %{__python} setup.py install --skip-build --root $RPM_BUILD_ROOT # force the mode until someone figures out why this sometimes ends up with 775 perms find $RPM_BUILD_ROOT -name sybasect.so -exec chmod 0755 {} \; mv doc/sybase.pdf doc/python-sybase.pdf %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc LICENCE ChangeLog doc/python-sybase.pdf examples %{python_sitearch}/* %changelog * Mon Jul 6 2009 Yanko Kaneti - 0.39-2 - Try harder to build human readable documentation - Move the sybasect.so chmod after the install phase * Thu Jun 25 2009 Yanko Kaneti - 0.39-1 - Start over reworking Andy Theuninck's submission in bug 459675