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

# To install a specific release manually: comment out pkgver(), set the release in "pkgver=" and
# 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 will update the package.
# That is the only reason why this package ends on -git.

pkgname=sickchill-git
pkgver=2022.7.20.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=('a7bb9f2406721f9d5eb66dab954bfc54f6bfe74fa6efd646e1006903e3e42bc8'
            '1467f3613f5f25e678e373465dc09a28230f7cdf07af23875a0896a509c3b850'
            '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"
}