Commit 7938fe35 authored by Root's avatar Root
Browse files

Removed plex. Please use plex-overlay # (https://github.com/comio/plex-overlay)

parent 56b88d09
This diff is collapsed.
AUX add_gentoo_profile_as_platform_version.patch 616 SHA256 b29ec02b808a807a911020d0241d52bdd0838832435e331735480a36b76aa0d8 SHA512 53e99d8a24a23f0c530ab955f5a4a9938c4e06056d3107f899883094690dd9426d0951ea695628351afa3e971a4f59827b6c8dcae323718d24450c74bd78769a WHIRLPOOL 30d2b0d31fef8a7edc18aa40f10de985ac2166c8d3ca9a8300c438628e412e32b859a0cee9d02b8dfb35ce3975cfa50f0d8d52a2c6d1136172698156bc22119a
AUX conf.d/plex-media-server 216 SHA256 d202e6c380248d08a494deabec6087b22d3e0508cbc3bf38e42f822c329662c8 SHA512 d3d68fa58a1c1064803a9607708123302890571e823e5bc26de741bb15bd51db19234636672ff01757cbbcdb984c60663545689fa915761c78c3cf49e6da0f95 WHIRLPOOL 73f4e4ac835c434c7ee3a207d8bcd128510b447df18468b1cf6366fa02cf4dfe3a2299ee1dc40de7fada8d43f0c8ba934b76aa0a821d3de98f18d234e9f87108
AUX etc-plexmediaserver 831 SHA256 0c8d887ff4bd037f5a6c960831cdfc61c652b5c390e3fcba6ad54af2ac7218be SHA512 e833cd4507646d45debe0b352d67f2276a767693081331625df241ddbd4055905d66b0fe2c14838ed1ba25f8cfc6a514ba9d27bafe8aa9322df43a20284a28c7 WHIRLPOOL 12d4c30f2f13455ee74ed9c7000c0700f06dd9e1a20b9b91da0a84b587b290b75be86d37716e246feb0f9cc571b207b1acb0e3704f41fec99f99f4cce122047c
AUX init.d/plex-media-server 413 SHA256 2733006ead10955216f5676722f2af729fdbed13b3de706c37e7baaad9995826 SHA512 aeb873a00081f20abd27cc76d395908ae0643bd8aa665557adafef2ed97edbe93c18b55818b49227746f9c3ce4b7a81ceb9132f07d8d873bc7b5a932b944a402 WHIRLPOOL 4e3b19cad2283861f68bbe1e84bf39541a56aab193fb1e17f63a19e951204639734236437d7c8bb863ed1236d0a1228b5173b53660caa995b6dac91fcec3cfbf
AUX plexmediamanager.desktop.new.patch 350 SHA256 e88ef2072b1e4ab588e590880cef480b2d305dff6d4726862e66f46fe2a45b07 SHA512 e7e97ef8d39ff0e9220026d282febaa2613f8cc96253a9f801f1f2af5c60c3780391cdada98f921cf0226156a2347db982cf814e6aa446b07e9ae6b1b96c9525 WHIRLPOOL c8386454863ac04a75a37094cccc344cc81f17697406d74a47aaeec27256d59eac9be703993a035d99812315ec511c5298a4febbeac2c59cabdc3dabedeeb314
AUX plexmediaserver.service.patch 818 SHA256 31a60a7ae695412518489cb11d2b60580ba8518e38727ee7ecb7306b591facf0 SHA512 18930ad1f610c63ede0df0c53beb39d21d762a09e6427493aa47293c595b96660ace9c780891ce1f49fcbece2324ddec6b0b431c4f82ac32be85fae8e7cd1600 WHIRLPOOL 55cc88940ecc591f89f73ecef1f3a40aa338bc71f49258d82333109b1d8cb2d5f766e97d5b86a458a81212578b3ac90d317016e828faebc04117348e6937b7ad
AUX start_pms 1742 SHA256 c9d8640aa544654f941678eccf4602383ebb562c1a233bab6830da5993215009 SHA512 c21739f8904f2ca82427f0c62a7305ab079f697205ad44ea4071e97d82fd56924abaaec0b4b056fbdf1c047491b7b46c1a711e4339c6bf0d482829185996367d WHIRLPOOL c578c9ec019486074ef8adb0ca2ccc54b7d5c68d56ecb4330d166b7c81c70512cc9ca6e38cb352427328e89963729dc58d584baf24031411fb1f2e98ea333c0f
AUX systemd/plex-media-server.service 159 SHA256 5dfda2be8f0d49990418ef770fde1be352f637eff7e95d04dd8a7801353a7966 SHA512 9066840efa43b127dd0d4b26ea0552894db97bf48f89003258095986e7d4728e05bee2f49de856777ed3d0b5ec41654c14505bc9867b227b754aeecd0529abd6 WHIRLPOOL 7ba1f4d91f5bdd3d9a59235689b6a864804726e6b4a649c7504d2adc5eb333930dd6f17d0f3be9804c79210503063a06a08e2ee5501437b4d06a24d2f2f717cd
DIST plexmediaserver_1.19.3.2764-ef515a800_amd64.deb 91136284 SHA256 a35c95a3071d71c8d036af5f6f96b0c47ba92ff3e96e78206e99550b234a4622 SHA512 6a79fedbab4d3030ecec60d11105a97bcf97c0d323cf0a57e59e8ea6f53c297a48573f71e10d78ea21672582d35e94edfa4435e31f120db2f19fc57e44052405 WHIRLPOOL 397e6d0a387c5cee1a190c284267fc5289d14b1b27f5be357bd1b075afba76eb0f6df3b60526f37a7aa34da120e861759f5504e1806e16feeabd9631287d7819
DIST plexmediaserver_1.19.3.2764-ef515a800_i386.deb 74971816 SHA256 ba38f467192291aec92e9884c2e1d7304fc2cb4992bc10b7921ab68b35710477 SHA512 17addc5710bc4b4f8958c918920c19477cc5fa326442c4709cdb683f04d05c4c672119f79d8c056ace48d21245df64ebbbd3335704407a5f6cf3cf4f20a62099 WHIRLPOOL 28258ab458841415c1d14b741c77bd3cdaa6e74fce864143221e70c2015a9cbb62e614c787e55a58d26309abf7732f44e274aba4980cc9a498e8f185aac52097
DIST plexmediaserver_1.19.3.2793-36efde971_amd64.deb 90866678 SHA256 4aa2a15ec9c84019293da35ccc6780741b90023af76b69bcc39bc3a3b5b4e9db SHA512 e5898005170009105d197a3137272a24ee091532f6779ee2a800f5a10699298f7d6728ab05225491093af91523426e3cdc95bbad7507d6e9dc6d460ad7437f74 WHIRLPOOL 45b8d40430caf9edf331931066385b28115d2689b82c12ef8c0df5b63812e6809ebe23fef8b42f3c5d8a7e7784559c2cee683767f9bb0dff74192d2fcb9dcbee
DIST plexmediaserver_1.19.3.2793-36efde971_i386.deb 74245180 SHA256 e400011ea6241aeacade514446b3d230f19f2dd8544dd1b7c592821defb484e8 SHA512 838ddb91fceb63f687c27ab73644b66d868c12ecf2033d0afc7a9d51c9bc1fdf4f2919d6bcebfdfb4716fd6c0111a0548e9c22ff878b68760bf467793698602d WHIRLPOOL a1754860844f07337a3b5c6a814d393a3400fc6165282114d454e368475636b886e08d14689a34066025d968960e613449feaf58b2674b147d5b59eaf6851b8c
EBUILD plex-media-server-1.19.3.2764.ebuild 4586 SHA256 1495bff592a462f08d007aef792446cf74589bf2acb16adfd8ad7c4bb8b893e3 SHA512 a813041ee05a08e5b6cf2cb205247ad07e2ef57bc81db40b38de447cf5003cc7af4fc304ea77f3d7dc66122a320e4da33a5ee4f2f4c157c6e42f43e7af055c34 WHIRLPOOL 35ea8fc99abd15717806a7c73f699724ae051fc0931d00e95d4154568de7f6249c204e2d1bd2eae62bfdd8ced37b16c9a7b92cb10da9abb63aecc6927b79d3bd
EBUILD plex-media-server-1.19.3.2793.ebuild 4588 SHA256 2517d543cdce90aaf9c5736c0a20c1e2e425c7ab012db1ed6a2200c74ccd03e2 SHA512 8c736ef2957100759e9e01ed3f37feeae4e798d1665c270e97549994ab8d96320ac5d33feaf0e64d05d03132eef909dd4b62d4ff6a26b6506ef4db9db67a8f3e WHIRLPOOL cd59ac2af1a31c2e5c063480eeffabed234f6cafece9f77055a07a6dca0dba4fa1fe5ef24f0abea0ce42b1cc3d5015a426b21216359d43bedd5cb57090d0f5ab
MISC ChangeLog 116187 SHA256 58a0977cb4ee30144dc85ceedf242a399b5e91b979afc141006c24ca59bde67f SHA512 edd9e221920e2e0467e055fe95ef4d91671cdd96984d337fc57381dea49b077f4bcd4dd5fea430f90aa72c6a7b51ffcff7ffe203ee97e86970161614f2618cce WHIRLPOOL a060661676d281c6204e57a610c516ff0de4efcf59c065edc5d340be094c055aa8474e5af5f1d4060b8315bd7e4c2b236cc5f77e30f0cfaf14f5ab7092d8a3cd
MISC metadata.xml 204 SHA256 4a59729f32c56f660840314b13a37f7d224866071518e27d7e0011c9d5f54cc9 SHA512 af986aac43dd32092544662a185f5886ed5a7f0a7c37148513b58423300c8b59912772a37ba7b53c2dde7e1beaa8ae8bf81248d560c4df0b0ae8c5d62ea88c13 WHIRLPOOL 3c0c7ed5a87927c522820e7aa9109af2cb48bd6acb9307f6ec7baecb0c29f41597fdca3e19c6358bf16d08c341b9c301b602debb8f22f23e80fdfae2c56d139c
--- a/usr/sbin/start_pms
+++ b/usr/sbin/start_pms
@@ -4,7 +4,8 @@
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)"
-export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION="$(grep ^VERSION= /etc/os-release|awk -F= '{print $2}'|tr -d \" )"
+GENTOO_PROFILE="`readlink /etc/portage/make.profile`"
+export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION="${GENTOO_PROFILE#.*/profiles/}"
# change these parameters in /etc/plex/plexmediaserver
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
# 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"
# default script for Plex Media Server
# the number of plugins that can run at the same time
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
# ulimit -s $PLEX_MEDIA_SERVER_MAX_STACK_SIZE
export PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000
# where the mediaserver should store the transcodes
export PLEX_MEDIA_SERVER_TMPDIR=/tmp
# uncomment to set it to something else
# export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${HOME}/Library/Application Support"
# the user that PMS should run as, defaults to 'plex'
# note that if you change this you might need to move
# the Application Support directory to not lose your
# media library (match what is in /etc/passwd)
export PLEX_MEDIA_SERVER_USER=plex
# Uncomment this to use syslog for logging instead of
# sending logs to Plex Media Server.log
#export PLEX_MEDIA_SERVER_USE_SYSLOG=true
#!/sbin/openrc-run
depend() {
need avahi-daemon
}
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 $?
}
--- ./usr/share/applications/plexmediaserver.desktop 2019-01-02 13:53:51.000000000 +0100
+++ ./usr/share/applications/plexmediaserver.desktop 2019-01-04 07:52:25.910331212 +0100
@@ -6,4 +6,4 @@
Icon=plexmediaserver
Terminal=false
Type=Application
-Categories=Audio;Music;Video;Player;Media;
+Categories=Audio;Music;Video;Player;AudioVideo;X-Media
--- ./usr/lib/plexmediaserver/lib/plexmediaserver.service.old 2020-01-29 08:50:39.856491924 +0100
+++ ./usr/lib/plexmediaserver/lib/plexmediaserver.service 2020-01-29 08:51:49.068249688 +0100
@@ -12,7 +12,8 @@
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)"; \
-export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION="$(grep ^VERSION= /etc/os-release | awk -F= "{print \\$2}" | tr -d \\" )"; \
+export GENTOO_PROFILE="`readlink /etc/portage/make.profile`"; \
+export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION="$${GENTOO_PROFILE#.*/profiles/}"; \
export LD_LIBRARY_PATH=/usr/lib/plexmediaserver/lib; \
exec "/usr/lib/plexmediaserver/Plex Media Server"'
Type=simple
#!/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/plex/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 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/plex/plexmediaserver && . /etc/plex/plexmediaserver
# Silently support PLEX_USER if provided as override
if [ "$PLEX_USER" != "" ]; then
export PLEX_MEDIA_SERVER_USER="$PLEX_USER"
fi
# Activate python virtualenv
. "${PLEX_MEDIA_SERVER_HOME}"/Resources/Python/bin/activate
# 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
(cd /usr/lib/plexmediaserver; exec ./Plex\ Media\ Server)
[Unit]
Description=Plex Media Server
After=network.target
[Service]
Type=simple
User=plex
ExecStart=/usr/sbin/start_pms
[Install]
WantedBy=multi-user.target
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer>
<email>fkmclane@gmail.com</email>
</maintainer>
</pkgmetadata>
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python2_7 )
inherit eutils systemd unpacker pax-utils python-single-r1
HASH_VERSION="ef515a800"
_APPNAME="plexmediaserver"
_USERNAME="plex"
_SHORTNAME="${_USERNAME}"
_FULL_VERSION="${PV}-${HASH_VERSION}"
URI="https://downloads.plex.tv/plex-media-server-new"
DESCRIPTION="A free media library that is intended for use with a plex client"
HOMEPAGE="https://www.plex.tv/"
SRC_URI="
amd64? ( ${URI}/${_FULL_VERSION}/debian/plexmediaserver_${_FULL_VERSION}_amd64.deb )
x86? ( ${URI}/${_FULL_VERSION}/debian/plexmediaserver_${_FULL_VERSION}_i386.deb )
"
SLOT="public"
LICENSE="Plex"
RESTRICT="bindist strip"
KEYWORDS="-* ~amd64"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
DEPEND="
$(python_gen_cond_dep '
dev-python/virtualenv[${PYTHON_MULTI_USEDEP}]
')"
BDEPEND="dev-util/patchelf"
RDEPEND="
acct-group/plex
acct-user/plex
net-dns/avahi
${PYTHON_DEPS}"
if [ ${SLOT} = "plexpass" ]; then
RDEPEND="${RDEPEND}
!media-tv/plex-media-server:public
"
elif [ ${SLOT} = "public" ]; then
RDEPEND="${RDEPEND}
!media-tv/plex-media-server:plexpass
"
fi
QA_DESKTOP_FILE="usr/share/applications/plexmediamanager.desktop"
QA_PREBUILT="*"
QA_MULTILIB_PATHS=(
"usr/lib/${_APPNAME}/.*"
"usr/lib/${_APPNAME}/Resources/Python/lib/python2.7/.*"
)
BINS_TO_PAX_MARK=(
"${ED}/usr/lib/plexmediaserver/Plex Script Host"
"${ED}/usr/lib/plexmediaserver/Plex Media Scanner"
)
S="${WORKDIR}"
PATCHES=(
"${FILESDIR}/plexmediamanager.desktop.new.patch"
"${FILESDIR}/plexmediaserver.service.patch"
)
src_unpack() {
unpack_deb ${A}
}
src_install() {
# Install base config file
insinto "/etc/plex/"
newins "${FILESDIR}/etc-plexmediaserver" "plexmediaserver"
# Remove Debian apt repo files
rm -r "etc/apt" || die
# Remove Debian specific files
rm -r "usr/share/doc" || die
# 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
local logging_dir="/var/log/pms"
dodir "${logging_dir}"
fowners "${_USERNAME}":"${_USERNAME}" "${logging_dir}"
keepdir "${logging_dir}"
# Create default library folder with correct permissions
local default_library_dir="/var/lib/${_APPNAME}"
dodir "${default_library_dir}"
fowners "${_USERNAME}":"${_USERNAME}" "${default_library_dir}"
keepdir "${default_library_dir}"
# Install the OpenRC init/conf files
doinitd "${FILESDIR}/init.d/${PN}"
doconfd "${FILESDIR}/conf.d/${PN}"
# Mask Plex libraries so that revdep-rebuild doesn't try to rebuild them.
# Plex has its own precompiled libraries.
_mask_plex_libraries_revdep
# Fix RPATH
patchelf --force-rpath --set-rpath '$ORIGIN:$ORIGIN/../../../../../../lib' "${ED}"/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/lib-dynload/_codecs_kr.so || die
# Install systemd service file
systemd_newunit "${FILESDIR}/systemd/${PN}.service" "${PN}.service"
# Add pax markings to some binaries so that they work on hardened setup
for f in "${BINS_TO_PAX_MARK[@]}"; do
pax-mark m "${f}"
done
# Install start_pms script
into /usr
dosbin "${FILESDIR}/start_pms"
einfo "Configuring virtualenv"
virtualenv -v --no-pip --no-setuptools --no-wheel "${ED}"/usr/lib/plexmediaserver/Resources/Python || die
pushd "${ED}"/usr/lib/plexmediaserver/Resources/Python &>/dev/null || die
find . -type f -exec sed -i -e "s#${D}##g" {} + || die
popd &>/dev/null || die
}
pkg_postinst() {
elog "Plex Media Server is now installed. Please check the configuration"
elog "file in /etc/${_SHORTNAME}/${_APPNAME}"
elog "to verify the default settings."
elog "To start the Plex Server, run 'rc-config start plex-media-server',"
elog "you will then be able to access your library at"
elog "http://<ip>:32400/web/"
}
# 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.
_mask_plex_libraries_revdep() {
dodir /etc/revdep-rebuild/
# Bug: 659702. The upstream plex binary installs its precompiled package to /usr/lib.
# Due to profile 17.1 splitting /usr/lib and /usr/lib64, we can no longer rely
# on the implicit symlink automatically satisfying our revdep requirement when we use $(get_libdir).
# Thus we will match upstream's directory automatically. If upstream switches their location,
# then so should we.
echo "SEARCH_DIRS_MASK=\"${EPREFIX}/usr/lib/plexmediaserver\"" > "${ED}"/etc/revdep-rebuild/80plexmediaserver
}
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python2_7 )
inherit eutils systemd unpacker pax-utils python-single-r1
HASH_VERSION="36efde971"
_APPNAME="plexmediaserver"
_USERNAME="plex"
_SHORTNAME="${_USERNAME}"
_FULL_VERSION="${PV}-${HASH_VERSION}"
URI="https://downloads.plex.tv/plex-media-server-new"
DESCRIPTION="A free media library that is intended for use with a plex client"
HOMEPAGE="https://www.plex.tv/"
SRC_URI="
amd64? ( ${URI}/${_FULL_VERSION}/debian/plexmediaserver_${_FULL_VERSION}_amd64.deb )
x86? ( ${URI}/${_FULL_VERSION}/debian/plexmediaserver_${_FULL_VERSION}_i386.deb )
"
SLOT="plexpass"
LICENSE="Plex"
RESTRICT="bindist strip"
KEYWORDS="-* ~amd64"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"
DEPEND="
$(python_gen_cond_dep '
dev-python/virtualenv[${PYTHON_MULTI_USEDEP}]
')"
BDEPEND="dev-util/patchelf"
RDEPEND="
acct-group/plex
acct-user/plex
net-dns/avahi
${PYTHON_DEPS}"
if [ ${SLOT} = "plexpass" ]; then
RDEPEND="${RDEPEND}
!media-tv/plex-media-server:public
"
elif [ ${SLOT} = "public" ]; then
RDEPEND="${RDEPEND}
!media-tv/plex-media-server:plexpass
"
fi
QA_DESKTOP_FILE="usr/share/applications/plexmediamanager.desktop"
QA_PREBUILT="*"
QA_MULTILIB_PATHS=(
"usr/lib/${_APPNAME}/.*"
"usr/lib/${_APPNAME}/Resources/Python/lib/python2.7/.*"
)
BINS_TO_PAX_MARK=(
"${ED}/usr/lib/plexmediaserver/Plex Script Host"
"${ED}/usr/lib/plexmediaserver/Plex Media Scanner"
)
S="${WORKDIR}"
PATCHES=(
"${FILESDIR}/plexmediamanager.desktop.new.patch"
"${FILESDIR}/plexmediaserver.service.patch"
)
src_unpack() {
unpack_deb ${A}
}
src_install() {
# Install base config file
insinto "/etc/plex/"
newins "${FILESDIR}/etc-plexmediaserver" "plexmediaserver"
# Remove Debian apt repo files
rm -r "etc/apt" || die
# Remove Debian specific files
rm -r "usr/share/doc" || die
# 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
local logging_dir="/var/log/pms"
dodir "${logging_dir}"
fowners "${_USERNAME}":"${_USERNAME}" "${logging_dir}"
keepdir "${logging_dir}"
# Create default library folder with correct permissions
local default_library_dir="/var/lib/${_APPNAME}"
dodir "${default_library_dir}"
fowners "${_USERNAME}":"${_USERNAME}" "${default_library_dir}"
keepdir "${default_library_dir}"
# Install the OpenRC init/conf files
doinitd "${FILESDIR}/init.d/${PN}"
doconfd "${FILESDIR}/conf.d/${PN}"
# Mask Plex libraries so that revdep-rebuild doesn't try to rebuild them.
# Plex has its own precompiled libraries.
_mask_plex_libraries_revdep
# Fix RPATH
patchelf --force-rpath --set-rpath '$ORIGIN:$ORIGIN/../../../../../../lib' "${ED}"/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/lib-dynload/_codecs_kr.so || die
# Install systemd service file
systemd_newunit "${FILESDIR}/systemd/${PN}.service" "${PN}.service"
# Add pax markings to some binaries so that they work on hardened setup
for f in "${BINS_TO_PAX_MARK[@]}"; do
pax-mark m "${f}"
done
# Install start_pms script
into /usr
dosbin "${FILESDIR}/start_pms"
einfo "Configuring virtualenv"
virtualenv -v --no-pip --no-setuptools --no-wheel "${ED}"/usr/lib/plexmediaserver/Resources/Python || die
pushd "${ED}"/usr/lib/plexmediaserver/Resources/Python &>/dev/null || die
find . -type f -exec sed -i -e "s#${D}##g" {} + || die
popd &>/dev/null || die
}
pkg_postinst() {
elog "Plex Media Server is now installed. Please check the configuration"
elog "file in /etc/${_SHORTNAME}/${_APPNAME}"
elog "to verify the default settings."
elog "To start the Plex Server, run 'rc-config start plex-media-server',"
elog "you will then be able to access your library at"
elog "http://<ip>:32400/web/"
}
# 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.
_mask_plex_libraries_revdep() {
dodir /etc/revdep-rebuild/
# Bug: 659702. The upstream plex binary installs its precompiled package to /usr/lib.
# Due to profile 17.1 splitting /usr/lib and /usr/lib64, we can no longer rely
# on the implicit symlink automatically satisfying our revdep requirement when we use $(get_libdir).
# Thus we will match upstream's directory automatically. If upstream switches their location,
# then so should we.
echo "SEARCH_DIRS_MASK=\"${EPREFIX}/usr/lib/plexmediaserver\"" > "${ED}"/etc/revdep-rebuild/80plexmediaserver
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment