Dominique Leuenberger 2019-09-04 07:11:17 +00:00 committed by Git OBS Bridge
parent ad21caff84
commit a645f742c2
6 changed files with 31 additions and 447 deletions

View File

@ -1,398 +0,0 @@
From ce5f7e3de927243c3e9c52eeac66a03f64eaf85d Mon Sep 17 00:00:00 2001
From: Wolfgang Bauer <wbauer@tmo.at>
Date: Fri, 1 Sep 2017 14:33:56 +0200
Subject: [PATCH] Lower minimum Qt version to 5.5.0
As qAsConst() is new in Qt 5.7.0, define it where needed to make
ktorrent compile with lower Qt versions too.
---
CMakeLists.txt | 2 +-
ktmagnetdownloader/magnettest.cpp | 8 ++++++++
ktorrent/core.cpp | 8 ++++++++
ktorrent/trayicon.cpp | 8 ++++++++
ktorrent/view/viewmodel.h | 9 +++++++++
libktcore/groups/groupmanager.cpp | 9 +++++++++
libktcore/gui/tabbarwidget.cpp | 9 +++++++++
libktcore/interfaces/torrentactivityinterface.cpp | 9 +++++++++
libktcore/torrent/magnetmanager.cpp | 9 +++++++++
libktcore/torrent/queuemanager.cpp | 8 ++++++++
libktcore/torrent/torrentfilelistmodel.cpp | 9 +++++++++
libktcore/torrent/torrentfiletreemodel.cpp | 9 +++++++++
plugins/bwscheduler/schedule.h | 9 +++++++++
plugins/infowidget/trackermodel.cpp | 9 +++++++++
plugins/mediaplayer/playlist.cpp | 8 ++++++++
plugins/search/searchactivity.cpp | 8 ++++++++
plugins/search/searchenginelist.cpp | 9 +++++++++
plugins/shutdown/shutdownruleset.cpp | 8 ++++++++
plugins/upnp/routermodel.cpp | 9 +++++++++
19 files changed, 156 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 87428597..a5dc007a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.8.12)
project(KTORRENT)
-set (QT_MIN_VERSION "5.7.0")
+set (QT_MIN_VERSION "5.5.0")
set (KF5_MIN_VERSION "5.15")
find_package(ECM REQUIRED NO_MODULE)
diff --git a/ktmagnetdownloader/magnettest.cpp b/ktmagnetdownloader/magnettest.cpp
index 7ad15e43..378e3714 100644
--- a/ktmagnetdownloader/magnettest.cpp
+++ b/ktmagnetdownloader/magnettest.cpp
@@ -38,6 +38,14 @@
#include <bcodec/bencoder.h>
#include <peer/authenticationmonitor.h>
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
using namespace kt;
using namespace bt;
diff --git a/ktorrent/core.cpp b/ktorrent/core.cpp
index c8b497da..da740e17 100644
--- a/ktorrent/core.cpp
+++ b/ktorrent/core.cpp
@@ -62,6 +62,14 @@
#include "gui.h"
#include "powermanagementinhibit_interface.h"
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
using namespace bt;
diff --git a/ktorrent/trayicon.cpp b/ktorrent/trayicon.cpp
index a0b9f6ed..fb723268 100644
--- a/ktorrent/trayicon.cpp
+++ b/ktorrent/trayicon.cpp
@@ -42,6 +42,14 @@
#include "core.h"
#include "gui.h"
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
using namespace bt;
diff --git a/ktorrent/view/viewmodel.h b/ktorrent/view/viewmodel.h
index 11217508..b1df54f5 100644
--- a/ktorrent/view/viewmodel.h
+++ b/ktorrent/view/viewmodel.h
@@ -26,6 +26,15 @@
#include <QAbstractTableModel>
#include <interfaces/torrentinterface.h>
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
+
namespace kt
{
class View;
diff --git a/libktcore/groups/groupmanager.cpp b/libktcore/groups/groupmanager.cpp
index 57ff90a4..902a8e68 100644
--- a/libktcore/groups/groupmanager.cpp
+++ b/libktcore/groups/groupmanager.cpp
@@ -37,6 +37,15 @@
#include "ungroupedgroup.h"
#include "functiongroup.h"
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
+
using namespace bt;
namespace kt
diff --git a/libktcore/gui/tabbarwidget.cpp b/libktcore/gui/tabbarwidget.cpp
index 8bece605..9a9f6e90 100644
--- a/libktcore/gui/tabbarwidget.cpp
+++ b/libktcore/gui/tabbarwidget.cpp
@@ -28,6 +28,15 @@
#include <QTimer>
#include <QVBoxLayout>
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
+
namespace kt
{
diff --git a/libktcore/interfaces/torrentactivityinterface.cpp b/libktcore/interfaces/torrentactivityinterface.cpp
index 4532761f..063497c3 100644
--- a/libktcore/interfaces/torrentactivityinterface.cpp
+++ b/libktcore/interfaces/torrentactivityinterface.cpp
@@ -20,6 +20,15 @@
#include "torrentactivityinterface.h"
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
+
namespace kt
{
TorrentActivityInterface::TorrentActivityInterface(const QString& name, const QString& icon, QWidget* parent)
diff --git a/libktcore/torrent/magnetmanager.cpp b/libktcore/torrent/magnetmanager.cpp
index 838959bb..4684c841 100644
--- a/libktcore/torrent/magnetmanager.cpp
+++ b/libktcore/torrent/magnetmanager.cpp
@@ -29,6 +29,15 @@
#include <util/error.h>
#include <bcodec/bnode.h>
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
+
using namespace bt;
namespace kt {
diff --git a/libktcore/torrent/queuemanager.cpp b/libktcore/torrent/queuemanager.cpp
index 0b805ef6..c930221d 100644
--- a/libktcore/torrent/queuemanager.cpp
+++ b/libktcore/torrent/queuemanager.cpp
@@ -42,6 +42,14 @@
#include <algorithm>
#include <climits>
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
using namespace bt;
diff --git a/libktcore/torrent/torrentfilelistmodel.cpp b/libktcore/torrent/torrentfilelistmodel.cpp
index 00b8436f..082971e4 100644
--- a/libktcore/torrent/torrentfilelistmodel.cpp
+++ b/libktcore/torrent/torrentfilelistmodel.cpp
@@ -32,6 +32,15 @@
#include <interfaces/torrentfileinterface.h>
#include <util/functions.h>
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
+
using namespace bt;
namespace kt
diff --git a/libktcore/torrent/torrentfiletreemodel.cpp b/libktcore/torrent/torrentfiletreemodel.cpp
index 35cf59f4..d6ea23b1 100644
--- a/libktcore/torrent/torrentfiletreemodel.cpp
+++ b/libktcore/torrent/torrentfiletreemodel.cpp
@@ -38,6 +38,15 @@
#include <util/log.h>
#include <util/error.h>
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
+
using namespace bt;
namespace kt
diff --git a/plugins/bwscheduler/schedule.h b/plugins/bwscheduler/schedule.h
index 4a630fff..07d95f47 100644
--- a/plugins/bwscheduler/schedule.h
+++ b/plugins/bwscheduler/schedule.h
@@ -26,6 +26,15 @@
#include <QTime>
#include <util/constants.h>
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
+
namespace bt
{
class BDictNode;
diff --git a/plugins/infowidget/trackermodel.cpp b/plugins/infowidget/trackermodel.cpp
index a94e0e31..80647128 100644
--- a/plugins/infowidget/trackermodel.cpp
+++ b/plugins/infowidget/trackermodel.cpp
@@ -28,6 +28,15 @@
#include <interfaces/torrentinterface.h>
#include <interfaces/trackerinterface.h>
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
+
namespace kt
{
diff --git a/plugins/mediaplayer/playlist.cpp b/plugins/mediaplayer/playlist.cpp
index ff277a4e..289c8fe7 100644
--- a/plugins/mediaplayer/playlist.cpp
+++ b/plugins/mediaplayer/playlist.cpp
@@ -37,6 +37,14 @@
#include <util/log.h>
#include "mediaplayer.h"
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
using namespace bt;
diff --git a/plugins/search/searchactivity.cpp b/plugins/search/searchactivity.cpp
index 196e781e..679f9500 100644
--- a/plugins/search/searchactivity.cpp
+++ b/plugins/search/searchactivity.cpp
@@ -45,6 +45,14 @@
#include <searchpluginsettings.h>
#include "searchtoolbar.h"
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
namespace kt
{
diff --git a/plugins/search/searchenginelist.cpp b/plugins/search/searchenginelist.cpp
index 0d715ed0..766404e0 100644
--- a/plugins/search/searchenginelist.cpp
+++ b/plugins/search/searchenginelist.cpp
@@ -35,6 +35,15 @@
#include "searchenginelist.h"
#include "opensearchdownloadjob.h"
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
+
using namespace bt;
namespace kt
diff --git a/plugins/shutdown/shutdownruleset.cpp b/plugins/shutdown/shutdownruleset.cpp
index ce728fb3..b3774bd6 100644
--- a/plugins/shutdown/shutdownruleset.cpp
+++ b/plugins/shutdown/shutdownruleset.cpp
@@ -31,6 +31,14 @@
#include <torrent/queuemanager.h>
#include "shutdownruleset.h"
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
using namespace bt;
diff --git a/plugins/upnp/routermodel.cpp b/plugins/upnp/routermodel.cpp
index 464e2f14..7167f3d4 100644
--- a/plugins/upnp/routermodel.cpp
+++ b/plugins/upnp/routermodel.cpp
@@ -27,6 +27,15 @@
#include <upnp/upnprouter.h>
#include "routermodel.h"
+#if QT_VERSION < QT_VERSION_CHECK(5, 7, 0)
+// this adds const to non-const objects (like std::as_const)
+template <typename T>
+Q_DECL_CONSTEXPR typename std::add_const<T>::type &qAsConst(T &t) Q_DECL_NOTHROW { return t; }
+// prevent rvalue arguments:
+template <typename T>
+void qAsConst(const T &&) Q_DECL_EQ_DELETE;
+#endif
+
using namespace bt;
namespace kt
--
2.13.5

View File

@ -1,4 +1,4 @@
--- a/ktorrent/org.kde.ktorrent.desktop.orig 2011-03-14 19:48:22.000000000 +0200 --- a/ktorrent/org.kde.ktorrent.desktop 2011-03-14 19:48:22.000000000 +0200
+++ b/ktorrent/org.kde.ktorrent.desktop 2011-03-16 00:26:00.162000025 +0200 +++ b/ktorrent/org.kde.ktorrent.desktop 2011-03-16 00:26:00.162000025 +0200
@@ -120,6 +120,7 @@ @@ -120,6 +120,7 @@
Type=Application Type=Application

View File

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

3
ktorrent-5.1.2.tar.xz Normal file
View File

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

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Sun Sep 1 19:44:57 UTC 2019 - wbauer@tmo.at
- Update to version 5.1.2
* Fix memory corruption in ScanFolder plugin
* Fix a few issues found by clang-tidy
* Some build fixes (missing include headers) that get triggered
on certain versions of Qt/KF5 frameworks
- Drop fix-build-with-qt5.6.patch, Leap 42 is EOL
- Remove conditionals for no longer supported distribution versions
- Use %kf5_find_htmldocs macro to autogenerate the translated docs
file list
- Update URL, ktorrent.org doesn't exist any more
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Aug 31 12:11:47 UTC 2018 - wbauer@tmo.at Fri Aug 31 12:11:47 UTC 2018 - wbauer@tmo.at

View File

@ -1,7 +1,7 @@
# #
# spec file for package ktorrent # spec file for package ktorrent
# #
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -12,33 +12,26 @@
# license that conforms to the Open Source Definition (Version 1.9) # license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative. # 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/
# #
Name: ktorrent Name: ktorrent
Version: 5.1.1 Version: 5.1.2
Release: 0 Release: 0
Summary: KDE BitTorrent Client Summary: KDE BitTorrent Client
License: GPL-2.0-or-later License: GPL-2.0-or-later
Group: Productivity/Networking/File-Sharing Group: Productivity/Networking/File-Sharing
URL: http://ktorrent.org/ URL: https://kde.org/applications/internet/org.kde.ktorrent/
Source0: http://download.kde.org/stable/ktorrent/%{version}/%{name}-%{version}.tar.xz Source0: https://download.kde.org/stable/ktorrent/%{version}/%{name}-%{version}.tar.xz
Source2: ktorrent.1 Source2: ktorrent.1
Source3: ktupnptest.1 Source3: ktupnptest.1
# PATCH-FIX-OPENSUSE initial-preference.diff cmorve69@yahoo.es -- InitialPreference to set it as the default torrent downloader # PATCH-FIX-OPENSUSE initial-preference.diff cmorve69@yahoo.es -- InitialPreference to set it as the default torrent downloader
Patch0: initial-preference.diff Patch0: initial-preference.diff
%if 0%{?suse_version} < 1330
# PATCH-FIX-OPENSUSE fix-build-with-qt5.6.patch -- make it build with Qt < 5.7.0 (i.e. on Leap 42.x)
Patch1: fix-build-with-qt5.6.patch
%endif
BuildRequires: extra-cmake-modules BuildRequires: extra-cmake-modules
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: libktorrent-devel >= 2.1 BuildRequires: libboost_headers-devel
BuildRequires: phonon4qt5-devel
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: plasma5-workspace-devel
BuildRequires: syndication-devel
BuildRequires: update-desktop-files BuildRequires: update-desktop-files
BuildRequires: cmake(KF5Archive) BuildRequires: cmake(KF5Archive)
BuildRequires: cmake(KF5Completion) BuildRequires: cmake(KF5Completion)
@ -60,11 +53,15 @@ BuildRequires: cmake(KF5NotifyConfig)
BuildRequires: cmake(KF5Parts) BuildRequires: cmake(KF5Parts)
BuildRequires: cmake(KF5Plotting) BuildRequires: cmake(KF5Plotting)
BuildRequires: cmake(KF5Solid) BuildRequires: cmake(KF5Solid)
BuildRequires: cmake(KF5Syndication)
BuildRequires: cmake(KF5TextWidgets) BuildRequires: cmake(KF5TextWidgets)
BuildRequires: cmake(KF5Torrent) >= 2.1
BuildRequires: cmake(KF5WebKit) BuildRequires: cmake(KF5WebKit)
BuildRequires: cmake(KF5WidgetsAddons) BuildRequires: cmake(KF5WidgetsAddons)
BuildRequires: cmake(KF5WindowSystem) BuildRequires: cmake(KF5WindowSystem)
BuildRequires: cmake(KF5XmlGui) BuildRequires: cmake(KF5XmlGui)
BuildRequires: cmake(LibKWorkspace)
BuildRequires: cmake(Phonon4Qt5)
BuildRequires: cmake(Qt5Core) BuildRequires: cmake(Qt5Core)
BuildRequires: cmake(Qt5DBus) BuildRequires: cmake(Qt5DBus)
BuildRequires: cmake(Qt5Network) BuildRequires: cmake(Qt5Network)
@ -72,21 +69,6 @@ BuildRequires: cmake(Qt5Script)
BuildRequires: cmake(Qt5Widgets) BuildRequires: cmake(Qt5Widgets)
BuildRequires: pkgconfig(taglib) BuildRequires: pkgconfig(taglib)
Recommends: %{name}-lang = %{version} Recommends: %{name}-lang = %{version}
%if 0%{?suse_version} > 1325
BuildRequires: libboost_headers-devel
%else
BuildRequires: boost-devel
%endif
%if 0%{?suse_version} < 1330
#!BuildIgnore: libgcc_s1
%if 0%{?sle_version} < 120300
BuildRequires: gcc5
BuildRequires: gcc5-c++
%else
BuildRequires: gcc7
BuildRequires: gcc7-c++
%endif
%endif
%description %description
KTorrent is a BitTorrent application by KDE which allows you to download files KTorrent is a BitTorrent application by KDE which allows you to download files
@ -101,30 +83,19 @@ for BitTorrent.
%autopatch -p1 %autopatch -p1
%build %build
%if 0%{?suse_version} < 1330
%if 0%{?sle_version} < 120300
%cmake_kf5 -d build -- -DCMAKE_C_COMPILER=gcc-5 -DCMAKE_CXX_COMPILER=g++-5
%else
%cmake_kf5 -d build -- -DCMAKE_C_COMPILER=gcc-7 -DCMAKE_CXX_COMPILER=g++-7
%endif
%else
%cmake_kf5 -d build %cmake_kf5 -d build
%endif
%make_jobs %make_jobs
%install %install
%kf5_makeinstall -C build %kf5_makeinstall -C build
# Not needed, fix "devel-file-in-non-devel-package" rpmlint warning
rm -f %{buildroot}%{_libdir}/libktcore.so
# Add man pages from help2man edited. # Add man pages from help2man edited.
mkdir -p %{buildroot}%{_mandir}/man1 mkdir -p %{buildroot}%{_mandir}/man1
cp -a %{SOURCE2} %{buildroot}%{_mandir}/man1 cp -a %{SOURCE2} %{buildroot}%{_mandir}/man1
cp -a %{SOURCE3} %{buildroot}%{_mandir}/man1 cp -a %{SOURCE3} %{buildroot}%{_mandir}/man1
# Fix any .py files with shebangs and wrong permissions. # Fix any .py files with shebangs and wrong permissions.
if test -z `find %{buildroot} -name *.py -perm 0644 -print0|xargs -0r grep -l '#!'`; \ if test -z "`find %{buildroot} -name *.py -perm 0644 -print0|xargs -0r grep -l '#!'`"; \
then break; then break;
else chmod -f 0755 `find %{buildroot} -name *.py -perm 0644 -print0|xargs -0r grep -l '#!'`; \ else chmod -f 0755 `find %{buildroot} -name *.py -perm 0644 -print0|xargs -0r grep -l '#!'`; \
fi fi
@ -134,6 +105,7 @@ fi
%fdupes -s %{buildroot} %fdupes -s %{buildroot}
%find_lang %{name} %find_lang %{name}
%kf5_find_htmldocs
%post -p /sbin/ldconfig %post -p /sbin/ldconfig
%postun -p /sbin/ldconfig %postun -p /sbin/ldconfig
@ -141,7 +113,6 @@ fi
%files %files
%license COPYING %license COPYING
%doc ChangeLog RoadMap %doc ChangeLog RoadMap
%dir %{_kf5_appstreamdir}
%{_kf5_bindir}/ktmagnetdownloader %{_kf5_bindir}/ktmagnetdownloader
%{_kf5_bindir}/ktorrent %{_kf5_bindir}/ktorrent
%{_kf5_bindir}/ktupnptest %{_kf5_bindir}/ktupnptest
@ -151,16 +122,13 @@ fi
%{_kf5_iconsdir}/hicolor/*/*/*.png %{_kf5_iconsdir}/hicolor/*/*/*.png
%{_kf5_iconsdir}/hicolor/*/*/*.svgz %{_kf5_iconsdir}/hicolor/*/*/*.svgz
%{_kf5_kxmlguidir}/ktorrent/ %{_kf5_kxmlguidir}/ktorrent/
%{_kf5_libdir}/libktcore.so.*
%{_kf5_mandir}/man1/ktorrent.1%{?ext_man} %{_kf5_mandir}/man1/ktorrent.1%{?ext_man}
%{_kf5_mandir}/man1/ktupnptest.1%{?ext_man} %{_kf5_mandir}/man1/ktupnptest.1%{?ext_man}
%{_kf5_notifydir}/ktorrent.notifyrc %{_kf5_notifydir}/ktorrent.notifyrc
%{_kf5_plugindir}/ %{_kf5_plugindir}/
%{_kf5_sharedir}/ktorrent/ %{_kf5_sharedir}/ktorrent/
%{_libdir}/libktcore.so.*
%files lang -f %{name}.lang %files lang -f %{name}.lang
%{_kf5_htmldir}/*/ktorrent/
%dir %{_kf5_htmldir}/pt_BR
%exclude %{_kf5_htmldir}/en/ktorrent/
%changelog %changelog