summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 150cda015405159611e4f8bc4f91d4ec53f3ff14 (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
# Maintainer: Luca Weiss <luca (at) z3ntu (dot) xyz>
# Contributor: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Daniel Seymour <dannyseeless@gmail.com>

pkgname=jellyfin-git
pkgver=10.0.2.r266.g9714b62fdd
pkgrel=1
pkgdesc='The Free Software Media Browser'
arch=('i686' 'x86_64' 'armv6h')
url='https://github.com/jellyfin/jellyfin'
license=('GPL2')
depends=('ffmpeg' 'imagemagick' 'dotnet-sdk' 'sqlite')
makedepends=('git')
provides=('jellyfin')
conflicts=('jellyfin')
source=('git+https://github.com/jellyfin/jellyfin.git#branch=dev'
        'git+https://github.com/jellyfin/jellyfin-web.git'
        'git+https://github.com/mono/taglib-sharp.git'
        'jellyfin.conf'
        'jellyfin.service'
        'jellyfin.sysusers'
        'jellyfin.tmpfiles')
backup=('etc/conf.d/jellyfin')
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'ff3c81ddfd716f179fec8149ea6c2db379e05cd20bd0ffa8ce3ff3a609ca9749'
            '61febaa0bbe71235d724f236223c7315da393b8b481e4bbed86489a343bca51f'
            '9bc1ddb77c73d46cc4078356b5773e5a776ebf8b47a1c820ad5fb17591ad5228'
            'aa87d52386dde4a2ea4663de2f08249415b2babfefd98d348a96df35dfc36bc0')

pkgver() {
  cd jellyfin
  # cutting off 'v' prefix that presents in the git tag
  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd jellyfin
  git submodule init
  git config submodule.ThirdParty/taglib-sharp.url $srcdir/taglib-sharp
  git config submodule.MediaBrowser.WebDashboard/jellyfin-web.url $srcdir/jellyfin-web
  git submodule update
}

build(){
  cd jellyfin

  dotnet build --configuration Release Jellyfin.Server
  # Ideally, this would be run in package() with the --output variable pointing
  # to "$pkgdir"/usr/lib/jellyfin, but this step fails in fakeroot.
  # The makepkg output looks like
  #   Restore completed in 56.84 ms for /aur/jellyfin-git/src/jellyfin/Jellyfin.Server/Jellyfin.Server.csproj.
  #   ==> ERROR: A failure occurred in package().
  # without indicating any sort of failure.
  dotnet publish --configuration Release Jellyfin.Server --output "$PWD"/publish
  # Clean up the runtimes folder (keep linux-*)
  rm -rfv publish/runtimes/{alpine-*,osx*,tizen-*,win*}
}

package() {
  mkdir -p "$pkgdir"/usr/lib
  cp -dr --no-preserve='ownership' jellyfin/publish "$pkgdir"/usr/lib/jellyfin

  install -Dm 644 jellyfin.service -t "${pkgdir}"/usr/lib/systemd/system/
  install -Dm 644 jellyfin.sysusers "${pkgdir}"/usr/lib/sysusers.d/jellyfin.conf
  install -Dm 644 jellyfin.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/jellyfin.conf
  install -Dm 644 jellyfin.conf "${pkgdir}"/etc/conf.d/jellyfin
}

# vim: ts=2 sw=2 et: