rpms/rb_libtorrent/devel rb_libtorrent-configure-dont-use-locate.patch, NONE, 1.1 rb_libtorrent-python26.patch, NONE, 1.1 .cvsignore, 1.5, 1.6 rb_libtorrent.spec, 1.18, 1.19 sources, 1.5, 1.6 rb_libtorrent-python-setup.py, 1.1, NONE

Peter Gordon pgordon at fedoraproject.org
Tue Jan 6 01:25:59 UTC 2009


Author: pgordon

Update of /cvs/pkgs/rpms/rb_libtorrent/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv18970

Modified Files:
	.cvsignore rb_libtorrent.spec sources 
Added Files:
	rb_libtorrent-configure-dont-use-locate.patch 
	rb_libtorrent-python26.patch 
Removed Files:
	rb_libtorrent-python-setup.py 
Log Message:
* Mon Jan 05 2009 Peter Gordon <peter at thecodergeek.com> - 0.14.1-1
- Update to new upstream release (0.14.1)
- Add asio-devel as runtime dependency for the devel subpackage (#478589)
- Add patch to build with Python 2.6:
  + python26.patch
- Add patch to make the configure script use the proper python include
  directory instead of calling locate, as that can cause failures in a chroot
  with no db file (and is a bit silly in the first place):
  + configure-dont-use-locate.patch
- Drop manual setup.py for building the python module (fixed upstream):
  - setup.py
- Update Source0 URL back to SourceForge's hosting.
- Reenable the examples, since the Makefiles are fixed.


rb_libtorrent-configure-dont-use-locate.patch:

--- NEW FILE rb_libtorrent-configure-dont-use-locate.patch ---
When building in a chroot (such as Fedora's Mock tool), using locate to find
where the Python include directory is causes build failures, since the db file
used by (m)locate does not yet exist.

However, instead of manually calling updatedb, there is no need to even use
locate at all since we already know that the properly-versioned include
directory is under the toplevel $includedir (defined earlier by autotools), and
is simply the same as the versioned Python binary ($ax_python_bin), so we can
simply substitute the locate call with a direct path that functions identically.

diff -up ./m4/ax_python.m4.old ./m4/ax_python.m4
--- ./m4/ax_python.m4.old	2009-01-05 15:24:44.000000000 -0800
+++ ./m4/ax_python.m4	2009-01-05 15:25:31.000000000 -0800
@@ -64,7 +64,7 @@ ax_python_bin=$PYTHON_BIN
 if test x$ax_python_bin != x; then
    AC_CHECK_LIB($ax_python_bin, main, ax_python_lib=$ax_python_bin, ax_python_lib=no)
    AC_CHECK_HEADER([$ax_python_bin/Python.h],
-   [[ax_python_header=`locate $ax_python_bin/Python.h | sed -e s,/Python.h,,`]],
+   [[ax_python_header=$includedir/$ax_python_bin]],
    ax_python_header=no)
    if test $ax_python_lib != no; then
      if test $ax_python_header != no; then

rb_libtorrent-python26.patch:

--- NEW FILE rb_libtorrent-python26.patch ---
With Python 2.6 (in Fedora rawhide), the current trunk (and 0.14.1) fail to
build the python bindings . I looked into it a bit more deeply and it seems that
AM_PATH_PYTHON is called in configure.in:329 (to check for the python stuff),
and that in turn uses the binary name as the top-level include directory to
search for when attempting to locate the Python headers. However, the m4 file
that defines the macro doesn't find the python2.6 executable because it doesn't
have that python2.6 name in its list (m4/ax_python.m4:61), and so when it finds
the unversioned "python" binary, it uses that as the directory name and thus
fails to properly find the Python headers (which *are* in a versioned directory,
e.g. "$includedir/python2.6/Python.h" - and not "$includedir/python/Python.h"
as it then tries to use).

The attached patch simply adds python2.6 to to the list, which after recreating
the build files with the already-included autotool.sh script, makes the
configure script properly find the python headers and thus makes the build
successful.

diff -up ./m4/ax_python.m4.old ./m4/ax_python.m4
--- ./m4/ax_python.m4.old	2009-01-05 14:50:47.000000000 -0800
+++ ./m4/ax_python.m4	2009-01-05 14:51:02.000000000 -0800
@@ -58,7 +58,7 @@
 AC_DEFUN([AX_PYTHON],
 [AC_MSG_CHECKING(for python build information)
 AC_MSG_RESULT([])
-for python in python2.5 python2.4 python2.3 python2.2 python2.1 python; do
+for python in python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python; do
 AC_CHECK_PROGS(PYTHON_BIN, [$python])
 ax_python_bin=$PYTHON_BIN
 if test x$ax_python_bin != x; then


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/rb_libtorrent/devel/.cvsignore,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- .cvsignore	15 Jul 2008 02:56:14 -0000	1.5
+++ .cvsignore	6 Jan 2009 01:25:28 -0000	1.6
@@ -1 +1 @@
-libtorrent-rasterbar-0.13.1.tar.gz
+libtorrent-rasterbar-0.14.1.tar.gz


Index: rb_libtorrent.spec
===================================================================
RCS file: /cvs/pkgs/rpms/rb_libtorrent/devel/rb_libtorrent.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- rb_libtorrent.spec	19 Dec 2008 12:28:09 -0000	1.18
+++ rb_libtorrent.spec	6 Jan 2009 01:25:28 -0000	1.19
@@ -2,24 +2,29 @@
 %{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
 
 Name:		rb_libtorrent
-Version:	0.13.1
-Release:	7%{?dist}
+Version:	0.14.1
+Release:	1%{?dist}
 Summary:	A C++ BitTorrent library aiming to be the best alternative
 
 Group:		System Environment/Libraries
 License:	BSD
 URL:		http://www.rasterbar.com/products/libtorrent/
 
-## TODO: Source0 Should use SourceForge's file-mirroring URL upon update to
-## version 0.14+.
-Source0:	http://mirror.thecodergeek.com/src/libtorrent-rasterbar-0.13.1.tar.gz
+Source0:	http://downloads.sourceforge.net/libtorrent/libtorrent-rasterbar-%{version}.tar.gz
 Source1:	%{name}-README-renames.Fedora
 Source2:	%{name}-COPYING.Boost
 Source3:	%{name}-COPYING.zlib
-## Sent upstream via the libtorrent-discuss ML.
-## Message-Id: <1216701448.24546.11.camel at tuxhugs>
-Source4: 	%{name}-python-setup.py
-Patch1:         rb_libtorrent-0.13.1-boost.patch
+
+## Patch the included m4 Python detection to properly find the binary and
+## include directory for Python 2.6 support.
+## Upstream bug: http://code.rasterbar.com/libtorrent/ticket/466
+Patch0: 	%{name}-python26.patch
+
+## Using locate when we already know where the file is, is a bit silly and
+## fails miserably with chroot-based building, since the db file does not
+## yet exist.
+## Upstream bug: http://code.rasterbar.com/libtorrent/ticket/467
+Patch1: 	%{name}-configure-dont-use-locate.patch
 
 BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -51,6 +56,7 @@
 ## Same include directory. :(
 Conflicts:	libtorrent-devel
 ## Needed for various headers used via #include directives...
+Requires:	asio-devel
 Requires:	boost-devel
 Requires:	openssl-devel
 
@@ -65,17 +71,17 @@
 a given source or header file is released under.
 
 
-#package	examples
-#Summary:	Example clients using %{name}
-#Group:		Applications/Internet
-#License:	BSD
-#Requires:	%{name} = %{version}-%{release}
-
-#description	examples
-#The %{name}-examples package contains example clients which intend to
-#show how to make use of its various features. (Due to potential
-#namespace conflicts, a couple of the examples had to be renamed. See the
-#included documentation for more details.)
+%package	examples
+Summary:	Example clients using %{name}
+Group:		Applications/Internet
+License:	BSD
+Requires:	%{name} = %{version}-%{release}
+
+%description	examples
+The %{name}-examples package contains example clients which intend to
+show how to make use of its various features. (Due to potential
+namespace conflicts, a couple of the examples had to be renamed. See the
+included documentation for more details.)
 
 
 %package	python
@@ -91,7 +97,10 @@
 
 %prep
 %setup -q -n "libtorrent-rasterbar-%{version}"
-%patch1 -p3
+%patch0 -b .python26
+%patch1 -b .dont-use-locate
+## We need to recreate the build scripts now that the M4 sources are patched.
+./autotool.sh 
 ## The RST files are the sources used to create the final HTML files; and are
 ## not needed.
 rm -f docs/*.rst
@@ -102,8 +111,6 @@
 ## Finally, ensure that everything is UTF-8, as it should be.
 iconv -t UTF-8 -f ISO_8859-15 AUTHORS -o AUTHORS.iconv
 mv AUTHORS.iconv AUTHORS
-## Install the necessary build script for the python bindings module...
-install -p -m 0755 %{SOURCE4} bindings/python/setup.py
 
 
 %build
@@ -111,21 +118,22 @@
 ## the local include directory overrides that of the system. We don't like
 ## local copies of system code. :)
 rm -rf include/libtorrent/asio*
-## FIXME: The examples currently fail to build (missing Makefile.in)
-%configure --disable-static --with-zlib=system		\
+%configure --disable-static				\
+	--enable-examples				\
+	--enable-python-binding				\
+	--with-asio=system				\
 	--with-boost-date-time=mt 			\
-	--with-boost-thread=mt				\
-	--with-boost-regex=mt				\
-	--with-boost-program_options=mt			\
 	--with-boost-filesystem=mt			\
+	--with-boost-program_options=mt			\
+	--with-boost-python=mt				\
+	--with-boost-regex=mt				\
 	--with-boost-system=mt				\
-	--with-asio=system
+	--with-boost-thread=mt				\
+	--with-zlib=system
 ## Use the system libtool to ensure that we don't get unnecessary RPATH
 ## hacks in our final build.
 make %{?_smp_mflags} LIBTOOL=%{_bindir}/libtool
-## Finally, build the python module.
 pushd bindings/python
-	CFLAGS="%{optflags}" %{__python} setup.py build
 	## Fix the interpreter for the example clients
 	sed -i -e 's:^#!/bin/python$:#!/usr/bin/python:' {simple_,}client.py 
 popd
@@ -141,8 +149,8 @@
 export CPPROG="%{__cp} -p"
 make install DESTDIR=%{buildroot} INSTALL="%{__install} -c -p"
 ## Do the renaming due to the somewhat limited %%_bindir namespace. 
-#rename client torrent_client %{buildroot}%{_bindir}/*
-#install -p -m 0644 %{SOURCE1} ./README-renames.Fedora
+rename client torrent_client %{buildroot}%{_bindir}/*
+install -p -m 0644 %{SOURCE1} ./README-renames.Fedora
 ## Install the python binding module.
 pushd bindings/python
 	%{__python} setup.py install -O1 --skip-build --root %{buildroot}
@@ -176,19 +184,33 @@
 %{_includedir}/libtorrent/
 %{_libdir}/libtorrent-rasterbar.so
 
-## Build failures...
-#files examples
-#doc COPYING README-renames.Fedora
-#{_bindir}/*torrent*
+%files examples
+%doc COPYING README-renames.Fedora
+%{_bindir}/*torrent*
+%{_bindir}/enum_if
 
 %files	python
 %defattr(-,root,root,-)
 %doc AUTHORS ChangeLog COPYING.Boost bindings/python/{simple_,}client.py
-%{python_sitearch}/libtorrent-%{version}-py?.?.egg-info
+%{python_sitearch}/python_libtorrent-%{version}-py?.?.egg-info
 %{python_sitearch}/libtorrent.so
 
 
 %changelog
+* Mon Jan 05 2009 Peter Gordon <peter at thecodergeek.com> - 0.14.1-1
+- Update to new upstream release (0.14.1)
+- Add asio-devel as runtime dependency for the devel subpackage (#478589)
+- Add patch to build with Python 2.6:
+  + python26.patch
+- Add patch to make the configure script use the proper python include
+  directory instead of calling locate, as that can cause failures in a chroot
+  with no db file (and is a bit silly in the first place):
+  + configure-dont-use-locate.patch
+- Drop manual setup.py for building the python module (fixed upstream):
+  - setup.py
+- Update Source0 URL back to SourceForge's hosting.
+- Reenable the examples, since the Makefiles are fixed.
+
 * Fri Dec 19 2008 Petr Machata <pmachata at redhat.com> - 0.13.1-7
 - Rebuild for boost-1.37.0.
 


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/rb_libtorrent/devel/sources,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- sources	15 Jul 2008 02:56:14 -0000	1.5
+++ sources	6 Jan 2009 01:25:29 -0000	1.6
@@ -1 +1 @@
-9d6b112fedc5861402647ff72e95dba0  libtorrent-rasterbar-0.13.1.tar.gz
+6aa0ed4da604b8b160bf12bcd41d5055  libtorrent-rasterbar-0.14.1.tar.gz


--- rb_libtorrent-python-setup.py DELETED ---




More information about the fedora-extras-commits mailing list