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