]> Pileus Git - ~andy/sunrise/blob - media-video/palantir/palantir-2.7.ebuild
app-editors/yzis: Fix qt deps, EAPI bump
[~andy/sunrise] / media-video / palantir / palantir-2.7.ebuild
1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=2
6 inherit toolchain-funcs user
7
8 DESCRIPTION="A video/audio/data interactive streaming server"
9 HOMEPAGE="http://www.fastpath.it/products/palantir/index.php"
10 SRC_URI="http://www.fastpath.it/products/${PN}/pub/${P}.tgz"
11
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS="~x86"
15 IUSE=""
16
17 RDEPEND="
18         virtual/jpeg
19         media-sound/gsm"
20 DEPEND="${RDEPEND}"
21
22 S=${S}/server
23
24 pkg_setup() {
25         PALANTIR_USER="palantir"
26         PALANTIR_PIPE_PATH="/var/run/palantir/telmu_pipe"
27
28         enewuser ${PALANTIR_USER}
29 }
30
31 src_prepare() {
32         # this one isn't mangled by Makefile
33         sed -i -e "s#/usr/local/share/palantir/telmu_pipe#${PALANTIR_PIPE_PATH}#" \
34                 tools/set_sensor || die
35         # install the config file in correct location
36         sed -i -e 's:$(SYS_DIR)/palantir.conf:$(CONFIG_FILE).sample:' Makefile || die
37         # tools/ like LDFLAGS too
38         sed -i -e 's:-o:$(LDFLAGS) -o:' tools/Makefile || die
39         # set the paths in sample configfile
40         sed -i \
41                 -e "s:^# \(NamedPipe \).*:\1${PALANTIR_PIPE_PATH}:" \
42                 -e "s:^# \(LogFile .*\):\1.log:" \
43                 ${PN}.conf.sample || die
44         # use system-wide libgsm headers
45         sed -i -e 's:\(#include \)"libgsm/inc/gsm.h":\1<gsm/gsm.h>:' audio.h || die
46 }
47
48 src_compile() {
49         # libgsm=-lgsm to avoid bundling it
50         emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" \
51                 libgsm=-lgsm \
52                 BASE_DIR=/usr \
53                 CONFIG_FILE=/etc/${PN}/${PN}.conf \
54                 NAMED_PIPE=${PALANTIR_PIPE_PATH} \
55                 || die
56 }
57
58 src_install() {
59         # we're mangling a lot here, so we need to create the dirs ourselves
60         dodir ${PALANTIR_PIPE_PATH%/*} /etc/${PN} /var/log || die
61         # XXX: make keeps relinking palantir
62         emake install CC="$(tc-getCC)" CFLAGS="${CFLAGS}" \
63                 libgsm=-lgsm \
64                 BASE_DIR="${D}"usr \
65                 CONFIG_FILE="${D}"etc/${PN}/${PN}.conf \
66                 NAMED_PIPE="${D}"${PALANTIR_PIPE_PATH#/} \
67                 LOG_FILE="${D}"var/log/${PN}.log \
68                 OWNER=${PALANTIR_USER} \
69                 || die
70
71         newbin tools/set_sensor palantir_set_sensor || die
72         dodoc doc/* README TODO || die
73         newinitd "${FILESDIR}"/${PN}.init ${PN} || die
74 }