summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSevenseven2017-01-15 08:51:34 +0300
committerSevenseven2017-01-15 08:51:34 +0300
commit7f03d21623278f08e35b14e1b922928cb66de627 (patch)
tree75bb6afefd4d79e8cdd7508565f3ac9a66f6b57e
parenta17354d066c93ec35e5dcc162d6544ab7b7ee28a (diff)
downloadaur-7f03d21623278f08e35b14e1b922928cb66de627.tar.gz
qbittorrent-libtorrent-1.1.1.patch
-rw-r--r--.SRCINFO10
-rw-r--r--PKGBUILD14
-rw-r--r--qbittorrent-libtorrent-1.1.1.patch61
-rwxr-xr-xqbittorrent.service5
-rw-r--r--qbittorrent@.service12
5 files changed, 91 insertions, 11 deletions
diff --git a/.SRCINFO b/.SRCINFO
index cf81d0f3c100..f464cbda2d40 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,6 @@
-# Generated by mksrcinfo v8
-# Sun Jan 10 16:05:20 UTC 2016
pkgbase = qbittorrent-nogui-git
pkgdesc = Bittorrent client based on libtorrent-rasterbar (without X support)
- pkgver = .6515
+ pkgver = .7189
pkgrel = 1
url = http://www.qbittorrent.org/
arch = i686
@@ -15,8 +13,12 @@ pkgbase = qbittorrent-nogui-git
conflicts = qbittorrent-nogui
source = git://github.com/qbittorrent/qBittorrent.git
source = qbittorrent.service
+ source = qbittorrent@.service
+ source = qbittorrent-libtorrent-1.1.1.patch
md5sums = SKIP
- md5sums = 7d04cc84253fa1b6c1bfaca6edce8c81
+ md5sums = 98ac5dd1f2a5ab78ece106ac2df1ec1c
+ md5sums = 375b80818026e6cdd586fca37379b0ab
+ md5sums = 1da24b5e84f642a2f2790a77e36d496c
pkgname = qbittorrent-nogui-git
diff --git a/PKGBUILD b/PKGBUILD
index 18915588d4f7..a8731619a72a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,7 +2,7 @@
#Contributor: Martin Villagra <mvillagra0@gmail.com>
pkgname=qbittorrent-nogui-git
-pkgver=.6515
+pkgver=.7189
pkgrel=1
pkgdesc="Bittorrent client based on libtorrent-rasterbar (without X support)"
arch=('i686' 'x86_64')
@@ -12,9 +12,13 @@ depends=('libtorrent-rasterbar' 'qt5-base')
makedepends=('boost' 'qt5-tools')
conflicts=('qbittorrent-nogui')
source=("git://github.com/qbittorrent/qBittorrent.git"
- "qbittorrent.service")
+ "qbittorrent.service"
+ "qbittorrent@.service"
+ "qbittorrent-libtorrent-1.1.1.patch")
md5sums=('SKIP'
- '7d04cc84253fa1b6c1bfaca6edce8c81')
+ '98ac5dd1f2a5ab78ece106ac2df1ec1c'
+ '375b80818026e6cdd586fca37379b0ab'
+ '1da24b5e84f642a2f2790a77e36d496c')
pkgver() {
cd ${srcdir}/qBittorrent
@@ -31,6 +35,7 @@ if [[ -d ${srcdir}/build ]]; then
build() {
cd ${srcdir}/build
+ patch -Np1 -i "$srcdir/qbittorrent-libtorrent-1.1.1.patch"
./configure --prefix=/usr --disable-gui
make
}
@@ -38,5 +43,6 @@ build() {
package() {
cd ${srcdir}/build
make INSTALL_ROOT=${pkgdir} install
- install -D -m0755 "$srcdir/qbittorrent.service" "$pkgdir/usr/lib/systemd/system/qbittorrent.service"
+ install -Dm644 "$srcdir/qbittorrent.service" "$pkgdir/usr/lib/systemd/user/qbittorrent.service"
+ install -Dm644 "$srcdir/qbittorrent@.service" "$pkgdir/usr/lib/systemd/system/qbittorrent@.service"
}
diff --git a/qbittorrent-libtorrent-1.1.1.patch b/qbittorrent-libtorrent-1.1.1.patch
new file mode 100644
index 000000000000..237835f0597f
--- /dev/null
+++ b/qbittorrent-libtorrent-1.1.1.patch
@@ -0,0 +1,61 @@
+--- a/src/base/bittorrent/session.cpp
++++ b/src/base/bittorrent/session.cpp
+@@ -45,6 +45,9 @@
+ #include <QTimer>
+
+ #include <cstdlib>
++#if LIBTORRENT_VERSION_NUM >= 10100 && LIBTORRENT_VERSION_NUM < 10102
++#include <sstream>
++#endif
+ #include <queue>
+ #include <vector>
+
+@@ -194,6 +197,36 @@ namespace
+
+ template <typename T>
+ LowerLimited<T> lowerLimited(T limit, T ret) { return LowerLimited<T>(limit, ret); }
++
++#if LIBTORRENT_VERSION_NUM >= 10100 && LIBTORRENT_VERSION_NUM < 10102
++ std::string makeFingerprint(const char* peerId, int major, int minor, int revision, int tag)
++ {
++ Q_ASSERT(peerId);
++ Q_ASSERT(major >= 0);
++ Q_ASSERT(minor >= 0);
++ Q_ASSERT(revision >= 0);
++ Q_ASSERT(tag >= 0);
++ Q_ASSERT(std::strlen(peerId) == 2);
++
++ auto versionToChar = [](int v) -> char
++ {
++ if (v >= 0 && v < 10) return static_cast<char>('0' + v);
++ if (v >= 10) return static_cast<char>('A' + (v - 10));
++ Q_ASSERT(false);
++ return '0';
++ };
++
++ std::ostringstream buf;
++ buf << '-'
++ << peerId
++ << versionToChar(major)
++ << versionToChar(minor)
++ << versionToChar(revision)
++ << versionToChar(tag)
++ << '-';
++ return buf.str();
++ }
++#endif
+ }
+
+ // Session
+@@ -334,7 +367,11 @@ Session::Session(QObject *parent)
+ dispatchAlerts(alertPtr.release());
+ });
+ #else
++#if LIBTORRENT_VERSION_NUM < 10102
++ std::string peerId = makeFingerprint(PEER_ID, VERSION_MAJOR, VERSION_MINOR, VERSION_BUGFIX, VERSION_BUILD);
++#else
+ std::string peerId = libt::generate_fingerprint(PEER_ID, VERSION_MAJOR, VERSION_MINOR, VERSION_BUGFIX, VERSION_BUILD);
++#endif
+ libt::settings_pack pack;
+ pack.set_int(libt::settings_pack::alert_mask, alertMask);
+ pack.set_str(libt::settings_pack::peer_fingerprint, peerId);
diff --git a/qbittorrent.service b/qbittorrent.service
index cfe78ce7734e..af47fa98113c 100755
--- a/qbittorrent.service
+++ b/qbittorrent.service
@@ -1,12 +1,11 @@
[Unit]
Description=qbittorrent-nox Daemon
+Documentation=https://github.com/qbittorrent/qBittorrent/wiki
After=network.target
[Service]
-User=0
Type=forking
ExecStart=/usr/bin/qbittorrent-nox --daemon --webui-port=8080
-RemainAfterExit=yes
[Install]
-WantedBy=multi-user.target
+WantedBy=default.target
diff --git a/qbittorrent@.service b/qbittorrent@.service
new file mode 100644
index 000000000000..6308addea3a2
--- /dev/null
+++ b/qbittorrent@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=qbittorrent-nox Daemon
+Documentation=https://github.com/qbittorrent/qBittorrent/wiki
+After=network.target
+
+[Service]
+User=%i
+Type=forking
+ExecStart=/usr/bin/qbittorrent-nox --daemon --webui-port=8080
+
+[Install]
+WantedBy=multi-user.target