mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-05 06:33:50 +02:00
plex-media-server: Add service, add _plex system user, ship better start_pms script, add default config
This commit is contained in:
parent
1bbedfe121
commit
f070a1f291
4 changed files with 55 additions and 3 deletions
15
srcpkgs/plex-media-server/files/default
Normal file
15
srcpkgs/plex-media-server/files/default
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# config for Plex Media Server
|
||||||
|
|
||||||
|
# ulimit -s $PLEX_MEDIA_SERVER_MAX_STACK_SIZE
|
||||||
|
export PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000
|
||||||
|
#export PLEX_MEDIA_SERVER_MAX_VIRTUAL_MEMORY=524288000
|
||||||
|
|
||||||
|
# the user that PMS should run as, defaults to 'plex'
|
||||||
|
# note that if you change this you might need to move
|
||||||
|
# the Application Support directory to not lose your
|
||||||
|
# media library (match what is in /etc/passwd)
|
||||||
|
#export PLEX_MEDIA_SERVER_USER="_plex"
|
||||||
|
|
||||||
|
# Uncomment this to use syslog for logging instead of
|
||||||
|
# sending logs to Plex Media Server.log
|
||||||
|
#export PLEX_MEDIA_SERVER_USE_SYSLOG=true
|
5
srcpkgs/plex-media-server/files/plex-media-server/run
Executable file
5
srcpkgs/plex-media-server/files/plex-media-server/run
Executable file
|
@ -0,0 +1,5 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
[ -r ./conf ] && ./conf
|
||||||
|
|
||||||
|
chpst -u _plex:_plex start_pms
|
28
srcpkgs/plex-media-server/files/start_pms
Executable file
28
srcpkgs/plex-media-server/files/start_pms
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Set identification variables
|
||||||
|
. /etc/os-release
|
||||||
|
export PLEX_MEDIA_SERVER_INFO_VENDOR="${NAME}"
|
||||||
|
export PLEX_MEDIA_SERVER_INFO_DEVICE="PC"
|
||||||
|
export PLEX_MEDIA_SERVER_INFO_MODEL="$(uname -m)"
|
||||||
|
export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION=$(date +%Y.%m.%d)
|
||||||
|
|
||||||
|
# change these parameters in /etc/default/plexmediaserver
|
||||||
|
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
|
||||||
|
export PLEX_MEDIA_SERVER_HOME="/usr/lib/plexmediaserver"
|
||||||
|
export PLEX_MEDIA_SERVER_TMPDIR="/tmp"
|
||||||
|
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/var/plexmediaserver"
|
||||||
|
|
||||||
|
test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || mkdir "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
|
||||||
|
|
||||||
|
test -e /etc/default/plexmediaserver && . /etc/default/plexmediaserver
|
||||||
|
|
||||||
|
export LD_LIBRARY_PATH="${PLEX_MEDIA_SERVER_HOME}/lib:${PLEX_MEDIA_SERVER_HOME}"
|
||||||
|
export TMPDIR="${PLEX_MEDIA_SERVER_TMPDIR}"
|
||||||
|
|
||||||
|
(
|
||||||
|
printf 'Starting "Plex Media Server" on %s (%s, %s)\n' "${PLEX_MEDIA_SERVER_INFO_VENDOR}" "${PLEX_MEDIA_SERVER_INFO_MODEL}" "${PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION}"
|
||||||
|
test -n "${PLEX_MEDIA_SERVER_MAX_STACK_SIZE}" && ulimit -s "${PLEX_MEDIA_SERVER_MAX_STACK_SIZE}"
|
||||||
|
test -n "${PLEX_MEDIA_SERVER_MAX_VIRTUAL_MEMORY}" && ulimit -v "${PLEX_MEDIA_SERVER_MAX_VIRTUAL_MEMORY}"
|
||||||
|
cd "${PLEX_MEDIA_SERVER_HOME}" && ./Plex\ Media\ Server
|
||||||
|
)
|
|
@ -1,7 +1,7 @@
|
||||||
# Template file for 'plex-media-server'
|
# Template file for 'plex-media-server'
|
||||||
pkgname=plex-media-server
|
pkgname=plex-media-server
|
||||||
version=1.15.3.876
|
version=1.15.3.876
|
||||||
revision=1
|
revision=2
|
||||||
_suffix=ad6e39743
|
_suffix=ad6e39743
|
||||||
archs="i686 x86_64 armv7 aarch64"
|
archs="i686 x86_64 armv7 aarch64"
|
||||||
create_wrksrc=yes
|
create_wrksrc=yes
|
||||||
|
@ -11,6 +11,7 @@ license="Proprietary"
|
||||||
homepage="https://www.plex.tv/media-server-downloads"
|
homepage="https://www.plex.tv/media-server-downloads"
|
||||||
restricted=yes
|
restricted=yes
|
||||||
repository=nonfree
|
repository=nonfree
|
||||||
|
system_accounts="_plex"
|
||||||
# See https://support.plex.tv/articles/categories/plex-media-server/
|
# See https://support.plex.tv/articles/categories/plex-media-server/
|
||||||
|
|
||||||
case "$XBPS_TARGET_MACHINE" in
|
case "$XBPS_TARGET_MACHINE" in
|
||||||
|
@ -35,18 +36,21 @@ esac
|
||||||
nopie="yes"
|
nopie="yes"
|
||||||
nopie_files="/usr/lib/plexmediaserver/Plex DLNA Server"
|
nopie_files="/usr/lib/plexmediaserver/Plex DLNA Server"
|
||||||
|
|
||||||
|
make_dirs="/var/plexmediaserver 0755 _plex _plex"
|
||||||
|
|
||||||
do_extract() {
|
do_extract() {
|
||||||
fn="${distfiles##*/}"
|
fn="${distfiles##*/}"
|
||||||
ar x "${XBPS_SRCDISTDIR}/${pkgname}-${version}/${fn}"
|
ar x "${XBPS_SRCDISTDIR}/${pkgname}-${version}/${fn}"
|
||||||
tar xf data.tar.xz
|
tar xf data.tar.xz
|
||||||
mv usr/{s,}bin
|
mv usr/{s,}bin
|
||||||
sed -i 's/export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR.*/'\
|
cp "${FILESDIR}/default" etc/default/plexmediaserver
|
||||||
'export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${HOME}\/.pms"/g' usr/bin/start_pms
|
cp "${FILESDIR}/start_pms" usr/bin/start_pms
|
||||||
rm -r etc/{apt,init}
|
rm -r etc/{apt,init}
|
||||||
}
|
}
|
||||||
|
|
||||||
do_install() {
|
do_install() {
|
||||||
vcopy etc /
|
vcopy etc /
|
||||||
vcopy usr /
|
vcopy usr /
|
||||||
|
vsv plex-media-server
|
||||||
vlicense "${FILESDIR}/LICENSE"
|
vlicense "${FILESDIR}/LICENSE"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue