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.12-r1.ebuild @ 34:98c75bcd15a4

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