diff options
author | feld <feld@FreeBSD.org> | 2014-11-29 03:18:26 +0800 |
---|---|---|
committer | feld <feld@FreeBSD.org> | 2014-11-29 03:18:26 +0800 |
commit | a5eefbce9e608bfc231ac1a8792e952fdf3640fd (patch) | |
tree | b0ca1a70a08bcb540c771b142afb8c15566f3161 /multimedia/plexmediaserver-plexpass | |
parent | ca97f562d9c5ff72042f5133aa0ce734a83cfd11 (diff) | |
download | freebsd-ports-gnome-a5eefbce9e608bfc231ac1a8792e952fdf3640fd.tar.gz freebsd-ports-gnome-a5eefbce9e608bfc231ac1a8792e952fdf3640fd.tar.zst freebsd-ports-gnome-a5eefbce9e608bfc231ac1a8792e952fdf3640fd.zip |
Make plexmediaserver-plexpass a slave port to reduce duplicated efforts.
While here fix a plist issue.
Diffstat (limited to 'multimedia/plexmediaserver-plexpass')
5 files changed, 76 insertions, 128 deletions
diff --git a/multimedia/plexmediaserver-plexpass/Makefile b/multimedia/plexmediaserver-plexpass/Makefile index d0c2f35895b6..06e6737f6741 100644 --- a/multimedia/plexmediaserver-plexpass/Makefile +++ b/multimedia/plexmediaserver-plexpass/Makefile @@ -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 -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 +USE_RC_SUBR= ${PORTNAME}_plexpass -.include <bsd.port.pre.mk> +MASTERDIR=${.CURDIR}/../plexmediaserver -.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 +DISTINFO_FILE= ${.CURDIR}/distinfo +PLIST= ${.CURDIR}/pkg-plist +FILESDIR= ${.CURDIR}/files +DATADIR= ${PREFIX}/share/${PORTNAME}${PKGNAMESUFFIX} -.include <bsd.port.post.mk> +.include "${MASTERDIR}/Makefile" diff --git a/multimedia/plexmediaserver-plexpass/files/pkg-message.in b/multimedia/plexmediaserver-plexpass/files/pkg-message.in new file mode 100644 index 000000000000..271b2ef52ea3 --- /dev/null +++ b/multimedia/plexmediaserver-plexpass/files/pkg-message.in @@ -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. + +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * diff --git a/multimedia/plexmediaserver-plexpass/files/plexmediaserver_plexpass.in b/multimedia/plexmediaserver-plexpass/files/plexmediaserver_plexpass.in index fe1165d8a776..b3b1af401862 100644 --- a/multimedia/plexmediaserver-plexpass/files/plexmediaserver_plexpass.in +++ b/multimedia/plexmediaserver-plexpass/files/plexmediaserver_plexpass.in @@ -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 } diff --git a/multimedia/plexmediaserver-plexpass/pkg-descr b/multimedia/plexmediaserver-plexpass/pkg-descr deleted file mode 100644 index a55a47c6f466..000000000000 --- a/multimedia/plexmediaserver-plexpass/pkg-descr +++ /dev/null @@ -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 diff --git a/multimedia/plexmediaserver-plexpass/pkg-plist b/multimedia/plexmediaserver-plexpass/pkg-plist index 0016ef7c9206..125efae87389 100644 --- a/multimedia/plexmediaserver-plexpass/pkg-plist +++ b/multimedia/plexmediaserver-plexpass/pkg-plist @@ -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 |