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

# This package installs the latest SickChill release

# To install another SickChill release:
# - Comment out pkgver()
# - Set the release in variable pkgver: pkgver=<release>
# - Set the same release number at the end of the "pip install" line,
#   by changing "sickchill" to "sickchill==$pkgver"
#
# To install the latest commit:
# - Comment out pkgver()
# - Set some descriptive label in variable pkgver: pkgver=latest
# - Change "sickchill" to "git+https://github.com/SickChill/sickchill.git"
#   to install the latest from the default branch
# - Or change "sickchill" to "git+https://github.com/SickChill/sickchill.git@develop"
#   to install the latest from the 'develop' branch
# )

# 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.3.1.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 \
      setuptools 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"
}