summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9caf3f675d2a07edd777a122cbdcc54f217dd104 (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
# Maintainer: Bao Trinh <qubidt@gmail.com>

pkgname=qbittorrent-cli
pkgver=1.7.23016.1
pkgrel=3
pkgdesc='Command line interface for qBittorrent'
arch=('i686' 'x86_64' 'arm' 'aarch64')
url="https://github.com/fedarovich/qbittorrent-cli"
license=('MIT')
depends=('dotnet-runtime-6.0')
makedepends=('dotnet-sdk-6.0')
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('ff5c53b50383c0eb478d485981556ed350645f8e8bf380630b1b0c7d3794cf32')
options=('!strip')

prepare() {
  cd "${pkgname}-${pkgver}/src/QBittorrent.CommandLineInterface"

  export DOTNET_CLI_TELEMETRY_OPTOUT=1
  export DOTNET_NOLOGO=1

  dotnet restore --use-current-runtime
}

build() {
  cd "${pkgname}-${pkgver}/src/QBittorrent.CommandLineInterface"
  dotnet build --no-restore -c Release -f net6 --no-self-contained --use-current-runtime "/p:Version=${pkgver}"
}

package() {
  cd "${pkgname}-${pkgver}/src/QBittorrent.CommandLineInterface"

  install -d "${pkgdir}/usr/lib/${pkgname}"
  dotnet publish --no-build --no-restore -c Release -f net6 --no-self-contained --use-current-runtime --output "${pkgdir}/usr/lib/${pkgname}"

  install -d "${pkgdir}/usr/bin"
  ln -st "${pkgdir}/usr/bin" "/usr/lib/${pkgname}/qbt"
}