aboutsummaryrefslogtreecommitdiffstats
path: root/community/qbittorrent/APKBUILD
blob: ef74a4983a5f20f587de8c08a57872194294eb4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Contributor: Jan Tatje <jan@jnt.io>
# Contributor: Simon Zeni <simon@bl4ckb0ne.ca>
# Maintainer: psykose <alice@ayaya.dev>
pkgname=qbittorrent
pkgver=4.4.2
pkgrel=5
pkgdesc="qBittorrent client"
url="https://www.qbittorrent.org/"
arch="all !s390x" # qt6-qttools
license="GPL-2.0-or-later"
options="!check" # qBittorrent has no tests
makedepends="
	boost-dev
	cmake
	libtorrent-rasterbar-dev
	ninja
	qt6-qtbase-dev
	qt6-qtsvg-dev
	qt6-qttools-dev
	"
subpackages="
	$pkgname-doc
	$pkgname-nox
	$pkgname-nox-openrc:nox_openrc
	$pkgname-nox-doc:nox_doc
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/qbittorrent/qBittorrent/archive/refs/tags/release-$pkgver.tar.gz
	qbittorrent-nox.initd
	qbittorrent-nox.confd
	"
builddir="$srcdir/qBittorrent-release-$pkgver"

# secfixes:
#   4.1.6-r3:
#     - CVE-2019-13640

build() {
	cmake -B build-gui -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
		-DWEBUI=OFF \
		-DSTACKTRACE=OFF \
		-DQT6=ON
	cmake --build build-gui

	cmake -B build-nox -G Ninja \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
		-DGUI=OFF \
		-DSTACKTRACE=OFF \
		-DQT6=ON
	cmake --build build-nox
}

package() {
	depends="qt6-qtsvg" # needed for ui icons
	DESTDIR="$pkgdir" cmake --install build-gui
}

nox() {
	install="$pkgname-nox.pre-install"
	pkgdesc="$pkgdesc (webui)"

	install -Dm755 "$builddir"/build-nox/qbittorrent-nox \
		"$subpkgdir"/usr/bin/qbittorrent-nox
}

nox_doc() {
	install -Dm644 "$builddir"/doc/qbittorrent-nox.1 \
		"$subpkgdir"/usr/share/man/man1/qbittorrent-nox.1
	default_doc
}

nox_openrc() {
	depends="openrc"
	pkgdesc="$pkgdesc (webui) (OpenRC init scripts)"
	install_if="openrc ${subpkgname%-openrc}=$pkgver-r$pkgrel"

	install -Dm755 "$srcdir"/$pkgname-nox.initd \
		"$subpkgdir"/etc/init.d/$pkgname-nox
	install -Dm644 "$srcdir"/$pkgname-nox.confd \
		"$subpkgdir"/etc/conf.d/$pkgname-nox
}

sha512sums="
55656fb5fd282a3ed0e703b9b47ec9733a70cf6242cae956a5b2487ef2aeb88a04bf5d37c8fa88554edf95ab0821b76ebebb53e8fc43dc5889f8c730075d6e26  qbittorrent-4.4.2.tar.gz
e84943b4e53717d4c53dc0a454aae2c43390b90afbd7e9d48c50cb914ac9041152a197677343ec81c6881bceb55228a2519bca9fffc158a713305214d0570711  qbittorrent-nox.initd
5cc840181f8b9febdc99b28dca9fe3f6b27a36bad0b20266e46d6ff148dfc9c5d9e6cba552198cd3d1b8ac5c21e2881d7defd8f13fcc8a862b93f4c80c1d4b19  qbittorrent-nox.confd
"