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.6.5_beta.ebuild @ 16:8fb91fc006ed
way overdue commit of plex ebuild from quite some weeks ago
author | gsnerf <gsnerf@gsnerf.de> |
---|---|
date | Mon, 06 Aug 2012 23:08:43 +0200 |
parents | |
children | c3345c7ee33e |
comparison
equal
deleted
inserted
replaced
11:60c9e5c6cdce | 16:8fb91fc006ed |
---|---|
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://www.plexapp.com/repo/pool/main/p/plexmediaserver/plexmediaserver_0.9.6.5.177-5c3cf40_i386.deb ) | |
13 amd64? ( http://www.plexapp.com/repo/pool/main/p/plexmediaserver/plexmediaserver_0.9.6.5.177-5c3cf40_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 "Preparing files for installation" | |
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 # move the config to the correct place | |
44 mkdir data/etc/plex | |
45 mv data/etc/default/plexmediaserver data/etc/plex/plexmediaserver.conf | |
46 rmdir data/etc/default | |
47 # apply patch for start_pms to use the new config file | |
48 cd data/usr/sbin | |
49 epatch "${FILESDIR}"/start_pms_1.patch | |
50 cd ../../.. | |
51 # remove debian specific useless files | |
52 rm data/usr/share/doc/plexmediaserver/README.Debian | |
53 # as the patch doesn't seem to correctly set the permissions on new files do this now | |
54 # now copy to image directory for actual installation | |
55 cp -R data/* ${D} | |
56 | |
57 # last but not least make sure the logging directory is created | |
58 mkdir ${D}var | |
59 mkdir ${D}var/log | |
60 mkdir ${D}var/log/pms | |
61 chown plex:plex ${D}var/log/pms | |
62 | |
63 einfo "Stopping running instances of Media Server" | |
64 if [ -e "${INIT_SCRIPT}" ]; then | |
65 ${INIT_SCRIPT} stop | |
66 fi | |
67 } | |
68 | |
69 pkg_prerm() { | |
70 einfo "Stopping running instances of Media Server" | |
71 if [ -e "${INIT_SCRIPT}" ]; then | |
72 ${INIT_SCRIPT} stop | |
73 fi | |
74 } |