2019-09-04 07:11:10 +00:00
committed by Git OBS Bridge
parent edac77531e
commit 74a22e0375
6 changed files with 52 additions and 144 deletions

View File

@@ -1,83 +0,0 @@
From bcb17b62ff492a7bc7d65c59a5b0a3513199c65d Mon Sep 17 00:00:00 2001
From: Wolfgang Bauer <wbauer@tmo.at>
Date: Thu, 31 Aug 2017 18:52:26 +0200
Subject: Fix build with Qt 5.6 or lower
qAsConst() is only available since Qt 5.7.0, but the specified minimum
Qt version is 5.2.0.
This partially reverts commit d671f62febfe2bedeae9c427c58a02675dabd9cb
in case of building with a lower Qt version to avoid the usage of
qAsConst() and make it compile.
Differential Revision: https://phabricator.kde.org/D7634
---
src/upnp/upnprouter.cpp | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/src/upnp/upnprouter.cpp b/src/upnp/upnprouter.cpp
index f51ebcd..5ae95b0 100644
--- a/src/upnp/upnprouter.cpp
+++ b/src/upnp/upnprouter.cpp
@@ -155,7 +155,11 @@ namespace bt
void UPnPRouter::addService(const UPnPService& s)
{
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+ foreach(const UPnPService& os, d->services)
+#else
for (const UPnPService& os : qAsConst(d->services))
+#endif
{
if(s.servicetype == os.servicetype)
return;
@@ -205,7 +209,11 @@ namespace bt
bool found = false;
Out(SYS_PNP | LOG_NOTICE) << "Forwarding port " << port.number << " (" << (port.proto == UDP ? "UDP" : "TCP") << ")" << endl;
// first find the right service
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+ foreach(const UPnPService& s, d->services)
+#else
for (const UPnPService& s : qAsConst(d->services))
+#endif
{
if(s.servicetype.contains("WANIPConnection") || s.servicetype.contains("WANPPPConnection"))
{
@@ -375,7 +383,11 @@ namespace bt
void UPnPRouter::visit(UPnPRouter::Visitor* visitor) const
{
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+ foreach(const Forwarding& fwd, d->fwds)
+#else
for (const Forwarding& fwd : qAsConst(d->fwds))
+#endif
{
visitor->forwarding(fwd.port, fwd.pending_req != 0, fwd.service);
}
@@ -391,7 +403,11 @@ namespace bt
UPnPRouter::UPnPRouterPrivate::~UPnPRouterPrivate()
{
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+ foreach(HTTPRequest* r, active_reqs)
+#else
for (HTTPRequest* r : qAsConst(active_reqs))
+#endif
{
r->deleteLater();
}
@@ -515,7 +531,11 @@ namespace bt
void UPnPRouter::UPnPRouterPrivate::getExternalIP()
{
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+ foreach(const UPnPService& s, services)
+#else
for (const UPnPService& s : qAsConst(services))
+#endif
{
if(s.servicetype.contains("WANIPConnection") || s.servicetype.contains("WANPPPConnection"))
{
--
cgit v0.11.2

3
libktorrent-2.1.1.tar.xz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5cc45c0b50a1b6b2ce64ad0384128f4ac3bc0e4a1417eb58e5e992b510fca100
size 357516

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3eefdcceec73410c558e82d7be22eb2ed18679e9ab64f34cc100b54e186fe26f
size 355476

View File

@@ -1,3 +1,19 @@
-------------------------------------------------------------------
Sun Sep 1 19:42:51 UTC 2019 - wbauer@tmo.at
- Update to version 2.1.1
* Fix HTTP seeding (kde#382375)
* Fix a few issues found by clang-tidy
* Some build fixes that get triggered on certain versions of
Qt/KF5 frameworks
- Drop fix-build-with-qt5.6.patch, merged upstream
- Drop require-lower-LibGMP.patch, no longer necessary as all
current distribution versions have gmp 6
- Remove conditionals for no longer supported distribution versions
- Add missing requirements to the devel package
- Update URL, ktorrent.org doesn't exist any more
- Run spec-cleaner
-------------------------------------------------------------------
Sat Sep 2 09:20:11 UTC 2017 - wbauer@tmo.at

View File

@@ -1,7 +1,7 @@
#
# spec file for package libktorrent
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,45 +12,35 @@
# 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/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define ktor_ver 5.1
Name: libktorrent
Version: 2.1
Release: 0
%define ktor_ver 5.1.2
%define sonum 6
Name: libktorrent
Version: 2.1.1
Release: 0
Summary: Torrent Downloading Library
License: GPL-2.0+
License: GPL-2.0-or-later
Group: Productivity/Networking/File-Sharing
Url: http://ktorrent.org/
Source0: http://download.kde.org/stable/ktorrent/%{ktor_ver}/%{name}-%{version}.tar.xz
# PATCH-FIX-OPENSUSE require-lower-LibGMP.patch
Patch0: require-lower-LibGMP.patch
# PATCH-FIX-UPSTREAM fix-build-with-qt5.6.patch
Patch1: fix-build-with-qt5.6.patch
%if 0%{?suse_version} > 1325
BuildRequires: libboost_headers-devel
%else
BuildRequires: boost-devel
%endif
URL: https://kde.org/applications/internet/org.kde.ktorrent/
Source0: https://download.kde.org/stable/ktorrent/%{ktor_ver}/%{name}-%{version}.tar.xz
BuildRequires: doxygen
BuildRequires: extra-cmake-modules
BuildRequires: gmp-devel >= 5.1.3
BuildRequires: karchive-devel
BuildRequires: kcrash-devel
BuildRequires: ki18n-devel
BuildRequires: kio-devel
BuildRequires: gmp-devel >= 6.0.0
BuildRequires: libboost_headers-devel
BuildRequires: libgcrypt-devel
BuildRequires: libqca-qt5-devel
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Test)
BuildRequires: pkgconfig(Qt5Xml)
BuildRequires: solid-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: cmake(KF5Archive)
BuildRequires: cmake(KF5Crash)
BuildRequires: cmake(KF5I18n)
BuildRequires: cmake(KF5KIO)
BuildRequires: cmake(KF5Solid)
BuildRequires: cmake(Qca-qt5)
BuildRequires: cmake(Qt5Core)
BuildRequires: cmake(Qt5Network)
BuildRequires: cmake(Qt5Test)
BuildRequires: cmake(Qt5Xml)
%description
libktorrent is a torrent downloading library.
@@ -58,14 +48,16 @@ libktorrent is a torrent downloading library.
%package devel
Summary: Development files for libktorrent
Group: Development/Libraries/C and C++
%if 0%{?suse_version} > 1325
Requires: libboost_headers-devel
%else
Requires: boost-devel
%endif
Requires: gmp-devel
Requires: libKF5Torrent%{sonum} = %{version}
Requires: libqca-qt5-devel
Requires: libboost_headers-devel
Requires: libgcrypt-devel
Requires: cmake(KF5Archive)
Requires: cmake(KF5Config)
Requires: cmake(KF5KIO)
Requires: cmake(Qca-qt5)
Requires: cmake(Qt5Core)
Requires: cmake(Qt5Network)
%description devel
This package includes the necessary files for development using libktorrent.
@@ -81,10 +73,9 @@ Obsoletes: %{name} < %{version}
libktorrent is a torrent downloading library.
%lang_package
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%setup -q
%build
%cmake_kf5 -d build
@@ -96,21 +87,18 @@ libktorrent is a torrent downloading library.
%find_lang libktorrent5 %{name}.lang
%post -n libKF5Torrent%{sonum} -p /sbin/ldconfig
%postun -n libKF5Torrent%{sonum} -p /sbin/ldconfig
%files devel
%defattr(-,root,root,-)
%{_kf5_includedir}/libktorrent/
%{_kf5_libdir}/libKF5Torrent.so
%{_kf5_cmakedir}/KF5Torrent/
%files -n libKF5Torrent%{sonum}
%defattr(-,root,root,-)
%doc COPYING ChangeLog RoadMap
%license COPYING
%doc ChangeLog RoadMap
%{_kf5_libdir}/libKF5Torrent.so.%{sonum}*
%files lang -f %{name}.lang
%defattr(-,root,root,-)
%changelog

View File

@@ -1,13 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fab39f2..7790d39 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,7 +26,7 @@ include(ECMSetupVersion)
include(ECMPackageConfigHelpers)
set(Boost_MIN_VERSION "1.34.0")
-set(LibGMP_MIN_VERSION "6.0.0")
+set(LibGMP_MIN_VERSION "5.1.3")
set(LibGcrypt_MIN_VERSION "1.4.5")
set(KF5_MIN_VERSION "5.15")
set(QT_MIN_VERSION "5.2.0")