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