diff --git a/net-libs/rb_libtorrent-python/Manifest b/net-libs/rb_libtorrent-python/Manifest new file mode 100644 index 000000000..72c55600d --- /dev/null +++ b/net-libs/rb_libtorrent-python/Manifest @@ -0,0 +1,3 @@ +AUX rb_libtorrent-python_setup.py 2196 RMD160 0036c66d95360a813776c2d7564f765965a259cc SHA1 f907df013bfd73b9ea665834349c9507d2dbf61c SHA256 640752e3c417cdca47a53ab097386b61cefef0eb008f32e41ba1c8081228d6ec +DIST libtorrent-0.13.tar.gz 1502517 RMD160 40b97552ca2b664facf864e48cc09a0cf4d84809 SHA1 010c02e350dc68263bb791bc8c37df341301e9bb SHA256 b187e6af2d2adc90417f991431fab5b0d6e61d71d0164345fad940a79cc45ee2 +EBUILD rb_libtorrent-python-0.13.ebuild 639 RMD160 40711f66fea32f6caf230cbf729734006ef316ee SHA1 b61bf860fd12300b7c54972467dcffdd71f54793 SHA256 482a26a0c6b7f95b685f963b7a2255482078faf5fe83449abe524eec66a32de2 diff --git a/net-libs/rb_libtorrent-python/files/rb_libtorrent-python_setup.py b/net-libs/rb_libtorrent-python/files/rb_libtorrent-python_setup.py new file mode 100644 index 000000000..bb9796f27 --- /dev/null +++ b/net-libs/rb_libtorrent-python/files/rb_libtorrent-python_setup.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python + +from distutils.core import setup, Extension +import commands + +def pkgconfig(*packages, **kw): + flag_map = {'-I': 'include_dirs', '-L': 'library_dirs', '-l': 'libraries'} + for token in commands.getoutput("pkg-config --libs --cflags %s" % ' '.join(packages)).split(): + if flag_map.has_key(token[:2]): + kw.setdefault(flag_map.get(token[:2]), []).append(token[2:]) + else: # throw others to extra_link_args + kw.setdefault('extra_link_args', []).append(token) + for k, v in kw.iteritems(): # remove duplicated + kw[k] = list(set(v)) + return kw + + +ltmod = Extension( + 'libtorrent', + sources = [ 'src/alert.cpp', + 'src/big_number.cpp', + 'src/converters.cpp', + 'src/datetime.cpp', + 'src/docstrings.cpp', + 'src/entry.cpp', + 'src/extensions.cpp', + 'src/filesystem.cpp', + 'src/fingerprint.cpp', + 'src/module.cpp', + 'src/peer_info.cpp', + 'src/peer_plugin.cpp', + 'src/session.cpp', + 'src/session_settings.cpp', + 'src/torrent.cpp', + 'src/torrent_handle.cpp', + 'src/torrent_info.cpp', + 'src/torrent_status.cpp', + 'src/utility.cpp', + 'src/version.cpp' ], + **pkgconfig('libtorrent', + libraries = [ 'boost_python', + 'boost_date_time', + 'boost_filesystem', + ], + ) + ); + +setup( name = 'python-libtorrent', + version = '0.13', + description = 'Python bindings for libtorrent (rasterbar)', + author = 'Daniel Wallin', + ext_modules = [ltmod] ) diff --git a/net-libs/rb_libtorrent-python/rb_libtorrent-python-0.13.ebuild b/net-libs/rb_libtorrent-python/rb_libtorrent-python-0.13.ebuild new file mode 100644 index 000000000..5f956b312 --- /dev/null +++ b/net-libs/rb_libtorrent-python/rb_libtorrent-python-0.13.ebuild @@ -0,0 +1,26 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +inherit distutils + +MY_P="${P/rb_/}" MY_P="${MY_P/-python/}" +S="${WORKDIR}/${MY_P}/bindings/python" + +DESCRIPTION="Python bindings for the rb_libtorrent library" +HOMEPAGE="http://www.rasterbar.com/products/libtorrent/" +SRC_URI="mirror://sourceforge/libtorrent/${MY_P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~x86-fbsd" +IUSE="debug" + +DEPEND="net-libs/rb_libtorrent + dev-libs/boost + !net-libs/libtorrent" +RDEPEND="${DEPEND}" + +src_compile() { + cd "${S}" + cp "${FILESDIR}"/rb_libtorrent-python_setup.py ./setup.py +}