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.7.11.ebuild @ 32:8fb6688203b3
added new pms release
author | gsnerf <gsnerf@gsnerf.de> |
---|---|
date | Tue, 15 Jan 2013 20:00:11 +0100 |
parents | |
children |
rev | line source |
---|---|
32 | 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 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." | |
10 HOMEPAGE="http://www.plexapp.com/" | |
11 KEYWORDS="-* ~x86 ~amd64" | |
12 SRC_URI="x86? ( http://plex.r.worldssl.net/PlexMediaServer/0.9.7.11.386-d353989/plexmediaserver_0.9.7.11.386-d353989_i386.deb ) | |
13 amd64? ( http://plex.r.worldssl.net/PlexMediaServer/0.9.7.11.386-d353989/plexmediaserver_0.9.7.11.386-d353989_amd64.deb )" | |
14 SLOT="0" | |
15 LICENSE="PMS-License" | |
16 IUSE="" | |
17 RESTRICT="mirror" | |
18 | |
19 RDEPEND="net-dns/avahi" | |
20 DEPEND="${RDEPEND}" | |
21 | |
22 INIT_SCRIPT="${ROOT}/etc/init/plexmediaserver" | |
23 | |
24 pkg_setup() { | |
25 enewgroup plex | |
26 enewuser plex -1 /bin/bash /var/lib/plexmediaserver "plex" --system | |
27 } | |
28 | |
29 pkg_preinst() { | |
30 einfo "unpacking DEB File" | |
31 cd ${WORKDIR} | |
32 ar x ${DISTDIR}/${A} | |
33 mkdir data | |
34 mkdir control | |
35 tar -xzf data.tar.gz -C data | |
36 tar -xzf control.tar.gz -C control | |
37 | |
38 einfo "updating init script" | |
39 # replace debian specific init scripts with gentoo specific ones | |
40 rm data/etc/init.d/plexmediaserver | |
41 rm -r data/etc/init | |
42 cp "${FILESDIR}"/pms_initd_1 data/etc/init.d/plex-media-server | |
43 chmod 755 data/etc/init.d/plex-media-server | |
44 | |
45 einfo "moving config files" | |
46 # move the config to the correct place | |
47 mkdir data/etc/plex | |
48 mv data/etc/default/plexmediaserver data/etc/plex/plexmediaserver.conf | |
49 rmdir data/etc/default | |
50 | |
51 einfo "cleaning apt config entry" | |
52 rm -r data/etc/apt | |
53 | |
54 einfo "patching startup" | |
55 # apply patch for start_pms to use the new config file | |
56 cd data/usr/sbin | |
57 epatch "${FILESDIR}"/start_pms_1.patch | |
58 cd ../../.. | |
59 # remove debian specific useless files | |
60 rm data/usr/share/doc/plexmediaserver/README.Debian | |
61 | |
62 # as the patch doesn't seem to correctly set the permissions on new files do this now | |
63 # now copy to image directory for actual installation | |
64 cp -R data/* ${D} | |
65 | |
66 einfo "preparing logging targets" | |
67 # make sure the logging directory is created | |
68 mkdir ${D}var | |
69 mkdir ${D}var/log | |
70 mkdir ${D}var/log/pms | |
71 chown plex:plex ${D}var/log/pms | |
72 | |
73 einfo "prepare default library destination" | |
74 # also make sure the default library folder is pre created with correct permissions | |
75 mkdir ${D}var/lib | |
76 mkdir ${D}var/lib/plexmediaserver | |
77 chown plex:plex ${D}var/lib/plexmediaserver | |
78 | |
79 einfo "Stopping running instances of Media Server" | |
80 if [ -e "${INIT_SCRIPT}" ]; then | |
81 ${INIT_SCRIPT} stop | |
82 fi | |
83 } | |
84 | |
85 pkg_prerm() { | |
86 einfo "Stopping running instances of Media Server" | |
87 if [ -e "${INIT_SCRIPT}" ]; then | |
88 ${INIT_SCRIPT} stop | |
89 fi | |
90 } | |
91 | |
92 pkg_postinst() { | |
93 einfo "" | |
94 elog "Plex Media Server is now fully installed. Please check the configuration file in /etc/plex if the defaults please your needs." | |
95 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/" | |
96 einfo "" | |
97 | |
98 ewarn "Please note, that the URL to the library management has changed from http://<ip>:32400/manage to http://<ip>:32400/web!" | |
99 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!" | |
100 } |