summaryrefslogtreecommitdiff
path: root/media-tv/jellyfin/jellyfin-10.6.4.ebuild
blob: db5d36bccf57e6c1932c4b2e359a9d94ca18fa55 (plain) (blame)
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
72
73
74
75
76
77
78
79
80
# Copyright 2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit systemd

DESCRIPTION="The Free Software Media System"
HOMEPAGE="https://github.com/jellyfin/jellyfin"

SRC_URI="https://github.com/${PN}/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz
		https://github.com/${PN}/${PN}-web/archive/v${PV}.tar.gz -> ${PN}-web-${PV}.tar.gz"

LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64"

DEPEND="!media-tv/jellyfin-bin"
RDEPEND="${DEPEND}
		acct-group/jellyfin
		acct-user/jellyfin
		media-video/ffmpeg[fontconfig,gmp,libass,libdrm,truetype,fribidi,vorbis,vdpau,vaapi,x264,x265,webp,bluray,zvbi,mp3,opus,theora]
		sys-process/at
		dev-db/sqlite:3
		media-libs/fontconfig
		media-libs/freetype
		dev-util/lttng-ust
		app-crypt/mit-krb5
		dev-libs/icu
		dev-libs/openssl"
BDEPEND="dev-dotnet/dotnetcore-sdk-bin:3.1
		sys-apps/yarn"

METAFILETOBUILD="MediaBrowser.sln"


src_compile() {
	cd ${WORKDIR}/${PN}-web-${PV}
	yarn install || die
	cp -r dist/. ${S}/MediaBrowser.WebDashboard/jellyfin-web
	cd ${S}
	export DOTNET_CLI_TELEMETRY_OPTOUT=1
	dotnet build --configuration Release Jellyfin.Server || die
	dotnet publish --configuration Release Jellyfin.Server --output ${S}/bin --self-contained --runtime linux-x64 || die
}

src_install() {

	insinto /etc/${PN}
	doins ${FILESDIR}/logging.json
	fowners -R "${PN}:${PN}" "/etc/${PN}"

	cp "${FILESDIR}/${PN}.conf.d" "${T}/${PN}.conf.d" || die
	cp "${FILESDIR}/${PN}.service.conf" "${T}/${PN}.service.conf" || die

	sed -i "s|/usr/lib/|/usr/$(get_libdir)/|g" \
		"${T}/${PN}.conf.d" \
		"${T}/${PN}.service.conf" || die

	newconfd "${T}/${PN}.conf.d" "${PN}"
	newinitd "${FILESDIR}/${PN}.init.d" "${PN}"

	systemd_install_serviced ${T}/${PN}.service.conf
	systemd_dounit ${FILESDIR}/${PN}.service

	keepdir "/var/lib/${PN}"
	fowners -R "${PN}:${PN}" "/var/lib/${PN}"

	keepdir "/var/log/${PN}"
	fowners -R "${PN}:${PN}" "/var/log/${PN}"

	keepdir "/var/cache/${PN}"
	fowners -R "${PN}:${PN}" "/var/cache/${PN}"

	insinto /usr/$(get_libdir)/${PN}/
	doins -r ${S}/bin
	fperms 0755 /usr/$(get_libdir)/${PN}/bin/${PN}

	dosym /usr/$(get_libdir)/${PN}/bin/${PN} /usr/bin/${PN}
}