2021-01-01 19:00:21 +01:00
|
|
|
# Copyright 1999-2021 Gentoo Authors
|
2020-09-20 23:47:50 +02:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
EAPI=7
|
|
|
|
|
2021-01-01 19:00:21 +01:00
|
|
|
BASE_URI="https://repo.jellyfin.org/releases/server/debian/versions/stable"
|
|
|
|
MY_PN="${PN/-bin}"
|
|
|
|
|
|
|
|
if [[ "${PV}" == *_rc* ]]; then
|
|
|
|
# _rc -> ~rc
|
|
|
|
MY_PV="${PV/_rc/~rc}"
|
2021-01-03 13:09:06 +01:00
|
|
|
SRV_SRC="${MY_PN}-server_${MY_PV}"
|
|
|
|
WEB_SRC="${MY_PN}-web_${MY_PV}"
|
2021-01-01 19:00:21 +01:00
|
|
|
else
|
|
|
|
# Add "-1"
|
|
|
|
MY_PV="${PV}"
|
2021-01-03 13:09:06 +01:00
|
|
|
SRV_SRC="${MY_PN}-server_${MY_PV}-1"
|
|
|
|
WEB_SRC="${MY_PN}-web_${MY_PV}-1"
|
2021-01-01 19:00:21 +01:00
|
|
|
fi
|
2020-09-20 23:47:50 +02:00
|
|
|
|
2020-10-25 08:38:55 +01:00
|
|
|
inherit unpacker systemd wrapper
|
2020-09-20 23:47:50 +02:00
|
|
|
|
|
|
|
DESCRIPTION="The Free Software Media System"
|
|
|
|
HOMEPAGE="https://jellyfin.org"
|
|
|
|
SRC_URI="
|
2021-01-03 13:09:06 +01:00
|
|
|
amd64? (
|
|
|
|
${BASE_URI}/server/${MY_PV}/${SRV_SRC}_amd64.deb -> ${P}-server-amd64.deb
|
|
|
|
)
|
|
|
|
arm64? (
|
|
|
|
${BASE_URI}/server/${MY_PV}/${SRV_SRC}_arm64.deb -> ${P}-server-arm64.deb
|
|
|
|
)
|
|
|
|
${BASE_URI}/web/${MY_PV}/${WEB_SRC}_all.deb -> ${P}-web.deb
|
2020-09-20 23:47:50 +02:00
|
|
|
"
|
|
|
|
|
|
|
|
RESTRICT="mirror"
|
|
|
|
LICENSE="GPL-2"
|
|
|
|
SLOT="0"
|
|
|
|
KEYWORDS="-* ~amd64 ~arm64"
|
|
|
|
|
2020-09-21 03:59:56 +02:00
|
|
|
DEPEND="
|
|
|
|
!www-servers/jellyfin
|
|
|
|
"
|
2020-09-20 23:47:50 +02:00
|
|
|
RDEPEND="
|
2020-09-21 03:59:56 +02:00
|
|
|
${DEPEND}
|
2020-09-20 23:47:50 +02:00
|
|
|
>=media-video/ffmpeg-4.2.2
|
2020-09-24 15:02:53 +02:00
|
|
|
acct-group/jellyfin
|
|
|
|
acct-user/jellyfin
|
2020-09-20 23:47:50 +02:00
|
|
|
dev-db/sqlite
|
2020-09-21 19:05:31 +02:00
|
|
|
dev-util/lttng-ust
|
2020-09-20 23:47:50 +02:00
|
|
|
media-libs/fontconfig
|
|
|
|
media-libs/freetype
|
|
|
|
"
|
|
|
|
|
2021-01-01 19:00:21 +01:00
|
|
|
QA_PREBUILT="usr/lib/${MY_PN}/bin/*"
|
|
|
|
QA_PRESTRIPPED="${QA_PRESTRIPPED}"
|
2020-09-20 23:47:50 +02:00
|
|
|
|
|
|
|
S="${WORKDIR}"
|
|
|
|
|
2020-09-22 19:17:30 +02:00
|
|
|
PATCHES=(
|
|
|
|
"${FILESDIR}/${MY_PN}-default.patch"
|
|
|
|
)
|
|
|
|
|
2020-09-20 23:47:50 +02:00
|
|
|
src_unpack() {
|
2021-01-03 12:48:05 +01:00
|
|
|
# https://gitlab.com/src_prepare/src_prepare-overlay/-/merge_requests/145
|
|
|
|
if use amd64
|
|
|
|
then
|
|
|
|
unpack_deb "${P}-server-amd64.deb"
|
|
|
|
elif use arm64
|
|
|
|
then
|
|
|
|
unpack_deb "${P}-server-arm64.deb"
|
|
|
|
else
|
|
|
|
die "Unsupported architecture"
|
|
|
|
fi
|
2020-09-20 23:47:50 +02:00
|
|
|
unpack_deb "${P}-web.deb"
|
|
|
|
}
|
|
|
|
|
|
|
|
src_install() {
|
|
|
|
# Install the Server part
|
|
|
|
insinto usr/lib/
|
2020-09-21 03:59:56 +02:00
|
|
|
doins -r "usr/lib/${MY_PN}"
|
2020-09-20 23:47:50 +02:00
|
|
|
insinto etc
|
2020-09-21 03:59:56 +02:00
|
|
|
doins -r "etc/${MY_PN}"
|
2020-09-20 23:47:50 +02:00
|
|
|
|
|
|
|
# Install the Web UI part
|
2020-09-21 06:50:17 +02:00
|
|
|
insinto "usr/share/${MY_PN}/web"
|
2020-09-21 03:59:56 +02:00
|
|
|
doins -r "usr/share/${MY_PN}/web"/*
|
2020-09-20 23:47:50 +02:00
|
|
|
|
2020-09-21 03:59:56 +02:00
|
|
|
# Install wrappers
|
2020-09-20 23:47:50 +02:00
|
|
|
make_wrapper "${MY_PN}" "${EPREFIX}/usr/lib/${MY_PN}/bin/${MY_PN}"
|
2020-09-21 03:59:56 +02:00
|
|
|
dosym "${EPREFIX}/usr/bin/${MY_PN}" "${EPREFIX}/usr/bin/${PN}"
|
|
|
|
|
|
|
|
# Install services
|
|
|
|
newinitd "${FILESDIR}/${MY_PN}" "${MY_PN}"
|
|
|
|
doconfd "etc/default/${MY_PN}"
|
|
|
|
dosym "${EPREFIX}/etc/conf.d/${MY_PN}" "${EPREFIX}/etc/default/${MY_PN}"
|
|
|
|
systemd_dounit "lib/systemd/system/${MY_PN}.service"
|
|
|
|
systemd_install_serviced "etc/systemd/system/${MY_PN}.service.d/${MY_PN}.service.conf"
|
2020-09-20 23:47:50 +02:00
|
|
|
|
|
|
|
# Fix permissions
|
2020-09-21 03:59:56 +02:00
|
|
|
chmod +x "${ED}/usr/lib/${MY_PN}"/* || die
|
|
|
|
chmod +x "${ED}/usr/lib/${MY_PN}/bin"/* || die
|
|
|
|
chown -R jellyfin:jellyfin "${ED}/usr/lib/${MY_PN}" || die
|
2020-09-20 23:47:50 +02:00
|
|
|
}
|