megacoffee.net Gentoo overlay - legacy mirror
We have moved to Git. This repository is only provided for compatibility with old installations. Learn how to migrate your installation here.
annotate media-tv/plex-media-server/plex-media-server-0.9.8.10.ebuild @ 46:eb18995b21f7
updated pms ebuilds
author | gsnerf <gsnerf@gsnerf.de> |
---|---|
date | Sun, 24 Nov 2013 15:52:29 +0100 |
parents | |
children |
rev | line source |
---|---|
46 | 1 # Copyright 1999-2011 Gentoo Foundation |
2 # Distributed under the terms of the GNU General Public License v2 | |
3 # $Header: $ | |
4 | |
5 EAPI="2" | |
6 | |
7 inherit eutils | |
8 | |
9 MAGIC="215-020456b" | |
10 # URI_PRE="http://plexapp.com/repo/pool/main/p/plexmediaserver/plexmediaserver_${PV}.${MAGIC}_" | |
11 # this does not seem to work atm(/anymore?) | |
12 # http://downloads.plexapp.com/plex-media-server/0.9.8.6.175-88ffbb2/plexmediaserver_0.9.8.6.175-88ffbb2_amd64.deb | |
13 URI_PRE="http://downloads.plexapp.com/plex-media-server/${PV}.${MAGIC}/plexmediaserver_${PV}.${MAGIC}_" | |
14 | |
15 DESCRIPTION="Plex Media Server is a free media library that is intended for use with a plex client available for OS X, iOS and Android systems. It is a standalone product which can be used in conjunction with every program, that knows the API. For managing the library a web based interface is provided." | |
16 HOMEPAGE="http://www.plexapp.com/" | |
17 KEYWORDS="-* ~x86 ~amd64" | |
18 SRC_URI="x86? ( ${URI_PRE}i386.deb ) | |
19 amd64? ( ${URI_PRE}amd64.deb )" | |
20 SLOT="0" | |
21 LICENSE="PMS-License" | |
22 IUSE="" | |
23 RESTRICT="mirror" | |
24 | |
25 RDEPEND="net-dns/avahi" | |
26 DEPEND="${RDEPEND}" | |
27 | |
28 INIT_SCRIPT="${ROOT}/etc/init/plexmediaserver" | |
29 | |
30 pkg_setup() { | |
31 enewgroup plex | |
32 enewuser plex -1 /bin/bash /var/lib/plexmediaserver "plex" --system | |
33 } | |
34 | |
35 pkg_preinst() { | |
36 einfo "unpacking DEB File" | |
37 cd ${WORKDIR} | |
38 # ar x ${DISTDIR}/${A} | |
39 mkdir data | |
40 mkdir control | |
41 tar -xzf data.tar.gz -C data | |
42 tar -xzf control.tar.gz -C control | |
43 | |
44 einfo "updating init script" | |
45 # replace debian specific init scripts with gentoo specific ones | |
46 rm data/etc/init.d/plexmediaserver | |
47 rm -r data/etc/init | |
48 cp "${FILESDIR}"/pms_initd_1 data/etc/init.d/plex-media-server | |
49 chmod 755 data/etc/init.d/plex-media-server | |
50 | |
51 einfo "moving config files" | |
52 # move the config to the correct place | |
53 mkdir data/etc/plex | |
54 mv data/etc/default/plexmediaserver data/etc/plex/plexmediaserver.conf | |
55 rmdir data/etc/default | |
56 | |
57 einfo "cleaning apt config entry" | |
58 rm -r data/etc/apt | |
59 | |
60 einfo "patching startup" | |
61 # apply patch for start_pms to use the new config file | |
62 cd data/usr/sbin | |
63 epatch "${FILESDIR}"/start_pms_1.patch | |
64 cd ../../.. | |
65 # remove debian specific useless files | |
66 rm data/usr/share/doc/plexmediaserver/README.Debian | |
67 | |
68 # as the patch doesn't seem to correctly set the permissions on new files do this now | |
69 # now copy to image directory for actual installation | |
70 cp -R data/* ${D} | |
71 | |
72 einfo "preparing logging targets" | |
73 # make sure the logging directory is created | |
74 mkdir ${D}var | |
75 mkdir ${D}var/log | |
76 mkdir ${D}var/log/pms | |
77 chown plex:plex ${D}var/log/pms | |
78 | |
79 einfo "prepare default library destination" | |
80 # also make sure the default library folder is pre created with correct permissions | |
81 mkdir ${D}var/lib | |
82 mkdir ${D}var/lib/plexmediaserver | |
83 chown plex:plex ${D}var/lib/plexmediaserver | |
84 | |
85 einfo "Stopping running instances of Media Server" | |
86 if [ -e "${INIT_SCRIPT}" ]; then | |
87 ${INIT_SCRIPT} stop | |
88 fi | |
89 } | |
90 | |
91 pkg_prerm() { | |
92 einfo "Stopping running instances of Media Server" | |
93 if [ -e "${INIT_SCRIPT}" ]; then | |
94 ${INIT_SCRIPT} stop | |
95 fi | |
96 } | |
97 | |
98 pkg_postinst() { | |
99 einfo "" | |
100 elog "Plex Media Server is now fully installed. Please check the configuration file in /etc/plex if the defaults please your needs." | |
101 elog "To start please call '/etc/init.d/plex-media-server start'. You can manage your library afterwards by navigating to http://<ip>:32400/web/" | |
102 einfo "" | |
103 | |
104 ewarn "Please note, that the URL to the library management has changed from http://<ip>:32400/manage to http://<ip>:32400/web!" | |
105 ewarn "If the new management interface forces you to log into myPlex and afterwards gives you an error that you need to be a plex-pass subscriber please delete the folder WebClient.bundle inside the Plug-Ins folder found in your library!" | |
106 } |