AUX init.d/plex-media-server 413 BLAKE2B f60fe9f653c591cddaf77a0ebcb47218681a63235e82bc016c7d2ee9180df7f6ff24f3784216ea370bdc2d493531492f196200b6ec56ff8b303e69adaa0f108d SHA512 aeb873a00081f20abd27cc76d395908ae0643bd8aa665557adafef2ed97edbe93c18b55818b49227746f9c3ce4b7a81ceb9132f07d8d873bc7b5a932b944a402
AUX plexmediamanager.desktop.new.patch 350 BLAKE2B f52186623be0ee3e4e1414639c69a39cd83f4a45af4854a6bf2c4f6e3d51dab3d16539d554f80dbb432dcb97f6171097677ae9e24486167802d2cf93fe4c2f63 SHA512 e7e97ef8d39ff0e9220026d282febaa2613f8cc96253a9f801f1f2af5c60c3780391cdada98f921cf0226156a2347db982cf814e6aa446b07e9ae6b1b96c9525
AUX plexmediamanager.desktop.patch 346 BLAKE2B 5f1af6247a24d4f8687c0f841417602d72f8d835fe7d3e9021f01c2204ca1fff6a9fe1c6b16b641f77bb3483f2ccf02eed5d3de8f06e149e55c4e6a605a85863 SHA512 dac6f9382309d266e73db98e41deffe6f562b1c06447428e5e6223030d0325369072b4234e6137a06c017efe9af6c0af4b956d390160628b84a161f51901f6a9
+AUX plexmediaserver.service.patch 773 BLAKE2B 85f8457d78027bf6f49dc1864ac4a552e8a0531a5c41b01d98554b77e0eb0e35360c81e51c59d9a52e44f71579837434ec221390bf79f9f1126855e8d115423a SHA512 40b8e510f3059ee462abe37263ca4c065a7075c8c932ee9e2a36318f826fe80d2899c75422769fae640afbcd7031a95358d2ad8f6f46127d8d84c53989f86105
AUX systemd/plex-media-server.service 265 BLAKE2B 7634b0fe15052eac8c40f390157588940ce3f91350cd0b7548a333755a6dcc42888d154dfb1f0e922ad968e548b88d84f83ae5e137693d134316271a55ed8085 SHA512 672db99884aed20b83b5b198c33237cbb398c1084b1412c692b7386cc15f87a5095f33f50ca9da6115afb2c6479bc88d95f674c4446131dc071f5df58b8ed141
AUX virtualenv_start_pms.patch 430 BLAKE2B bfb4839491d8887959cbbc8e5d83fa5c5f7b6d73c293960af06b559ef6c51242b1717abdccf371cd5c81ec45ee07df18fac713381370b218a2f9d0376dd70f53 SHA512 df9ad1e3a3627325ad6b96015b2dfd1e0f92dd4252b788f6eccc5445f7016785b72f34572b7a60011300394b3a3668116929ebb2c9a5525e37d7c211e198d0e7
DIST plexmediaserver_1.18.6.2348-fd90a1389_amd64.deb 87558254 BLAKE2B 6563285a628b829e63f7857e893ea5fb970ea2fe86e95538d73a37860ff232da996fc448460776ae5d989bacbcd32cd4ed3c22a2a9fc3637ae422b5a6f2b5276 SHA512 e3c76b7a82dc7a94ea990ae852f040938f2cb03c9aa615ab8cd3d48d594548bad958ca52bfa54bdd26f4c43301c7e11494f04f7287977eede839aec788eb4bec
DIST plexmediaserver_1.18.6.2348-fd90a1389_i386.deb 73792686 BLAKE2B 8125dd94d4cf07d2a750dbac339cd28e874ab3d2e669c61e972d26ffe5dc0dbe188c00dd884f09d4629b3e725101514cb37a27c22dc9854caf05397e956b34ab SHA512 926a320dcbc994c1db95a69e85c83ac0407f9572fa719ec70ddcc539c0fdd347c042b6500326f3afeb29210905ce85a96cec31fcc454465d43cd5c5ada2df3bb
+DIST plexmediaserver_1.21.0.3608-f7262c352_amd64.deb 80886852 BLAKE2B 5cb5dcf23cf2eb9e2211458e880177c17f4ff3732c788fb35de3b57f335299172678ce7392992db291ce94143c5d8c8f29d7b88ca4f1998d5a0d93f0c505e450 SHA512 c4ed27f50e6628db9e909e513dd7f25af7fe8adeaa1528e00e2f14acb472e404b43e474fe5f60578e611c15ef52b227ae323caa034c185877e6adf397829a0e3
+DIST plexmediaserver_1.21.0.3608-f7262c352_i386.deb 73736686 BLAKE2B 1ea69c1609b8871356f40fa254798f819cf1362a10537acd38677c91a34acc7882dd3a443c01ec9fbb17f74b4878125f8f5305ff7b2c5c6684ca6983a4b414eb SHA512 dc50b4fc6802423bbbfe132947b9c7e384f4738daaac4e1a3ef7d53837e21365beef7322405005b1007723fc69b27aae4602f4e62ff3fa736ecfae50d6be56f7
EBUILD plex-media-server-1.18.6.2348.ebuild 5563 BLAKE2B d60947e4ac19ad5e91ad60a401975124759f480d8a778065bc8ce84fecd0924aa76bf32af764f6ca7c0fe24003e837b855b6ef28885fb43cfe0f9869a8e90319 SHA512 351884cf562cdfd52411e240173a402b3658f58cb69010d6ece62753ddbbc62435df22f9f3f0c31a51205fe65d736b6a9eb94e1c4dde1c4394496289449ffd22
+EBUILD plex-media-server-1.21.0-r1.ebuild 3734 BLAKE2B 590bef323fa5112dad52ee1dd836fc1056bde7c1811ee79c7278645e5763e375bc59b22a1777d6c935af72e1ae1427347183be90fd4e1a796031001907b35d64 SHA512 ed46c8b162777ae6ca2987a00f961791cd4beffe709949096a39a92f69a090d3f65a836b5a0a39b25137ce86f7a5da32652c35851ca72aa119a53ae3ad0cd5e7
MISC metadata.xml 887 BLAKE2B 19b816e57f087e91a25e6c7605280d447342a6978fd7c804fcb2eed79bbe806e9318493c061521f74834fc89d44ce4f78c56de99e2ad35cea39c63cfa123d0f6 SHA512 e174f3cf2c7f28fbd97cf86441e2de227d2b79749b5416dfd9b670c2ff000e882e3b40b4e1613a37fdc2d86377144c9b06f72ae55e76262ffae1ad11b8a87bc0
--- /dev/null
+# 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
+
+MINOR_VERSION="3608-f7262c352"
+_APPNAME="plexmediaserver"
+_USERNAME="plex"
+_SHORTNAME="${_USERNAME}"
+_FULL_VERSION="${PV}.${MINOR_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="0"
+LICENSE="Plex"
+RESTRICT="bindist strip mirror"
+KEYWORDS="-* ~amd64 ~x86"
+
+BDEPEND="dev-util/patchelf"
+
+RDEPEND="
+ acct-group/plex
+ acct-user/plex
+ net-dns/avahi"
+
+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() {
+ # 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 "${ED}"/usr/lib/plexmediaserver/lib/plexmediaserver.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
+}
+
+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
+}