From 1e1b0255e1a21229b2adfdf973401bdaee2596a7 Mon Sep 17 00:00:00 2001 From: TheK0tYaRa Date: Fri, 12 Sep 2025 22:06:42 +0300 Subject: [PATCH] net-p2p/qbittorrent-5.1.2 --- net-p2p/qbittorrent/Manifest | 2 + net-p2p/qbittorrent/files/qbittorrent.confd | 20 +++ net-p2p/qbittorrent/files/qbittorrent.initd | 27 ++++ net-p2p/qbittorrent/metadata.xml | 24 ++++ net-p2p/qbittorrent/qbittorrent-5.1.2.ebuild | 126 +++++++++++++++++++ 5 files changed, 199 insertions(+) create mode 100644 net-p2p/qbittorrent/Manifest create mode 100644 net-p2p/qbittorrent/files/qbittorrent.confd create mode 100644 net-p2p/qbittorrent/files/qbittorrent.initd create mode 100644 net-p2p/qbittorrent/metadata.xml create mode 100644 net-p2p/qbittorrent/qbittorrent-5.1.2.ebuild diff --git a/net-p2p/qbittorrent/Manifest b/net-p2p/qbittorrent/Manifest new file mode 100644 index 0000000..9ab463d --- /dev/null +++ b/net-p2p/qbittorrent/Manifest @@ -0,0 +1,2 @@ +DIST qbittorrent-5.1.2.tar.xz 4631900 BLAKE2B 5cf21619c29878f1cecc08d66df27289c8f8541fe03bc4593384394921ad13891fc89f5846a9828b927ea08b51c0123d17d02952fee0b5ddac6dd259a9b0030b SHA512 8817c0136892373257b4c89983121af1d2c33ab93b248678949775c3b0e5e6b299cefd1ad3c7ab9b88c56a618ee3837a984872f781bb4ace9769c92a42908cab +DIST qbittorrent-5.1.2.tar.xz.asc 849 BLAKE2B 2d023dd2dc922da973f26094349c2262e8f29227b615debc4a8f04c511bb513bfa56c0ac78e8e351e5b6c5f1a003c29d3a1860cd31e7d3dcbb006367b41e7d3e SHA512 69be899ed521da551ebcf0961c494ae828d2143fea9bc253f17ed81df61c4989124a8b231226c83c433314059e292ee3bf58422d861166eaa4272597bb8643c6 diff --git a/net-p2p/qbittorrent/files/qbittorrent.confd b/net-p2p/qbittorrent/files/qbittorrent.confd new file mode 100644 index 0000000..21e2e42 --- /dev/null +++ b/net-p2p/qbittorrent/files/qbittorrent.confd @@ -0,0 +1,20 @@ +# /etc/conf.d/qbittorrent: config file for /etc/init.d/qbittorrent + +# User and group as which to run +#QBITTORRENT_USER="qbittorrent" +#QBITTORRENT_GROUP="qbittorrent" + +# Directory where qBittorrent saves its logs (and maybe downloads) +#QBITTORRENT_DIRECTORY="/var/lib/qbittorrent" + +# umask used to create files +#QBITTORRENT_UMASK=0022 + +# I/O nice level of qBittorrent +#QBITTORRENT_IONICE=0 + +# Nice level of qBittorrent +#QBITTORRENT_NICE=0 + +# Extra opts given to qBittorrent +#QBITTORRENT_OPTS="" diff --git a/net-p2p/qbittorrent/files/qbittorrent.initd b/net-p2p/qbittorrent/files/qbittorrent.initd new file mode 100644 index 0000000..a04de6a --- /dev/null +++ b/net-p2p/qbittorrent/files/qbittorrent.initd @@ -0,0 +1,27 @@ +#!/sbin/openrc-run +# Copyright 2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +QBITTORRENT_USER=${QBITTORRENT_USER:-qbittorrent} +QBITTORRENT_GROUP=${QBITTORRENT_GROUP:-qbittorrent} +QBITTORRENT_DIRECTORY=${QBITTORRENT_DIRECTORY:-/var/lib/qbittorrent} +QBITTORRENT_UMASK=${QBITTORRENT_UMASK:-0022} +QBITTORRENT_IONICE=${QBITTORRENT_IONICE:-0} +QBITTORRENT_NICE=${QBITTORRENT_NICE:-0} + +description="BitTorrent client in C++ and Qt" +command="/usr/bin/qbittorrent-nox" +command_args="${QBITTORRENT_OPTS}" +pidfile="/run/${RC_SVCNAME}.pid" +command_background="yes" +command_user="${QBITTORRENT_USER}:${QBITTORRENT_GROUP}" +umask="${QBITTORRENT_UMASK}" +start_stop_daemon_args="--ionice ${QBITTORRENT_IONICE} --nicelevel ${QBITTORRENT_NICE}" + +depend() { + need localmount net +} + +start_pre() { + checkpath -q -d -o ${QBITTORRENT_USER}:${QBITTORRENT_GROUP} ${QBITTORRENT_DIRECTORY} +} diff --git a/net-p2p/qbittorrent/metadata.xml b/net-p2p/qbittorrent/metadata.xml new file mode 100644 index 0000000..c404f9e --- /dev/null +++ b/net-p2p/qbittorrent/metadata.xml @@ -0,0 +1,24 @@ + + + + + eschwartz@gentoo.org + Eli Schwartz + + + fkobi@pm.me + Filip Kobierski + + + Enable support for notifications and power-management features via D-Bus + Install qBittorrent Web UI (qbittorrent-nox) + + + https://github.com/qbittorrent/qBittorrent/issues + https://www.qbittorrent.org/news + https://github.com/qbittorrent/qBittorrent/wiki + qbittorrent/qBittorrent + + + diff --git a/net-p2p/qbittorrent/qbittorrent-5.1.2.ebuild b/net-p2p/qbittorrent/qbittorrent-5.1.2.ebuild new file mode 100644 index 0000000..80f8bcc --- /dev/null +++ b/net-p2p/qbittorrent/qbittorrent-5.1.2.ebuild @@ -0,0 +1,126 @@ +# Copyright 2023-2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit cmake edo multibuild optfeature systemd verify-sig xdg + +DESCRIPTION="BitTorrent client in C++ and Qt" +HOMEPAGE="https://www.qbittorrent.org" + +if [[ ${PV} == *9999 ]]; then + EGIT_REPO_URI="https://github.com/qbittorrent/qBittorrent.git" + inherit git-r3 +else + SRC_URI=" + https://downloads.sourceforge.net/qbittorrent/${P}.tar.xz + verify-sig? ( https://downloads.sourceforge.net/qbittorrent/${P}.tar.xz.asc ) + " + KEYWORDS="amd64 ~arm ~arm64 ~ppc64 ~riscv x86" + + BDEPEND="verify-sig? ( sec-keys/openpgp-keys-qbittorrent )" + VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/qBittorrent.asc +fi + +LICENSE="GPL-2+-with-openssl-exception GPL-3+-with-openssl-exception" +SLOT="0" +IUSE="+dbus +gui test webui" +RESTRICT="!test? ( test )" +REQUIRED_USE=" + || ( gui webui ) + dbus? ( gui ) +" + +RDEPEND=" + >=dev-libs/openssl-3.0.2:= + >=dev-qt/qtbase-6.5:6[network,ssl,sql,sqlite,xml] + >=net-libs/libtorrent-rasterbar-2.0.10:= + >=sys-libs/zlib-1.2.11 + gui? ( + >=dev-qt/qtbase-6.5:6[dbus?,gui,widgets] + >=dev-qt/qtsvg-6.5:6 + ) + webui? ( + acct-group/qbittorrent + acct-user/qbittorrent + ) +" +DEPEND=" + ${RDEPEND} + >=dev-libs/boost-1.76 +" +BDEPEND+=" + >=dev-qt/qttools-6.5:6[linguist] + virtual/pkgconfig +" + +DOCS=( AUTHORS Changelog {CONTRIBUTING,README}.md ) + +src_configure() { + MULTIBUILD_VARIANTS=( + $(usev gui) + $(usev webui nogui) + ) + + my_src_configure() { + local mycmakeargs=( + -DVERBOSE_CONFIGURE=ON # for bug reports + -DSTACKTRACE=$(usex !elibc_musl) # musl lacks execinfo.h + -DTESTING=$(usex test) + -DWEBUI=$(usex webui) + ) + + # upstream supports building just gui or nogui + # so we build the project twice (see #839531 for details) + # Fedora does the same: https://src.fedoraproject.org/rpms/qbittorrent + if [[ ${MULTIBUILD_VARIANT} == "gui" ]]; then + mycmakeargs+=( + -DGUI=ON + -DDBUS=$(usex dbus) + -DSYSTEMD=OFF + ) + else + mycmakeargs+=( + -DGUI=OFF + -DDBUS=OFF + # The systemd service calls qbittorrent-nox, built only when GUI=OFF. + -DSYSTEMD=ON + -DSYSTEMD_SERVICES_INSTALL_DIR="$(systemd_get_systemunitdir)" + ) + fi + + cmake_src_configure + } + + multibuild_foreach_variant my_src_configure +} + +src_compile() { + multibuild_foreach_variant cmake_src_compile +} + +src_test() { + my_src_test() { + # cmake does not detect tests by default, if you use enable_testing + # in a subdirectory instead of the root CMakeLists.txt + cd "${BUILD_DIR}"/test || die + edo ctest . + } + + multibuild_foreach_variant my_src_test +} + +src_install() { + multibuild_foreach_variant cmake_src_install + + if use webui; then + newconfd "${FILESDIR}/${PN}.confd" "${PN}" + newinitd "${FILESDIR}/${PN}.initd" "${PN}" + fi +} + +pkg_postinst() { + xdg_pkg_postinst + + optfeature "I2P anonymyzing network support" net-vpn/i2pd net-vpn/i2p +}