Gentoo Archives: gentoo-commits

From: Tony Vroon <chainsaw@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-tv/plex-media-server/
Date: Fri, 08 Feb 2019 13:49:04
Message-Id: 1549633732.58fbf17a8c52c49dcfd9568a972b5f9b9a8fd2c2.chainsaw@gentoo
1 commit: 58fbf17a8c52c49dcfd9568a972b5f9b9a8fd2c2
2 Author: Tony Vroon <chainsaw <AT> gentoo <DOT> org>
3 AuthorDate: Fri Feb 8 13:48:38 2019 +0000
4 Commit: Tony Vroon <chainsaw <AT> gentoo <DOT> org>
5 CommitDate: Fri Feb 8 13:48:52 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=58fbf17a
7
8 media-tv/plex-media-server: 1.14.1 version bump
9
10 As per the earlier request by Chris Slycord, bump to most recent version.
11 Taking ebuild review from Jonas Stein into account, bumping EAPI to 7.
12 Various quote-related simplifications as a result.
13
14 Taking maintainership and assigning bugs to me.
15
16 Closes: https://bugs.gentoo.org/661734
17 Signed-Off-By: Tony Vroon <chainsaw <AT> gentoo.org>
18 Package-Manager: Portage-2.3.51, Repoman-2.3.11
19
20 media-tv/plex-media-server/Manifest | 1 +
21 media-tv/plex-media-server/metadata.xml | 5 +-
22 .../plex-media-server-1.14.1.ebuild | 161 +++++++++++++++++++++
23 3 files changed, 166 insertions(+), 1 deletion(-)
24
25 diff --git a/media-tv/plex-media-server/Manifest b/media-tv/plex-media-server/Manifest
26 index 8cd0da75b94..7fea2adddd2 100644
27 --- a/media-tv/plex-media-server/Manifest
28 +++ b/media-tv/plex-media-server/Manifest
29 @@ -1,3 +1,4 @@
30 DIST plexmediaserver_1.11.3.4803-c40bba82e_amd64.deb 108830880 BLAKE2B 7ed912756b8bdedb695c4cbf99d0565da53904814cedb8e026614b8db9bb638cbd437f35e05915d6d22221c87ecf1136ea9ae08797bca2ebbe4f2e0a861b4841 SHA512 0bda324e733b1e86e8dba7c10f6bab3e9dad5463113c5998059492bd7d4a49e105068d1d9313c9405d7a3c85c99e6528be6c0f1c9f52db115a1da1545a9485b5
31 DIST plexmediaserver_1.12.3.4973-215c28d86_amd64.deb 109277946 BLAKE2B 6a868943c77a1355dd0a4dbe88323b937d827dbfe84e729cf1f5c5c7d4a7d44e9af7e69121a7e3cf9f5d60786c9877bd3e303d9d5d301c86f08984afb1062730 SHA512 1befe9196926bf4cabd1f9c746e958efc72392479a844f8c3d9161282618fe28e29dbb9c12ddccf5db5b852ae58cd43dc0d988f00732431e16106021c8618347
32 DIST plexmediaserver_1.13.2.5154-fd05be322_amd64.deb 111093662 BLAKE2B 26b1161107a8f9223f7065ff4119a32470c06794a159a42181b9278107a6d14f9fbb582e515223aaa659e9007d9b18299cd65b2a068e1d7dd934d52552a44cd1 SHA512 548c033272d56f6c54ab073536327b285fdbda3192c203a3ea3ff2b6c7afbc79ba7d56d7251f623ca1e09db572c92000d7baa7a8a555d853d85fdb9d1dfb8479
33 +DIST plexmediaserver_1.14.1.5488-cc260c476_amd64.deb 105175642 BLAKE2B 59f7cc130115ae2179bcf0ddf5ef4583886c11447c423ada2b1da62f83c3840c89aa2b6d9c56e3a358d1da03bc9a6bd340cae7fee1b6da102e9bc785de4f8e27 SHA512 48f25ac27a8dc5d1a4ae74a04793994bb21431ed3069a9808373e0c5a424fd53f577d0912e1e46a155133b094bdafb7edeb5b6c9ef428a08e07e24e055267e86
34
35 diff --git a/media-tv/plex-media-server/metadata.xml b/media-tv/plex-media-server/metadata.xml
36 index bca0744b282..1a06e96ebdc 100644
37 --- a/media-tv/plex-media-server/metadata.xml
38 +++ b/media-tv/plex-media-server/metadata.xml
39 @@ -1,5 +1,8 @@
40 <?xml version="1.0" encoding="UTF-8"?>
41 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
42 <pkgmetadata>
43 - <!-- maintainer-needed -->
44 + <maintainer type="person">
45 + <email>chainsaw@g.o</email>
46 + <name>Tony Vroon</name>
47 + </maintainer>
48 </pkgmetadata>
49
50 diff --git a/media-tv/plex-media-server/plex-media-server-1.14.1.ebuild b/media-tv/plex-media-server/plex-media-server-1.14.1.ebuild
51 new file mode 100644
52 index 00000000000..f37b60268a7
53 --- /dev/null
54 +++ b/media-tv/plex-media-server/plex-media-server-1.14.1.ebuild
55 @@ -0,0 +1,161 @@
56 +# Copyright 1999-2019 Gentoo Authors
57 +# Distributed under the terms of the GNU General Public License v2
58 +
59 +EAPI=7
60 +
61 +PYTHON_COMPAT=( python2_7 )
62 +inherit eutils user systemd unpacker pax-utils python-single-r1
63 +
64 +MINOR_VERSION="5488-cc260c476"
65 +
66 +_APPNAME="plexmediaserver"
67 +_USERNAME="plex"
68 +_SHORTNAME="${_USERNAME}"
69 +_FULL_VERSION="${PV}.${MINOR_VERSION}"
70 +
71 +URI="https://downloads.plex.tv/plex-media-server"
72 +
73 +DESCRIPTION="A free media library that is intended for use with a plex client."
74 +HOMEPAGE="https://www.plex.tv/"
75 +SRC_URI="amd64? ( ${URI}/${_FULL_VERSION}/plexmediaserver_${_FULL_VERSION}_amd64.deb )"
76 +SLOT="0"
77 +LICENSE="Plex"
78 +RESTRICT="bindist strip"
79 +KEYWORDS="-* ~amd64"
80 +REQUIRED_USE="${PYTHON_REQUIRED_USE}"
81 +
82 +DEPEND="
83 + sys-apps/fix-gnustack
84 + dev-python/virtualenv[${PYTHON_USEDEP}]"
85 +
86 +RDEPEND="
87 + net-dns/avahi
88 + ${PYTHON_DEPS}"
89 +
90 +QA_DESKTOP_FILE="usr/share/applications/plexmediamanager.desktop"
91 +QA_PREBUILT="*"
92 +QA_MULTILIB_PATHS=(
93 + "usr/lib/${_APPNAME}/.*"
94 + "usr/lib/${_APPNAME}/Resources/Python/lib/python2.7/.*"
95 +)
96 +
97 +EXECSTACKED_BINS=( "${ED}/usr/lib/plexmediaserver/libgnsdk_dsp.so*" )
98 +BINS_TO_PAX_MARK=( "${ED}/usr/lib/plexmediaserver/Plex Script Host" )
99 +
100 +S="${WORKDIR}"
101 +PATCHES=( "${FILESDIR}/virtualenv_start_pms.patch" )
102 +
103 +pkg_setup() {
104 + enewgroup ${_USERNAME}
105 + enewuser ${_USERNAME} -1 /bin/bash /var/lib/${_APPNAME} "${_USERNAME},video"
106 + python-single-r1_pkg_setup
107 +}
108 +
109 +src_unpack() {
110 + unpack_deb ${A}
111 +}
112 +
113 +src_install() {
114 + # Move the config to the correct place
115 + local CONFIG_VANILLA="/etc/default/plexmediaserver"
116 + local CONFIG_PATH="/etc/${_SHORTNAME}"
117 + dodir "${CONFIG_PATH}"
118 + insinto "${CONFIG_PATH}"
119 + doins "${CONFIG_VANILLA#/}"
120 + sed -e "s#${CONFIG_VANILLA}#${CONFIG_PATH}/${_APPNAME}#g" -i "${S}"/usr/sbin/start_pms || die
121 +
122 + # Remove Debian specific files
123 + rm -rf "usr/share/doc" || die
124 +
125 + # Copy main files over to image and preserve permissions so it is portable
126 + cp -rp usr/ "${ED}"/ || die
127 +
128 + # Make sure the logging directory is created
129 + local LOGGING_DIR="/var/log/pms"
130 + dodir "${LOGGING_DIR}"
131 + chown "${_USERNAME}":"${_USERNAME}" "${ED}/${LOGGING_DIR}" || die
132 + keepdir "${LOGGING_DIR}"
133 +
134 + # Create default library folder with correct permissions
135 + local DEFAULT_LIBRARY_DIR="/var/lib/${_APPNAME}"
136 + dodir "${DEFAULT_LIBRARY_DIR}"
137 + chown "${_USERNAME}":"${_USERNAME}" "${ED}/${DEFAULT_LIBRARY_DIR}" || die
138 + keepdir "${DEFAULT_LIBRARY_DIR}"
139 +
140 + # Install the OpenRC init/conf files
141 + doinitd "${FILESDIR}/init.d/${PN}"
142 + doconfd "${FILESDIR}/conf.d/${PN}"
143 +
144 + # Disabling due to Bug 644694
145 + #_handle_multilib
146 +
147 + # Mask Plex libraries so that revdep-rebuild doesn't try to rebuild them.
148 + # Plex has its own precompiled libraries.
149 + _mask_plex_libraries_revdep
150 +
151 + # Install systemd service file
152 + local INIT_NAME="${PN}.service"
153 + local INIT="${FILESDIR}/systemd/${INIT_NAME}"
154 + systemd_newunit "${INIT}" "${INIT_NAME}"
155 +
156 + _remove_execstack_markings
157 + _add_pax_markings
158 +
159 + einfo "Configuring virtualenv"
160 + virtualenv -v --no-pip --no-setuptools --no-wheel "${ED}"/usr/lib/plexmediaserver/Resources/Python || die
161 + pushd "${ED}"/usr/lib/plexmediaserver/Resources/Python &>/dev/null || die
162 + find . -type f -exec sed -i -e "s#${D}##g" {} + || die
163 + popd &>/dev/null || die
164 +}
165 +
166 +pkg_postinst() {
167 + einfo ""
168 + elog "Plex Media Server is now installed. Please check the configuration file in /etc/${_SHORTNAME}/${_APPNAME} to verify the default settings."
169 + 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/"
170 +}
171 +
172 +# Disabling the follow function due to Bug 644694.
173 +# We shouldn't register plex libraries in global
174 +# library path since this will cause other packages
175 +# on the system to break.
176 +
177 +# Finds out where the library directory is for this system
178 +# and handles ldflags as to not break library dependencies
179 +# during rebuilds.
180 +_handle_multilib() {
181 + # Prevent revdep-rebuild, @preserved-rebuild breakage
182 + cat > "${T}"/66plex <<-EOF || die
183 + LDPATH="${EPREFIX}/usr/$(get_libdir)/plexmediaserver"
184 + EOF
185 +
186 + doenvd "${T}"/66plex
187 +}
188 +
189 +# Adds the precompiled plex libraries to the revdep-rebuild's mask list
190 +# so it doesn't try to rebuild libraries that can't be rebuilt.
191 +_mask_plex_libraries_revdep() {
192 + dodir /etc/revdep-rebuild/
193 +
194 + # Bug: 659702. The upstream plex binary installs its precompiled package to /usr/lib.
195 + # Due to profile 17.1 splitting /usr/lib and /usr/lib64, we can no longer rely
196 + # on the implicit symlink automatically satisfying our revdep requirement when we use $(get_libdir).
197 + # Thus we will match upstream's directory automatically. If upstream switches their location,
198 + # then so should we.
199 + echo "SEARCH_DIRS_MASK=\"${EPREFIX}/usr/lib/plexmediaserver\"" > "${ED}"/etc/revdep-rebuild/80plexmediaserver
200 +}
201 +
202 +# Remove execstack flags from some libraries/executables
203 +# so that it works in hardened setups.
204 +_remove_execstack_markings() {
205 + for f in "${EXECSTACKED_BINS[@]}"; do
206 + # Unquoting 'f' so that expansion works.
207 + fix-gnustack -f ${f} > /dev/null
208 + done
209 +}
210 +
211 +# Add pax markings to some binaries so that they work on hardened setup.
212 +_add_pax_markings() {
213 + for f in "${BINS_TO_PAX_MARK[@]}"; do
214 + pax-mark m "${f}"
215 + done
216 +}