void-packages/srcpkgs/plex-media-server/template

59 lines
1.9 KiB
Bash

# Template file for 'plex-media-server'
pkgname=plex-media-server
version=1.15.3.876
revision=4
_suffix=ad6e39743
archs="i686 x86_64 armv7 aarch64"
create_wrksrc=yes
hostmakedepends="tar xz"
short_desc="Plex Media Server"
maintainer="Anachron <gith@cron.world>"
license="custom:Proprietary"
homepage="https://www.plex.tv/media-server-downloads"
restricted=yes
repository=nonfree
system_accounts="_plex"
python_version=2
# See https://support.plex.tv/articles/categories/plex-media-server/
case "$XBPS_TARGET_MACHINE" in
i686*)
distfiles="https://downloads.plex.tv/${pkgname}-new/${version}-${_suffix}/debian/plexmediaserver_${version}-${_suffix}_i386.deb"
checksum="47dd162e48749d68c37093b4d1796a91fdbdfb5b8e68980ce126380d4894da66"
;;
x86_64*)
distfiles="https://downloads.plex.tv/${pkgname}-new/${version}-${_suffix}/debian/plexmediaserver_${version}-${_suffix}_amd64.deb"
checksum="a432d6a46fdc0117e9f3529e032ab1fc7ad25f705b9be5dad850108d89a5ca79"
;;
armv7*)
distfiles="https://downloads.plex.tv/${pkgname}-new/${version}-${_suffix}/debian/plexmediaserver_${version}-${_suffix}_armhf.deb"
checksum="0ec9ad17fe3e3df2e278477eb6139f15261dfc8faac3830b3723c07502772b75"
;;
aarch64*)
distfiles="https://downloads.plex.tv/${pkgname}-new/${version}-${_suffix}/debian/plexmediaserver_${version}-${_suffix}_arm64.deb"
checksum="3c343bb7f6f335637a1fec15d790e53a9a8e73ec66918ae11f41b4d11073d110"
;;
esac
nopie="yes"
nopie_files="/usr/lib/plexmediaserver/Plex DLNA Server"
make_dirs="/var/plexmediaserver 0755 _plex _plex"
do_extract() {
fn="${distfiles##*/}"
ar x "${XBPS_SRCDISTDIR}/${pkgname}-${version}/${fn}"
tar xf data.tar.xz
mv usr/{s,}bin
cp "${FILESDIR}/default" etc/default/plexmediaserver
cp "${FILESDIR}/start_pms" usr/bin/start_pms
rm -r etc/{apt,init}
}
do_install() {
vcopy etc /
vcopy usr /
vsv plex-media-server
vlicense "${FILESDIR}/LICENSE"
}