Make plexmediaserver-plexpass a slave port to reduce duplicated efforts.

While here fix a plist issue.
This commit is contained in:
Mark Felder 2014-11-28 19:18:26 +00:00
parent d406136e2c
commit 6d7f861aab
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=373575
6 changed files with 81 additions and 132 deletions

View file

@ -1,66 +1,21 @@
# Created by: KalleDK <plexmaintainer@k-moeller.dk>
# $FreeBSD$
PORTNAME= plexmediaserver
PORTVERSION= 0.9.11.4.739
CATEGORIES= multimedia
MASTER_SITES= http://downloads.plexapp.com/plex-media-server/${PORTVERSION}-${PLEX_BUILD}/
PORTREVISION= 1
PKGNAMESUFFIX= -plexpass
DISTNAME= PlexMediaServer-${PORTVERSION}-${PLEX_BUILD}-freebsd-amd64
MAINTAINER= feld@FreeBSD.org
COMMENT= The Plex Media Server component
USES= tar:bzip2
PLEX_BUILD= a4e710f
NO_BUILD= yes
WRKSRC= ${WRKDIR}/PlexMediaServer-${PORTVERSION}-${PLEX_BUILD}
BUNDLE_LIBS= yes
USE_RC_SUBR= ${PORTNAME}_plexpass
MASTERDIR=${.CURDIR}/../plexmediaserver
DISTINFO_FILE= ${.CURDIR}/distinfo
PLIST= ${.CURDIR}/pkg-plist
FILESDIR= ${.CURDIR}/files
DATADIR= ${PREFIX}/share/${PORTNAME}${PKGNAMESUFFIX}
USE_RC_SUBR= plexmediaserver_plexpass
SUB_FILES= plexmediaserver_plexpass
SUB_LIST= SUPPORT_PATH=${SUPPORT_PATH} SCRIPT_PATH="${SCRIPT_PATH}" USERS=${USERS} GROUPS=${GROUPS}
USERS= plex
GROUPS= plex
SUPPORT_PATH?= ${PREFIX}/plexdata${PKGNAMESUFFIX}
SCRIPT_PATH?= ${DATADIR}
ONLY_FOR_ARCHS= amd64
.include <bsd.port.pre.mk>
.if ${OPSYS} == FreeBSD
.if ${OSVERSION} < 900000
IGNORE= supplied binaries compiled for FreeBSD 9
.endif
.if ${OSVERSION} >= 1000054
RUN_DEPENDS+= ${LOCALBASE}/lib/compat/libstdc++.so.6:${PORTSDIR}/misc/compat9x
.endif
.endif
post-patch:
# binaries don't come pre-stripped
${FIND} ${WRKSRC} -name '*.so' -exec ${STRIP_CMD} {} \;
${STRIP_CMD} ${WRKSRC}/Resources/rsync ${WRKSRC}/Resources/Python/bin/python
do-install:
@(cd ${WRKSRC} && ${COPYTREE_SHARE} Resources ${STAGEDIR}/${SCRIPT_PATH})
${INSTALL_PROGRAM} ${WRKSRC}/Plex\ DLNA\ Server ${STAGEDIR}/${SCRIPT_PATH}
${INSTALL_PROGRAM} ${WRKSRC}/Plex\ Media\ Scanner ${STAGEDIR}/${SCRIPT_PATH}
${INSTALL_PROGRAM} ${WRKSRC}/Plex\ Media\ Server ${STAGEDIR}/${SCRIPT_PATH}
${INSTALL_LIB} ${WRKSRC}/lib* ${STAGEDIR}/${SCRIPT_PATH}
# Fix permissions to programs and db
@${CHMOD} a+x ${STAGEDIR}/${SCRIPT_PATH}/Resources/rsync
@${CHMOD} a+x ${STAGEDIR}/${SCRIPT_PATH}/Resources/Plex\ New\ Transcoder
@${CHMOD} a+x ${STAGEDIR}/${SCRIPT_PATH}/Resources/Plex\ Transcoder
@${CHMOD} a+x ${STAGEDIR}/${SCRIPT_PATH}/Resources/Python/bin/python
@${CHMOD} u+w ${STAGEDIR}/${SCRIPT_PATH}/Resources/com.plexapp.plugins.library.db
# Python fix
@${LN} -s ${SCRIPT_PATH}/libpython2.7.so.1 ${STAGEDIR}/${SCRIPT_PATH}/libpython2.7.so
.include <bsd.port.post.mk>
.include "${MASTERDIR}/Makefile"

View file

@ -0,0 +1,18 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
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
This is the PlexPass release channel of Plex. It is bleeding edge and
new features may not function without an active PlexPass account.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

View file

@ -3,50 +3,49 @@
#
# $FreeBSD$
#
# PROVIDE: plexmediaserver_plexpass
# PROVIDE: %%PORTNAME%%
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable the Plex Media Server:
#
# plexmediaserver_plexpass_enable="YES"
# %%PORTNAME%%_enable="YES"
#
# plexmediaserver_plexpass_support_path="%%SUPPORT_PATH%%" # Plex data: logs, media metadata, settings, etc
# %%PORTNAME%%_support_path="%%PREFIX%%/plexdata" # Plex data: logs, media metadata, settings, etc
#
# plexmediaserver_plexpass_tmp="/var/tmp/plex" # configure tmp directory used for the transcoding process if desired
# %%PORTNAME%%_tmp="/var/tmp/plex" # configure tmp directory used for the transcoding process if desired
#
# plexmediaserver_plexpass_maxplugins="6" # Maximum number of background plugin procs. May have to raise in rare cases.
# %%PORTNAME%%_maxplugins="6" # Maximum number of background plugin procs. May have to raise in rare cases.
#
. /etc/rc.subr
name=plexmediaserver_plexpass
rcvar=plexmediaserver_plexpass_enable
name=%%PORTNAME%%
rcvar=%%PORTNAME%%_enable
load_rc_config $name
: ${plexmediaserver_plexpass_enable:=NO}
: ${plexmediaserver_plexpass_support_path="%%SUPPORT_PATH%%"}
: ${plexmediaserver_plexpass_user="%%USERS%%"}
: ${plexmediaserver_plexpass_group="%%GROUPS%%"}
: ${plexmediaserver_plexpass_maxplugins=6}
: ${%%PORTNAME%%_enable:=NO}
: ${%%PORTNAME%%_support_path="%%PREFIX%%/plexdata"}
: ${%%PORTNAME%%_user="%%USERS%%"}
: ${%%PORTNAME%%_group="%%GROUPS%%"}
: ${%%PORTNAME%%_maxplugins=6}
extra_commands=status
command=/usr/sbin/daemon
procname="%%DATADIR%%/Plex_Media_Server"
command_args="-f ${procname}"
start_precmd=plex_precmd
start_cmd=plex_startcmd
status_cmd=plex_statuscmd
stop_cmd=plex_stopcmd
pidfile=/var/run/plex/plex.pid
plex_precmd()
{
export SUPPORT_PATH="${plexmediaserver_plexpass_support_path}"
export HOME="${plexmediaserver_plexpass_support_path}/Plex Media Server"
export PYTHONHOME="%%SCRIPT_PATH%%/Resources/Python"
export SCRIPTPATH="%%SCRIPT_PATH%%"
export SUPPORT_PATH="${plexmediaserver_support_path}"
export HOME="${plexmediaserver_support_path}/Plex Media Server"
export PYTHONHOME="%%DATADIR%%/Resources/Python"
export SCRIPTPATH="%%DATADIR%%"
export LD_LIBRARY_PATH="${SCRIPTPATH}"
export PLEX_MEDIA_SERVER_HOME="${SCRIPTPATH}"
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=${plexmediaserver_plexpass_maxplugins}
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=${plexmediaserver_plexpass_support_path}
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=${plexmediaserver_maxplugins}
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=${plexmediaserver_support_path}
export PLEX_MEDIA_SERVER_PIDFILE=${pidfile}
export PATH="${SCRIPTPATH}/Resources/Python/bin:${PATH}"
export LC_ALL="C"
@ -54,51 +53,16 @@ plex_precmd()
ulimit -s 3000
if [ ! -d ${pidfile%/*} ]; then
install -d -o ${plexmediaserver_plexpass_user} ${pidfile%/*};
install -d -o ${plexmediaserver_user} ${pidfile%/*};
fi
if [ ! -d "${plexmediaserver_plexpass_support_path}/Plex Media Server" ]; then
install -d -g ${plexmediaserver_plexpass_group} -o ${plexmediaserver_plexpass_user} "${plexmediaserver_plexpass_support_path}/Plex Media Server";
if [ ! -d "${plexmediaserver_support_path}/Plex Media Server" ]; then
install -d -g ${plexmediaserver_group} -o ${plexmediaserver_user} "${plexmediaserver_support_path}/Plex Media Server";
fi
if [ ${plexmediaserver_plexpass_tmp} ]; then
export TMPDIR=${plexmediaserver_plexpass_tmp};
install -d -g ${plexmediaserver_plexpass_group} -o ${plexmediaserver_plexpass_user} "${plexmediaserver_plexpass_tmp}";
fi
}
plex_startcmd()
{
if [ -f "${pidfile}" ] && (pgrep -F ${pidfile} Plex >/dev/null); then
echo "${name} is already running with pid: $(cat ${pidfile})";
else
echo "Starting ${name}."
/usr/sbin/daemon -u ${plexmediaserver_plexpass_user} -f '%%SCRIPT_PATH%%/Plex Media Server'
fi
}
plex_statuscmd()
{
if [ -f "${pidfile}" ] && (pgrep -F ${pidfile} Plex >/dev/null); then
echo "${name} is running with pid: $(cat ${pidfile})";
else
echo "${name} is not running.";
exit 1;
fi
}
plex_stopcmd()
{
if [ -f "${pidfile}" ] && (pgrep -F ${pidfile} Plex >/dev/null); then
main_pid=$(cat ${pidfile});
child_pids=$(pgrep -P ${main_pid});
all_pids="${main_pid} ${child_pids}"
kill ${sig_stop} ${all_pids};
wait_for_pids ${all_pids};
rm ${pidfile}
else
echo "${name} is not running.";
exit 1;
if [ ${plexmediaserver_tmp} ]; then
export TMPDIR=${plexmediaserver_tmp};
install -d -g ${plexmediaserver_group} -o ${plexmediaserver_user} "${plexmediaserver_tmp}";
fi
}

View file

@ -1,11 +0,0 @@
Plex Media Server is used to host the content and plugins that are then
streamed to Plex Media Center and Plex mobile app clients, either on the
same machine, the same local area network, or over the Internet. Content
may be transcoded by the server before it's streamed in order to reduce
bandwidth requirements, or for compatibility with the device being
streamed to.
This is the PlexPass release channel of Plex. It is bleeding edge and new
features may not function without an active PlexPass account.
WWW: https://plex.tv

View file

@ -1,6 +1,7 @@
%%DATADIR%%/Plex DLNA Server
%%DATADIR%%/Plex Media Scanner
%%DATADIR%%/Plex Media Server
%%DATADIR%%/Plex_Media_Server
%%DATADIR%%/Resources/Graphics/DefaultAlbumCover.png
%%DATADIR%%/Resources/Graphics/actor-icon.png
%%DATADIR%%/Resources/Graphics/album-fanart.jpg
@ -3030,3 +3031,24 @@
%%DATADIR%%/libxslt.so.2
%%DATADIR%%/libz.so.1
%%DATADIR%%/libzen.so.0
@dir %%DATADIR%%/Resources/English.lproj
@dir %%DATADIR%%/Resources/Python/lib/python2.7/bsddb
@dir %%DATADIR%%/Resources/Python/lib/python2.7/distutils
@dir %%DATADIR%%/Resources/Python/lib/python2.7/email/test
@dir %%DATADIR%%/Resources/Python/lib/python2.7/idlelib
@dir %%DATADIR%%/Resources/Python/lib/python2.7/lib-tk
@dir %%DATADIR%%/Resources/Python/lib/python2.7/test
@dir %%DATADIR%%/Resources/locale/ar/LC_MESSAGES
@dir %%DATADIR%%/Resources/locale/cs-CZ/LC_MESSAGES
@dir %%DATADIR%%/Resources/locale/da/LC_MESSAGES
@dir %%DATADIR%%/Resources/locale/de/LC_MESSAGES
@dir %%DATADIR%%/Resources/locale/en/LC_MESSAGES
@dir %%DATADIR%%/Resources/locale/es/LC_MESSAGES
@dir %%DATADIR%%/Resources/locale/fr/LC_MESSAGES
@dir %%DATADIR%%/Resources/locale/he/LC_MESSAGES
@dir %%DATADIR%%/Resources/locale/it/LC_MESSAGES
@dir %%DATADIR%%/Resources/locale/lt/LC_MESSAGES
@dir %%DATADIR%%/Resources/locale/nl/LC_MESSAGES
@dir %%DATADIR%%/Resources/locale/nl-BE/LC_MESSAGES
@dir %%DATADIR%%/Resources/locale/no/LC_MESSAGES
@dir %%DATADIR%%/Resources/locale/pt-BR/LC_MESSAGES

View file

@ -3,19 +3,20 @@
PORTNAME= plexmediaserver
PORTVERSION?= 0.9.11.4.739
PORTREVISION?= 0
CATEGORIES= multimedia
MASTER_SITES= http://downloads.plexapp.com/plex-media-server/${PORTVERSION}-${PLEX_BUILD}/
DISTNAME= PlexMediaServer-${PORTVERSION}-${PLEX_BUILD}-freebsd-${ARCH}
MAINTAINER= feld@FreeBSD.org
COMMENT= The Plex Media Server component
MAINTAINER?= feld@FreeBSD.org
COMMENT= Plex Media Server component
USES= tar:bzip2
PLEX_BUILD?= a4e710f
NO_BUILD= yes
WRKSRC= ${WRKDIR}/PlexMediaServer-${PORTVERSION}-${PLEX_BUILD}
USE_RC_SUBR= ${PORTNAME}
USE_RC_SUBR?= ${PORTNAME}
SUB_FILES= pkg-message
SUB_LIST= PORTNAME=${PORTNAME} DATADIR=${DATADIR} USERS=${USERS} GROUPS=${GROUPS}