diff options
author | Hexhu | 2023-10-01 21:34:41 -0700 |
---|---|---|
committer | Hexhu | 2023-10-01 21:36:28 -0700 |
commit | c7243ca0499909cf11cf2798a656a8621d88fbf2 (patch) | |
tree | a722efb2d0bfa512c11e49fbf057248b2057c972 | |
parent | 4dd5482cd517d1471166ff1e34430717d53bb1a7 (diff) | |
download | aur-c7243ca0499909cf11cf2798a656a8621d88fbf2.tar.gz |
4.0.4-1: upgrade to transmission 4.0 and merge patches
-rw-r--r-- | .SRCINFO | 64 | ||||
-rw-r--r-- | PKGBUILD | 142 | ||||
-rw-r--r-- | ban-3-more-leech-only-clients.patch | 23 | ||||
-rw-r--r-- | ban-xunlei.patch | 112 | ||||
-rw-r--r-- | transmission-3.00-openssl-3.patch | 37 |
5 files changed, 202 insertions, 176 deletions
@@ -1,28 +1,33 @@ pkgbase = transmission-noxunlei - pkgdesc = patched version of transmission that bans Xunlei (a well-known leech-only client) - pkgver = 3.00 - pkgrel = 5 - url = https://www.transmissionbt.com/ + pkgver = 4.0.4 + pkgrel = 1 + url = http://www.transmissionbt.com/ arch = x86_64 - license = MIT - makedepends = gtk3 - makedepends = intltool + license = GPL + makedepends = cmake makedepends = curl - makedepends = qt5-base + makedepends = dht + makedepends = glibmm-2.68 + makedepends = gtk4 + makedepends = gtkmm-4.0 + makedepends = intltool + makedepends = libb64 + makedepends = libdeflate makedepends = libevent + makedepends = libnatpmp + makedepends = miniupnpc + makedepends = ninja + makedepends = npm + makedepends = qt6-base + makedepends = qt6-svg + makedepends = qt6-tools makedepends = systemd - makedepends = qt5-tools - makedepends = libappindicator-gtk3 - source = https://github.com/transmission/transmission-releases/raw/master/transmission-3.00.tar.xz - source = transmission-3.00-openssl-3.patch + source = https://github.com/transmission/transmission/releases/download/4.0.4/transmission-4.0.4.tar.xz source = ban-xunlei.patch - source = ban-3-more-leech-only-clients.patch source = transmission-noxunlei-cli.sysusers source = transmission-noxunlei-cli.tmpfiles - sha256sums = 9144652fe742f7f7dd6657716e378da60b751aaeda8bef8344b3eefc4db255f2 - sha256sums = a5e56b906724f007db0bdb9835fbf5088bb56a521ec2971aec0ea44578d5955b - sha256sums = c1b21b0e2d54a0a041c602709f6f0c2dc3626e6aa04c049c1a76b2e3d0dcc89d - sha256sums = 90d6e7fcdc84fc14546d1060880f656e5f2e9490e094c42339b74a7973be779b + sha256sums = 15f7b4318fdfbffb19aa8d9a6b0fd89348e6ef1e86baa21a0806ffd1893bd5a6 + sha256sums = f895bafecf6d0f19420a01cb0077a2466af08527670df95f4d70d7430e79d71e sha256sums = 641310fb0590d40e00bea1b5b9c843953ab78edf019109f276be9c6a7bdaf5b2 sha256sums = 1266032bb07e47d6bcdc7dabd74df2557cc466c33bf983a5881316a4cc098451 @@ -31,6 +36,10 @@ pkgname = transmission-noxunlei-cli depends = curl depends = libevent depends = systemd + depends = libb64 + depends = miniupnpc + depends = libnatpmp + depends = libdeflate provides = transmission-cli conflicts = transmission-cli @@ -38,10 +47,13 @@ pkgname = transmission-noxunlei-gtk pkgdesc = Fast, easy, and free BitTorrent client (GTK+ GUI), patched to ban Xunlei (a well-known leecher client) depends = curl depends = libevent - depends = gtk3 - depends = desktop-file-utils + depends = gtk4 depends = hicolor-icon-theme - depends = libappindicator-gtk3 + depends = libb64 + depends = miniupnpc + depends = libnatpmp + depends = libdeflate + depends = gtkmm-4.0 optdepends = libnotify: Desktop notification support optdepends = transmission-cli: daemon and web support provides = transmission-gtk @@ -50,8 +62,18 @@ pkgname = transmission-noxunlei-gtk pkgname = transmission-noxunlei-qt pkgdesc = Fast, easy, and free BitTorrent client (Qt GUI), patched to ban Xunlei (a well-known leecher client) depends = curl - depends = qt5-base + depends = qt6-base + depends = qt6-svg depends = libevent + depends = libb64 + depends = miniupnpc + depends = libnatpmp + depends = libdeflate optdepends = transmission-cli: daemon and web support provides = transmission-qt conflicts = transmission-qt + +pkgname = libtransmission-noxunlei + pkgdesc = Fast, easy, and free BitTorrent client (shared library), patched to ban Xunlei (a well-known leecher client) + provides = libtransmission + conflicts = libtransmission @@ -1,26 +1,42 @@ # Maintainer : Hexhu <i at hexhu.net> # Contributor : Tom Gundersen <teg at jklm.no> # Contributor : Ionut Biru <ibiru at archlinux.org> +# Contributor : Thomas Weißschuh <thomas t-8ch de> +# Contributor : Florian Pritz <bluewind at xinu.at> pkgbase=transmission-noxunlei -pkgname=(transmission-noxunlei-cli transmission-noxunlei-gtk transmission-noxunlei-qt) -pkgdesc='patched version of transmission that bans Xunlei (a well-known leech-only client)' -pkgver=3.00 -pkgrel=5 +pkgname=(transmission-noxunlei-cli transmission-noxunlei-gtk transmission-noxunlei-qt libtransmission-noxunlei) +pkgver=4.0.4 +pkgrel=1 arch=(x86_64) -url="https://www.transmissionbt.com/" -license=(MIT) -makedepends=(gtk3 intltool curl qt5-base libevent systemd qt5-tools libappindicator-gtk3) -source=(https://github.com/transmission/transmission-releases/raw/master/transmission-${pkgver}.tar.xz - transmission-3.00-openssl-3.patch +url="http://www.transmissionbt.com/" +license=(GPL) +makedepends=( + cmake + curl + dht + glibmm-2.68 + gtk4 + gtkmm-4.0 + intltool + libb64 + libdeflate + libevent + libnatpmp + miniupnpc + ninja + npm + qt6-base + qt6-svg + qt6-tools + systemd +) +source=(https://github.com/transmission/transmission/releases/download/$pkgver/transmission-$pkgver.tar.xz ban-xunlei.patch - ban-3-more-leech-only-clients.patch transmission-noxunlei-cli.sysusers transmission-noxunlei-cli.tmpfiles) -sha256sums=('9144652fe742f7f7dd6657716e378da60b751aaeda8bef8344b3eefc4db255f2' - 'a5e56b906724f007db0bdb9835fbf5088bb56a521ec2971aec0ea44578d5955b' - 'c1b21b0e2d54a0a041c602709f6f0c2dc3626e6aa04c049c1a76b2e3d0dcc89d' - '90d6e7fcdc84fc14546d1060880f656e5f2e9490e094c42339b74a7973be779b' +sha256sums=('15f7b4318fdfbffb19aa8d9a6b0fd89348e6ef1e86baa21a0806ffd1893bd5a6' + 'f895bafecf6d0f19420a01cb0077a2466af08527670df95f4d70d7430e79d71e' '641310fb0590d40e00bea1b5b9c843953ab78edf019109f276be9c6a7bdaf5b2' '1266032bb07e47d6bcdc7dabd74df2557cc466c33bf983a5881316a4cc098451') @@ -28,50 +44,71 @@ prepare() { ln -sf transmission-$pkgver $pkgbase-$pkgver cd $pkgbase-$pkgver - # Fix compatibility with OpenSSL 3.0 (patch from Gentoo) - # https://github.com/transmission/transmission/issues/1777 - patch -Np1 -i ../transmission-3.00-openssl-3.patch - - # loqs's patch, fixes building with autoconf 2.70+ https://bugs.archlinux.org/task/70877 - sed -i 's/\[IT_PROG_INTLTOOL(\[/[\nIT_PROG_INTLTOOL(\[/' configure.ac - - # Ban Xunlei (Thunder) downloader as described in blog.zscself.com/posts/66b00f02/ + # Ban Xunlei (Thunder) downloader as described in blog.zscself.com/posts/66b00f02/ and 3 more leech-only clients + # https://github.com/firedent/transmission-Block-Thunder/commit/f6b87adbd852911f72d977e967e7fee9f5944379 + # TODO: incorporate https://github.com/GrandArth/Risi-Pwsh-Profile/blob/master/Modules/TransmissionAntiXunlei/TransmissionAntiXunlei.psm1 as well patch -Np1 -i "$srcdir/ban-xunlei.patch" - # https://github.com/firedent/transmission/commit/f6b87adbd852911f72d977e967e7fee9f5944379 - patch -Np1 -i "$srcdir/ban-3-more-leech-only-clients.patch" +} - rm -f m4/glib-gettext.m4 - autoreconf -fi +build() { + export CFLAGS+=" -ffat-lto-objects" + cd $pkgbase-$pkgver - sed -i '/^Icon=/ s/$/-qt/' qt/transmission-qt.desktop + cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DENABLE_CLI=ON \ + -DENABLE_DAEMON=ON \ + -DENABLE_GTK=ON \ + -DENABLE_MAC=OFF \ + -DENABLE_QT=ON \ + -DREBUILD_WEB=ON \ + -DENABLE_TESTS=ON \ + -DENABLE_UTILS=ON \ + -DENABLE_UTP=ON \ + -DINSTALL_LIB=ON \ + -DUSE_SYSTEM_B64=ON \ + -DUSE_SYSTEM_DEFLATE=ON \ + -DUSE_SYSTEM_DHT=ON \ + -DUSE_SYSTEM_EVENT2=ON \ + -DUSE_SYSTEM_MINIUPNPC=ON \ + -DUSE_SYSTEM_NATPMP=ON \ + -DUSE_SYSTEM_PSL=ON \ + -DUSE_SYSTEM_UTP=OFF \ + -DWITH_CRYPTO=openssl \ + -S . -B build + + cmake --build build --config Release } -build() { +check() { cd $pkgbase-$pkgver - ./configure --prefix=/usr - make - - cd qt - qmake qtr.pro \ - DEFINES+=TRANSLATIONS_DIR=\\\\\\\"/usr/share/transmission-qt/translations\\\\\\\" - make - lrelease translations/*.ts + + cd build + ctest --output-on-failure -j "$(nproc)" +} + +_install_component() { + (cd $srcdir/$pkgbase-$pkgver/build; DESTDIR="$pkgdir" ninja $1/install) } package_transmission-noxunlei-cli() { pkgdesc='Fast, easy, and free BitTorrent client (CLI tools, daemon and web client), patched to ban Xunlei (a well-known leecher client)' - depends=(curl libevent systemd) + depends=(curl libevent systemd libb64 miniupnpc libnatpmp libdeflate) conflicts=(transmission-cli) provides=(transmission-cli) cd $pkgbase-$pkgver for dir in daemon cli web utils; do - make -C "$dir" DESTDIR="$pkgdir" install + _install_component $dir done + install -d "$pkgdir"/usr/share/transmission + cp -a build/web/public_html/ "$pkgdir"/usr/share/transmission + install -Dm644 daemon/transmission-daemon.service \ "$pkgdir/usr/lib/systemd/system/transmission.service" + install -Dm644 COPYING "$pkgdir/usr/share/licenses/transmission-cli/COPYING" install -Dm644 "$srcdir/$pkgname.sysusers" \ @@ -82,7 +119,7 @@ package_transmission-noxunlei-cli() { package_transmission-noxunlei-gtk() { pkgdesc='Fast, easy, and free BitTorrent client (GTK+ GUI), patched to ban Xunlei (a well-known leecher client)' - depends=(curl libevent gtk3 desktop-file-utils hicolor-icon-theme libappindicator-gtk3) + depends=(curl libevent gtk4 hicolor-icon-theme libb64 miniupnpc libnatpmp libdeflate gtkmm-4.0) optdepends=('libnotify: Desktop notification support' 'transmission-cli: daemon and web support') provides=(transmission-gtk) @@ -90,27 +127,34 @@ package_transmission-noxunlei-gtk() { cd $pkgbase-$pkgver - make -C gtk DESTDIR="$pkgdir" install - make -C po DESTDIR="$pkgdir" install + _install_component gtk + _install_component po + install -Dm644 COPYING "$pkgdir/usr/share/licenses/transmission-gtk/COPYING" } package_transmission-noxunlei-qt() { pkgdesc='Fast, easy, and free BitTorrent client (Qt GUI), patched to ban Xunlei (a well-known leecher client)' - depends=(curl qt5-base libevent) + depends=(curl qt6-base qt6-svg libevent libb64 miniupnpc libnatpmp libdeflate) optdepends=('transmission-cli: daemon and web support') provides=(transmission-qt) conflicts=(transmission-qt) cd $pkgbase-$pkgver - make -C qt INSTALL_ROOT="$pkgdir"/usr install - install -Dm644 -t "$pkgdir/usr/share/transmission-qt/translations" \ - qt/translations/*.qm + _install_component qt install -Dm644 COPYING "$pkgdir/usr/share/licenses/transmission-qt/COPYING" - install -Dm644 qt/icons/transmission.png \ - "$pkgdir/usr/share/pixmaps/transmission-qt.png" - install -Dm644 qt/transmission-qt.desktop \ - "$pkgdir/usr/share/applications/transmission-qt.desktop" +} + +package_libtransmission-noxunlei() { + pkgdesc='Fast, easy, and free BitTorrent client (shared library), patched to ban Xunlei (a well-known leecher client)' + provides=(libtransmission) + conflicts=(libtransmission) + + cd $pkgbase-$pkgver + + install -Dm644 build/libtransmission/libtransmission.a -t "$pkgdir"/usr/lib + install -Dm644 libtransmission/*.h -t "$pkgdir"/usr/include/transmission + install -Dm644 COPYING "$pkgdir/usr/share/licenses/libtransmission/COPYING" } diff --git a/ban-3-more-leech-only-clients.patch b/ban-3-more-leech-only-clients.patch deleted file mode 100644 index d20822e9fc74..000000000000 --- a/ban-3-more-leech-only-clients.patch +++ /dev/null @@ -1,23 +0,0 @@ -From f6b87adbd852911f72d977e967e7fee9f5944379 Mon Sep 17 00:00:00 2001 -From: zscself <zscself@gmail.com> -Date: Sat, 5 Dec 2020 18:20:43 +1100 -Subject: [PATCH] =?UTF-8?q?update:=20=E5=8A=A0=E5=85=A5=E5=8F=A6=E5=A4=96?= - =?UTF-8?q?=E5=87=A0=E6=AC=BE=E5=90=B8=E8=A1=80=E8=BD=AF=E4=BB=B6?= -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -diff -u a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c ---- a/libtransmission/peer-mgr.c -+++ b/libtransmission/peer-mgr.c -@@ -4373,6 +4373,9 @@ - bool banned = false; - banned |= !memcmp(peer_id+1, "SD", 2); - banned |= !memcmp(peer_id+1, "XL", 2); -+ banned |= !memcmp(peer_id+1, "QD", 2); -+ banned |= !memcmp(peer_id+1, "XF", 2); -+ banned |= !memcmp(peer_id+1, "BN", 2); - //if (banned) - // tr_logAddNamedError ("Client banned.", "(Client filter)"); - return banned; - diff --git a/ban-xunlei.patch b/ban-xunlei.patch index 9d1c7b794cb7..b3cee0206571 100644 --- a/ban-xunlei.patch +++ b/ban-xunlei.patch @@ -1,64 +1,84 @@ -From 9f6f662eeb5d6a1a7fe6544387fc30ada17cb7fe Mon Sep 17 00:00:00 2001 -From: Hexhu <i@hexhu.net> -Date: Sun, 14 Jun 2020 07:46:12 -0700 -Subject: [PATCH] apply noxunlei patch - - -diff --git a/libtransmission/handshake.c b/libtransmission/handshake.c -index bab0e2d28..bfad9b124 100644 ---- a/libtransmission/handshake.c -+++ b/libtransmission/handshake.c -@@ -271,6 +271,9 @@ static handshake_parse_err_t parseHandshake(tr_handshake* handshake, struct evbu - handshake->havePeerID = true; - dbgmsg(handshake, "peer-id is [%*.*s]", PEER_ID_LEN, PEER_ID_LEN, peer_id); +diff --git a/libtransmission/handshake.cc b/libtransmission/handshake.cc +index 6be04586c..8cbaf6edf 100644 +--- a/libtransmission/handshake.cc ++++ b/libtransmission/handshake.cc +@@ -20,6 +20,7 @@ + #include "handshake.h" + #include "log.h" + #include "peer-io.h" ++#include "peer-mgr.h" + #include "timer.h" + #include "tr-assert.h" + #include "tr-buffer.h" +@@ -110,6 +111,9 @@ tr_handshake::ParseResult tr_handshake::parse_handshake(tr_peerIo* peer_io) + return ParseResult::PeerIsSelf; + } -+ /* Error if the client is banned. */ -+ if (tr_peerMgrClientIsBanned(peer_id)) return HANDSHAKE_ENCRYPTION_WRONG; ++ /* bans leetch-only clients */ ++ if (tr_peerMgrClientIsBanned(peer_id)) return ParseResult::PeerIsLeetcher; + - tor = tr_torrentFindFromHash(handshake->session, hash); - - if (memcmp(peer_id, tr_torrentGetPeerId(tor), PEER_ID_LEN) == 0) -diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c -index d1239cc16..d2ad0ac57 100644 ---- a/libtransmission/peer-mgr.c -+++ b/libtransmission/peer-mgr.c -@@ -2080,7 +2080,7 @@ static bool myHandshakeDoneCB(tr_handshake* handshake, tr_peerIo* io, bool readA - atom->flags |= ADDED_F_UTP_FLAGS; - } + return ParseResult::Ok; + } -- if ((atom->flags2 & MYFLAG_BANNED) != 0) -+ if (((atom->flags2 & MYFLAG_BANNED) != 0) | tr_peerMgrClientIsBanned(peer_id)) - { - tordbg(s, "banned peer %s tried to reconnect", tr_atomAddrStr(atom)); - } -@@ -4365,3 +4365,15 @@ static void makeNewPeerConnections(struct tr_peerMgr* mgr, int const max) +diff --git a/libtransmission/handshake.h b/libtransmission/handshake.h +index c9b6582c4..2d0769b1e 100644 +--- a/libtransmission/handshake.h ++++ b/libtransmission/handshake.h +@@ -80,6 +80,7 @@ private: + EncryptionWrong, + BadTorrent, + PeerIsSelf, ++ PeerIsLeetcher, + }; - tr_free(candidates); + enum class State +diff --git a/libtransmission/peer-mgr.cc b/libtransmission/peer-mgr.cc +index f17577647..aa8df86a9 100644 +--- a/libtransmission/peer-mgr.cc ++++ b/libtransmission/peer-mgr.cc +@@ -968,6 +968,22 @@ void tr_peerMgrPieceCompleted(tr_torrent* tor, tr_piece_index_t p) + tor->set_needs_completeness_check(); } -+ -+bool -+tr_peerMgrClientIsBanned (const uint8_t * peer_id) + ++bool tr_peerMgrClientIsBanned(const tr_peer_id_t& peer_id_arr) +{ -+ if (peer_id == NULL) return false; -+ bool banned = false; ++ const char* peer_id = peer_id_arr.data(); ++ bool banned = peer_id_arr.empty(); ++ // Names like '-XL0012-','-DL3760-', '-FD51YC-', etc. + banned |= !memcmp(peer_id+1, "SD", 2); + banned |= !memcmp(peer_id+1, "XL", 2); -+ //if (banned) -+ // tr_logAddNamedError ("Client banned.", "(Client filter)"); ++ banned |= !memcmp(peer_id+1, "QD", 2); ++ banned |= !memcmp(peer_id+1, "XF", 2); ++ banned |= !memcmp(peer_id+1, "BN", 2); ++ banned |= !memcmp(peer_id, "Xunlei", 6); ++ banned |= !memcmp(peer_id, "Thunder", 7); ++ banned |= !memcmp(peer_id, "QQDownload", 10); + return banned; +} ++ + namespace + { + namespace handshake_helpers +@@ -1069,6 +1085,10 @@ void create_bit_torrent_peer(tr_torrent* tor, std::shared_ptr<tr_peerIo> io, str + { + tr_logAddTraceSwarm(s, fmt::format("banned peer {} tried to reconnect", atom->display_name())); + } ++ else if (!result.peer_id.has_value() || tr_peerMgrClientIsBanned(result.peer_id.value())) ++ { ++ tr_logAddDebugSwarm(s, fmt::format("banned leetch-only peer {} tried to reconnect", atom->display_name())); ++ } + else if (result.io->is_incoming() && s->peerCount() >= s->tor->peerLimit()) + { + /* too many peers already */ diff --git a/libtransmission/peer-mgr.h b/libtransmission/peer-mgr.h -index 2dd414a97..672d7d4ba 100644 +index 4566e685b..25d106b33 100644 --- a/libtransmission/peer-mgr.h +++ b/libtransmission/peer-mgr.h -@@ -136,4 +136,7 @@ void tr_peerMgrGotBadPiece(tr_torrent* tor, tr_piece_index_t pieceIndex); +@@ -222,4 +222,7 @@ void tr_peerMgrGotBadPiece(tr_torrent* tor, tr_piece_index_t piece_index); void tr_peerMgrPieceCompleted(tr_torrent* tor, tr_piece_index_t pieceIndex); -+/* Check if the client is banned. XunLei is banned because it never uploads.*/ -+bool tr_peerMgrClientIsBanned(const uint8_t* peer_id); ++/* Check if the client is banned. XunLei is banned because it is leetch-only (never uploads). */ ++bool tr_peerMgrClientIsBanned(const tr_peer_id_t& peer_id); + /* @} */ --- -2.27.0 - diff --git a/transmission-3.00-openssl-3.patch b/transmission-3.00-openssl-3.patch deleted file mode 100644 index f288298cbf3d..000000000000 --- a/transmission-3.00-openssl-3.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 6ee128b95bacaff20746538dc97c2b8e2b9fcc29 Mon Sep 17 00:00:00 2001 -From: Mike Gilbert <floppym@gentoo.org> -Date: Sun, 15 May 2022 10:54:38 -0400 -Subject: [PATCH] openssl: load "legacy" provider for RC4 - ---- - libtransmission/crypto-utils-openssl.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/libtransmission/crypto-utils-openssl.c b/libtransmission/crypto-utils-openssl.c -index 45fd71913..14d680654 100644 ---- a/libtransmission/crypto-utils-openssl.c -+++ b/libtransmission/crypto-utils-openssl.c -@@ -20,6 +20,9 @@ - #include <openssl/rand.h> - #include <openssl/ssl.h> - #include <openssl/x509.h> -+#if OPENSSL_VERSION_MAJOR >= 3 -+#include <openssl/provider.h> -+#endif - - #include "transmission.h" - #include "crypto-utils.h" -@@ -184,6 +187,10 @@ static void openssl_evp_cipher_context_free(EVP_CIPHER_CTX* handle) - - tr_rc4_ctx_t tr_rc4_new(void) - { -+#if OPENSSL_VERSION_MAJOR >= 3 -+ OSSL_PROVIDER_load(NULL, "default"); -+ OSSL_PROVIDER_load(NULL, "legacy"); -+#endif - EVP_CIPHER_CTX* handle = EVP_CIPHER_CTX_new(); - - if (check_result(EVP_CipherInit_ex(handle, EVP_rc4(), NULL, NULL, NULL, -1))) --- -2.35.1 - |