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: Mon, 26 Mar 2018 00:58:25
Message-Id: 1522025760.72bde8547f7f70c1e91489d01546ec80cc8d14b6.fearedbliss@gentoo
1 commit: 72bde8547f7f70c1e91489d01546ec80cc8d14b6
2 Author: Jonathan Vasquez <fearedbliss <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 26 00:56:00 2018 +0000
4 Commit: Jonathan Vasquez <fearedbliss <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 26 00:56:00 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=72bde854
7
8 media-tv/plex-media-server: version bump to 1.12.1
9
10 Package-Manager: Portage-2.3.24, Repoman-2.3.6
11
12 media-tv/plex-media-server/Manifest | 1 +
13 .../plex-media-server-1.12.1.ebuild | 155 +++++++++++++++++++++
14 2 files changed, 156 insertions(+)
15
16 diff --git a/media-tv/plex-media-server/Manifest b/media-tv/plex-media-server/Manifest
17 index bda59a727a4..0f4906e0fc1 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.11.3.4803-c40bba82e_amd64.deb 108830880 BLAKE2B 7ed912756b8bdedb695c4cbf99d0565da53904814cedb8e026614b8db9bb638cbd437f35e05915d6d22221c87ecf1136ea9ae08797bca2ebbe4f2e0a861b4841 SHA512 0bda324e733b1e86e8dba7c10f6bab3e9dad5463113c5998059492bd7d4a49e105068d1d9313c9405d7a3c85c99e6528be6c0f1c9f52db115a1da1545a9485b5
22 +DIST plexmediaserver_1.12.1.4885-1046ba85f_amd64.deb 109238814 BLAKE2B 52f44e4531c3ffb4a7f6d6cc5fdaed97ce3b44a7469074c6c4e81a5a9991b7a371a40a3d4db30f8cab5e10ae6caeb9798822c541dc27b1f5597d464fdd0292c2 SHA512 8125fa8132b6ed928f08660ddbff6dd8855719c0833c4c2b5dc8193674d8d22148f95848ce8b500612b12379efbc6e180ea72b2f90d695e1bf40ba2705def8a4
23
24 diff --git a/media-tv/plex-media-server/plex-media-server-1.12.1.ebuild b/media-tv/plex-media-server/plex-media-server-1.12.1.ebuild
25 new file mode 100644
26 index 00000000000..3997a207e48
27 --- /dev/null
28 +++ b/media-tv/plex-media-server/plex-media-server-1.12.1.ebuild
29 @@ -0,0 +1,155 @@
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="4885-1046ba85f"
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 + keepdir "${LOGGING_DIR}"
107 +
108 + # Create default library folder with correct permissions
109 + local DEFAULT_LIBRARY_DIR="/var/lib/${_APPNAME}"
110 + dodir "${DEFAULT_LIBRARY_DIR}"
111 + chown "${_USERNAME}":"${_USERNAME}" "${ED%/}/${DEFAULT_LIBRARY_DIR}" || die
112 + keepdir "${DEFAULT_LIBRARY_DIR}"
113 +
114 + # Install the OpenRC init/conf files
115 + doinitd "${FILESDIR}/init.d/${PN}"
116 + doconfd "${FILESDIR}/conf.d/${PN}"
117 +
118 + # Disabling due to Bug 644694
119 + #_handle_multilib
120 +
121 + # Mask Plex libraries so that revdep-rebuild doesn't try to rebuild them.
122 + # Plex has its own precompiled libraries.
123 + _mask_plex_libraries_revdep
124 +
125 + # Install systemd service file
126 + local INIT_NAME="${PN}.service"
127 + local INIT="${FILESDIR}/systemd/${INIT_NAME}"
128 + systemd_newunit "${INIT}" "${INIT_NAME}"
129 +
130 + _remove_execstack_markings
131 + _add_pax_markings
132 +
133 + einfo "Configuring virtualenv"
134 + virtualenv -v --no-pip --no-setuptools --no-wheel "${ED}"usr/lib/plexmediaserver/Resources/Python || die
135 + pushd "${ED}"usr/lib/plexmediaserver/Resources/Python &>/dev/null || die
136 + find . -type f -exec sed -i -e "s#${D}##g" {} + || die
137 + popd &>/dev/null || die
138 +}
139 +
140 +pkg_postinst() {
141 + einfo ""
142 + elog "Plex Media Server is now installed. Please check the configuration file in /etc/${_SHORTNAME}/${_APPNAME} to verify the default settings."
143 + 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/"
144 +}
145 +
146 +# Disabling the follow function due to Bug 644694.
147 +# We shouldn't register plex libraries in global
148 +# library path since this will cause other packages
149 +# on the system to break.
150 +
151 +# Finds out where the library directory is for this system
152 +# and handles ldflags as to not break library dependencies
153 +# during rebuilds.
154 +_handle_multilib() {
155 + # Prevent revdep-rebuild, @preserved-rebuild breakage
156 + cat > "${T}"/66plex <<-EOF || die
157 + LDPATH="${EPREFIX}/usr/$(get_libdir)/plexmediaserver"
158 + EOF
159 +
160 + doenvd "${T}"/66plex
161 +}
162 +
163 +# Adds the precompiled plex libraries to the revdep-rebuild's mask list
164 +# so it doesn't try to rebuild libraries that can't be rebuilt.
165 +_mask_plex_libraries_revdep() {
166 + dodir /etc/revdep-rebuild/
167 + echo "SEARCH_DIRS_MASK=\"${EPREFIX}/usr/$(get_libdir)/plexmediaserver\"" > "${ED}"/etc/revdep-rebuild/80plexmediaserver
168 +}
169 +
170 +# Remove execstack flags from some libraries/executables
171 +# so that it works in hardened setups.
172 +_remove_execstack_markings() {
173 + for f in "${EXECSTACKED_BINS[@]}"; do
174 + # Unquoting 'f' so that expansion works.
175 + fix-gnustack -f ${f} > /dev/null
176 + done
177 +}
178 +
179 +# Add pax markings to some binaries so that they work on hardened setup.
180 +_add_pax_markings() {
181 + for f in "${BINS_TO_PAX_MARK[@]}"; do
182 + pax-mark m "${f}"
183 + done
184 +}