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: Sat, 01 Jul 2017 16:23:32
Message-Id: 1498926178.34e1a909eaeafc661b77703d9a51bfbd4265d466.fearedbliss@gentoo
1 commit: 34e1a909eaeafc661b77703d9a51bfbd4265d466
2 Author: Jonathan Vasquez <fearedbliss <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jul 1 16:22:58 2017 +0000
4 Commit: Jonathan Vasquez <fearedbliss <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 1 16:22:58 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34e1a909
7
8 media-tv/plex-media-server: version bump to 1.7.5
9
10 Package-Manager: Portage-2.3.6, Repoman-2.3.2
11
12 media-tv/plex-media-server/Manifest | 1 +
13 .../plex-media-server-1.7.5.ebuild | 135 +++++++++++++++++++++
14 2 files changed, 136 insertions(+)
15
16 diff --git a/media-tv/plex-media-server/Manifest b/media-tv/plex-media-server/Manifest
17 index 52bb66cc30a..be3aaf7454b 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.5.6.3790-4613ce077_amd64.deb 105490284 SHA256 633a7fad995347fed1b22dd6983156d24ac95659d541ee4cf8eea505d4cc5575 SHA512 87173c290937706f05461b7ca3b217e09262ec02b0fa728580c18802e3b7246899f2840fdd6703256e32cd92adb71e3d5321c0a38569827f005eb1face9144f7 WHIRLPOOL d9de5e1a90e8644aa14702e034d1799cd1f1fab1c7c730a2334bdac6e1c90a44a0febdfdb42ab791a728bf6daf9baf655c3f2dd82ff9632a86340a9e9aef38e9
22 +DIST plexmediaserver_1.7.5.4035-313f93718_amd64.deb 106646674 SHA256 a8c9d2961443c22c85b2795f267bafe576561d365a85d18a97627508a3515844 SHA512 033296004a57c0b7ded412298e7bb2c817ca5c4276683115e0bfb88ecb3445355745ef8216aa4ec92926a3f3ff5ae813470ad4a2edc7f85ed32386e363e76203 WHIRLPOOL 912b2057f71f51a3820a5e660f8726af000165a72ea36f480a62786057cf1e7c42f20741119cd7de14565360d45b6e6c6888ae2cc6ccdc67e7f1d7b8da54c530
23
24 diff --git a/media-tv/plex-media-server/plex-media-server-1.7.5.ebuild b/media-tv/plex-media-server/plex-media-server-1.7.5.ebuild
25 new file mode 100644
26 index 00000000000..6049473e6e8
27 --- /dev/null
28 +++ b/media-tv/plex-media-server/plex-media-server-1.7.5.ebuild
29 @@ -0,0 +1,135 @@
30 +# Copyright 1999-2017 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="4035-313f93718"
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 + _handle_multilib
117 +
118 + # Install systemd service file
119 + local INIT_NAME="${PN}.service"
120 + local INIT="${FILESDIR}/systemd/${INIT_NAME}"
121 + systemd_newunit "${INIT}" "${INIT_NAME}"
122 +
123 + _remove_execstack_markings
124 + _add_pax_markings
125 +
126 + einfo "Configuring virtualenv"
127 + virtualenv -v --no-pip --no-setuptools --no-wheel "${ED}"usr/lib/plexmediaserver/Resources/Python || die
128 + pushd "${ED}"usr/lib/plexmediaserver/Resources/Python &>/dev/null || die
129 + find . -type f -exec sed -i -e "s#${D}##g" {} + || die
130 + popd &>/dev/null || die
131 +}
132 +
133 +pkg_postinst() {
134 + einfo ""
135 + elog "Plex Media Server is now installed. Please check the configuration file in /etc/${_SHORTNAME}/${_APPNAME} to verify the default settings."
136 + 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/"
137 +}
138 +
139 +# Finds out where the library directory is for this system
140 +# and handles ldflags as to not break library dependencies
141 +# during rebuilds.
142 +_handle_multilib() {
143 + # Prevent revdep-rebuild, @preserved-rebuild breakage
144 + cat > "${T}"/66plex <<-EOF || die
145 + LDPATH="${EPREFIX}/usr/$(get_libdir)/plexmediaserver"
146 + EOF
147 +
148 + doenvd "${T}"/66plex
149 +}
150 +
151 +# Remove execstack flags from some libraries/executables so that it works in hardened setups.
152 +_remove_execstack_markings() {
153 + for f in "${EXECSTACKED_BINS[@]}"; do
154 + # Unquoting 'f' so that expansion works.
155 + fix-gnustack -f ${f} > /dev/null
156 + done
157 +}
158 +
159 +# Add pax markings to some binaries so that they work on hardened setup.
160 +_add_pax_markings() {
161 + for f in "${BINS_TO_PAX_MARK[@]}"; do
162 + pax-mark m "${f}"
163 + done
164 +}