summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Martin <om@organizedmagnetism.com>2021-04-10 00:51:29 -0500
committerSam James <sam@gentoo.org>2021-06-02 13:53:29 +0000
commit18855a31307185dbd7e245ed1b47a82dd0ffdf95 (patch)
treec74a04b5f9a995a50eaff405677ddedc6d65409c /media-tv
parentapp-misc/filebus: Bump to version 0.1.0 (diff)
downloadgentoo-18855a31307185dbd7e245ed1b47a82dd0ffdf95.tar.gz
gentoo-18855a31307185dbd7e245ed1b47a82dd0ffdf95.tar.bz2
gentoo-18855a31307185dbd7e245ed1b47a82dd0ffdf95.zip
media-tv/plex-media-server: restore package (new ebuild version 1.23.1.4602)
This package does bundle deps (Python, optionally OpenSSL). [Note by sam@: - Restoring because this is a particularly popular piece of software. - Yes, Python is "bundled", but it's a stripped down copy, modified/patched copy with missing functionality, and we'll do best to treat it as if it's not there. - Users are better served by keeping an up-to-date version in tree, even if it's less-than-ideal for upstream to include Python in this way.] Closes: https://bugs.gentoo.org/769782 Signed-off-by: Scott Martin <om@organizedmagnetism.com> Closes: https://github.com/gentoo/gentoo/pull/20320 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'media-tv')
-rw-r--r--media-tv/plex-media-server/Manifest2
-rw-r--r--media-tv/plex-media-server/files/80plexmediaserver1
-rw-r--r--media-tv/plex-media-server/files/README.gentoo4
-rw-r--r--media-tv/plex-media-server/files/plex-media-server.conf.d7
-rw-r--r--media-tv/plex-media-server/files/plex-media-server.init.d16
-rwxr-xr-xmedia-tv/plex-media-server/files/start_pms51
-rw-r--r--media-tv/plex-media-server/metadata.xml19
-rw-r--r--media-tv/plex-media-server/plex-media-server-1.23.1.4602.ebuild76
8 files changed, 176 insertions, 0 deletions
diff --git a/media-tv/plex-media-server/Manifest b/media-tv/plex-media-server/Manifest
new file mode 100644
index 000000000000..286eb5f414f2
--- /dev/null
+++ b/media-tv/plex-media-server/Manifest
@@ -0,0 +1,2 @@
+DIST plexmediaserver_1.23.1.4602-280ab6053_amd64.deb 81613502 BLAKE2B 59f3bc54e8436bb35983cc7b77c252c88d5ccc26325203edcbaf7ef2428dbe465e0db8bb0b24472f7f7b07b25b23d23e240903243d8dcd7983edd4cda62906b3 SHA512 e269066a10794d63cf9912df3e66b92874701a8263f2806f42d0abe9484bd347284e2bacb3ba2f6825e1489be164f0b2abe6d23021737b37be918a9b356c1301
+DIST plexmediaserver_1.23.1.4602-280ab6053_i386.deb 75020714 BLAKE2B 12c8057592f734969c9d4a3ea245c2b725fe16433260214c1e18d0b192151b51c61d55bde7b40015727b1775a21fe965960165b8cc6f039a138f521f95f34cb3 SHA512 afd569e0cfd665b81e422b925e623b910d29b99e77dbfe2ff2333497f63fb69adf851562c887a9bd8ff216f37b18397cad673547a41d8fdba611d9a6bd7254e2
diff --git a/media-tv/plex-media-server/files/80plexmediaserver b/media-tv/plex-media-server/files/80plexmediaserver
new file mode 100644
index 000000000000..54fe49b09fd2
--- /dev/null
+++ b/media-tv/plex-media-server/files/80plexmediaserver
@@ -0,0 +1 @@
+SEARCH_DIRS_MASK="/usr/lib/plexmediaserver/lib /usr/lib/plexmediaserver/Resources/Python/lib/python2.7/lib-dynload /usr/lib/plexmediaserver/Resources/Python/lib/python2.7/site-packages/lxml"
diff --git a/media-tv/plex-media-server/files/README.gentoo b/media-tv/plex-media-server/files/README.gentoo
new file mode 100644
index 000000000000..3ac1430ab2f7
--- /dev/null
+++ b/media-tv/plex-media-server/files/README.gentoo
@@ -0,0 +1,4 @@
+Plex Media Server is now installed. Please check the configuration file.
+It can be found in /etc/plex/plexmediaserver to verify the default settings.
+To start the Plex Server, run 'rc-config start plex-media-server'
+You will then be able to access your library at http://localhost:32400/manage
diff --git a/media-tv/plex-media-server/files/plex-media-server.conf.d b/media-tv/plex-media-server/files/plex-media-server.conf.d
new file mode 100644
index 000000000000..7fe754fb1d81
--- /dev/null
+++ b/media-tv/plex-media-server/files/plex-media-server.conf.d
@@ -0,0 +1,7 @@
+# Config file for /etc/init.d/plex-media-server
+
+PLEX_PIDFILE="/var/run/plex-media-server.pid"
+PLEX_OUTLOG="/var/log/pms/out.log"
+PLEX_ERRLOG="/var/log/pms/err.log"
+PLEX_USER="plex"
+PLEX_SCRIPT="/usr/sbin/start_pms"
diff --git a/media-tv/plex-media-server/files/plex-media-server.init.d b/media-tv/plex-media-server/files/plex-media-server.init.d
new file mode 100644
index 000000000000..81204c87335c
--- /dev/null
+++ b/media-tv/plex-media-server/files/plex-media-server.init.d
@@ -0,0 +1,16 @@
+#!/sbin/openrc-run
+
+start() {
+ ebegin "Starting Plex Media Server"
+ start-stop-daemon -S -m -p ${PLEX_PIDFILE} -1 ${PLEX_OUTLOG} -2 ${PLEX_ERRLOG} --quiet -u ${PLEX_USER} -N -5 -b --exec ${PLEX_SCRIPT}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Plex Media Server"
+ kill -- -`cat ${PLEX_PIDFILE}`
+
+ # Remove stale pid file since this is a dirty solution
+ rm ${PLEX_PIDFILE}
+ eend $?
+}
diff --git a/media-tv/plex-media-server/files/start_pms b/media-tv/plex-media-server/files/start_pms
new file mode 100755
index 000000000000..e00ba5620267
--- /dev/null
+++ b/media-tv/plex-media-server/files/start_pms
@@ -0,0 +1,51 @@
+#!/bin/sh
+#
+# Plex Media Server - Manual start script.
+#
+
+# Set Crash Reporting identification variables
+export PLEX_MEDIA_SERVER_INFO_VENDOR="$(grep ^NAME= /etc/os-release|awk -F= '{print $2}'|tr -d \" )"
+export PLEX_MEDIA_SERVER_INFO_DEVICE="PC"
+export PLEX_MEDIA_SERVER_INFO_MODEL="$(uname -m)"
+GENTOO_PROFILE="`readlink /etc/portage/make.profile`"
+export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION="${GENTOO_PROFILE#.*/profiles/}"
+
+# Change these parameters in /etc/default/plexmediaserver
+export PLEX_MEDIA_SERVER_USER=plex
+export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
+export PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
+export PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000
+export LD_LIBRARY_PATH="${PLEX_MEDIA_SERVER_HOME}"
+export PLEX_MEDIA_SERVER_TMPDIR=/tmp
+export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${HOME}/Library/Application Support"
+
+if [ -f /etc/default/locale ]; then
+ export LANG="$(cat /etc/default/locale|awk -F '=' '/LANG=/{print $2}'|sed 's/"//g')"
+ export LC_ALL="$LANG"
+fi
+
+test -f /etc/default/plexmediaserver && . /etc/default/plexmediaserver
+
+# Silently support PLEX_USER if provided as override
+if [ "$PLEX_USER" != "" ]; then
+ export PLEX_MEDIA_SERVER_USER="$PLEX_USER"
+fi
+
+# Create AppSuppDir if not present
+if [ ! -d "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR" ]; then
+ mkdir -p "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR"
+ if [ ! $? -eq 0 ]; then
+ echo "ERROR: Couldn't create $PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR "
+ exit 1
+ fi
+fi
+
+export LD_LIBRARY_PATH="${PLEX_MEDIA_SERVER_HOME}/lib":"${PLEX_MEDIA_SERVER_HOME}"
+export TMPDIR="${PLEX_MEDIA_SERVER_TMPDIR}"
+
+ulimit -s $PLEX_MEDIA_SERVER_MAX_STACK_SIZE
+
+# Add sleep - for those who launch with this script
+sleep 3
+
+(cd /usr/lib/plexmediaserver; ./Plex\ Media\ Server)
diff --git a/media-tv/plex-media-server/metadata.xml b/media-tv/plex-media-server/metadata.xml
new file mode 100644
index 000000000000..39729e116b91
--- /dev/null
+++ b/media-tv/plex-media-server/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>om@organizedmagnetism.com</email>
+ <name>Scott Martin</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <upstream>
+ <changelog>http://forums.plex.tv/discussion/62832/plex-media-server#latest</changelog>
+ <doc>https://support.plex.tv/hc/en-us/categories/200007268-Getting-Started</doc>
+ </upstream>
+ <use>
+ <flag name="system-openssl">Use system copy of <pkg>dev-libs/openssl</pkg> instead of the bundled one. Unsupported upstream.</flag>
+ </use>
+</pkgmetadata>
diff --git a/media-tv/plex-media-server/plex-media-server-1.23.1.4602.ebuild b/media-tv/plex-media-server/plex-media-server-1.23.1.4602.ebuild
new file mode 100644
index 000000000000..3c08b6b51bf1
--- /dev/null
+++ b/media-tv/plex-media-server/plex-media-server-1.23.1.4602.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit readme.gentoo-r1 systemd unpacker
+
+MY_PV="${PV}-280ab6053"
+MY_URI="https://downloads.plex.tv/plex-media-server-new"
+
+DESCRIPTION="Free media library that is intended for use with a plex client"
+HOMEPAGE="https://www.plex.tv/"
+SRC_URI="
+ amd64? ( ${MY_URI}/${MY_PV}/debian/plexmediaserver_${MY_PV}_amd64.deb )
+ x86? ( ${MY_URI}/${MY_PV}/debian/plexmediaserver_${MY_PV}_i386.deb )"
+S="${WORKDIR}"
+
+LICENSE="Plex"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~x86"
+IUSE="system-openssl"
+RESTRICT="mirror bindist"
+
+DEPEND="
+ acct-group/plex
+ acct-user/plex"
+RDEPEND="
+ ${DEPEND}
+ system-openssl? ( dev-libs/openssl:0/1.1 )"
+
+QA_PREBUILT="*"
+QA_MULTILIB_PATHS=(
+ "usr/lib/plexmediaserver/lib/.*"
+ "usr/lib/plexmediaserver/Resources/Python/lib/python2.7/.*"
+ "usr/lib/plexmediaserver/Resources/Python/lib/python2.7/lib-dynload/_hashlib.so"
+)
+
+src_install() {
+ # Remove Debian specific files
+ rm -r "usr/share/doc" || die
+
+ # Remove shipped openssl library
+ if use system-openssl; then
+ rm usr/lib/plexmediaserver/lib/libssl.so.1.1 || die
+ fi
+
+ # Add startup wrapper
+ dosbin "${FILESDIR}/start_pms"
+
+ # Copy main files over to image and preserve permissions so it is portable
+ cp -rp usr/ "${ED}" || die
+
+ # Make sure the logging directory is created
+ keepdir /var/log/pms
+ fowners plex:plex /var/log/pms
+
+ keepdir /var/lib/plexmediaserver
+ fowners plex:plex /var/lib/plexmediaserver
+
+ newinitd "${FILESDIR}/${PN}.init.d" ${PN}
+ newconfd "${FILESDIR}/${PN}.conf.d" ${PN}
+
+ systemd_dounit "${ED}"/usr/lib/plexmediaserver/lib/plexmediaserver.service
+ keepdir /var/lib/plexmediaserver
+
+ # Adds the precompiled plex libraries to the revdep-rebuild's mask list
+ # so it doesn't try to rebuild libraries that can't be rebuilt.
+ insinto /etc/revdep-rebuild
+ doins "${FILESDIR}"/80plexmediaserver
+
+ readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+ readme.gentoo_print_elog
+}