diff --git a/_constraints b/_constraints index aa71f04..d9c80a2 100644 --- a/_constraints +++ b/_constraints @@ -2,7 +2,7 @@ - 3500 + 4 @@ -20,11 +20,15 @@ ppc64 ppc64le + aarch64 - 4500 + 5 + + 4 + diff --git a/libtorrent-rasterbar-fix_library_version.patch b/libtorrent-rasterbar-fix_library_version.patch new file mode 100644 index 0000000..9fb5be7 --- /dev/null +++ b/libtorrent-rasterbar-fix_library_version.patch @@ -0,0 +1,30 @@ +From: Luigi Baldoni +Date: 2020-09-09 16:22:42 +0200 +Subject: Avoid soname/library version confusion +References: gh#arvidn/libtorrent#4927 + +Upstream has changed the version format in 2.0 and this has percolated +down to the cmake scripts in 1.2.x. This patch makes it match autotools +behaviour. + +Index: libtorrent-rasterbar-1.2.10/CMakeLists.txt +=================================================================== +--- libtorrent-rasterbar-1.2.10.orig/CMakeLists.txt ++++ libtorrent-rasterbar-1.2.10/CMakeLists.txt +@@ -10,6 +10,7 @@ project(libtorrent + VERSION ${VER_MAJOR}.${VER_MINOR}.${VER_TINY} + ) + set (SOVERSION "10") ++set (SOVERSION_FULL "${SOVERSION}.0.0") + + include(GNUInstallDirs) + include(GeneratePkgConfig) +@@ -555,7 +556,7 @@ set_target_properties(torrent-rasterbar + PROPERTIES + CXX_VISIBILITY_PRESET "hidden" + VISIBILITY_INLINES_HIDDEN "true" +- VERSION ${PROJECT_VERSION} ++ VERSION ${SOVERSION_FULL} + SOVERSION ${SOVERSION} + ) + diff --git a/libtorrent-rasterbar-fix_pkgconfig_path.patch b/libtorrent-rasterbar-fix_pkgconfig_path.patch new file mode 100644 index 0000000..39a31b9 --- /dev/null +++ b/libtorrent-rasterbar-fix_pkgconfig_path.patch @@ -0,0 +1,33 @@ +From ad3bb12b4a05e3efd7bc3fbc692109203e5c9331 Mon Sep 17 00:00:00 2001 +From: Luigi Baldoni +Date: Sat, 1 Aug 2020 07:44:33 +0200 +Subject: [PATCH] Fix path duplication in .pc file installation + +--- + cmake/Modules/GeneratePkgConfig/generate-pkg-config.cmake.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: libtorrent-rasterbar-1.2.10/cmake/Modules/GeneratePkgConfig/generate-pkg-config.cmake.in +=================================================================== +--- libtorrent-rasterbar-1.2.10.orig/cmake/Modules/GeneratePkgConfig/generate-pkg-config.cmake.in ++++ libtorrent-rasterbar-1.2.10/cmake/Modules/GeneratePkgConfig/generate-pkg-config.cmake.in +@@ -49,4 +49,4 @@ set(_interface_compile_options "${_TARGE + string(REPLACE ";" " " _interface_compile_options "${_interface_compile_options}") + + configure_file("@_pkg_config_file_template_filename@" "@_generate_target_dir@/@_package_name@.pc" @ONLY) +-file(INSTALL "@_generate_target_dir@/@_package_name@.pc" DESTINATION "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/pkgconfig") ++file(INSTALL "@_generate_target_dir@/@_package_name@.pc" DESTINATION "@CMAKE_INSTALL_FULL_LIBDIR@/pkgconfig") +Index: libtorrent-rasterbar-1.2.10/cmake/Modules/GeneratePkgConfig/pkg-config.cmake.in +=================================================================== +--- libtorrent-rasterbar-1.2.10.orig/cmake/Modules/GeneratePkgConfig/pkg-config.cmake.in ++++ libtorrent-rasterbar-1.2.10/cmake/Modules/GeneratePkgConfig/pkg-config.cmake.in +@@ -1,7 +1,7 @@ + prefix=@CMAKE_INSTALL_PREFIX@ +-libdir=${prefix}/@_INSTALL_LIBDIR@ ++libdir=@_INSTALL_LIBDIR@ + +-Name: @_PROJECT_NAME@ ++Name: libtorrent-rasterbar + Description: @_PROJECT_DESCRIPTION@ + Version: @_PROJECT_VERSION@ + Libs: -L${libdir} -l@_TARGET_OUTPUT_NAME@ @_interface_link_libraries@ diff --git a/libtorrent-rasterbar.changes b/libtorrent-rasterbar.changes index ba00dca..7cd700e 100644 --- a/libtorrent-rasterbar.changes +++ b/libtorrent-rasterbar.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Sep 9 08:24:41 UTC 2020 - Luigi Baldoni + +- Switch to cmake build +- Remove references to python2 +- Add libtorrent-rasterbar-fix_pkgconfig_path.patch and + libtorrent-rasterbar-fix_library_version.patch +- Build in c++14 mode (qbittorrent prefers it) + ------------------------------------------------------------------- Thu Sep 3 13:49:19 UTC 2020 - Luigi Baldoni diff --git a/libtorrent-rasterbar.spec b/libtorrent-rasterbar.spec index 309342d..a514520 100644 --- a/libtorrent-rasterbar.spec +++ b/libtorrent-rasterbar.spec @@ -18,8 +18,6 @@ %define _name libtorrent %define sover 10 -%bcond_without python2 -%bcond_without python3 %bcond_with examples %bcond_with tests Name: libtorrent-rasterbar @@ -30,26 +28,22 @@ License: BSD-3-Clause Group: Development/Libraries/C and C++ URL: https://libtorrent.org/ Source: https://github.com/arvidn/%{_name}/releases/download/%{_name}-%{version}/%{name}-%{version}.tar.gz +# PATCH-FIX-UPSTREAM libtorrent-rasterbar-fix_pkgconfig_path.patch +Patch0: libtorrent-rasterbar-fix_pkgconfig_path.patch +# PATCH-FIX-OPENSUSE libtorrent-rasterbar-fix_library_version.patch +Patch1: libtorrent-rasterbar-fix_library_version.patch # for directory ownership BuildRequires: cmake-full +BuildRequires: fdupes BuildRequires: gcc-c++ -BuildRequires: pkgconfig -BuildRequires: pkgconfig(openssl) -%if %{with python2} -BuildRequires: python-devel -%endif -%if %{with python3} -BuildRequires: python3-devel -%endif BuildRequires: libboost_chrono-devel +BuildRequires: libboost_python3-devel BuildRequires: libboost_random-devel BuildRequires: libboost_system-devel -%if %{with python2} -BuildRequires: libboost_python-devel -%endif -%if %{with python3} -BuildRequires: libboost_python3-devel -%endif +BuildRequires: pkgconfig +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: pkgconfig(openssl) %description libtorrent-rasterbar is a C++ library that aims to be a good @@ -70,16 +64,6 @@ 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. -%package -n python2-%{name} -Summary: Python Bindings for libtorrent-rasterbar -# python-libtorrent-rasterbar was last used in openSUSE Leap 42.2. -Group: Development/Libraries/Python -Provides: python-%{name} = %{version}-%{release} -Obsoletes: python-%{name} < %{version}-%{release} - -%description -n python2-%{name} -Python Bindings for the libtorrent-rasterbar package. - %package -n python3-%{name} Summary: Python Bindings for libtorrent-rasterbar Group: Development/Libraries/Python @@ -87,6 +71,7 @@ Group: Development/Libraries/Python %description -n python3-%{name} Python Bindings for the libtorrent-rasterbar package. +### conditional here? %%if %%{with examples} %package tools Summary: Example tools from libtorrent-rasterbar Group: Development/Libraries/C and C++ @@ -119,61 +104,37 @@ BuildArch: noarch Documentation for the libtorrent-rasterbar package. %prep -%setup -q +%autosetup -p1 %build -export CFLAGS="%{optflags} -fno-strict-aliasing" -export CXXFLAGS="$CFLAGS" - -%global _configure ../configure -for py in %{?with_python2:python} %{?with_python3:python3}; do - mkdir -p "build-$py" - pushd "build-$py" - export PYTHON="$py" - %configure \ - --disable-static \ - --disable-silent-rules \ - --with-libiconv \ +export CXXFLAGS="-std=c++14" +%cmake \ %if %{with tests} - --enable-tests \ + -Dbuild_tests=ON \ %endif %if %{with examples} - --enable-examples \ + -Dbuild_examples=ON \ %endif - --with-boost-python="boost_$py" \ - --enable-python-binding - make %{?_smp_mflags} V=1 - popd -done + -Dpython-bindings=ON +%cmake_build %install -%if %{with python2} -%make_install -C build-python -%endif -%if %{with python3} -%make_install -C build-python3 -%endif +%cmake_install -find %{buildroot} -type f -name "*.la" -delete -print # Move doc to a separate package. mkdir -p %{buildroot}%{_docdir}/%{name}/ cp -r docs/* %{buildroot}%{_docdir}/%{name}/ %if %{with examples} -# 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} +install -Dm0755 build/examples/dump_torrent build/examples/make_torrent \ + build/examples/simple_client -t %{buildroot}%{_bindir} %endif +%fdupes %{buildroot}%{python3_sitearch} + %if %{with tests} %check -%if %{with python2} -make check %{?_smp_mflags} V=1 -C build-python -%endif -%if %{with python3} -make check %{?_smp_mflags} V=1 -C build-python3 -%endif +%ctest --verbose --exclude-regex "(test_flags|test_resume|test_torrent|test_url_seed|test_upnp)" %endif %post -n %{name}%{sover} -p /sbin/ldconfig @@ -191,21 +152,14 @@ make check %{?_smp_mflags} V=1 -C build-python3 %doc AUTHORS ChangeLog %{_libdir}/%{name}.so.%{sover}* -%if %{with python2} -%files -n python2-%{name} -%{python_sitearch}/%{_name}*.so -%{python_sitearch}/python_%{_name}-* -%endif - -%if %{with python3} %files -n python3-%{name} %{python3_sitearch}/%{_name}*.so -%{python3_sitearch}/python_%{_name}-* -%endif +%{python3_sitearch}/%{_name}.egg-info %files devel %{_datadir}/cmake/Modules/FindLibtorrentRasterbar.cmake %{_includedir}/%{_name}/ +%{_libdir}/cmake/LibtorrentRasterbar %{_libdir}/%{name}.so %{_libdir}/pkgconfig/%{name}.pc