1
0
Alexei Sorokin 2016-05-16 22:40:57 +00:00 committed by Git OBS Bridge
parent 3b412efb9b
commit cf7cf50a7e
4 changed files with 62 additions and 66 deletions

View File

@ -1,36 +0,0 @@
diff --git a/configure.ac b/configure.ac
index efa1943..945d2bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -159,10 +159,20 @@ AC_CHECK_FUNCS([clock_gettime], [],
[AC_MSG_WARN([clock_gettime function not found.])])])]
)
+case "$host" in
+ i?86-* | k?-* | athlon-* | pentium*-)
+ ARCH_SPECIFIC_CFLAGS="-msse4.2"
+ ;;
+ x86_64-*)
+ ARCH_SPECIFIC_CFLAGS="-msse4.2"
+ ;;
+ *)
+ AC_MSG_NOTICE([No architecture specific optimization])
+ ;;
+esac
dnl Pass some build options to .pc file
-COMPILETIME_OPTIONS=""
-
+COMPILETIME_OPTIONS="$ARCH_SPECIFIC_CFLAGS "
###############################################################################
# Setting configure options
@@ -536,8 +546,6 @@ AM_CONDITIONAL([WITH_OPENSSL], [test "x$ARG_ENABLE_ENCRYPTION" = "xyes" -o "x$AR
AC_DEFINE([BOOST_ASIO_HASH_MAP_BUCKETS],[1021],[Define to fix a wrong behavior in boost 1.39.])
COMPILETIME_OPTIONS="$COMPILETIME_OPTIONS -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 "
-COMPILETIME_OPTIONS="$COMPILETIME_OPTIONS -msse4.2 "
-
AC_DEFINE([BOOST_EXCEPTION_DISABLE],[1],[Define to disable the boost.exception features.])
COMPILETIME_OPTIONS="$COMPILETIME_OPTIONS -DBOOST_EXCEPTION_DISABLE "

View File

@ -0,0 +1,11 @@
--- a/configure
+++ b/configure
@@ -20267,8 +20267,6 @@ $as_echo "#define BOOST_ASIO_HASH_MAP_BU
COMPILETIME_OPTIONS="$COMPILETIME_OPTIONS -DBOOST_ASIO_HASH_MAP_BUCKETS=1021 "
-COMPILETIME_OPTIONS="$COMPILETIME_OPTIONS -msse4.2 "
-
$as_echo "#define BOOST_EXCEPTION_DISABLE 1" >>confdefs.h

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Mon May 16 13:26:12 UTC 2016 - sor.alexei@meowr.ru
- Build Python3 bindings.
- Remove GeoIP support remnants, was removed in 1.1.0.
- Replace fix-sse-only-on-x86.patch with
libtorrent-rasterbar-1.1.0-remove-x86-only-flag.patch
(commit 680eddf) and apply unconditionally.
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Apr 15 16:26:36 UTC 2016 - rpm@fthiessen.de Fri Apr 15 16:26:36 UTC 2016 - rpm@fthiessen.de

View File

@ -26,22 +26,18 @@ Release: 0
Summary: Libtorrent is a C++ implementation of the BitTorrent protocol Summary: Libtorrent is a C++ implementation of the BitTorrent protocol
License: BSD-3-Clause License: BSD-3-Clause
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Url: http://rasterbar.com/products/libtorrent Url: http://libtorrent.org/
Source: https://github.com/arvidn/%{_name}/releases/download/%{_name}-%{_version}/%{name}-%{version}.tar.gz Source: https://github.com/arvidn/%{_name}/releases/download/%{_name}-%{_version}/%{name}-%{version}.tar.gz
%ifnarch x86_64 amd64 %{ix86} # PATCH-FIX-UPSTREAM libtorrent-rasterbar-1.1.0-remove-x86-only-flag.patch -- Remove -msse4.2 flag (commit 680eddf).
Patch0: fix-sse-only-on-x86.patch Patch0: %{name}-1.1.0-remove-x86-only-flag.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: libtool
%endif
BuildRequires: boost-devel >= 1.36 BuildRequires: boost-devel >= 1.36
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: pkg-config BuildRequires: pkg-config
BuildRequires: python-devel BuildRequires: python-devel
BuildRequires: pkgconfig(geoip) BuildRequires: python3-devel
BuildRequires: pkgconfig(openssl) BuildRequires: pkgconfig(openssl)
# For quadmath.h we need gcc-fortran on openSUSE < Factory (<= 42.1) %if 0%{?suse_version} <= 1320
%if 0%{?suse_version} <=1320 # For quadmath.h we need gcc-fortran on openSUSE Leap 42.x and older.
BuildRequires: gcc-fortran BuildRequires: gcc-fortran
%endif %endif
@ -81,6 +77,13 @@ Group: Development/Libraries/Python
%description -n python-%{name} %description -n python-%{name}
Python Bindings for the libtorrent-rasterbar package. Python Bindings for the libtorrent-rasterbar package.
%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.
%if %{with examples} %if %{with examples}
%package tools %package tools
Summary: Example tools from libtorrent-rasterbar Summary: Example tools from libtorrent-rasterbar
@ -96,7 +99,7 @@ Group: Development/Libraries/C and C++
Requires: %{name}%{sover} = %{version} Requires: %{name}%{sover} = %{version}
Requires: boost-devel >= 1.36 Requires: boost-devel >= 1.36
Requires: gcc-c++ Requires: gcc-c++
Requires: pkgconfig(geoip) Requires: pkg-config
Requires: pkgconfig(openssl) Requires: pkgconfig(openssl)
%description devel %description devel
@ -121,40 +124,44 @@ Documentation for the libtorrent-rasterbar package.
%prep %prep
%setup -q %setup -q
%ifnarch x86_64 amd64 %{ix86}
%patch0 -p1 %patch0 -p1
autoreconf -vi
%endif
%build %build
export CFLAGS="%{optflags} -fno-strict-aliasing" export CFLAGS="%{optflags} -fno-strict-aliasing"
export CXXFLAGS="$CFLAGS" export CXXFLAGS="$CFLAGS"
export LDFLAGS="%{optflags} -lrt" export LDFLAGS="%{optflags} -lrt"
%configure \ %global _configure ../configure
--disable-static \ for py in python python3; do
--disable-silent-rules \ mkdir -p "build-$py"
--with-libgeoip \ pushd "build-$py"
--with-boost-libdir=%{_libdir} \ export PYTHON="$py"
%configure \
--disable-static \
--disable-silent-rules \
%if %{with examples} %if %{with examples}
--enable-examples \ --enable-examples \
%endif %endif
--enable-python-binding \ --with-boost-python="libboost_$py" \
--enable-encryption --enable-python-binding
make %{?_smp_mflags} make %{?_smp_mflags}
popd
done
%install %install
%make_install %make_install -C build-python
%make_install -C build-python3
find %{buildroot} -type f -name "*.la" -delete -print find %{buildroot} -type f -name "*.la" -delete -print
# Move doc to a separate package. # Move doc to a separate package.
mkdir -p %{buildroot}%{_docdir}/%{name}/ mkdir -p %{buildroot}%{_docdir}/%{name}/
cp -r docs/* %{buildroot}%{_docdir}/%{name}/ cp -r docs/* %{buildroot}%{_docdir}/%{name}/
%if %{with examples} %if %{with examples}
# Drop tests binaries from -tools subpackage. # Drop tests binaries from the libtorrent-rasterbar-tools subpackage.
rm -v %{buildroot}%{_bindir}/{client_test,connection_tester,enum_if,fragmentation_test} \ rm -v %{buildroot}%{_bindir}/{client_test,connection_tester,enum_if} \
%{buildroot}%{_bindir}/{parse_hash_fails,parse_request_log,rss_reader,upnp_test,utp_test} %{buildroot}%{_bindir}/{fragmentation_test,parse_hash_fails} \
%{buildroot}%{_bindir}/{parse_request_log,rss_reader,upnp_test,utp_test}
%endif %endif
%post -n %{name}%{sover} -p /sbin/ldconfig %post -n %{name}%{sover} -p /sbin/ldconfig
@ -176,8 +183,13 @@ rm -v %{buildroot}%{_bindir}/{client_test,connection_tester,enum_if,fragmentatio
%files -n python-%{name} %files -n python-%{name}
%defattr(-,root,root) %defattr(-,root,root)
%{py_sitedir}/%{_name}.so %{python_sitearch}/%{_name}*.so
%{py_sitedir}/python_%{_name}-%{version}-py%{py_ver}.egg-info %{python_sitearch}/python_%{_name}-*
%files -n python3-%{name}
%defattr(-,root,root)
%{python3_sitearch}/%{_name}*.so
%{python3_sitearch}/python_%{_name}-*
%files devel %files devel
%defattr(-,root,root) %defattr(-,root,root)