2011-04-11 03:07:13 +00:00
#
# spec file for package libtorrent-rasterbar
#
2016-01-15 01:30:50 +00:00
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
2011-04-11 03:07:13 +00:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
2011-12-09 15:38:42 +00:00
2015-06-02 06:25:17 +00:00
%define _name libtorrent
2016-04-14 23:34:39 +00:00
%define sover 9
%define _version 1_1
2011-06-07 15:23:03 +00:00
%bcond_with examples
2016-07-17 21:07:16 +00:00
%bcond_with tests
2011-04-11 03:07:13 +00:00
Name : libtorrent-rasterbar
2016-04-14 23:34:39 +00:00
Version : 1.1.0
2011-12-09 09:06:02 +00:00
Release : 0
2011-04-11 03:07:13 +00:00
Summary : Libtorrent is a C++ implementation of the BitTorrent protocol
2011-12-09 09:06:02 +00:00
License : BSD-3-Clause
2011-04-11 03:07:13 +00:00
Group : Development/Libraries/C and C++
2016-05-16 22:40:57 +00:00
Url : http://libtorrent.org/
2015-08-02 12:04:33 +00:00
Source : https://github.com/arvidn/%{_name}/releases/download/%{_name}-%{_version}/%{name} -%{version} .tar.gz
2016-05-16 22:40:57 +00:00
# PATCH-FIX-UPSTREAM libtorrent-rasterbar-1.1.0-remove-x86-only-flag.patch -- Remove -msse4.2 flag (commit 680eddf).
2016-07-17 21:07:16 +00:00
Patch0 : %{name} -1.1.0-remove-x86-only-flag.patch
# PATCH-FIX-UPSTREAM libtorrent-rasterbar-1.1.0-fix-get-ip-filter.patch boo#978600 -- Fix crash in session::get_ip_filter when not having set one (commit 66e5994).
Patch1 : %{name} -1.1.0-fix-get-ip-filter.patch
2016-08-17 10:42:37 +00:00
# PATCH-FIX-UPSTREAM libtorrent-rasterbar-1.1.0-python-fixes.patch boo#988986 -- Fixes for Python bindings (commits e4fd45e, 80710ab, f01ac8f, 42c6376, f05fad0).
2016-07-17 21:07:16 +00:00
Patch2 : %{name} -1.1.0-python-fixes.patch
2016-06-06 10:25:20 +00:00
# PATCH-FIX-UPSTREAM libtorrent-rasterbar-1.1.0-fix-invalid-input-crash.patch boo#983228 -- Fix crash on invalid input in http_parser (commit 3624ce6).
2016-07-16 12:23:51 +00:00
Patch3 : %{name} -1.1.0-fix-invalid-input-crash.patch
2016-07-29 14:41:14 +00:00
# PATCH-FIX-UPSTREAM libtorrent-rasterbar-1.1.0-add_ppc64le_as_64_bit_system_libraries.patch -- Fix configure error on ppc64le (commit 487cb44).
2016-07-29 14:40:52 +00:00
Patch4 : %{name} -1.1.0-add_ppc64le_as_64_bit_system_libraries.patch
2016-08-17 10:42:37 +00:00
BuildRequires : boost-devel >= 1.53
2011-04-11 03:07:13 +00:00
BuildRequires : gcc-c++
2016-06-29 19:10:45 +00:00
BuildRequires : pkgconfig
2013-02-21 16:32:52 +00:00
BuildRequires : python-devel
2011-04-11 03:07:13 +00:00
BuildRequires : pkgconfig(openssl)
2016-06-29 19:10:45 +00:00
%if 0%{?suse_version} > 1320
2016-05-17 07:18:00 +00:00
BuildRequires : python3-devel
2016-06-29 19:10:45 +00:00
%else
2016-05-16 22:40:57 +00:00
# For quadmath.h we need gcc-fortran on openSUSE Leap 42.x and older.
2016-04-14 23:34:39 +00:00
BuildRequires : gcc-fortran
%endif
2011-04-11 03:07:13 +00:00
%description
2015-06-02 06:25:17 +00:00
libtorrent-rasterbar is a C++ library that aims to be a good
alternative to all the other bittorrent implementations around.
It is a library and not a full featured client, although it comes
with a working example client.
2011-04-11 03:07:13 +00:00
2015-06-02 06:25:17 +00:00
The main goals of libtorrent-rasterbar are:
* To be cpu efficient.
* To be memory efficient.
* To be very easy to use.
2011-04-11 03:07:13 +00:00
2015-06-02 06:25:17 +00:00
This package holds the sample client and example files for
libtorrent-rasterbar.
2011-04-11 03:07:13 +00:00
2015-06-02 06:25:17 +00:00
%package -n %{name}%{sover}
2011-04-11 03:07:13 +00:00
Summary : Libtorrent is a C++ implementation of the BitTorrent protocol
2015-06-08 08:20:49 +00:00
Group : System/Libraries
2011-04-11 03:07:13 +00:00
2015-06-02 06:25:17 +00:00
%description -n %{name}%{sover}
libtorrent-rasterbar is a C++ library that aims to be a good
alternative to all the other bittorrent implementations around.
It is a library and not a full featured client, although it comes
with a working example client.
2011-04-11 03:07:13 +00:00
2015-06-02 06:25:17 +00:00
The main goals of libtorrent-rasterbar are:
* To be cpu efficient.
* To be memory efficient.
* To be very easy to use.
2011-04-11 03:07:13 +00:00
%package -n python-%{name}
Summary : Python Bindings for libtorrent-rasterbar
Group : Development/Libraries/Python
2015-06-02 06:25:17 +00:00
%description -n python-%{name}
Python Bindings for the libtorrent-rasterbar package.
2011-04-11 03:07:13 +00:00
2016-06-29 19:10:45 +00:00
%if 0%{?suse_version} > 1320
2016-05-16 22:40:57 +00:00
%package -n python3-%{name}
Summary : Python Bindings for libtorrent-rasterbar
Group : Development/Libraries/Python
%description -n python3-%{name}
Python Bindings for the libtorrent-rasterbar package.
2016-05-17 07:18:00 +00:00
%endif
2016-05-16 22:40:57 +00:00
2011-06-07 15:23:03 +00:00
%if %{with examples}
2015-06-02 06:25:17 +00:00
%package tools
2011-06-07 15:23:03 +00:00
Summary : Example tools from libtorrent-rasterbar
Group : Development/Libraries/C and C++
2011-06-22 08:47:57 +00:00
2015-06-02 06:25:17 +00:00
%description tools
2011-06-07 15:23:03 +00:00
Example tools from the libtorrent-rasterbar package.
%endif
2011-04-11 03:07:13 +00:00
%package devel
Summary : Libtorrent is a C++ implementation of the BitTorrent protocol
Group : Development/Libraries/C and C++
2015-06-02 06:25:17 +00:00
Requires : %{name} %{sover} = %{version}
2016-08-17 10:42:37 +00:00
Requires : boost-devel >= 1.53
2011-04-11 03:07:13 +00:00
Requires : gcc-c++
Requires : pkgconfig(openssl)
%description devel
2015-06-02 06:25:17 +00:00
libtorrent-rasterbar is a C++ library that aims to be a good
alternative to all the other bittorrent implementations around.
It is a library and not a full featured client, although it comes
with a working example client.
2011-04-11 03:07:13 +00:00
2015-06-02 06:25:17 +00:00
The main goals of libtorrent-rasterbar are:
* To be cpu efficient.
* To be memory efficient.
* To be very easy to use.
2011-04-11 03:07:13 +00:00
This package holds the development files for libtorrent-rasterbar.
%package doc
Summary : Documentation for libtorrent-rasterbar
Group : Documentation/HTML
%description doc
2015-06-02 06:25:17 +00:00
Documentation for the libtorrent-rasterbar package.
2011-04-11 03:07:13 +00:00
%prep
%setup -q
2016-04-15 17:40:08 +00:00
%patch0 -p1
2016-06-06 10:25:20 +00:00
%patch1 -p1
2016-07-15 17:26:15 +00:00
%patch2 -p1
2016-07-16 12:23:51 +00:00
%patch3 -p1
2016-07-29 14:40:52 +00:00
%patch4 -p1
2016-04-15 17:40:08 +00:00
2011-04-11 03:07:13 +00:00
%build
2015-06-02 06:25:17 +00:00
export CFLAGS=" %{optflags} - f n o - s t r i c t - a l i a s i n g "
2016-07-03 16:21:10 +00:00
export CXXFLAGS=" $ C F L A G S "
%if 0%{?suse_version} <= 1320
export CXXFLAGS=" $ C X X F L A G S - s t d = c + + 1 1 "
2016-06-21 18:56:30 +00:00
%ifarch aarch64
2016-07-03 16:21:10 +00:00
# Some architectures require explicit linkage to libboost_atomic on boost 1.55 and older.
export LIBS=" $ L I B S - l b o o s t _ a t o m i c "
2016-06-21 18:56:30 +00:00
%endif
2016-07-16 12:23:51 +00:00
%endif
2011-04-11 03:07:13 +00:00
2016-05-16 22:40:57 +00:00
%global _configure ../configure
2016-06-29 19:10:45 +00:00
%if 0%{?suse_version} > 1320
2016-05-16 22:40:57 +00:00
for py in python python3; do
2016-05-17 07:18:00 +00:00
%else
for py in python; do
%endif
2016-05-16 22:40:57 +00:00
mkdir -p " b u i l d - $ p y "
pushd " b u i l d - $ p y "
export PYTHON=" $ p y "
%configure \
2016-07-15 17:26:15 +00:00
--disable-static \
--disable-silent-rules \
2016-07-17 21:07:16 +00:00
%if %{with tests}
--enable-tests \
%endif
2011-06-07 15:23:03 +00:00
%if %{with examples}
2016-07-15 17:26:15 +00:00
--enable-examples \
2011-06-07 15:23:03 +00:00
%endif
2016-05-16 22:40:57 +00:00
--with-boost-python=" l i b b o o s t _ $ p y " \
--enable-python-binding
make %{?_smp_mflags}
popd
done
2011-04-11 03:07:13 +00:00
%install
2016-05-16 22:40:57 +00:00
%make_install -C build-python
2016-06-29 19:10:45 +00:00
%if 0%{?suse_version} > 1320
2016-05-16 22:40:57 +00:00
%make_install -C build-python3
2016-05-17 07:18:00 +00:00
%endif
2016-05-16 22:40:57 +00:00
2015-04-16 17:52:27 +00:00
find %{buildroot} -type f -name " * . l a " -delete -print
2015-06-02 06:25:17 +00:00
# Move doc to a separate package.
mkdir -p %{buildroot} %{_docdir} /%{name} /
cp -r docs/* %{buildroot} %{_docdir} /%{name} /
2011-04-11 03:07:13 +00:00
2013-12-13 11:42:43 +00:00
%if %{with examples}
2016-05-16 22:40:57 +00:00
# Drop tests binaries from the libtorrent-rasterbar-tools subpackage.
rm -v %{buildroot} %{_bindir} /{client_test,connection_tester,enum_if} \
%{buildroot} %{_bindir} /{fragmentation_test,parse_hash_fails} \
%{buildroot} %{_bindir} /{parse_request_log,rss_reader,upnp_test,utp_test}
2013-12-13 11:42:43 +00:00
%endif
2016-07-17 21:07:16 +00:00
%if %{with tests}
%check
make check %{?_smp_mflags} -C build-python
%if 0%{?suse_version} > 1320
make check %{?_smp_mflags} -C build-python3
%endif
%endif
2015-06-02 06:25:17 +00:00
%post -n %{name}%{sover} -p /sbin/ldconfig
2011-06-22 08:47:57 +00:00
2015-06-02 06:25:17 +00:00
%postun -n %{name}%{sover} -p /sbin/ldconfig
2011-04-11 03:07:13 +00:00
2011-06-07 15:23:03 +00:00
%if %{with examples}
2015-06-02 06:25:17 +00:00
%files tools
2011-06-07 15:23:03 +00:00
%defattr (-,root,root)
%{_bindir} /dump_torrent
%{_bindir} /make_torrent
%{_bindir} /simple_client
%endif
2015-06-02 06:25:17 +00:00
%files -n %{name}%{sover}
2011-04-11 03:07:13 +00:00
%defattr (-,root,root)
2015-11-23 13:45:18 +00:00
%doc AUTHORS ChangeLog COPYING
2015-06-02 06:25:17 +00:00
%{_libdir} /%{name} .so.%{sover} *
2011-04-11 03:07:13 +00:00
%files -n python-%{name}
%defattr (-,root,root)
2016-05-16 22:40:57 +00:00
%{python_sitearch} /%{_name}*.so
%{python_sitearch} /python_%{_name}-*
2016-06-29 19:10:45 +00:00
%if 0%{?suse_version} > 1320
2016-05-16 22:40:57 +00:00
%files -n python3-%{name}
%defattr (-,root,root)
%{python3_sitearch} /%{_name}*.so
%{python3_sitearch} /python_%{_name}-*
2016-05-17 07:18:00 +00:00
%endif
2011-04-11 03:07:13 +00:00
%files devel
%defattr (-,root,root)
2015-06-02 06:25:17 +00:00
%{_includedir} /%{_name}/
2011-04-11 03:07:13 +00:00
%{_libdir} /%{name} .so
%{_libdir} /pkgconfig/%{name} .pc
%files doc
%defattr (-,root,root)
2015-06-02 06:25:17 +00:00
%doc %{_docdir} /%{name} /
2011-04-11 03:07:13 +00:00
%changelog