Index: head/multimedia/plexmediaserver/Makefile =================================================================== --- head/multimedia/plexmediaserver/Makefile (revision 496349) +++ head/multimedia/plexmediaserver/Makefile (revision 496350) @@ -1,69 +1,69 @@ # Created by: KalleDK # $FreeBSD$ PORTNAME= plexmediaserver -PORTVERSION?= 1.14.1.5488 -DISTVERSIONSUFFIX?=cc260c476 -PORTREVISION?= 1 +PORTVERSION?= 1.15.1.791 +DISTVERSIONSUFFIX?=8bec0f76c +PORTREVISION?= 0 CATEGORIES= multimedia -MASTER_SITES?= https://downloads.plex.tv/plex-media-server/${DISTVERSION}-${DISTVERSIONSUFFIX}/ -DISTNAME?= PlexMediaServer-${DISTVERSION}-${DISTVERSIONSUFFIX}-freebsd-${ARCH} +MASTER_SITES?= https://downloads.plex.tv/plex-media-server-new/${DISTVERSION}-${DISTVERSIONSUFFIX}/freebsd/ +DISTNAME?= PlexMediaServer-${DISTVERSION}-${DISTVERSIONSUFFIX}-FreeBSD-${ARCH} MAINTAINER?= feld@FreeBSD.org COMMENT= Plex Media Server component USES= cpe tar:bzip2 NO_BUILD= yes WRKSRC= ${WRKDIR}/PlexMediaServer-${PORTVERSION}-${DISTVERSIONSUFFIX} CPE_VENDOR= plex CPE_PRODUCT= plex_media_server CPE_VERSION= ${PORTVERSION:R} USE_RC_SUBR?= ${PORTNAME} SUB_FILES= pkg-message SUB_LIST?= PORTNAME=${PORTNAME} DATADIR=${DATADIR} USERS=${USERS} GROUPS=${GROUPS} USERS= plex GROUPS= ${USERS} BUNDLE_LIBS= yes ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON= binary-only program, source code not available OPTIONS_DEFINE= RELAY OPTIONS_DEFAULT= RELAY OPTIONS_SUB= yes RELAY_DESC= Install Plex Relay daemon .include .if ${OPSYS} == FreeBSD RUN_DEPENDS?= ${LOCALBASE}/lib/compat/libstdc++.so.6:misc/compat9x .endif post-patch: # binaries don't come pre-stripped ${FIND} ${WRKSRC}/Resources -type f -name '*.so' -exec ${STRIP_CMD} {} \+ ${FIND} ${WRKSRC} ${WRKSRC}/Resources -type f -name 'Plex*' -depth 1 -exec ${STRIP_CMD} {} \+ ${FIND} ${WRKSRC} -depth 1 -type f -name 'lib*' -exec ${STRIP_CMD} {} \+ ${RM} ${WRKSRC}/start.sh ${WRKSRC}/Resources/start.sh # Older verisons of Plex we have to create a symlink # Newer versions of Plex ship a duplicate file; we'll just symlink ${RM} ${WRKSRC}/libpython2.7.so post-patch-RELAY-off: ${RM} ${WRKSRC}/Plex\ Relay do-install: (cd ${WRKSRC} && ${COPYTREE_SHARE} \* ${STAGEDIR}/${DATADIR}) # Workaround for space in binary name ${INSTALL} -lrs ${STAGEDIR}/${DATADIR}/Plex\ Media\ Server ${STAGEDIR}/${DATADIR}/Plex_Media_Server post-install: @${CHMOD} 555 ${STAGEDIR}/${DATADIR}/CrashUploader ${STAGEDIR}/${DATADIR}/Plex* @${FIND} -s ${STAGEDIR}${DATADIR} -not -type d | ${SORT} | \ ${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST} .include Index: head/multimedia/plexmediaserver/distinfo =================================================================== --- head/multimedia/plexmediaserver/distinfo (revision 496349) +++ head/multimedia/plexmediaserver/distinfo (revision 496350) @@ -1,3 +1,3 @@ -TIMESTAMP = 1545160778 -SHA256 (PlexMediaServer-1.14.1.5488-cc260c476-freebsd-amd64.tar.bz2) = 9a157e1566963bceac6e736d679522b7030cd53ddcbb3b0982a9e0a13cc176f1 -SIZE (PlexMediaServer-1.14.1.5488-cc260c476-freebsd-amd64.tar.bz2) = 90555303 +TIMESTAMP = 1553098065 +SHA256 (PlexMediaServer-1.15.1.791-8bec0f76c-FreeBSD-amd64.tar.bz2) = 37b4e75819b98cdd1ddf6a05193885ed54e76c93fea1a7cb8909e6e655409f20 +SIZE (PlexMediaServer-1.15.1.791-8bec0f76c-FreeBSD-amd64.tar.bz2) = 91986684 Index: head/multimedia/plexmediaserver/files/pkg-message.in =================================================================== --- head/multimedia/plexmediaserver/files/pkg-message.in (revision 496349) +++ head/multimedia/plexmediaserver/files/pkg-message.in (revision 496350) @@ -1,15 +1,58 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * multimedia/%%PORTNAME%% includes an RC script: %%PREFIX%%/etc/rc.d/%%PORTNAME%% TO START PLEXMEDIASERVER ON BOOT: sysrc %%PORTNAME%%_enable=YES START MANUALLY: service %%PORTNAME%% start Once started, visit the following to configure: http://localhost:32400/web +@@@ INTEL GPU OFFLOAD NOTES @@@ + +If you have a supported Intel GPU, you can leverage hardware +accellerated encoding/decoding in Plex Media Server on FreeBSD 12.0+. + +The requirements are as follows: + +* Install multimedia/drm-kmod: e.g., pkg install drm-fbsd12.0-kmod + +* Enable loading of kernel module on boot: sysrc kld_list+="drm" +** If Plex will run in a jail, you must load the module outside the jail! + +* Load the kernel module now: kldload drm + +* Install the supporting Intel VA support library for your GPU +** multimedia/libva-intel-driver: [LEGACY] Intel GMA 4500 or newer +** multimedia/libva-intel-media-driver: Intel HD 5000 (Gen8) or newer +*** This must be installed beside Plex. e.g., in the jail with Plex + +* Add plex user to the video group: pw groupmod -n video -m plex + +* For jails, make a devfs ruleset to expose /dev/dri/* devices. + +e.g., /dev/devfs.rules on the host: + +[plex_drm=10] +add include $devfsrules_hide_all +add include $devfsrules_unhide_basic +add include $devfsrules_unhide_login +add include $devfsrules_jail +add path 'dri*' unhide +add path 'dri/*' unhide +add path 'drm*' unhide +add path 'drm/*' unhide + +* Enable the devfs ruleset for your jail. e.g., devfs_ruleset=10 in your +/etc/jail.conf or for iocage, iocage set devfs_ruleset="10" + +Please refer to documentation for all other FreeBSD jail management +utilities. + +@@@ INTEL GPU OFFLOAD NOTES @@@ + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Index: head/multimedia/plexmediaserver/files/plexmediaserver.in =================================================================== --- head/multimedia/plexmediaserver/files/plexmediaserver.in (revision 496349) +++ head/multimedia/plexmediaserver/files/plexmediaserver.in (revision 496350) @@ -1,87 +1,103 @@ #!/bin/sh # Created by: KalleDK # # $FreeBSD$ # # PROVIDE: %%PORTNAME%% # REQUIRE: LOGIN # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf to enable the Plex Media Server: # # %%PORTNAME%%_enable="YES" # # %%PORTNAME%%_support_path="%%PREFIX%%/plexdata" # Plex data: logs, media metadata, settings, etc # # %%PORTNAME%%_tmp="/var/tmp/plex" # configure tmp directory used for the transcoding process if desired # # %%PORTNAME%%_maxplugins="6" # Maximum number of background plugin procs. May have to raise in rare cases. # . /etc/rc.subr name=%%PORTNAME%% rcvar=%%PORTNAME%%_enable load_rc_config $name : ${%%PORTNAME%%_enable:=NO} : ${%%PORTNAME%%_support_path="%%PREFIX%%/plexdata"} : ${%%PORTNAME%%_user="%%USERS%%"} : ${%%PORTNAME%%_group="%%GROUPS%%"} : ${%%PORTNAME%%_maxplugins=6} command=/usr/sbin/daemon procname="%%DATADIR%%/Plex_Media_Server" command_args="-f ${procname}" pidfile=/var/run/plex/plex.pid start_precmd=plex_precmd stop_precmd=plex_stop_precmd stop_postcmd=plex_stop_postcmd plex_precmd() { + #Set identification variables for FreeNAS; with fallback to FreeBSD + if [ -f "/etc/version" ]; then + export PLEX_MEDIA_SERVER_INFO_VENDOR="$(cat /etc/version|cut -d- -f1)" + export PLEX_MEDIA_SERVER_INFO_DEVICE=NAS + export PLEX_MEDIA_SERVER_INFO_MODEL="$(uname -m)" + export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION="$(cat /etc/version|cut -d- -f2-)" + else + export PLEX_MEDIA_SERVER_INFO_VENDOR=FreeBSD + export PLEX_MEDIA_SERVER_INFO_DEVICE=PC + export PLEX_MEDIA_SERVER_INFO_MODEL="$(uname -m)" + export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION="$(uname -r)" + fi export SUPPORT_PATH="${%%PORTNAME%%_support_path}" export HOME="${%%PORTNAME%%_support_path}/Plex Media Server" export PYTHONHOME="%%DATADIR%%/Resources/Python" export SCRIPTPATH="%%DATADIR%%" - export LD_LIBRARY_PATH="%%PREFIX%%/lib/compat:${SCRIPTPATH}" + export LD_LIBRARY_PATH="${SCRIPTPATH}/lib" export PLEX_MEDIA_SERVER_HOME="${SCRIPTPATH}" export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=${%%PORTNAME%%_maxplugins} export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=${%%PORTNAME%%_support_path} export PLEX_MEDIA_SERVER_PIDFILE=${pidfile} export PLEX_MEDIA_SERVER_LOG_DIR="${%%PORTNAME%%_support_path}/Plex Media Server/Logs" export PATH="${SCRIPTPATH}/Resources/Python/bin:${PATH}" export LC_ALL="en_US.UTF-8" export LANG="en_US.UTF-8" ulimit -s 3000 if [ ! -d ${pidfile%/*} ]; then install -d -o ${%%PORTNAME%%_user} ${pidfile%/*}; fi if [ ! -d "${%%PORTNAME%%_support_path}/Plex Media Server" ]; then install -d -g ${%%PORTNAME%%_group} -o ${%%PORTNAME%%_user} "${%%PORTNAME%%_support_path}/Plex Media Server"; + fi + + if [ ! -d "${%%PORTNAME%%_support_path}/Plex" ]; then + install -d -g ${%%PORTNAME%%_group} -o ${%%PORTNAME%%_user} "${%%PORTNAME%%_support_path}/Plex"; fi if [ ${%%PORTNAME%%_tmp} ]; then export TMPDIR=${%%PORTNAME%%_tmp}; install -d -g ${%%PORTNAME%%_group} -o ${%%PORTNAME%%_user} "${%%PORTNAME%%_tmp}"; fi } plex_stop_precmd() { if [ -r ${pidfile} ]; then export _PLEXPID=$(check_pidfile ${pidfile} ${procname}) fi } plex_stop_postcmd() { _PLEX_CHILDREN=$(pgrep -g ${_PLEXPID}) echo "Cleaning up leftover child processes." kill $sig_stop ${_PLEX_CHILDREN} wait_for_pids ${_PLEX_CHILDREN} } run_rc_command "$1"