Gentoo Archives: gentoo-commits

From: Jonathan Vasquez <fearedbliss@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-tv/plex-media-server/
Date: Tue, 27 Feb 2018 01:22:53
Message-Id: 1519694544.67828fe1c9b5e418c6a6280dd36c2a85985301be.fearedbliss@gentoo
1 commit: 67828fe1c9b5e418c6a6280dd36c2a85985301be
2 Author: Jonathan Vasquez <fearedbliss <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 27 01:22:24 2018 +0000
4 Commit: Jonathan Vasquez <fearedbliss <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 27 01:22:24 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=67828fe1
7
8 media-tv/plex-media-server: version bump to 1.11.3
9
10 Package-Manager: Portage-2.3.21, Repoman-2.3.6
11
12 media-tv/plex-media-server/Manifest | 1 +
13 .../plex-media-server-1.11.3.ebuild | 153 +++++++++++++++++++++
14 2 files changed, 154 insertions(+)
15
16 diff --git a/media-tv/plex-media-server/Manifest b/media-tv/plex-media-server/Manifest
17 index 3731189161f..807cb4e4e31 100644
18 --- a/media-tv/plex-media-server/Manifest
19 +++ b/media-tv/plex-media-server/Manifest
20 @@ -1 +1,2 @@
21 DIST plexmediaserver_1.10.1.4602-f54242b6b_amd64.deb 108445778 BLAKE2B 8c71bbc7a90d5465aa23b4ddaddbec8ccc81f7e5f09e2e3b98a878c5375158381c5fc20fd6542a3a9e642007ab06045eb3afe210ef5f16a5f60f1d3abd8c3fe7 SHA512 16f3f28e1ba409b141c8f2f7ecb912bcf47485e68d8e813c4908465407d8e6e3c455e6358538445e06b73380f82c46a5b29e6d02d4b4576407dc8d7bc0644b38
22 +DIST plexmediaserver_1.11.3.4803-c40bba82e_amd64.deb 108830880 BLAKE2B 7ed912756b8bdedb695c4cbf99d0565da53904814cedb8e026614b8db9bb638cbd437f35e05915d6d22221c87ecf1136ea9ae08797bca2ebbe4f2e0a861b4841 SHA512 0bda324e733b1e86e8dba7c10f6bab3e9dad5463113c5998059492bd7d4a49e105068d1d9313c9405d7a3c85c99e6528be6c0f1c9f52db115a1da1545a9485b5
23
24 diff --git a/media-tv/plex-media-server/plex-media-server-1.11.3.ebuild b/media-tv/plex-media-server/plex-media-server-1.11.3.ebuild
25 new file mode 100644
26 index 00000000000..b9c6e337a7b
27 --- /dev/null
28 +++ b/media-tv/plex-media-server/plex-media-server-1.11.3.ebuild
29 @@ -0,0 +1,153 @@
30 +# Copyright 1999-2018 Gentoo Foundation
31 +# Distributed under the terms of the GNU General Public License v2
32 +
33 +EAPI=6
34 +
35 +PYTHON_COMPAT=( python2_7 )
36 +inherit eutils user systemd unpacker pax-utils python-single-r1
37 +
38 +MINOR_VERSION="4803-c40bba82e"
39 +
40 +_APPNAME="plexmediaserver"
41 +_USERNAME="plex"
42 +_SHORTNAME="${_USERNAME}"
43 +_FULL_VERSION="${PV}.${MINOR_VERSION}"
44 +
45 +URI="https://downloads.plex.tv/plex-media-server"
46 +
47 +DESCRIPTION="A free media library that is intended for use with a plex client."
48 +HOMEPAGE="http://www.plex.tv/"
49 +SRC_URI="amd64? ( ${URI}/${_FULL_VERSION}/plexmediaserver_${_FULL_VERSION}_amd64.deb )"
50 +SLOT="0"
51 +LICENSE="Plex"
52 +RESTRICT="bindist strip"
53 +KEYWORDS="-* ~amd64"
54 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
55 +
56 +DEPEND="
57 + sys-apps/fix-gnustack
58 + dev-python/virtualenv[${PYTHON_USEDEP}]"
59 +
60 +RDEPEND="
61 + net-dns/avahi
62 + ${PYTHON_DEPS}"
63 +
64 +QA_DESKTOP_FILE="usr/share/applications/plexmediamanager.desktop"
65 +QA_PREBUILT="*"
66 +QA_MULTILIB_PATHS=(
67 + "usr/lib/${_APPNAME}/.*"
68 + "usr/lib/${_APPNAME}/Resources/Python/lib/python2.7/.*"
69 +)
70 +
71 +EXECSTACKED_BINS=( "${ED%/}/usr/lib/plexmediaserver/libgnsdk_dsp.so*" )
72 +BINS_TO_PAX_MARK=( "${ED%/}/usr/lib/plexmediaserver/Plex Script Host" )
73 +
74 +S="${WORKDIR}"
75 +PATCHES=( "${FILESDIR}/virtualenv_start_pms.patch" )
76 +
77 +pkg_setup() {
78 + enewgroup ${_USERNAME}
79 + enewuser ${_USERNAME} -1 /bin/bash /var/lib/${_APPNAME} "${_USERNAME},video"
80 + python-single-r1_pkg_setup
81 +}
82 +
83 +src_unpack() {
84 + unpack_deb ${A}
85 +}
86 +
87 +src_install() {
88 + # Move the config to the correct place
89 + local CONFIG_VANILLA="/etc/default/plexmediaserver"
90 + local CONFIG_PATH="/etc/${_SHORTNAME}"
91 + dodir "${CONFIG_PATH}"
92 + insinto "${CONFIG_PATH}"
93 + doins "${CONFIG_VANILLA#/}"
94 + sed -e "s#${CONFIG_VANILLA}#${CONFIG_PATH}/${_APPNAME}#g" -i "${S}"/usr/sbin/start_pms || die
95 +
96 + # Remove Debian specific files
97 + rm -rf "usr/share/doc" || die
98 +
99 + # Copy main files over to image and preserve permissions so it is portable
100 + cp -rp usr/ "${ED}" || die
101 +
102 + # Make sure the logging directory is created
103 + local LOGGING_DIR="/var/log/pms"
104 + dodir "${LOGGING_DIR}"
105 + chown "${_USERNAME}":"${_USERNAME}" "${ED%/}/${LOGGING_DIR}" || die
106 +
107 + # Create default library folder with correct permissions
108 + local DEFAULT_LIBRARY_DIR="/var/lib/${_APPNAME}"
109 + dodir "${DEFAULT_LIBRARY_DIR}"
110 + chown "${_USERNAME}":"${_USERNAME}" "${ED%/}/${DEFAULT_LIBRARY_DIR}" || die
111 +
112 + # Install the OpenRC init/conf files
113 + doinitd "${FILESDIR}/init.d/${PN}"
114 + doconfd "${FILESDIR}/conf.d/${PN}"
115 +
116 + # Disabling due to Bug 644694
117 + #_handle_multilib
118 +
119 + # Mask Plex libraries so that revdep-rebuild doesn't try to rebuild them.
120 + # Plex has its own precompiled libraries.
121 + _mask_plex_libraries_revdep
122 +
123 + # Install systemd service file
124 + local INIT_NAME="${PN}.service"
125 + local INIT="${FILESDIR}/systemd/${INIT_NAME}"
126 + systemd_newunit "${INIT}" "${INIT_NAME}"
127 +
128 + _remove_execstack_markings
129 + _add_pax_markings
130 +
131 + einfo "Configuring virtualenv"
132 + virtualenv -v --no-pip --no-setuptools --no-wheel "${ED}"usr/lib/plexmediaserver/Resources/Python || die
133 + pushd "${ED}"usr/lib/plexmediaserver/Resources/Python &>/dev/null || die
134 + find . -type f -exec sed -i -e "s#${D}##g" {} + || die
135 + popd &>/dev/null || die
136 +}
137 +
138 +pkg_postinst() {
139 + einfo ""
140 + elog "Plex Media Server is now installed. Please check the configuration file in /etc/${_SHORTNAME}/${_APPNAME} to verify the default settings."
141 + elog "To start the Plex Server, run 'rc-config start plex-media-server', you will then be able to access your library at http://<ip>:32400/web/"
142 +}
143 +
144 +# Disabling the follow function due to Bug 644694.
145 +# We shouldn't register plex libraries in global
146 +# library path since this will cause other packages
147 +# on the system to break.
148 +
149 +# Finds out where the library directory is for this system
150 +# and handles ldflags as to not break library dependencies
151 +# during rebuilds.
152 +_handle_multilib() {
153 + # Prevent revdep-rebuild, @preserved-rebuild breakage
154 + cat > "${T}"/66plex <<-EOF || die
155 + LDPATH="${EPREFIX}/usr/$(get_libdir)/plexmediaserver"
156 + EOF
157 +
158 + doenvd "${T}"/66plex
159 +}
160 +
161 +# Adds the precompiled plex libraries to the revdep-rebuild's mask list
162 +# so it doesn't try to rebuild libraries that can't be rebuilt.
163 +_mask_plex_libraries_revdep() {
164 + dodir /etc/revdep-rebuild/
165 + echo "SEARCH_DIRS_MASK=\"${EPREFIX}/usr/$(get_libdir)/plexmediaserver\"" > "${ED}"/etc/revdep-rebuild/80plexmediaserver
166 +}
167 +
168 +# Remove execstack flags from some libraries/executables
169 +# so that it works in hardened setups.
170 +_remove_execstack_markings() {
171 + for f in "${EXECSTACKED_BINS[@]}"; do
172 + # Unquoting 'f' so that expansion works.
173 + fix-gnustack -f ${f} > /dev/null
174 + done
175 +}
176 +
177 +# Add pax markings to some binaries so that they work on hardened setup.
178 +_add_pax_markings() {
179 + for f in "${BINS_TO_PAX_MARK[@]}"; do
180 + pax-mark m "${f}"
181 + done
182 +}