diff options
Diffstat (limited to 'multimedia/plexmediaserver')
-rw-r--r-- | multimedia/plexmediaserver/README | 9 | ||||
-rw-r--r-- | multimedia/plexmediaserver/doinst.sh | 20 | ||||
-rw-r--r-- | multimedia/plexmediaserver/plexmediaserver.SlackBuild | 88 | ||||
-rw-r--r-- | multimedia/plexmediaserver/plexmediaserver.info | 14 | ||||
-rw-r--r-- | multimedia/plexmediaserver/rc.plexmediaserver | 113 |
5 files changed, 71 insertions, 173 deletions
diff --git a/multimedia/plexmediaserver/README b/multimedia/plexmediaserver/README index b2a74c4f78..3c0e127c73 100644 --- a/multimedia/plexmediaserver/README +++ b/multimedia/plexmediaserver/README @@ -1,9 +1,10 @@ Plex Media Server is the backend for the Plex media system. Plex's frontend media player, Plex Home Theater, is Windows/Mac only; -however, you can stream your local files on Linux from your web browser. -Plex Home Theater allows the user to manage and play video, photos, music, -and podcasts from a local or remote computer running Plex Media Server. +however, you can stream your local files on Linux from your web +browser. Plex Home Theater allows the user to manage and play video, +photos, music, and podcasts from a local or remote computer running +Plex Media Server. Plex Media Server runs as plex:plex (UID/GID 279) with its $HOME as /var/lib/plexmediaserver: @@ -12,4 +13,4 @@ Plex Media Server runs as plex:plex (UID/GID 279) with its $HOME as # useradd -u 279 -d /var/lib/plexmediaserver -s /bin/false -g plex plex After installing, grab an account from https://www.plex.tv and visit -http://localhost:32400/manage to configure your server. +http://localhost:32400/web configure your server. diff --git a/multimedia/plexmediaserver/doinst.sh b/multimedia/plexmediaserver/doinst.sh index 0908c4e6c4..b295ab1144 100644 --- a/multimedia/plexmediaserver/doinst.sh +++ b/multimedia/plexmediaserver/doinst.sh @@ -11,15 +11,19 @@ config() { # Otherwise, we leave the .new copy for the admin to consider... } -# Keep same perms on rc.plexmediaserver.new: -if [ -e etc/rc.d/rc.plexmediaserver ]; then - cp -a etc/rc.d/rc.plexmediaserver etc/rc.d/rc.plexmediaserver.new.incoming - cat etc/rc.d/rc.plexmediaserver.new > etc/rc.d/rc.plexmediaserver.new.incoming - mv etc/rc.d/rc.plexmediaserver.new.incoming etc/rc.d/rc.plexmediaserver.new -fi +preserve_perms() { + NEW="$1" + OLD="$(dirname $NEW)/$(basename $NEW .new)" + if [ -e $OLD ]; then + cp -a $OLD ${NEW}.incoming + cat $NEW > ${NEW}.incoming + mv ${NEW}.incoming $NEW + fi + config $NEW +} -config etc/rc.d/rc.plexmediaserver.new -config etc/default/plexmediaserver +preserve_perms etc/rc.d/rc.plexmediaserver.new +config etc/default/plexmediaserver.new if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 diff --git a/multimedia/plexmediaserver/plexmediaserver.SlackBuild b/multimedia/plexmediaserver/plexmediaserver.SlackBuild index e8d9abf362..9984cfe6aa 100644 --- a/multimedia/plexmediaserver/plexmediaserver.SlackBuild +++ b/multimedia/plexmediaserver/plexmediaserver.SlackBuild @@ -1,10 +1,11 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for "plexmediaserver". # Copyright 2014-2015 Lionel Young <lionelyoung@gmail.com> # Copyright 2015-2017 Marcel Saegebarth <marc@mos6581.de> -# Copyright 2017-2019 Kevin Matthew <kevin@kevinmatthew.com> +# Copyright 2017-2020 Kevin Matthew <kevin@kevinmatthew.com> +# Copyright 2020-2023 Stu Miller <slackbuilds@go4it2day.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -26,11 +27,20 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20230528 bkw: modified by SlackBuilds.org: +# - use standard ARCH (not i386). note that this is cosmetic (the package +# contents do not change, only the filename of the .tgz package). +# - speed up find and strip stuff (build now runs ~3.2x faster). +# - fix permission on .desktop file. + +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=plexmediaserver -VERSION=${VERSION:-1.18.4.2171_ac2afe5f8} +VERSION=${VERSION:-1.40.2.8395_c67dce28e} PKG_VERSION=$(echo $VERSION | tr _ -) BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -40,7 +50,11 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} @@ -48,15 +62,12 @@ OUTPUT=${OUTPUT:-/tmp} if [ "$ARCH" = "i586" ]; then DEBARCH="i386" LIBDIRSUFFIX="" - ARCH="i386" elif [ "$ARCH" = "i686" ]; then DEBARCH="i386" LIBDIRSUFFIX="" - ARCH="i386" elif [ "$ARCH" = "x86_64" ]; then DEBARCH="amd64" LIBDIRSUFFIX="64" - ARCH="x86_64" else echo "Package for $(uname -m) architecture is not available." exit 1 @@ -91,37 +102,42 @@ fi rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT -cd $PKG -rm -rf $PRGNAM-$PKG_VERSION -ar xv $CWD/${PRGNAM}_${PKG_VERSION}_${DEBARCH}.deb -tar xvf data.tar.?z -rm -f debian-binary control.tar.?z data.tar.?z -rm -rf $PKG/etc/apt/ $PKG/etc/init $PKG/etc/init.d +cd $TMP +rm -rf $PRGNAM-$VERSION +mkdir $PRGNAM-$VERSION +ar xv $CWD/${PRGNAM}_${PKG_VERSION}_${DEBARCH}.deb data.tar.xz +tar xvf data.tar.xz -C $PRGNAM-$VERSION +rm -f data.tar.xz +cd $PRGNAM-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ - -o -perm 511 \) -exec chmod 755 {} \; -o \ + -o -perm 511 \) -exec chmod 755 {} + \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} + -mkdir -p $PKG/opt/$PRGNAM/bin/ -mv $PKG/usr/lib/plexmediaserver $PKG/opt/$PRGNAM/lib +mkdir -p $PKG/usr/lib/ +mv usr/lib/plexmediaserver $PKG/usr/lib -mv usr/sbin/start_pms $PKG/opt/$PRGNAM/bin/ -sed -i -e "s#/usr/lib/plexmediaserver#/opt/$PRGNAM/lib#" \ - $PKG/opt/$PRGNAM/bin/start_pms -mkdir -p $PKG/usr/bin/ -ln -s /opt/$PRGNAM/bin/start_pms \ - $PKG/usr/bin/start_pms +# 20230528 bkw: This strip command is *way* faster than the find|grep|xargs +# stuff (runs in about 1 sec, vs. over a minute) and has the same effect. +strip --strip-unneeded \ + $PKG/usr/lib/$PRGNAM/* \ + $PKG/usr/lib/$PRGNAM/lib/*.so* \ + $PKG/usr/lib/$PRGNAM/Resources/Python/lib/python*/site-packages/*/*.so \ + 2>/dev/null || true -mv usr/share/applications/plexmediaserver.desktop $PKG/opt/$PRGNAM/ -sed -i -e "s/x-www-browser/xdg-open/" \ - $PKG/opt/$PRGNAM/plexmediaserver.desktop -mkdir -p $PKG/usr/share/applications -ln -s /opt/$PRGNAM/plexmediaserver.desktop \ - $PKG/usr/share/applications/plexmediaserver.desktop +DESKTOP=usr/share/applications/$PRGNAM.desktop +install -D -m0644 $DESKTOP $PKG/$DESKTOP +sed -i -e "s/x-www-browser/xdg-open/" $PKG/$DESKTOP -rm -rf $PKG/etc/systemd $PKG/usr/share/doc $PKG/usr/sbin $PKG/usr/lib +mkdir -p $PKG/etc/rc.d +cat $PKG/usr/lib/$PRGNAM/lib/$PRGNAM.init > $PKG/etc/rc.d/rc.$PRGNAM.new +chmod 0644 $PKG/etc/rc.d/rc.$PRGNAM.new + +mkdir -p $PKG/etc/default +cat $PKG/usr/lib/plexmediaserver/lib/plexmediaserver.default > $PKG/etc/default/$PRGNAM.new +chmod 0644 $PKG/etc/default/$PRGNAM.new mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild @@ -129,19 +145,9 @@ cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/var/lib/$PRGNAM chown -R $PLEX_USER:$PLEX_GROUP $PKG/var/lib/$PRGNAM -mkdir -p $PKG/etc/rc.d/ -cat $CWD/rc.$PRGNAM > $PKG/etc/rc.d/rc.$PRGNAM.new -chmod 0644 $PKG/etc/rc.d/rc.$PRGNAM.new - -# cleanup -( - cd $PKG - rm -rf _gpgplex lib -) - mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/multimedia/plexmediaserver/plexmediaserver.info b/multimedia/plexmediaserver/plexmediaserver.info index 1da723cc4e..d4128b5fda 100644 --- a/multimedia/plexmediaserver/plexmediaserver.info +++ b/multimedia/plexmediaserver/plexmediaserver.info @@ -1,10 +1,10 @@ PRGNAM="plexmediaserver" -VERSION="1.18.4.2171_ac2afe5f8" +VERSION="1.40.2.8395_c67dce28e" HOMEPAGE="https://plex.tv/" -DOWNLOAD="https://downloads.plex.tv/plex-media-server-new/1.18.4.2171-ac2afe5f8/debian/plexmediaserver_1.18.4.2171-ac2afe5f8_i386.deb" -MD5SUM="f0675f183be34df50e51f14febf4d2fc" -DOWNLOAD_x86_64="https://downloads.plex.tv/plex-media-server-new/1.18.4.2171-ac2afe5f8/debian/plexmediaserver_1.18.4.2171-ac2afe5f8_amd64.deb" -MD5SUM_x86_64="104b1350707f52d0ade2720af80fa7e3" +DOWNLOAD="https://downloads.plex.tv/plex-media-server-new/1.40.2.8395-c67dce28e/debian/plexmediaserver_1.40.2.8395-c67dce28e_i386.deb" +MD5SUM="29932efda14d2bea2024b0feb9f7da26" +DOWNLOAD_x86_64="https://downloads.plex.tv/plex-media-server-new/1.40.2.8395-c67dce28e/debian/plexmediaserver_1.40.2.8395-c67dce28e_amd64.deb" +MD5SUM_x86_64="96756b4ea968fd59c75b17143e13c951" REQUIRES="" -MAINTAINER="Kevin Matthew" -EMAIL="kevin@kevinmatthew.com" +MAINTAINER="Stu Miller" +EMAIL="slackbuilds@go4it2day.com" diff --git a/multimedia/plexmediaserver/rc.plexmediaserver b/multimedia/plexmediaserver/rc.plexmediaserver deleted file mode 100644 index 0ca0d327e4..0000000000 --- a/multimedia/plexmediaserver/rc.plexmediaserver +++ /dev/null @@ -1,113 +0,0 @@ -#!/bin/sh - -# Copyright 2016 Marcel Saegebarth <marc@mos6581.de> -# All rights reserved. -# -# Redistribution and use of this script, with or without modification, is -# permitted provided that the following conditions are met: -# -# 1. Redistributions of this script must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED -# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO -# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -RUN_USER=plex - -plexmediaserver_start() { - PIDOF=$(pidof "Plex Media Server") - - if [ -z "$PIDOF" ]; then - echo "Starting plexmediaserver..." - /bin/su -s /bin/sh -l $RUN_USER -c '/usr/bin/start_pms &> /dev/null &' - else - echo "plexmediaserver is already active (PID: $PIDOF)." - exit 1 - fi -} - -plexmediaserver_stop() { - PIDOF=$(pidof "Plex Media Server") - # plugins may still running when stopping plexmediaserver on its startup - # process - PGREP_PLUGINS=$(pgrep -f "Plex Plug-in") - PGREP_DLNA=$(pgrep -f "Plex DLNA Server") - PGREP_TUNER=$(pgrep -f "Plex Tuner Service") - PGREP_EGP=$(pgrep -f "Plex EAE Service") - PGREP_TRANSCODER=$(pgrep -f "Plex Transcoder") - PGREP_PLEXRELAY=$(pgrep -f "Plex Relay") - - - if [ -z "$PIDOF" ] && [ -z "$PGREP_PLUGINS" ]; then - echo "plexmediaserver is not running..." - exit 1 - else - echo -n "Stopping plexmediaserver..." - - if [ -n "$PIDOF" ]; then - kill -9 $PIDOF - fi - - if [ -n "$PGREP_PLUGINS" ]; then - for i in "$PGREP_PLUGINS"; do - kill -9 $i - done - fi - - if [ -n "$PGREP_DLNA" ]; then - for i in "$PGREP_DLNA"; do - kill -9 $i - done - fi - - if [ -n "$PGREP_TUNER" ]; then - for i in "$PGREP_TUNER"; do - kill -9 $i - done - fi - - if [ -n "$PGREP_EGP" ]; then - for i in "$PGREP_EGP"; do - kill -9 $i - done - fi - - if [ -n "$PGREP_TRANSCODER" ]; then - for i in "$PGREP_TRANSCODER"; do - kill -9 $i - done - fi - - if [ -n "$PGREP_PLEXRELAY" ]; then - for i in "$PGREP_PLEXRELAY"; do - kill -9 $i - done - fi - - - - echo "done" - fi -} - -plexmediaserver_restart() { - plexmediaserver_stop - sleep 3 - plexmediaserver_start -} - -case "$1" in - start) plexmediaserver_start ;; - stop) plexmediaserver_stop ;; - restart) plexmediaserver_restart ;; - *) echo "USAGE: $0 start|stop|restart" - exit 1 ;; -esac |