summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 41f703d166097bf7ada5397c474cde6fb47a4e01 (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
# Maintainer: willemw <willemw12@gmail.com>

# To install a specific SickChill release:
# - comment out pkgver()
# - set the release number in variable pkgver: pkgver=<release>
# - set the release number at the end of the "pip install" line: change sickchill to sickchill==<release>

# This "PIP install" package is similar to a VCS package:
# it has a pkgver() function and a reinstall updates the package.
# That is the only reason why this package ends on "-git".

pkgname=sickchill-git
pkgver=2024.2.18.r0
pkgrel=1
pkgdesc='Automatic video library manager for TV shows'
arch=(any)
url=https://sickchill.github.io
license=(GPL3)
makedepends=(jq python-virtualenv)
optdepends=('libmediainfo: determine the resolution of MKV and AVI files with no resolution in the filename'
            'unrar: for RAR files')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
options=('!strip')
install=$pkgname.install
source=(sickchill.service
        sickchill.sysusers
        sickchill.tmpfiles)
sha256sums=('b417284472d804e634c0dcaac2876ca164ad9a485f947e0f05798d0ce1136d59'
            'aaeb298c9717da8b28853ed15509fb8428d975ae49e8737ebcec15caab9f0978'
            '2069f15e18fc7dd0f0f25b623f2067fc9028b1ca4122021a62364aa39914f88f')

pkgver() {
  local version
  version="$(curl -s "https://pypi.org/pypi/${pkgname%-git}/json" | jq --raw-output --join-output '.info.version')"
  printf "%s.r0" "$version" | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  #python -m venv build
  export XDG_CACHE_HOME=cache/pip
  VIRTUALENV_OVERRIDE_APP_DATA=cache/virtualenv virtualenv build
  PIP_CONFIG_FILE=/dev/null build/bin/pip install \
      --ignore-installed --isolated --cache-dir=cache --prefix=. --root=build \
      --default-timeout=60 --disable-pip-version-check --no-warn-script-location --progress-bar=off \
      sickchill

  sed -i '1s|.*|#!/opt/sickchill/app/bin/python|' build/bin/SickChill
}

package() {
  install -Dm644 sickchill.service -t "$pkgdir/usr/lib/systemd/system"
  install -Dm644 sickchill.sysusers   "$pkgdir/usr/lib/sysusers.d/sickchill.conf"
  install -Dm644 sickchill.tmpfiles   "$pkgdir/usr/lib/tmpfiles.d/sickchill.conf"

  install -dm755 "$pkgdir/opt/sickchill"
  cp -a build    "$pkgdir/opt/sickchill/app"
}