svn commit: r373574 - in head/multimedia/plexmediaserver: . files
Mark Felder
feld at FreeBSD.org
Fri Nov 28 18:32:41 UTC 2014
Author: feld
Date: Fri Nov 28 18:32:39 2014
New Revision: 373574
URL: https://svnweb.freebsd.org/changeset/ports/373574
QAT: https://qat.redports.org/buildarchive/r373574/
Log:
Port cleanup and preparation for making -plexpass a slave port to
prevent duplicate work
PR: 194909
Submitted by: Josh Ruehlig
Added:
head/multimedia/plexmediaserver/files/pkg-message.in (contents, props changed)
Modified:
head/multimedia/plexmediaserver/Makefile
head/multimedia/plexmediaserver/files/plexmediaserver.in
head/multimedia/plexmediaserver/pkg-plist
Modified: head/multimedia/plexmediaserver/Makefile
==============================================================================
--- head/multimedia/plexmediaserver/Makefile Fri Nov 28 18:03:57 2014 (r373573)
+++ head/multimedia/plexmediaserver/Makefile Fri Nov 28 18:32:39 2014 (r373574)
@@ -2,31 +2,29 @@
# $FreeBSD$
PORTNAME= plexmediaserver
-PORTVERSION= 0.9.11.4.739
+PORTVERSION?= 0.9.11.4.739
CATEGORIES= multimedia
MASTER_SITES= http://downloads.plexapp.com/plex-media-server/${PORTVERSION}-${PLEX_BUILD}/
-DISTNAME= PlexMediaServer-${PORTVERSION}-${PLEX_BUILD}-freebsd-amd64
+DISTNAME= PlexMediaServer-${PORTVERSION}-${PLEX_BUILD}-freebsd-${ARCH}
MAINTAINER= feld at FreeBSD.org
COMMENT= The Plex Media Server component
USES= tar:bzip2
-PLEX_BUILD= a4e710f
+PLEX_BUILD?= a4e710f
NO_BUILD= yes
WRKSRC= ${WRKDIR}/PlexMediaServer-${PORTVERSION}-${PLEX_BUILD}
-USE_RC_SUBR= plexmediaserver
+USE_RC_SUBR= ${PORTNAME}
-SUB_FILES= plexmediaserver
-SUB_LIST= SUPPORT_PATH=${SUPPORT_PATH} SCRIPT_PATH="${SCRIPT_PATH}" USERS=${USERS} GROUPS=${GROUPS}
+SUB_FILES= pkg-message
+SUB_LIST= PORTNAME=${PORTNAME} DATADIR=${DATADIR} USERS=${USERS} GROUPS=${GROUPS}
USERS= plex
-GROUPS= plex
-SUPPORT_PATH?= ${PREFIX}/plexdata
-SCRIPT_PATH?= ${DATADIR}
+GROUPS= ${USERS}
BUNDLE_LIBS= yes
-ONLY_FOR_ARCHS= amd64
+ONLY_FOR_ARCHS_REASON= It is a binary-only program. Source code not available.
.include <bsd.port.pre.mk>
@@ -42,22 +40,24 @@ RUN_DEPENDS+= ${LOCALBASE}/lib/compat/li
post-patch:
# binaries don't come pre-stripped
- ${FIND} ${WRKSRC} -name '*.so' -exec ${STRIP_CMD} {} \;
+ ${FIND} ${WRKSRC}/Resources -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}
+ @(cd ${WRKSRC} && ${COPYTREE_SHARE} Resources ${STAGEDIR}/${DATADIR})
+ ${INSTALL_PROGRAM} ${WRKSRC}/Plex\ DLNA\ Server ${STAGEDIR}/${DATADIR}
+ ${INSTALL_PROGRAM} ${WRKSRC}/Plex\ Media\ Scanner ${STAGEDIR}/${DATADIR}
+ ${INSTALL_PROGRAM} ${WRKSRC}/Plex\ Media\ Server ${STAGEDIR}/${DATADIR}
+ ${INSTALL_LIB} ${WRKSRC}/lib* ${STAGEDIR}/${DATADIR}
# 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
+ @${CHMOD} a+x ${STAGEDIR}/${DATADIR}/Resources/rsync
+ @${CHMOD} a+x ${STAGEDIR}/${DATADIR}/Resources/Plex\ New\ Transcoder
+ @${CHMOD} a+x ${STAGEDIR}/${DATADIR}/Resources/Plex\ Transcoder
+ @${CHMOD} a+x ${STAGEDIR}/${DATADIR}/Resources/Python/bin/python
+ @${CHMOD} u+w ${STAGEDIR}/${DATADIR}/Resources/com.plexapp.plugins.library.db
# Python fix
- @${LN} -s ${SCRIPT_PATH}/libpython2.7.so.1 ${STAGEDIR}/${SCRIPT_PATH}/libpython2.7.so
+ @${LN} -s ${DATADIR}/libpython2.7.so.1 ${STAGEDIR}/${DATADIR}/libpython2.7.so
+ # Workaround for space in binary name
+ @${LN} -s ${DATADIR}/Plex\ Media\ Server ${STAGEDIR}${DATADIR}/Plex_Media_Server
.include <bsd.port.post.mk>
Added: head/multimedia/plexmediaserver/files/pkg-message.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/multimedia/plexmediaserver/files/pkg-message.in Fri Nov 28 18:32:39 2014 (r373574)
@@ -0,0 +1,15 @@
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+
+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
+
+* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Modified: head/multimedia/plexmediaserver/files/plexmediaserver.in
==============================================================================
--- head/multimedia/plexmediaserver/files/plexmediaserver.in Fri Nov 28 18:03:57 2014 (r373573)
+++ head/multimedia/plexmediaserver/files/plexmediaserver.in Fri Nov 28 18:32:39 2014 (r373574)
@@ -3,46 +3,45 @@
#
# $FreeBSD$
#
-# PROVIDE: plexmediaserver
+# PROVIDE: %%PORTNAME%%
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable the Plex Media Server:
#
-# plexmediaserver_enable="YES"
+# %%PORTNAME%%_enable="YES"
#
-# plexmediaserver_support_path="%%SUPPORT_PATH%%" # Plex data: logs, media metadata, settings, etc
+# %%PORTNAME%%_support_path="%%PREFIX%%/plexdata" # Plex data: logs, media metadata, settings, etc
#
-# plexmediaserver_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_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
-rcvar=plexmediaserver_enable
+name=%%PORTNAME%%
+rcvar=%%PORTNAME%%_enable
load_rc_config $name
-: ${plexmediaserver_enable:=NO}
-: ${plexmediaserver_support_path="%%SUPPORT_PATH%%"}
-: ${plexmediaserver_user="%%USERS%%"}
-: ${plexmediaserver_group="%%GROUPS%%"}
-: ${plexmediaserver_maxplugins=6}
-
-extra_commands=status
+: ${%%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}"
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_support_path}"
export HOME="${plexmediaserver_support_path}/Plex Media Server"
- export PYTHONHOME="%%SCRIPT_PATH%%/Resources/Python"
- export SCRIPTPATH="%%SCRIPT_PATH%%"
+ 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_maxplugins}
@@ -67,39 +66,4 @@ plex_precmd()
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_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;
- fi
-}
-
run_rc_command "$1"
Modified: head/multimedia/plexmediaserver/pkg-plist
==============================================================================
--- head/multimedia/plexmediaserver/pkg-plist Fri Nov 28 18:03:57 2014 (r373573)
+++ head/multimedia/plexmediaserver/pkg-plist Fri Nov 28 18:32:39 2014 (r373574)
@@ -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
More information about the svn-ports-all
mailing list